Context stringlengths 57 6.04k | file_name stringlengths 21 79 | start int64 14 1.49k | end int64 18 1.5k | theorem stringlengths 25 1.55k | proof stringlengths 5 7.36k | goals listlengths 0 224 | goals_before listlengths 0 221 |
|---|---|---|---|---|---|---|---|
import Mathlib.Algebra.Category.MonCat.Basic
import Mathlib.CategoryTheory.Limits.HasLimits
import Mathlib.CategoryTheory.ConcreteCategory.Elementwise
#align_import algebra.category.Mon.colimits from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe v
open CategoryTheory
open CategoryTheory.Limits
namespace MonCat.Colimits
variable {J : Type v} [SmallCategory J] (F : J ⥤ MonCat.{v})
inductive Prequotient
-- There's always `of`
| of : ∀ (j : J) (_ : F.obj j), Prequotient
-- Then one generator for each operation
| one : Prequotient
| mul : Prequotient → Prequotient → Prequotient
set_option linter.uppercaseLean3 false in
#align Mon.colimits.prequotient MonCat.Colimits.Prequotient
instance : Inhabited (Prequotient F) :=
⟨Prequotient.one⟩
open Prequotient
inductive Relation : Prequotient F → Prequotient F → Prop-- Make it an equivalence relation:
| refl : ∀ x, Relation x x
| symm : ∀ (x y) (_ : Relation x y), Relation y x
| trans : ∀ (x y z) (_ : Relation x y) (_ : Relation y z),
Relation x z-- There's always a `map` relation
| map :
∀ (j j' : J) (f : j ⟶ j') (x : F.obj j),
Relation (Prequotient.of j' ((F.map f) x))
(Prequotient.of j x)-- Then one relation per operation, describing the interaction with `of`
| mul : ∀ (j) (x y : F.obj j), Relation (Prequotient.of j (x * y))
(mul (Prequotient.of j x) (Prequotient.of j y))
| one : ∀ j, Relation (Prequotient.of j 1) one-- Then one relation per argument of each operation
| mul_1 : ∀ (x x' y) (_ : Relation x x'), Relation (mul x y) (mul x' y)
| mul_2 : ∀ (x y y') (_ : Relation y y'), Relation (mul x y) (mul x y')
-- And one relation per axiom
| mul_assoc : ∀ x y z, Relation (mul (mul x y) z) (mul x (mul y z))
| one_mul : ∀ x, Relation (mul one x) x
| mul_one : ∀ x, Relation (mul x one) x
set_option linter.uppercaseLean3 false in
#align Mon.colimits.relation MonCat.Colimits.Relation
def colimitSetoid : Setoid (Prequotient F) where
r := Relation F
iseqv := ⟨Relation.refl, Relation.symm _ _, Relation.trans _ _ _⟩
set_option linter.uppercaseLean3 false in
#align Mon.colimits.colimit_setoid MonCat.Colimits.colimitSetoid
attribute [instance] colimitSetoid
def ColimitType : Type v :=
Quotient (colimitSetoid F)
set_option linter.uppercaseLean3 false in
#align Mon.colimits.colimit_type MonCat.Colimits.ColimitType
instance : Inhabited (ColimitType F) := by
dsimp [ColimitType]
infer_instance
instance monoidColimitType : Monoid (ColimitType F) where
one := Quotient.mk _ one
mul := Quotient.map₂ mul fun x x' rx y y' ry =>
Setoid.trans (Relation.mul_1 _ _ y rx) (Relation.mul_2 x' _ _ ry)
one_mul := Quotient.ind fun _ => Quotient.sound <| Relation.one_mul _
mul_one := Quotient.ind fun _ => Quotient.sound <| Relation.mul_one _
mul_assoc := Quotient.ind fun _ => Quotient.ind₂ fun _ _ =>
Quotient.sound <| Relation.mul_assoc _ _ _
set_option linter.uppercaseLean3 false in
#align Mon.colimits.monoid_colimit_type MonCat.Colimits.monoidColimitType
@[simp]
theorem quot_one : Quot.mk Setoid.r one = (1 : ColimitType F) :=
rfl
set_option linter.uppercaseLean3 false in
#align Mon.colimits.quot_one MonCat.Colimits.quot_one
@[simp]
theorem quot_mul (x y : Prequotient F) : Quot.mk Setoid.r (mul x y) =
@HMul.hMul (ColimitType F) (ColimitType F) (ColimitType F) _
(Quot.mk Setoid.r x) (Quot.mk Setoid.r y) :=
rfl
set_option linter.uppercaseLean3 false in
#align Mon.colimits.quot_mul MonCat.Colimits.quot_mul
def colimit : MonCat :=
⟨ColimitType F, by infer_instance⟩
set_option linter.uppercaseLean3 false in
#align Mon.colimits.colimit MonCat.Colimits.colimit
def coconeFun (j : J) (x : F.obj j) : ColimitType F :=
Quot.mk _ (Prequotient.of j x)
set_option linter.uppercaseLean3 false in
#align Mon.colimits.cocone_fun MonCat.Colimits.coconeFun
def coconeMorphism (j : J) : F.obj j ⟶ colimit F where
toFun := coconeFun F j
map_one' := Quot.sound (Relation.one _)
map_mul' _ _ := Quot.sound (Relation.mul _ _ _)
set_option linter.uppercaseLean3 false in
#align Mon.colimits.cocone_morphism MonCat.Colimits.coconeMorphism
@[simp]
theorem cocone_naturality {j j' : J} (f : j ⟶ j') :
F.map f ≫ coconeMorphism F j' = coconeMorphism F j := by
ext
apply Quot.sound
apply Relation.map
set_option linter.uppercaseLean3 false in
#align Mon.colimits.cocone_naturality MonCat.Colimits.cocone_naturality
@[simp]
| Mathlib/Algebra/Category/MonCat/Colimits.lean | 188 | 191 | theorem cocone_naturality_components (j j' : J) (f : j ⟶ j') (x : F.obj j) :
(coconeMorphism F j') (F.map f x) = (coconeMorphism F j) x := by |
rw [← cocone_naturality F f]
rfl
| [
" Inhabited (ColimitType F)",
" Inhabited (Quotient (colimitSetoid F))",
" Monoid (ColimitType F)",
" F.map f ≫ coconeMorphism F j' = coconeMorphism F j",
" (F.map f ≫ coconeMorphism F j') x✝ = (coconeMorphism F j) x✝",
" Setoid.r (Prequotient.of j' ((F.map f) x✝)) (Prequotient.of j x✝)",
" (coconeMorph... | [
" Inhabited (ColimitType F)",
" Inhabited (Quotient (colimitSetoid F))",
" Monoid (ColimitType F)",
" F.map f ≫ coconeMorphism F j' = coconeMorphism F j",
" (F.map f ≫ coconeMorphism F j') x✝ = (coconeMorphism F j) x✝",
" Setoid.r (Prequotient.of j' ((F.map f) x✝)) (Prequotient.of j x✝)",
" (coconeMorph... |
import Mathlib.LinearAlgebra.Isomorphisms
import Mathlib.LinearAlgebra.Projection
import Mathlib.Order.JordanHolder
import Mathlib.Order.CompactlyGenerated.Intervals
import Mathlib.LinearAlgebra.FiniteDimensional
#align_import ring_theory.simple_module from "leanprover-community/mathlib"@"cce7f68a7eaadadf74c82bbac20721cdc03a1cc1"
variable {ι : Type*} (R S : Type*) [Ring R] [Ring S] (M : Type*) [AddCommGroup M] [Module R M]
abbrev IsSimpleModule :=
IsSimpleOrder (Submodule R M)
#align is_simple_module IsSimpleModule
abbrev IsSemisimpleModule :=
ComplementedLattice (Submodule R M)
#align is_semisimple_module IsSemisimpleModule
abbrev IsSemisimpleRing := IsSemisimpleModule R R
theorem RingEquiv.isSemisimpleRing (e : R ≃+* S) [IsSemisimpleRing R] : IsSemisimpleRing S :=
(Submodule.orderIsoMapComap e.toSemilinearEquiv).complementedLattice
-- Making this an instance causes the linter to complain of "dangerous instances"
theorem IsSimpleModule.nontrivial [IsSimpleModule R M] : Nontrivial M :=
⟨⟨0, by
have h : (⊥ : Submodule R M) ≠ ⊤ := bot_ne_top
contrapose! h
ext x
simp [Submodule.mem_bot, Submodule.mem_top, h x]⟩⟩
#align is_simple_module.nontrivial IsSimpleModule.nontrivial
variable {m : Submodule R M} {N : Type*} [AddCommGroup N] [Module R N] {R S M}
theorem LinearMap.isSimpleModule_iff_of_bijective [Module S N] {σ : R →+* S} [RingHomSurjective σ]
(l : M →ₛₗ[σ] N) (hl : Function.Bijective l) : IsSimpleModule R M ↔ IsSimpleModule S N :=
(Submodule.orderIsoMapComapOfBijective l hl).isSimpleOrder_iff
theorem IsSimpleModule.congr (l : M ≃ₗ[R] N) [IsSimpleModule R N] : IsSimpleModule R M :=
(Submodule.orderIsoMapComap l).isSimpleOrder
#align is_simple_module.congr IsSimpleModule.congr
theorem isSimpleModule_iff_isAtom : IsSimpleModule R m ↔ IsAtom m := by
rw [← Set.isSimpleOrder_Iic_iff_isAtom]
exact m.mapIic.isSimpleOrder_iff
#align is_simple_module_iff_is_atom isSimpleModule_iff_isAtom
| Mathlib/RingTheory/SimpleModule.lean | 91 | 94 | theorem isSimpleModule_iff_isCoatom : IsSimpleModule R (M ⧸ m) ↔ IsCoatom m := by |
rw [← Set.isSimpleOrder_Ici_iff_isCoatom]
apply OrderIso.isSimpleOrder_iff
exact Submodule.comapMkQRelIso m
| [
" ∃ y, 0 ≠ y",
" ⊥ = ⊤",
" x ∈ ⊥ ↔ x ∈ ⊤",
" IsSimpleModule R ↥m ↔ IsAtom m",
" IsSimpleModule R ↥m ↔ IsSimpleOrder ↑(Set.Iic m)",
" IsSimpleModule R (M ⧸ m) ↔ IsCoatom m",
" IsSimpleModule R (M ⧸ m) ↔ IsSimpleOrder ↑(Set.Ici m)",
" Submodule R (M ⧸ m) ≃o ↑(Set.Ici m)"
] | [
" ∃ y, 0 ≠ y",
" ⊥ = ⊤",
" x ∈ ⊥ ↔ x ∈ ⊤",
" IsSimpleModule R ↥m ↔ IsAtom m",
" IsSimpleModule R ↥m ↔ IsSimpleOrder ↑(Set.Iic m)",
" IsSimpleModule R (M ⧸ m) ↔ IsCoatom m"
] |
import Mathlib.Algebra.Lie.Abelian
import Mathlib.Algebra.Lie.IdealOperations
import Mathlib.Order.Hom.Basic
#align_import algebra.lie.solvable from "leanprover-community/mathlib"@"a50170a88a47570ed186b809ca754110590f9476"
universe u v w w₁ w₂
variable (R : Type u) (L : Type v) (M : Type w) {L' : Type w₁}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L'] [LieAlgebra R L']
variable (I J : LieIdeal R L) {f : L' →ₗ⁅R⁆ L}
namespace LieAlgebra
def derivedSeriesOfIdeal (k : ℕ) : LieIdeal R L → LieIdeal R L :=
(fun I => ⁅I, I⁆)^[k]
#align lie_algebra.derived_series_of_ideal LieAlgebra.derivedSeriesOfIdeal
@[simp]
theorem derivedSeriesOfIdeal_zero : derivedSeriesOfIdeal R L 0 I = I :=
rfl
#align lie_algebra.derived_series_of_ideal_zero LieAlgebra.derivedSeriesOfIdeal_zero
@[simp]
theorem derivedSeriesOfIdeal_succ (k : ℕ) :
derivedSeriesOfIdeal R L (k + 1) I =
⁅derivedSeriesOfIdeal R L k I, derivedSeriesOfIdeal R L k I⁆ :=
Function.iterate_succ_apply' (fun I => ⁅I, I⁆) k I
#align lie_algebra.derived_series_of_ideal_succ LieAlgebra.derivedSeriesOfIdeal_succ
abbrev derivedSeries (k : ℕ) : LieIdeal R L :=
derivedSeriesOfIdeal R L k ⊤
#align lie_algebra.derived_series LieAlgebra.derivedSeries
theorem derivedSeries_def (k : ℕ) : derivedSeries R L k = derivedSeriesOfIdeal R L k ⊤ :=
rfl
#align lie_algebra.derived_series_def LieAlgebra.derivedSeries_def
variable {R L}
local notation "D" => derivedSeriesOfIdeal R L
theorem derivedSeriesOfIdeal_add (k l : ℕ) : D (k + l) I = D k (D l I) := by
induction' k with k ih
· rw [Nat.zero_add, derivedSeriesOfIdeal_zero]
· rw [Nat.succ_add k l, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ, ih]
#align lie_algebra.derived_series_of_ideal_add LieAlgebra.derivedSeriesOfIdeal_add
@[mono]
theorem derivedSeriesOfIdeal_le {I J : LieIdeal R L} {k l : ℕ} (h₁ : I ≤ J) (h₂ : l ≤ k) :
D k I ≤ D l J := by
revert l; induction' k with k ih <;> intro l h₂
· rw [le_zero_iff] at h₂; rw [h₂, derivedSeriesOfIdeal_zero]; exact h₁
· have h : l = k.succ ∨ l ≤ k := by rwa [le_iff_eq_or_lt, Nat.lt_succ_iff] at h₂
cases' h with h h
· rw [h, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ]
exact LieSubmodule.mono_lie _ _ _ _ (ih (le_refl k)) (ih (le_refl k))
· rw [derivedSeriesOfIdeal_succ]; exact le_trans (LieSubmodule.lie_le_left _ _) (ih h)
#align lie_algebra.derived_series_of_ideal_le LieAlgebra.derivedSeriesOfIdeal_le
theorem derivedSeriesOfIdeal_succ_le (k : ℕ) : D (k + 1) I ≤ D k I :=
derivedSeriesOfIdeal_le (le_refl I) k.le_succ
#align lie_algebra.derived_series_of_ideal_succ_le LieAlgebra.derivedSeriesOfIdeal_succ_le
theorem derivedSeriesOfIdeal_le_self (k : ℕ) : D k I ≤ I :=
derivedSeriesOfIdeal_le (le_refl I) (zero_le k)
#align lie_algebra.derived_series_of_ideal_le_self LieAlgebra.derivedSeriesOfIdeal_le_self
theorem derivedSeriesOfIdeal_mono {I J : LieIdeal R L} (h : I ≤ J) (k : ℕ) : D k I ≤ D k J :=
derivedSeriesOfIdeal_le h (le_refl k)
#align lie_algebra.derived_series_of_ideal_mono LieAlgebra.derivedSeriesOfIdeal_mono
theorem derivedSeriesOfIdeal_antitone {k l : ℕ} (h : l ≤ k) : D k I ≤ D l I :=
derivedSeriesOfIdeal_le (le_refl I) h
#align lie_algebra.derived_series_of_ideal_antitone LieAlgebra.derivedSeriesOfIdeal_antitone
| Mathlib/Algebra/Lie/Solvable.lean | 116 | 124 | theorem derivedSeriesOfIdeal_add_le_add (J : LieIdeal R L) (k l : ℕ) :
D (k + l) (I + J) ≤ D k I + D l J := by |
let D₁ : LieIdeal R L →o LieIdeal R L :=
{ toFun := fun I => ⁅I, I⁆
monotone' := fun I J h => LieSubmodule.mono_lie I J I J h h }
have h₁ : ∀ I J : LieIdeal R L, D₁ (I ⊔ J) ≤ D₁ I ⊔ J := by
simp [D₁, LieSubmodule.lie_le_right, LieSubmodule.lie_le_left, le_sup_of_le_right]
rw [← D₁.iterate_sup_le_sup_iff] at h₁
exact h₁ k l I J
| [
" D (k + l) I = D k (D l I)",
" D (0 + l) I = D 0 (D l I)",
" D (k + 1 + l) I = D (k + 1) (D l I)",
" D k I ≤ D l J",
" ∀ {l : ℕ}, l ≤ k → D k I ≤ D l J",
" ∀ {l : ℕ}, l ≤ 0 → D 0 I ≤ D l J",
" ∀ {l : ℕ}, l ≤ k + 1 → D (k + 1) I ≤ D l J",
" D 0 I ≤ D l J",
" I ≤ D 0 J",
" D (k + 1) I ≤ D l J",
"... | [
" D (k + l) I = D k (D l I)",
" D (0 + l) I = D 0 (D l I)",
" D (k + 1 + l) I = D (k + 1) (D l I)",
" D k I ≤ D l J",
" ∀ {l : ℕ}, l ≤ k → D k I ≤ D l J",
" ∀ {l : ℕ}, l ≤ 0 → D 0 I ≤ D l J",
" ∀ {l : ℕ}, l ≤ k + 1 → D (k + 1) I ≤ D l J",
" D 0 I ≤ D l J",
" I ≤ D 0 J",
" D (k + 1) I ≤ D l J",
"... |
import Mathlib.Data.Finset.Prod
import Mathlib.Data.Set.Finite
#align_import data.finset.n_ary from "leanprover-community/mathlib"@"eba7871095e834365616b5e43c8c7bb0b37058d0"
open Function Set
variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type*}
namespace Finset
variable [DecidableEq α'] [DecidableEq β'] [DecidableEq γ] [DecidableEq γ'] [DecidableEq δ]
[DecidableEq δ'] [DecidableEq ε] [DecidableEq ε'] {f f' : α → β → γ} {g g' : α → β → γ → δ}
{s s' : Finset α} {t t' : Finset β} {u u' : Finset γ} {a a' : α} {b b' : β} {c : γ}
def image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) : Finset γ :=
(s ×ˢ t).image <| uncurry f
#align finset.image₂ Finset.image₂
@[simp]
theorem mem_image₂ : c ∈ image₂ f s t ↔ ∃ a ∈ s, ∃ b ∈ t, f a b = c := by
simp [image₂, and_assoc]
#align finset.mem_image₂ Finset.mem_image₂
@[simp, norm_cast]
theorem coe_image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) :
(image₂ f s t : Set γ) = Set.image2 f s t :=
Set.ext fun _ => mem_image₂
#align finset.coe_image₂ Finset.coe_image₂
theorem card_image₂_le (f : α → β → γ) (s : Finset α) (t : Finset β) :
(image₂ f s t).card ≤ s.card * t.card :=
card_image_le.trans_eq <| card_product _ _
#align finset.card_image₂_le Finset.card_image₂_le
theorem card_image₂_iff :
(image₂ f s t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × β)).InjOn fun x => f x.1 x.2 := by
rw [← card_product, ← coe_product]
exact card_image_iff
#align finset.card_image₂_iff Finset.card_image₂_iff
theorem card_image₂ (hf : Injective2 f) (s : Finset α) (t : Finset β) :
(image₂ f s t).card = s.card * t.card :=
(card_image_of_injective _ hf.uncurry).trans <| card_product _ _
#align finset.card_image₂ Finset.card_image₂
theorem mem_image₂_of_mem (ha : a ∈ s) (hb : b ∈ t) : f a b ∈ image₂ f s t :=
mem_image₂.2 ⟨a, ha, b, hb, rfl⟩
#align finset.mem_image₂_of_mem Finset.mem_image₂_of_mem
| Mathlib/Data/Finset/NAry.lean | 73 | 74 | theorem mem_image₂_iff (hf : Injective2 f) : f a b ∈ image₂ f s t ↔ a ∈ s ∧ b ∈ t := by |
rw [← mem_coe, coe_image₂, mem_image2_iff hf, mem_coe, mem_coe]
| [
" c ∈ image₂ f s t ↔ ∃ a ∈ s, ∃ b ∈ t, f a b = c",
" (image₂ f s t).card = s.card * t.card ↔ InjOn (fun x => f x.1 x.2) (↑s ×ˢ ↑t)",
" (image₂ f s t).card = (s ×ˢ t).card ↔ InjOn (fun x => f x.1 x.2) ↑(s ×ˢ t)",
" f a b ∈ image₂ f s t ↔ a ∈ s ∧ b ∈ t"
] | [
" c ∈ image₂ f s t ↔ ∃ a ∈ s, ∃ b ∈ t, f a b = c",
" (image₂ f s t).card = s.card * t.card ↔ InjOn (fun x => f x.1 x.2) (↑s ×ˢ ↑t)",
" (image₂ f s t).card = (s ×ˢ t).card ↔ InjOn (fun x => f x.1 x.2) ↑(s ×ˢ t)",
" f a b ∈ image₂ f s t ↔ a ∈ s ∧ b ∈ t"
] |
import Mathlib.Analysis.NormedSpace.Multilinear.Basic
import Mathlib.Analysis.NormedSpace.Units
import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness
import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul
#align_import analysis.normed_space.bounded_linear_maps from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a"
noncomputable section
open Topology
open Filter (Tendsto)
open Metric ContinuousLinearMap
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E]
[NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {G : Type*}
[NormedAddCommGroup G] [NormedSpace 𝕜 G]
structure IsBoundedLinearMap (𝕜 : Type*) [NormedField 𝕜] {E : Type*} [NormedAddCommGroup E]
[NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] (f : E → F) extends
IsLinearMap 𝕜 f : Prop where
bound : ∃ M, 0 < M ∧ ∀ x : E, ‖f x‖ ≤ M * ‖x‖
#align is_bounded_linear_map IsBoundedLinearMap
theorem IsLinearMap.with_bound {f : E → F} (hf : IsLinearMap 𝕜 f) (M : ℝ)
(h : ∀ x : E, ‖f x‖ ≤ M * ‖x‖) : IsBoundedLinearMap 𝕜 f :=
⟨hf,
by_cases
(fun (this : M ≤ 0) =>
⟨1, zero_lt_one, fun x =>
(h x).trans <| mul_le_mul_of_nonneg_right (this.trans zero_le_one) (norm_nonneg x)⟩)
fun (this : ¬M ≤ 0) => ⟨M, lt_of_not_ge this, h⟩⟩
#align is_linear_map.with_bound IsLinearMap.with_bound
theorem ContinuousLinearMap.isBoundedLinearMap (f : E →L[𝕜] F) : IsBoundedLinearMap 𝕜 f :=
{ f.toLinearMap.isLinear with bound := f.bound }
#align continuous_linear_map.is_bounded_linear_map ContinuousLinearMap.isBoundedLinearMap
namespace IsBoundedLinearMap
def toLinearMap (f : E → F) (h : IsBoundedLinearMap 𝕜 f) : E →ₗ[𝕜] F :=
IsLinearMap.mk' _ h.toIsLinearMap
#align is_bounded_linear_map.to_linear_map IsBoundedLinearMap.toLinearMap
def toContinuousLinearMap {f : E → F} (hf : IsBoundedLinearMap 𝕜 f) : E →L[𝕜] F :=
{ toLinearMap f hf with
cont :=
let ⟨C, _, hC⟩ := hf.bound
AddMonoidHomClass.continuous_of_bound (toLinearMap f hf) C hC }
#align is_bounded_linear_map.to_continuous_linear_map IsBoundedLinearMap.toContinuousLinearMap
theorem zero : IsBoundedLinearMap 𝕜 fun _ : E => (0 : F) :=
(0 : E →ₗ[𝕜] F).isLinear.with_bound 0 <| by simp [le_refl]
#align is_bounded_linear_map.zero IsBoundedLinearMap.zero
theorem id : IsBoundedLinearMap 𝕜 fun x : E => x :=
LinearMap.id.isLinear.with_bound 1 <| by simp [le_refl]
#align is_bounded_linear_map.id IsBoundedLinearMap.id
theorem fst : IsBoundedLinearMap 𝕜 fun x : E × F => x.1 := by
refine (LinearMap.fst 𝕜 E F).isLinear.with_bound 1 fun x => ?_
rw [one_mul]
exact le_max_left _ _
#align is_bounded_linear_map.fst IsBoundedLinearMap.fst
theorem snd : IsBoundedLinearMap 𝕜 fun x : E × F => x.2 := by
refine (LinearMap.snd 𝕜 E F).isLinear.with_bound 1 fun x => ?_
rw [one_mul]
exact le_max_right _ _
#align is_bounded_linear_map.snd IsBoundedLinearMap.snd
variable {f g : E → F}
theorem smul (c : 𝕜) (hf : IsBoundedLinearMap 𝕜 f) : IsBoundedLinearMap 𝕜 (c • f) :=
let ⟨hlf, M, _, hM⟩ := hf
(c • hlf.mk' f).isLinear.with_bound (‖c‖ * M) fun x =>
calc
‖c • f x‖ = ‖c‖ * ‖f x‖ := norm_smul c (f x)
_ ≤ ‖c‖ * (M * ‖x‖) := mul_le_mul_of_nonneg_left (hM _) (norm_nonneg _)
_ = ‖c‖ * M * ‖x‖ := (mul_assoc _ _ _).symm
#align is_bounded_linear_map.smul IsBoundedLinearMap.smul
theorem neg (hf : IsBoundedLinearMap 𝕜 f) : IsBoundedLinearMap 𝕜 fun e => -f e := by
rw [show (fun e => -f e) = fun e => (-1 : 𝕜) • f e by funext; simp]
exact smul (-1) hf
#align is_bounded_linear_map.neg IsBoundedLinearMap.neg
| Mathlib/Analysis/NormedSpace/BoundedLinearMaps.lean | 144 | 151 | theorem add (hf : IsBoundedLinearMap 𝕜 f) (hg : IsBoundedLinearMap 𝕜 g) :
IsBoundedLinearMap 𝕜 fun e => f e + g e :=
let ⟨hlf, Mf, _, hMf⟩ := hf
let ⟨hlg, Mg, _, hMg⟩ := hg
(hlf.mk' _ + hlg.mk' _).isLinear.with_bound (Mf + Mg) fun x =>
calc
‖f x + g x‖ ≤ Mf * ‖x‖ + Mg * ‖x‖ := norm_add_le_of_le (hMf x) (hMg x)
_ ≤ (Mf + Mg) * ‖x‖ := by | rw [add_mul]
| [
" ∀ (x : E), ‖0 x‖ ≤ 0 * ‖x‖",
" ∀ (x : E), ‖LinearMap.id x‖ ≤ 1 * ‖x‖",
" IsBoundedLinearMap 𝕜 fun x => x.1",
" ‖(LinearMap.fst 𝕜 E F) x‖ ≤ 1 * ‖x‖",
" ‖(LinearMap.fst 𝕜 E F) x‖ ≤ ‖x‖",
" IsBoundedLinearMap 𝕜 fun x => x.2",
" ‖(LinearMap.snd 𝕜 E F) x‖ ≤ 1 * ‖x‖",
" ‖(LinearMap.snd 𝕜 E F) x‖ ≤ ‖... | [
" ∀ (x : E), ‖0 x‖ ≤ 0 * ‖x‖",
" ∀ (x : E), ‖LinearMap.id x‖ ≤ 1 * ‖x‖",
" IsBoundedLinearMap 𝕜 fun x => x.1",
" ‖(LinearMap.fst 𝕜 E F) x‖ ≤ 1 * ‖x‖",
" ‖(LinearMap.fst 𝕜 E F) x‖ ≤ ‖x‖",
" IsBoundedLinearMap 𝕜 fun x => x.2",
" ‖(LinearMap.snd 𝕜 E F) x‖ ≤ 1 * ‖x‖",
" ‖(LinearMap.snd 𝕜 E F) x‖ ≤ ‖... |
import Mathlib.Topology.MetricSpace.PseudoMetric
import Mathlib.Topology.UniformSpace.Equicontinuity
#align_import topology.metric_space.equicontinuity from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Filter Topology Uniformity
variable {α β ι : Type*} [PseudoMetricSpace α]
namespace Metric
theorem equicontinuousAt_iff_right {ι : Type*} [TopologicalSpace β] {F : ι → β → α} {x₀ : β} :
EquicontinuousAt F x₀ ↔ ∀ ε > 0, ∀ᶠ x in 𝓝 x₀, ∀ i, dist (F i x₀) (F i x) < ε :=
uniformity_basis_dist.equicontinuousAt_iff_right
#align metric.equicontinuous_at_iff_right Metric.equicontinuousAt_iff_right
theorem equicontinuousAt_iff {ι : Type*} [PseudoMetricSpace β] {F : ι → β → α} {x₀ : β} :
EquicontinuousAt F x₀ ↔ ∀ ε > 0, ∃ δ > 0, ∀ x, dist x x₀ < δ → ∀ i, dist (F i x₀) (F i x) < ε :=
nhds_basis_ball.equicontinuousAt_iff uniformity_basis_dist
#align metric.equicontinuous_at_iff Metric.equicontinuousAt_iff
protected theorem equicontinuousAt_iff_pair {ι : Type*} [TopologicalSpace β] {F : ι → β → α}
{x₀ : β} :
EquicontinuousAt F x₀ ↔
∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ i, dist (F i x) (F i x') < ε := by
rw [equicontinuousAt_iff_pair]
constructor <;> intro H
· intro ε hε
exact H _ (dist_mem_uniformity hε)
· intro U hU
rcases mem_uniformity_dist.mp hU with ⟨ε, hε, hεU⟩
refine Exists.imp (fun V => And.imp_right fun h => ?_) (H _ hε)
exact fun x hx x' hx' i => hεU (h _ hx _ hx' i)
#align metric.equicontinuous_at_iff_pair Metric.equicontinuousAt_iff_pair
theorem uniformEquicontinuous_iff_right {ι : Type*} [UniformSpace β] {F : ι → β → α} :
UniformEquicontinuous F ↔ ∀ ε > 0, ∀ᶠ xy : β × β in 𝓤 β, ∀ i, dist (F i xy.1) (F i xy.2) < ε :=
uniformity_basis_dist.uniformEquicontinuous_iff_right
#align metric.uniform_equicontinuous_iff_right Metric.uniformEquicontinuous_iff_right
theorem uniformEquicontinuous_iff {ι : Type*} [PseudoMetricSpace β] {F : ι → β → α} :
UniformEquicontinuous F ↔
∀ ε > 0, ∃ δ > 0, ∀ x y, dist x y < δ → ∀ i, dist (F i x) (F i y) < ε :=
uniformity_basis_dist.uniformEquicontinuous_iff uniformity_basis_dist
#align metric.uniform_equicontinuous_iff Metric.uniformEquicontinuous_iff
theorem equicontinuousAt_of_continuity_modulus {ι : Type*} [TopologicalSpace β] {x₀ : β}
(b : β → ℝ) (b_lim : Tendsto b (𝓝 x₀) (𝓝 0)) (F : ι → β → α)
(H : ∀ᶠ x in 𝓝 x₀, ∀ i, dist (F i x₀) (F i x) ≤ b x) : EquicontinuousAt F x₀ := by
rw [Metric.equicontinuousAt_iff_right]
intro ε ε0
-- Porting note: Lean 3 didn't need `Filter.mem_map.mp` here
filter_upwards [Filter.mem_map.mp <| b_lim (Iio_mem_nhds ε0), H] using
fun x hx₁ hx₂ i => (hx₂ i).trans_lt hx₁
#align metric.equicontinuous_at_of_continuity_modulus Metric.equicontinuousAt_of_continuity_modulus
| Mathlib/Topology/MetricSpace/Equicontinuity.lean | 103 | 114 | theorem uniformEquicontinuous_of_continuity_modulus {ι : Type*} [PseudoMetricSpace β] (b : ℝ → ℝ)
(b_lim : Tendsto b (𝓝 0) (𝓝 0)) (F : ι → β → α)
(H : ∀ (x y : β) (i), dist (F i x) (F i y) ≤ b (dist x y)) : UniformEquicontinuous F := by |
rw [Metric.uniformEquicontinuous_iff]
intro ε ε0
rcases tendsto_nhds_nhds.1 b_lim ε ε0 with ⟨δ, δ0, hδ⟩
refine ⟨δ, δ0, fun x y hxy i => ?_⟩
calc
dist (F i x) (F i y) ≤ b (dist x y) := H x y i
_ ≤ |b (dist x y)| := le_abs_self _
_ = dist (b (dist x y)) 0 := by simp [Real.dist_eq]
_ < ε := hδ (by simpa only [Real.dist_eq, tsub_zero, abs_dist] using hxy)
| [
" EquicontinuousAt F x₀ ↔ ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ (i : ι), dist (F i x) (F i x') < ε",
" (∀ U ∈ 𝓤 α, ∃ V ∈ 𝓝 x₀, ∀ x ∈ V, ∀ y ∈ V, ∀ (i : ι), (F i x, F i y) ∈ U) ↔\n ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ (i : ι), dist (F i x) (F i x') < ε",
" (∀ U ∈ 𝓤 α, ∃ V ∈ 𝓝 x₀, ∀ x ∈ V, ∀ y ∈... | [
" EquicontinuousAt F x₀ ↔ ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ (i : ι), dist (F i x) (F i x') < ε",
" (∀ U ∈ 𝓤 α, ∃ V ∈ 𝓝 x₀, ∀ x ∈ V, ∀ y ∈ V, ∀ (i : ι), (F i x, F i y) ∈ U) ↔\n ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ (i : ι), dist (F i x) (F i x') < ε",
" (∀ U ∈ 𝓤 α, ∃ V ∈ 𝓝 x₀, ∀ x ∈ V, ∀ y ∈... |
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
| [
" Set.InjOn (fun x => (x ⊔ u) \\ v) {x | Disjoint u x ∧ v ≤ x}",
" a = b",
" ((a ⊔ u) \\ v) \\ u ⊔ v = ((b ⊔ u) \\ v) \\ u ⊔ v",
" compress u v ((a ⊔ v) \\ u) = a",
" compress u u a = a",
" (if Disjoint u a ∧ u ≤ a then (a ⊔ u) \\ u else a) = a",
" (a ⊔ u) \\ u = a",
" a = a"
] | [
" Set.InjOn (fun x => (x ⊔ u) \\ v) {x | Disjoint u x ∧ v ≤ x}",
" a = b",
" ((a ⊔ u) \\ v) \\ u ⊔ v = ((b ⊔ u) \\ v) \\ u ⊔ v",
" compress u v ((a ⊔ v) \\ u) = a",
" compress u u a = a"
] |
import Mathlib.Combinatorics.SimpleGraph.Connectivity
#align_import combinatorics.simple_graph.prod from "leanprover-community/mathlib"@"2985fa3c31a27274aed06c433510bc14b73d6488"
variable {α β γ : Type*}
namespace SimpleGraph
-- Porting note: pruned variables to keep things out of local contexts, which
-- can impact how generalization works, or what aesop does.
variable {G : SimpleGraph α} {H : SimpleGraph β}
def boxProd (G : SimpleGraph α) (H : SimpleGraph β) : SimpleGraph (α × β) where
Adj x y := G.Adj x.1 y.1 ∧ x.2 = y.2 ∨ H.Adj x.2 y.2 ∧ x.1 = y.1
symm x y := by simp [and_comm, or_comm, eq_comm, adj_comm]
loopless x := by simp
#align simple_graph.box_prod SimpleGraph.boxProd
infixl:70 " □ " => boxProd
set_option autoImplicit true in
@[simp]
theorem boxProd_adj : (G □ H).Adj x y ↔ G.Adj x.1 y.1 ∧ x.2 = y.2 ∨ H.Adj x.2 y.2 ∧ x.1 = y.1 :=
Iff.rfl
#align simple_graph.box_prod_adj SimpleGraph.boxProd_adj
set_option autoImplicit true in
--@[simp] Porting note (#10618): `simp` can prove
| Mathlib/Combinatorics/SimpleGraph/Prod.lean | 59 | 60 | theorem boxProd_adj_left : (G □ H).Adj (a₁, b) (a₂, b) ↔ G.Adj a₁ a₂ := by |
simp only [boxProd_adj, and_true, SimpleGraph.irrefl, false_and, or_false]
| [
" (fun x y => G.Adj x.1 y.1 ∧ x.2 = y.2 ∨ H.Adj x.2 y.2 ∧ x.1 = y.1) x y →\n (fun x y => G.Adj x.1 y.1 ∧ x.2 = y.2 ∨ H.Adj x.2 y.2 ∧ x.1 = y.1) y x",
" ¬(fun x y => G.Adj x.1 y.1 ∧ x.2 = y.2 ∨ H.Adj x.2 y.2 ∧ x.1 = y.1) x x",
" (G □ H).Adj (a₁, b) (a₂, b) ↔ G.Adj a₁ a₂"
] | [
" (fun x y => G.Adj x.1 y.1 ∧ x.2 = y.2 ∨ H.Adj x.2 y.2 ∧ x.1 = y.1) x y →\n (fun x y => G.Adj x.1 y.1 ∧ x.2 = y.2 ∨ H.Adj x.2 y.2 ∧ x.1 = y.1) y x",
" ¬(fun x y => G.Adj x.1 y.1 ∧ x.2 = y.2 ∨ H.Adj x.2 y.2 ∧ x.1 = y.1) x x",
" (G □ H).Adj (a₁, b) (a₂, b) ↔ G.Adj a₁ a₂"
] |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.Order.Invertible
import Mathlib.Algebra.Order.Module.OrderedSMul
import Mathlib.Algebra.Order.Group.Instances
import Mathlib.LinearAlgebra.AffineSpace.Slope
import Mathlib.LinearAlgebra.AffineSpace.Midpoint
import Mathlib.Tactic.FieldSimp
#align_import linear_algebra.affine_space.ordered from "leanprover-community/mathlib"@"78261225eb5cedc61c5c74ecb44e5b385d13b733"
open AffineMap
variable {k E PE : Type*}
section OrderedRing
variable [OrderedRing k] [OrderedAddCommGroup E] [Module k E] [OrderedSMul k E]
variable {a a' b b' : E} {r r' : k}
| Mathlib/LinearAlgebra/AffineSpace/Ordered.lean | 52 | 54 | theorem lineMap_mono_left (ha : a ≤ a') (hr : r ≤ 1) : lineMap a b r ≤ lineMap a' b r := by |
simp only [lineMap_apply_module]
exact add_le_add_right (smul_le_smul_of_nonneg_left ha (sub_nonneg.2 hr)) _
| [
" (lineMap a b) r ≤ (lineMap a' b) r",
" (1 - r) • a + r • b ≤ (1 - r) • a' + r • b"
] | [
" (lineMap a b) r ≤ (lineMap a' b) r"
] |
import Mathlib.CategoryTheory.Subobject.MonoOver
import Mathlib.CategoryTheory.Skeletal
import Mathlib.CategoryTheory.ConcreteCategory.Basic
import Mathlib.Tactic.ApplyFun
import Mathlib.Tactic.CategoryTheory.Elementwise
#align_import category_theory.subobject.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe v₁ v₂ u₁ u₂
noncomputable section
namespace CategoryTheory
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits
variable {C : Type u₁} [Category.{v₁} C] {X Y Z : C}
variable {D : Type u₂} [Category.{v₂} D]
def Subobject (X : C) :=
ThinSkeleton (MonoOver X)
#align category_theory.subobject CategoryTheory.Subobject
instance (X : C) : PartialOrder (Subobject X) := by
dsimp only [Subobject]
infer_instance
open CategoryTheory.Limits
namespace Subobject
def lower {Y : D} (F : MonoOver X ⥤ MonoOver Y) : Subobject X ⥤ Subobject Y :=
ThinSkeleton.map F
#align category_theory.subobject.lower CategoryTheory.Subobject.lower
theorem lower_iso (F₁ F₂ : MonoOver X ⥤ MonoOver Y) (h : F₁ ≅ F₂) : lower F₁ = lower F₂ :=
ThinSkeleton.map_iso_eq h
#align category_theory.subobject.lower_iso CategoryTheory.Subobject.lower_iso
def lower₂ (F : MonoOver X ⥤ MonoOver Y ⥤ MonoOver Z) : Subobject X ⥤ Subobject Y ⥤ Subobject Z :=
ThinSkeleton.map₂ F
#align category_theory.subobject.lower₂ CategoryTheory.Subobject.lower₂
@[simp]
theorem lower_comm (F : MonoOver Y ⥤ MonoOver X) :
toThinSkeleton _ ⋙ lower F = F ⋙ toThinSkeleton _ :=
rfl
#align category_theory.subobject.lower_comm CategoryTheory.Subobject.lower_comm
def lowerAdjunction {A : C} {B : D} {L : MonoOver A ⥤ MonoOver B} {R : MonoOver B ⥤ MonoOver A}
(h : L ⊣ R) : lower L ⊣ lower R :=
ThinSkeleton.lowerAdjunction _ _ h
#align category_theory.subobject.lower_adjunction CategoryTheory.Subobject.lowerAdjunction
@[simps]
def lowerEquivalence {A : C} {B : D} (e : MonoOver A ≌ MonoOver B) : Subobject A ≌ Subobject B where
functor := lower e.functor
inverse := lower e.inverse
unitIso := by
apply eqToIso
convert ThinSkeleton.map_iso_eq e.unitIso
· exact ThinSkeleton.map_id_eq.symm
· exact (ThinSkeleton.map_comp_eq _ _).symm
counitIso := by
apply eqToIso
convert ThinSkeleton.map_iso_eq e.counitIso
· exact (ThinSkeleton.map_comp_eq _ _).symm
· exact ThinSkeleton.map_id_eq.symm
#align category_theory.subobject.lower_equivalence CategoryTheory.Subobject.lowerEquivalence
section Pullback
variable [HasPullbacks C]
def pullback (f : X ⟶ Y) : Subobject Y ⥤ Subobject X :=
lower (MonoOver.pullback f)
#align category_theory.subobject.pullback CategoryTheory.Subobject.pullback
theorem pullback_id (x : Subobject X) : (pullback (𝟙 X)).obj x = x := by
induction' x using Quotient.inductionOn' with f
exact Quotient.sound ⟨MonoOver.pullbackId.app f⟩
#align category_theory.subobject.pullback_id CategoryTheory.Subobject.pullback_id
| Mathlib/CategoryTheory/Subobject/Basic.lean | 561 | 564 | theorem pullback_comp (f : X ⟶ Y) (g : Y ⟶ Z) (x : Subobject Z) :
(pullback (f ≫ g)).obj x = (pullback f).obj ((pullback g).obj x) := by |
induction' x using Quotient.inductionOn' with t
exact Quotient.sound ⟨(MonoOver.pullbackComp _ _).app t⟩
| [
" PartialOrder (Subobject X)",
" PartialOrder (ThinSkeleton (MonoOver X))",
" 𝟭 (Subobject A) ≅ lower e.functor ⋙ lower e.inverse",
" 𝟭 (Subobject A) = lower e.functor ⋙ lower e.inverse",
" 𝟭 (Subobject A) = ThinSkeleton.map (𝟭 (MonoOver A))",
" lower e.functor ⋙ lower e.inverse = ThinSkeleton.map (e.... | [
" PartialOrder (Subobject X)",
" PartialOrder (ThinSkeleton (MonoOver X))",
" 𝟭 (Subobject A) ≅ lower e.functor ⋙ lower e.inverse",
" 𝟭 (Subobject A) = lower e.functor ⋙ lower e.inverse",
" 𝟭 (Subobject A) = ThinSkeleton.map (𝟭 (MonoOver A))",
" lower e.functor ⋙ lower e.inverse = ThinSkeleton.map (e.... |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : ℕ → ℤ → ℤ → ℕ → ℤ → ℤ → ℕ × ℤ × ℤ
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
| Mathlib/Data/Int/GCD.lean | 48 | 48 | theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by | simp [xgcdAux]
| [
" (invImage\n (fun x =>\n PSigma.casesOn x fun a a_1 =>\n PSigma.casesOn a_1 fun a_2 a_3 =>\n PSigma.casesOn a_3 fun a_4 a_5 => PSigma.casesOn a_5 fun a_6 a_7 => PSigma.casesOn a_7 fun a_8 a_9 => a)\n instWellFoundedRelationOfSizeOf).1\n ⟨r' % k.succ, ⟨s' - ↑q * s, ... | [
" (invImage\n (fun x =>\n PSigma.casesOn x fun a a_1 =>\n PSigma.casesOn a_1 fun a_2 a_3 =>\n PSigma.casesOn a_3 fun a_4 a_5 => PSigma.casesOn a_5 fun a_6 a_7 => PSigma.casesOn a_7 fun a_8 a_9 => a)\n instWellFoundedRelationOfSizeOf).1\n ⟨r' % k.succ, ⟨s' - ↑q * s, ... |
import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
import Mathlib.MeasureTheory.Integral.SetIntegral
#align_import measure_theory.measure.haar.normed_space from "leanprover-community/mathlib"@"b84aee748341da06a6d78491367e2c0e9f15e8a5"
noncomputable section
open scoped NNReal ENNReal Pointwise Topology
open Inv Set Function MeasureTheory.Measure Filter
open FiniteDimensional
namespace MeasureTheory
namespace Measure
example {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [Nontrivial E] [FiniteDimensional ℝ E]
[MeasurableSpace E] [BorelSpace E] (μ : Measure E) [IsAddHaarMeasure μ] : NoAtoms μ := by
infer_instance
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [MeasurableSpace E] [BorelSpace E]
[FiniteDimensional ℝ E] (μ : Measure E) [IsAddHaarMeasure μ] {F : Type*} [NormedAddCommGroup F]
[NormedSpace ℝ F]
variable {s : Set E}
theorem integral_comp_smul (f : E → F) (R : ℝ) :
∫ x, f (R • x) ∂μ = |(R ^ finrank ℝ E)⁻¹| • ∫ x, f x ∂μ := by
by_cases hF : CompleteSpace F; swap
· simp [integral, hF]
rcases eq_or_ne R 0 with (rfl | hR)
· simp only [zero_smul, integral_const]
rcases Nat.eq_zero_or_pos (finrank ℝ E) with (hE | hE)
· have : Subsingleton E := finrank_zero_iff.1 hE
have : f = fun _ => f 0 := by ext x; rw [Subsingleton.elim x 0]
conv_rhs => rw [this]
simp only [hE, pow_zero, inv_one, abs_one, one_smul, integral_const]
· have : Nontrivial E := finrank_pos_iff.1 hE
simp only [zero_pow hE.ne', measure_univ_of_isAddLeftInvariant, ENNReal.top_toReal, zero_smul,
inv_zero, abs_zero]
· calc
(∫ x, f (R • x) ∂μ) = ∫ y, f y ∂Measure.map (fun x => R • x) μ :=
(integral_map_equiv (Homeomorph.smul (isUnit_iff_ne_zero.2 hR).unit).toMeasurableEquiv
f).symm
_ = |(R ^ finrank ℝ E)⁻¹| • ∫ x, f x ∂μ := by
simp only [map_addHaar_smul μ hR, integral_smul_measure, ENNReal.toReal_ofReal, abs_nonneg]
#align measure_theory.measure.integral_comp_smul MeasureTheory.Measure.integral_comp_smul
theorem integral_comp_smul_of_nonneg (f : E → F) (R : ℝ) {hR : 0 ≤ R} :
∫ x, f (R • x) ∂μ = (R ^ finrank ℝ E)⁻¹ • ∫ x, f x ∂μ := by
rw [integral_comp_smul μ f R, abs_of_nonneg (inv_nonneg.2 (pow_nonneg hR _))]
#align measure_theory.measure.integral_comp_smul_of_nonneg MeasureTheory.Measure.integral_comp_smul_of_nonneg
| Mathlib/MeasureTheory/Measure/Haar/NormedSpace.lean | 97 | 99 | theorem integral_comp_inv_smul (f : E → F) (R : ℝ) :
∫ x, f (R⁻¹ • x) ∂μ = |R ^ finrank ℝ E| • ∫ x, f x ∂μ := by |
rw [integral_comp_smul μ f R⁻¹, inv_pow, inv_inv]
| [
" NoAtoms μ",
" ∫ (x : E), f (R • x) ∂μ = |(R ^ finrank ℝ E)⁻¹| • ∫ (x : E), f x ∂μ",
" ∫ (x : E), f (0 • x) ∂μ = |(0 ^ finrank ℝ E)⁻¹| • ∫ (x : E), f x ∂μ",
" (μ univ).toReal • f 0 = |(0 ^ finrank ℝ E)⁻¹| • ∫ (x : E), f x ∂μ",
" f = fun x => f 0",
" f x = f 0",
"E : Type u_1\ninst✝⁷ : NormedAddCommGrou... | [
" NoAtoms μ",
" ∫ (x : E), f (R • x) ∂μ = |(R ^ finrank ℝ E)⁻¹| • ∫ (x : E), f x ∂μ",
" ∫ (x : E), f (0 • x) ∂μ = |(0 ^ finrank ℝ E)⁻¹| • ∫ (x : E), f x ∂μ",
" (μ univ).toReal • f 0 = |(0 ^ finrank ℝ E)⁻¹| • ∫ (x : E), f x ∂μ",
" f = fun x => f 0",
" f x = f 0",
"E : Type u_1\ninst✝⁷ : NormedAddCommGrou... |
import Mathlib.Analysis.Convolution
import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd
import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup
import Mathlib.Analysis.Analytic.IsolatedZeros
import Mathlib.Analysis.Complex.CauchyIntegral
#align_import analysis.special_functions.gamma.beta from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090"
noncomputable section
set_option linter.uppercaseLean3 false
open Filter intervalIntegral Set Real MeasureTheory
open scoped Nat Topology Real
section BetaIntegral
section InvGamma
open scoped Real
namespace Complex
| Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean | 530 | 534 | theorem one_div_Gamma_eq_self_mul_one_div_Gamma_add_one (s : ℂ) :
(Gamma s)⁻¹ = s * (Gamma (s + 1))⁻¹ := by |
rcases ne_or_eq s 0 with (h | rfl)
· rw [Gamma_add_one s h, mul_inv, mul_inv_cancel_left₀ h]
· rw [zero_add, Gamma_zero, inv_zero, zero_mul]
| [
" s.Gamma⁻¹ = s * (s + 1).Gamma⁻¹",
" (Gamma 0)⁻¹ = 0 * (0 + 1).Gamma⁻¹"
] | [
" s.Gamma⁻¹ = s * (s + 1).Gamma⁻¹"
] |
import Mathlib.Data.Set.Lattice
import Mathlib.Data.Set.Pairwise.Basic
#align_import data.set.pairwise.lattice from "leanprover-community/mathlib"@"c4c2ed622f43768eff32608d4a0f8a6cec1c047d"
open Function Set Order
variable {α β γ ι ι' : Type*} {κ : Sort*} {r p q : α → α → Prop}
section Pairwise
variable {f g : ι → α} {s t u : Set α} {a b : α}
namespace Set
section
variable {f : ι → Set α} {s t : Set ι}
| Mathlib/Data/Set/Pairwise/Lattice.lean | 147 | 153 | theorem Set.PairwiseDisjoint.subset_of_biUnion_subset_biUnion (h₀ : (s ∪ t).PairwiseDisjoint f)
(h₁ : ∀ i ∈ s, (f i).Nonempty) (h : ⋃ i ∈ s, f i ⊆ ⋃ i ∈ t, f i) : s ⊆ t := by |
rintro i hi
obtain ⟨a, hai⟩ := h₁ i hi
obtain ⟨j, hj, haj⟩ := mem_iUnion₂.1 (h <| mem_iUnion₂_of_mem hi hai)
rwa [h₀.eq (subset_union_left hi) (subset_union_right hj)
(not_disjoint_iff.2 ⟨a, hai, haj⟩)]
| [
" s ⊆ t",
" i ∈ t"
] | [
" s ⊆ t"
] |
import Mathlib.Algebra.Category.ModuleCat.EpiMono
import Mathlib.Algebra.Category.ModuleCat.Kernels
import Mathlib.CategoryTheory.Subobject.WellPowered
import Mathlib.CategoryTheory.Subobject.Limits
#align_import algebra.category.Module.subobject from "leanprover-community/mathlib"@"6d584f1709bedbed9175bd9350df46599bdd7213"
open CategoryTheory
open CategoryTheory.Subobject
open CategoryTheory.Limits
open ModuleCat
universe v u
namespace ModuleCat
set_option linter.uppercaseLean3 false -- `Module`
variable {R : Type u} [Ring R] (M : ModuleCat.{v} R)
noncomputable def subobjectModule : Subobject M ≃o Submodule R M :=
OrderIso.symm
{ invFun := fun S => LinearMap.range S.arrow
toFun := fun N => Subobject.mk (↾N.subtype)
right_inv := fun S => Eq.symm (by
fapply eq_mk_of_comm
· apply LinearEquiv.toModuleIso'Left
apply LinearEquiv.ofBijective (LinearMap.codRestrict (LinearMap.range S.arrow) S.arrow _)
constructor
· simp [← LinearMap.ker_eq_bot, LinearMap.ker_codRestrict]
rw [ker_eq_bot_of_mono]
· rw [← LinearMap.range_eq_top, LinearMap.range_codRestrict, Submodule.comap_subtype_self]
exact LinearMap.mem_range_self _
· apply LinearMap.ext
intro x
rfl)
left_inv := fun N => by
-- Porting note: The type of `↾N.subtype` was ambiguous. Not entirely sure, I made the right
-- choice here
convert congr_arg LinearMap.range
(underlyingIso_arrow (↾N.subtype : of R { x // x ∈ N } ⟶ M)) using 1
· have :
-- Porting note: added the `.toLinearEquiv.toLinearMap`
(underlyingIso (↾N.subtype : of R _ ⟶ M)).inv =
(underlyingIso (↾N.subtype : of R _ ⟶ M)).symm.toLinearEquiv.toLinearMap := by
apply LinearMap.ext
intro x
rfl
rw [this, comp_def, LinearEquiv.range_comp]
· exact (Submodule.range_subtype _).symm
map_rel_iff' := fun {S T} => by
refine ⟨fun h => ?_, fun h => mk_le_mk_of_comm (↟(Submodule.inclusion h)) rfl⟩
convert LinearMap.range_comp_le_range (ofMkLEMk _ _ h) (↾T.subtype)
· simpa only [← comp_def, ofMkLEMk_comp] using (Submodule.range_subtype _).symm
· exact (Submodule.range_subtype _).symm }
#align Module.subobject_Module ModuleCat.subobjectModule
instance wellPowered_moduleCat : WellPowered (ModuleCat.{v} R) :=
⟨fun M => ⟨⟨_, ⟨(subobjectModule M).toEquiv⟩⟩⟩⟩
#align Module.well_powered_Module ModuleCat.wellPowered_moduleCat
attribute [local instance] hasKernels_moduleCat
noncomputable def toKernelSubobject {M N : ModuleCat.{v} R} {f : M ⟶ N} :
LinearMap.ker f →ₗ[R] kernelSubobject f :=
(kernelSubobjectIso f ≪≫ ModuleCat.kernelIsoKer f).inv
#align Module.to_kernel_subobject ModuleCat.toKernelSubobject
@[simp]
theorem toKernelSubobject_arrow {M N : ModuleCat R} {f : M ⟶ N} (x : LinearMap.ker f) :
(kernelSubobject f).arrow (toKernelSubobject x) = x.1 := by
-- Porting note: The whole proof was just `simp [toKernelSubobject]`.
suffices ((arrow ((kernelSubobject f))) ∘ (kernelSubobjectIso f ≪≫ kernelIsoKer f).inv) x = x by
convert this
rw [Iso.trans_inv, ← coe_comp, Category.assoc]
simp only [Category.assoc, kernelSubobject_arrow', kernelIsoKer_inv_kernel_ι]
aesop_cat
#align Module.to_kernel_subobject_arrow ModuleCat.toKernelSubobject_arrow
-- Porting note (#11215): TODO compiler complains that this is marked with `@[ext]`.
-- Should this be changed?
-- @[ext] this is no longer an ext lemma under the current interpretation see eg
-- the conversation beginning at
-- https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/
-- Goal.20state.20not.20updating.2C.20bugs.2C.20etc.2E/near/338456803
| Mathlib/Algebra/Category/ModuleCat/Subobject.lean | 111 | 120 | theorem cokernel_π_imageSubobject_ext {L M N : ModuleCat.{v} R} (f : L ⟶ M) [HasImage f]
(g : (imageSubobject f : ModuleCat.{v} R) ⟶ N) [HasCokernel g] {x y : N} (l : L)
(w : x = y + g (factorThruImageSubobject f l)) : cokernel.π g x = cokernel.π g y := by |
subst w
-- Porting note: The proof from here used to just be `simp`.
simp only [map_add, add_right_eq_self]
change ((cokernel.π g) ∘ (g) ∘ (factorThruImageSubobject f)) l = 0
rw [← coe_comp, ← coe_comp, Category.assoc]
simp only [cokernel.condition, comp_zero]
rfl
| [
" (fun S => LinearMap.range S.arrow) ((fun N => Subobject.mk (↾N.subtype)) N) = N",
" (fun S => LinearMap.range S.arrow) ((fun N => Subobject.mk (↾N.subtype)) N) =\n LinearMap.range ((underlyingIso (↾N.subtype)).inv ≫ (Subobject.mk (↾N.subtype)).arrow)",
" (underlyingIso (↾N.subtype)).inv = ↑(underlyingIso (... | [
" (fun S => LinearMap.range S.arrow) ((fun N => Subobject.mk (↾N.subtype)) N) = N",
" (fun S => LinearMap.range S.arrow) ((fun N => Subobject.mk (↾N.subtype)) N) =\n LinearMap.range ((underlyingIso (↾N.subtype)).inv ≫ (Subobject.mk (↾N.subtype)).arrow)",
" (underlyingIso (↾N.subtype)).inv = ↑(underlyingIso (... |
import Mathlib.Algebra.Group.Commute.Basic
import Mathlib.Data.Fintype.Card
import Mathlib.GroupTheory.Perm.Basic
#align_import group_theory.perm.support from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Equiv Finset
namespace Equiv.Perm
variable {α : Type*}
section support
section Set
variable (p q : Perm α)
theorem set_support_inv_eq : { x | p⁻¹ x ≠ x } = { x | p x ≠ x } := by
ext x
simp only [Set.mem_setOf_eq, Ne]
rw [inv_def, symm_apply_eq, eq_comm]
#align equiv.perm.set_support_inv_eq Equiv.Perm.set_support_inv_eq
| Mathlib/GroupTheory/Perm/Support.lean | 270 | 271 | theorem set_support_apply_mem {p : Perm α} {a : α} :
p a ∈ { x | p x ≠ x } ↔ a ∈ { x | p x ≠ x } := by | simp
| [
" {x | p⁻¹ x ≠ x} = {x | p x ≠ x}",
" x ∈ {x | p⁻¹ x ≠ x} ↔ x ∈ {x | p x ≠ x}",
" ¬p⁻¹ x = x ↔ ¬p x = x",
" p a ∈ {x | p x ≠ x} ↔ a ∈ {x | p x ≠ x}"
] | [
" {x | p⁻¹ x ≠ x} = {x | p x ≠ x}",
" x ∈ {x | p⁻¹ x ≠ x} ↔ x ∈ {x | p x ≠ x}",
" ¬p⁻¹ x = x ↔ ¬p x = x",
" p a ∈ {x | p x ≠ x} ↔ a ∈ {x | p x ≠ x}"
] |
import Mathlib.Algebra.Module.Equiv
import Mathlib.Algebra.Module.Submodule.Basic
import Mathlib.Algebra.PUnitInstances
import Mathlib.Data.Set.Subsingleton
#align_import algebra.module.submodule.lattice from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
universe v
variable {R S M : Type*}
section AddCommMonoid
variable [Semiring R] [Semiring S] [AddCommMonoid M] [Module R M] [Module S M]
variable [SMul S R] [IsScalarTower S R M]
variable {p q : Submodule R M}
namespace Submodule
instance : Bot (Submodule R M) :=
⟨{ (⊥ : AddSubmonoid M) with
carrier := {0}
smul_mem' := by simp }⟩
instance inhabited' : Inhabited (Submodule R M) :=
⟨⊥⟩
#align submodule.inhabited' Submodule.inhabited'
@[simp]
theorem bot_coe : ((⊥ : Submodule R M) : Set M) = {0} :=
rfl
#align submodule.bot_coe Submodule.bot_coe
@[simp]
theorem bot_toAddSubmonoid : (⊥ : Submodule R M).toAddSubmonoid = ⊥ :=
rfl
#align submodule.bot_to_add_submonoid Submodule.bot_toAddSubmonoid
@[simp]
lemma bot_toAddSubgroup {R M} [Ring R] [AddCommGroup M] [Module R M] :
(⊥ : Submodule R M).toAddSubgroup = ⊥ := rfl
variable (R) in
@[simp]
theorem mem_bot {x : M} : x ∈ (⊥ : Submodule R M) ↔ x = 0 :=
Set.mem_singleton_iff
#align submodule.mem_bot Submodule.mem_bot
instance uniqueBot : Unique (⊥ : Submodule R M) :=
⟨inferInstance, fun x ↦ Subtype.ext <| (mem_bot R).1 x.mem⟩
#align submodule.unique_bot Submodule.uniqueBot
instance : OrderBot (Submodule R M) where
bot := ⊥
bot_le p x := by simp (config := { contextual := true }) [zero_mem]
protected theorem eq_bot_iff (p : Submodule R M) : p = ⊥ ↔ ∀ x ∈ p, x = (0 : M) :=
⟨fun h ↦ h.symm ▸ fun _ hx ↦ (mem_bot R).mp hx,
fun h ↦ eq_bot_iff.mpr fun x hx ↦ (mem_bot R).mpr (h x hx)⟩
#align submodule.eq_bot_iff Submodule.eq_bot_iff
@[ext high]
protected theorem bot_ext (x y : (⊥ : Submodule R M)) : x = y := by
rcases x with ⟨x, xm⟩; rcases y with ⟨y, ym⟩; congr
rw [(Submodule.eq_bot_iff _).mp rfl x xm]
rw [(Submodule.eq_bot_iff _).mp rfl y ym]
#align submodule.bot_ext Submodule.bot_ext
protected theorem ne_bot_iff (p : Submodule R M) : p ≠ ⊥ ↔ ∃ x ∈ p, x ≠ (0 : M) := by
simp only [ne_eq, p.eq_bot_iff, not_forall, exists_prop]
#align submodule.ne_bot_iff Submodule.ne_bot_iff
theorem nonzero_mem_of_bot_lt {p : Submodule R M} (bot_lt : ⊥ < p) : ∃ a : p, a ≠ 0 :=
let ⟨b, hb₁, hb₂⟩ := p.ne_bot_iff.mp bot_lt.ne'
⟨⟨b, hb₁⟩, hb₂ ∘ congr_arg Subtype.val⟩
#align submodule.nonzero_mem_of_bot_lt Submodule.nonzero_mem_of_bot_lt
theorem exists_mem_ne_zero_of_ne_bot {p : Submodule R M} (h : p ≠ ⊥) : ∃ b : M, b ∈ p ∧ b ≠ 0 :=
let ⟨b, hb₁, hb₂⟩ := p.ne_bot_iff.mp h
⟨b, hb₁, hb₂⟩
#align submodule.exists_mem_ne_zero_of_ne_bot Submodule.exists_mem_ne_zero_of_ne_bot
-- FIXME: we default PUnit to PUnit.{1} here without the explicit universe annotation
@[simps]
def botEquivPUnit : (⊥ : Submodule R M) ≃ₗ[R] PUnit.{v+1} where
toFun _ := PUnit.unit
invFun _ := 0
map_add' _ _ := rfl
map_smul' _ _ := rfl
left_inv _ := Subsingleton.elim _ _
right_inv _ := rfl
#align submodule.bot_equiv_punit Submodule.botEquivPUnit
theorem subsingleton_iff_eq_bot : Subsingleton p ↔ p = ⊥ := by
rw [subsingleton_iff, Submodule.eq_bot_iff]
refine ⟨fun h x hx ↦ by simpa using h ⟨x, hx⟩ ⟨0, p.zero_mem⟩,
fun h ⟨x, hx⟩ ⟨y, hy⟩ ↦ by simp [h x hx, h y hy]⟩
theorem eq_bot_of_subsingleton [Subsingleton p] : p = ⊥ :=
subsingleton_iff_eq_bot.mp inferInstance
#align submodule.eq_bot_of_subsingleton Submodule.eq_bot_of_subsingleton
| Mathlib/Algebra/Module/Submodule/Lattice.lean | 131 | 132 | theorem nontrivial_iff_ne_bot : Nontrivial p ↔ p ≠ ⊥ := by |
rw [iff_not_comm, not_nontrivial_iff_subsingleton, subsingleton_iff_eq_bot]
| [
" ∀ (c : R) {x : M},\n x ∈ { carrier := {0}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier →\n c • x ∈ { carrier := {0}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier",
" x ∈ ⊥ → x ∈ p",
" x = y",
" ⟨x, xm⟩ = y",
" ⟨x, xm⟩ = ⟨y, ym⟩",
" 0 = y",
" p ≠ ⊥ ↔ ∃ x ∈ p, x ≠ 0",
" Subsingleton ↥p ↔ p = ⊥",
" (∀... | [
" ∀ (c : R) {x : M},\n x ∈ { carrier := {0}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier →\n c • x ∈ { carrier := {0}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier",
" x ∈ ⊥ → x ∈ p",
" x = y",
" ⟨x, xm⟩ = y",
" ⟨x, xm⟩ = ⟨y, ym⟩",
" 0 = y",
" p ≠ ⊥ ↔ ∃ x ∈ p, x ≠ 0",
" Subsingleton ↥p ↔ p = ⊥",
" (∀... |
import Mathlib.RingTheory.Nilpotent.Basic
import Mathlib.RingTheory.UniqueFactorizationDomain
#align_import algebra.squarefree from "leanprover-community/mathlib"@"00d163e35035c3577c1c79fa53b68de17781ffc1"
variable {R : Type*}
def Squarefree [Monoid R] (r : R) : Prop :=
∀ x : R, x * x ∣ r → IsUnit x
#align squarefree Squarefree
theorem IsRelPrime.of_squarefree_mul [CommMonoid R] {m n : R} (h : Squarefree (m * n)) :
IsRelPrime m n := fun c hca hcb ↦ h c (mul_dvd_mul hca hcb)
@[simp]
theorem IsUnit.squarefree [CommMonoid R] {x : R} (h : IsUnit x) : Squarefree x := fun _ hdvd =>
isUnit_of_mul_isUnit_left (isUnit_of_dvd_unit hdvd h)
#align is_unit.squarefree IsUnit.squarefree
-- @[simp] -- Porting note (#10618): simp can prove this
theorem squarefree_one [CommMonoid R] : Squarefree (1 : R) :=
isUnit_one.squarefree
#align squarefree_one squarefree_one
@[simp]
theorem not_squarefree_zero [MonoidWithZero R] [Nontrivial R] : ¬Squarefree (0 : R) := by
erw [not_forall]
exact ⟨0, by simp⟩
#align not_squarefree_zero not_squarefree_zero
theorem Squarefree.ne_zero [MonoidWithZero R] [Nontrivial R] {m : R} (hm : Squarefree (m : R)) :
m ≠ 0 := by
rintro rfl
exact not_squarefree_zero hm
#align squarefree.ne_zero Squarefree.ne_zero
@[simp]
theorem Irreducible.squarefree [CommMonoid R] {x : R} (h : Irreducible x) : Squarefree x := by
rintro y ⟨z, hz⟩
rw [mul_assoc] at hz
rcases h.isUnit_or_isUnit hz with (hu | hu)
· exact hu
· apply isUnit_of_mul_isUnit_left hu
#align irreducible.squarefree Irreducible.squarefree
@[simp]
theorem Prime.squarefree [CancelCommMonoidWithZero R] {x : R} (h : Prime x) : Squarefree x :=
h.irreducible.squarefree
#align prime.squarefree Prime.squarefree
theorem Squarefree.of_mul_left [CommMonoid R] {m n : R} (hmn : Squarefree (m * n)) : Squarefree m :=
fun p hp => hmn p (dvd_mul_of_dvd_left hp n)
#align squarefree.of_mul_left Squarefree.of_mul_left
theorem Squarefree.of_mul_right [CommMonoid R] {m n : R} (hmn : Squarefree (m * n)) :
Squarefree n := fun p hp => hmn p (dvd_mul_of_dvd_right hp m)
#align squarefree.of_mul_right Squarefree.of_mul_right
theorem Squarefree.squarefree_of_dvd [CommMonoid R] {x y : R} (hdvd : x ∣ y) (hsq : Squarefree y) :
Squarefree x := fun _ h => hsq _ (h.trans hdvd)
#align squarefree.squarefree_of_dvd Squarefree.squarefree_of_dvd
theorem Squarefree.eq_zero_or_one_of_pow_of_not_isUnit [CommMonoid R] {x : R} {n : ℕ}
(h : Squarefree (x ^ n)) (h' : ¬ IsUnit x) :
n = 0 ∨ n = 1 := by
contrapose! h'
replace h' : 2 ≤ n := by omega
have : x * x ∣ x ^ n := by rw [← sq]; exact pow_dvd_pow x h'
exact h.squarefree_of_dvd this x (refl _)
namespace multiplicity
section Irreducible
variable [CommMonoidWithZero R] [WfDvdMonoid R]
theorem squarefree_iff_no_irreducibles {x : R} (hx₀ : x ≠ 0) :
Squarefree x ↔ ∀ p, Irreducible p → ¬ (p * p ∣ x) := by
refine ⟨fun h p hp hp' ↦ hp.not_unit (h p hp'), fun h d hd ↦ by_contra fun hdu ↦ ?_⟩
have hd₀ : d ≠ 0 := ne_zero_of_dvd_ne_zero (ne_zero_of_dvd_ne_zero hx₀ hd) (dvd_mul_left d d)
obtain ⟨p, irr, dvd⟩ := WfDvdMonoid.exists_irreducible_factor hdu hd₀
exact h p irr ((mul_dvd_mul dvd dvd).trans hd)
| Mathlib/Algebra/Squarefree/Basic.lean | 154 | 163 | theorem irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree (r : R) :
(∀ x : R, Irreducible x → ¬x * x ∣ r) ↔ (r = 0 ∧ ∀ x : R, ¬Irreducible x) ∨ Squarefree r := by |
refine ⟨fun h ↦ ?_, ?_⟩
· rcases eq_or_ne r 0 with (rfl | hr)
· exact .inl (by simpa using h)
· exact .inr ((squarefree_iff_no_irreducibles hr).mpr h)
· rintro (⟨rfl, h⟩ | h)
· simpa using h
intro x hx t
exact hx.not_unit (h x t)
| [
" ¬Squarefree 0",
" ∃ x, ¬(x * x ∣ 0 → IsUnit x)",
" ¬(0 * 0 ∣ 0 → IsUnit 0)",
" m ≠ 0",
" False",
" Squarefree x",
" IsUnit y",
" n = 0 ∨ n = 1",
" IsUnit x",
" 2 ≤ n",
" x * x ∣ x ^ n",
" x ^ 2 ∣ x ^ n",
" Squarefree x ↔ ∀ (p : R), Irreducible p → ¬p * p ∣ x",
" (∀ (x : R), Irreducible x... | [
" ¬Squarefree 0",
" ∃ x, ¬(x * x ∣ 0 → IsUnit x)",
" ¬(0 * 0 ∣ 0 → IsUnit 0)",
" m ≠ 0",
" False",
" Squarefree x",
" IsUnit y",
" n = 0 ∨ n = 1",
" IsUnit x",
" 2 ≤ n",
" x * x ∣ x ^ n",
" x ^ 2 ∣ x ^ n",
" Squarefree x ↔ ∀ (p : R), Irreducible p → ¬p * p ∣ x",
" (∀ (x : R), Irreducible x... |
import Mathlib.Analysis.Calculus.ContDiff.Basic
import Mathlib.Analysis.NormedSpace.FiniteDimension
#align_import analysis.calculus.bump_function_inner from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
noncomputable section
open Function Set Filter
open scoped Topology Filter
variable {E X : Type*}
structure ContDiffBump (c : E) where
(rIn rOut : ℝ)
rIn_pos : 0 < rIn
rIn_lt_rOut : rIn < rOut
#align cont_diff_bump ContDiffBump
#align cont_diff_bump.r ContDiffBump.rIn
set_option linter.uppercaseLean3 false in
#align cont_diff_bump.R ContDiffBump.rOut
#align cont_diff_bump.r_pos ContDiffBump.rIn_pos
set_option linter.uppercaseLean3 false in
#align cont_diff_bump.r_lt_R ContDiffBump.rIn_lt_rOut
-- Porting note(#5171): linter not yet ported; was @[nolint has_nonempty_instance]
structure ContDiffBumpBase (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] where
toFun : ℝ → E → ℝ
mem_Icc : ∀ (R : ℝ) (x : E), toFun R x ∈ Icc (0 : ℝ) 1
symmetric : ∀ (R : ℝ) (x : E), toFun R (-x) = toFun R x
smooth : ContDiffOn ℝ ⊤ (uncurry toFun) (Ioi (1 : ℝ) ×ˢ (univ : Set E))
eq_one : ∀ R : ℝ, 1 < R → ∀ x : E, ‖x‖ ≤ 1 → toFun R x = 1
support : ∀ R : ℝ, 1 < R → Function.support (toFun R) = Metric.ball (0 : E) R
#align cont_diff_bump_base ContDiffBumpBase
class HasContDiffBump (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] : Prop where
out : Nonempty (ContDiffBumpBase E)
#align has_cont_diff_bump HasContDiffBump
def someContDiffBumpBase (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E]
[hb : HasContDiffBump E] : ContDiffBumpBase E :=
Nonempty.some hb.out
#align some_cont_diff_bump_base someContDiffBumpBase
namespace ContDiffBump
theorem rOut_pos {c : E} (f : ContDiffBump c) : 0 < f.rOut :=
f.rIn_pos.trans f.rIn_lt_rOut
set_option linter.uppercaseLean3 false in
#align cont_diff_bump.R_pos ContDiffBump.rOut_pos
theorem one_lt_rOut_div_rIn {c : E} (f : ContDiffBump c) : 1 < f.rOut / f.rIn := by
rw [one_lt_div f.rIn_pos]
exact f.rIn_lt_rOut
set_option linter.uppercaseLean3 false in
#align cont_diff_bump.one_lt_R_div_r ContDiffBump.one_lt_rOut_div_rIn
instance (c : E) : Inhabited (ContDiffBump c) :=
⟨⟨1, 2, zero_lt_one, one_lt_two⟩⟩
variable [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup X] [NormedSpace ℝ X]
[HasContDiffBump E] {c : E} (f : ContDiffBump c) {x : E} {n : ℕ∞}
@[coe] def toFun {c : E} (f : ContDiffBump c) : E → ℝ :=
(someContDiffBumpBase E).toFun (f.rOut / f.rIn) ∘ fun x ↦ (f.rIn⁻¹ • (x - c))
#align cont_diff_bump.to_fun ContDiffBump.toFun
instance : CoeFun (ContDiffBump c) fun _ => E → ℝ :=
⟨toFun⟩
protected theorem apply (x : E) :
f x = (someContDiffBumpBase E).toFun (f.rOut / f.rIn) (f.rIn⁻¹ • (x - c)) :=
rfl
#align cont_diff_bump.def ContDiffBump.apply
protected theorem sub (x : E) : f (c - x) = f (c + x) := by
simp [f.apply, ContDiffBumpBase.symmetric]
#align cont_diff_bump.sub ContDiffBump.sub
protected theorem neg (f : ContDiffBump (0 : E)) (x : E) : f (-x) = f x := by
simp_rw [← zero_sub, f.sub, zero_add]
#align cont_diff_bump.neg ContDiffBump.neg
open Metric
| Mathlib/Analysis/Calculus/BumpFunction/Basic.lean | 154 | 157 | theorem one_of_mem_closedBall (hx : x ∈ closedBall c f.rIn) : f x = 1 := by |
apply ContDiffBumpBase.eq_one _ _ f.one_lt_rOut_div_rIn
simpa only [norm_smul, Real.norm_eq_abs, abs_inv, abs_of_nonneg f.rIn_pos.le, ← div_eq_inv_mul,
div_le_one f.rIn_pos] using mem_closedBall_iff_norm.1 hx
| [
" 1 < f.rOut / f.rIn",
" f.rIn < f.rOut",
" ↑f (c - x) = ↑f (c + x)",
" ↑f (-x) = ↑f x",
" ↑f x = 1",
" ‖(fun x => f.rIn⁻¹ • (x - c)) x‖ ≤ 1"
] | [
" 1 < f.rOut / f.rIn",
" f.rIn < f.rOut",
" ↑f (c - x) = ↑f (c + x)",
" ↑f (-x) = ↑f x",
" ↑f x = 1"
] |
import Mathlib.Topology.PartialHomeomorph
import Mathlib.Analysis.Normed.Group.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Data.Real.Sqrt
#align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
open Set Metric Pointwise
variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E]
noncomputable section
@[simps (config := .lemmasOnly)]
def PartialHomeomorph.univUnitBall : PartialHomeomorph E E where
toFun x := (√(1 + ‖x‖ ^ 2))⁻¹ • x
invFun y := (√(1 - ‖(y : E)‖ ^ 2))⁻¹ • (y : E)
source := univ
target := ball 0 1
map_source' x _ := by
have : 0 < 1 + ‖x‖ ^ 2 := by positivity
rw [mem_ball_zero_iff, norm_smul, Real.norm_eq_abs, abs_inv, ← _root_.div_eq_inv_mul,
div_lt_one (abs_pos.mpr <| Real.sqrt_ne_zero'.mpr this), ← abs_norm x, ← sq_lt_sq,
abs_norm, Real.sq_sqrt this.le]
exact lt_one_add _
map_target' _ _ := trivial
left_inv' x _ := by
field_simp [norm_smul, smul_smul, (zero_lt_one_add_norm_sq x).ne', sq_abs,
Real.sq_sqrt (zero_lt_one_add_norm_sq x).le, ← Real.sqrt_div (zero_lt_one_add_norm_sq x).le]
right_inv' y hy := by
have : 0 < 1 - ‖y‖ ^ 2 := by nlinarith [norm_nonneg y, mem_ball_zero_iff.1 hy]
field_simp [norm_smul, smul_smul, this.ne', sq_abs, Real.sq_sqrt this.le,
← Real.sqrt_div this.le]
open_source := isOpen_univ
open_target := isOpen_ball
continuousOn_toFun := by
suffices Continuous fun (x:E) => (√(1 + ‖x‖ ^ 2))⁻¹
from (this.smul continuous_id).continuousOn
refine Continuous.inv₀ ?_ fun x => Real.sqrt_ne_zero'.mpr (by positivity)
continuity
continuousOn_invFun := by
have : ∀ y ∈ ball (0 : E) 1, √(1 - ‖(y : E)‖ ^ 2) ≠ 0 := fun y hy ↦ by
rw [Real.sqrt_ne_zero']
nlinarith [norm_nonneg y, mem_ball_zero_iff.1 hy]
exact ContinuousOn.smul (ContinuousOn.inv₀
(continuousOn_const.sub (continuous_norm.continuousOn.pow _)).sqrt this) continuousOn_id
@[simp]
theorem PartialHomeomorph.univUnitBall_apply_zero : univUnitBall (0 : E) = 0 := by
simp [PartialHomeomorph.univUnitBall_apply]
@[simp]
theorem PartialHomeomorph.univUnitBall_symm_apply_zero : univUnitBall.symm (0 : E) = 0 := by
simp [PartialHomeomorph.univUnitBall_symm_apply]
@[simps! (config := .lemmasOnly)]
def Homeomorph.unitBall : E ≃ₜ ball (0 : E) 1 :=
(Homeomorph.Set.univ _).symm.trans PartialHomeomorph.univUnitBall.toHomeomorphSourceTarget
#align homeomorph_unit_ball Homeomorph.unitBall
@[simp]
theorem Homeomorph.coe_unitBall_apply_zero :
(Homeomorph.unitBall (0 : E) : E) = 0 :=
PartialHomeomorph.univUnitBall_apply_zero
#align coe_homeomorph_unit_ball_apply_zero Homeomorph.coe_unitBall_apply_zero
variable {P : Type*} [PseudoMetricSpace P] [NormedAddTorsor E P]
namespace PartialHomeomorph
@[simps!]
def unitBallBall (c : P) (r : ℝ) (hr : 0 < r) : PartialHomeomorph E P :=
((Homeomorph.smulOfNeZero r hr.ne').trans
(IsometryEquiv.vaddConst c).toHomeomorph).toPartialHomeomorphOfImageEq
(ball 0 1) isOpen_ball (ball c r) <| by
change (IsometryEquiv.vaddConst c) ∘ (r • ·) '' ball (0 : E) 1 = ball c r
rw [image_comp, image_smul, smul_unitBall hr.ne', IsometryEquiv.image_ball]
simp [abs_of_pos hr]
def univBall (c : P) (r : ℝ) : PartialHomeomorph E P :=
if h : 0 < r then univUnitBall.trans' (unitBallBall c r h) rfl
else (IsometryEquiv.vaddConst c).toHomeomorph.toPartialHomeomorph
@[simp]
theorem univBall_source (c : P) (r : ℝ) : (univBall c r).source = univ := by
unfold univBall; split_ifs <;> rfl
theorem univBall_target (c : P) {r : ℝ} (hr : 0 < r) : (univBall c r).target = ball c r := by
rw [univBall, dif_pos hr]; rfl
theorem ball_subset_univBall_target (c : P) (r : ℝ) : ball c r ⊆ (univBall c r).target := by
by_cases hr : 0 < r
· rw [univBall_target c hr]
· rw [univBall, dif_neg hr]
exact subset_univ _
@[simp]
theorem univBall_apply_zero (c : P) (r : ℝ) : univBall c r 0 = c := by
unfold univBall; split_ifs <;> simp
@[simp]
| Mathlib/Analysis/NormedSpace/HomeomorphBall.lean | 144 | 146 | theorem univBall_symm_apply_center (c : P) (r : ℝ) : (univBall c r).symm c = 0 := by |
have : 0 ∈ (univBall c r).source := by simp
simpa only [univBall_apply_zero] using (univBall c r).left_inv this
| [
" (fun x => (√(1 + ‖x‖ ^ 2))⁻¹ • x) x ∈ ball 0 1",
" 0 < 1 + ‖x‖ ^ 2",
" ‖x‖ ^ 2 < 1 + ‖x‖ ^ 2",
" (fun y => (√(1 - ‖y‖ ^ 2))⁻¹ • y) ((fun x => (√(1 + ‖x‖ ^ 2))⁻¹ • x) x) = x",
" (fun x => (√(1 + ‖x‖ ^ 2))⁻¹ • x) ((fun y => (√(1 - ‖y‖ ^ 2))⁻¹ • y) y) = y",
" 0 < 1 - ‖y‖ ^ 2",
" ContinuousOn\n ↑{ toFu... | [
" (fun x => (√(1 + ‖x‖ ^ 2))⁻¹ • x) x ∈ ball 0 1",
" 0 < 1 + ‖x‖ ^ 2",
" ‖x‖ ^ 2 < 1 + ‖x‖ ^ 2",
" (fun y => (√(1 - ‖y‖ ^ 2))⁻¹ • y) ((fun x => (√(1 + ‖x‖ ^ 2))⁻¹ • x) x) = x",
" (fun x => (√(1 + ‖x‖ ^ 2))⁻¹ • x) ((fun y => (√(1 - ‖y‖ ^ 2))⁻¹ • y) y) = y",
" 0 < 1 - ‖y‖ ^ 2",
" ContinuousOn\n ↑{ toFu... |
import Mathlib.Topology.Order.IsLUB
open Set Filter TopologicalSpace Topology Function
open OrderDual (toDual ofDual)
variable {α β γ : Type*}
section ConditionallyCompleteLinearOrder
variable [ConditionallyCompleteLinearOrder α] [TopologicalSpace α] [OrderTopology α]
[ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderClosedTopology β] [Nonempty γ]
theorem csSup_mem_closure {s : Set α} (hs : s.Nonempty) (B : BddAbove s) : sSup s ∈ closure s :=
(isLUB_csSup hs B).mem_closure hs
#align cSup_mem_closure csSup_mem_closure
theorem csInf_mem_closure {s : Set α} (hs : s.Nonempty) (B : BddBelow s) : sInf s ∈ closure s :=
(isGLB_csInf hs B).mem_closure hs
#align cInf_mem_closure csInf_mem_closure
theorem IsClosed.csSup_mem {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddAbove s) :
sSup s ∈ s :=
(isLUB_csSup hs B).mem_of_isClosed hs hc
#align is_closed.cSup_mem IsClosed.csSup_mem
theorem IsClosed.csInf_mem {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddBelow s) :
sInf s ∈ s :=
(isGLB_csInf hs B).mem_of_isClosed hs hc
#align is_closed.cInf_mem IsClosed.csInf_mem
theorem IsClosed.isLeast_csInf {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddBelow s) :
IsLeast s (sInf s) :=
⟨hc.csInf_mem hs B, (isGLB_csInf hs B).1⟩
theorem IsClosed.isGreatest_csSup {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddAbove s) :
IsGreatest s (sSup s) :=
IsClosed.isLeast_csInf (α := αᵒᵈ) hc hs B
theorem Monotone.map_csSup_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sSup s))
(Mf : Monotone f) (ne : s.Nonempty) (H : BddAbove s) : f (sSup s) = sSup (f '' s) := by
refine ((isLUB_csSup (ne.image f) (Mf.map_bddAbove H)).unique ?_).symm
refine (isLUB_csSup ne H).isLUB_of_tendsto (fun x _ y _ xy => Mf xy) ne ?_
exact Cf.mono_left inf_le_left
#align monotone.map_cSup_of_continuous_at Monotone.map_csSup_of_continuousAt
theorem Monotone.map_ciSup_of_continuousAt {f : α → β} {g : γ → α} (Cf : ContinuousAt f (⨆ i, g i))
(Mf : Monotone f) (H : BddAbove (range g)) : f (⨆ i, g i) = ⨆ i, f (g i) := by
rw [iSup, Mf.map_csSup_of_continuousAt Cf (range_nonempty _) H, ← range_comp, iSup]; rfl
#align monotone.map_csupr_of_continuous_at Monotone.map_ciSup_of_continuousAt
theorem Monotone.map_csInf_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sInf s))
(Mf : Monotone f) (ne : s.Nonempty) (H : BddBelow s) : f (sInf s) = sInf (f '' s) :=
Monotone.map_csSup_of_continuousAt (α := αᵒᵈ) (β := βᵒᵈ) Cf Mf.dual ne H
#align monotone.map_cInf_of_continuous_at Monotone.map_csInf_of_continuousAt
theorem Monotone.map_ciInf_of_continuousAt {f : α → β} {g : γ → α} (Cf : ContinuousAt f (⨅ i, g i))
(Mf : Monotone f) (H : BddBelow (range g)) : f (⨅ i, g i) = ⨅ i, f (g i) :=
Monotone.map_ciSup_of_continuousAt (α := αᵒᵈ) (β := βᵒᵈ) Cf Mf.dual H
#align monotone.map_cinfi_of_continuous_at Monotone.map_ciInf_of_continuousAt
theorem Antitone.map_csSup_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sSup s))
(Af : Antitone f) (ne : s.Nonempty) (H : BddAbove s) : f (sSup s) = sInf (f '' s) :=
Monotone.map_csSup_of_continuousAt (show ContinuousAt (OrderDual.toDual ∘ f) (sSup s) from Cf) Af
ne H
#align antitone.map_cSup_of_continuous_at Antitone.map_csSup_of_continuousAt
theorem Antitone.map_ciSup_of_continuousAt {f : α → β} {g : γ → α} (Cf : ContinuousAt f (⨆ i, g i))
(Af : Antitone f) (H : BddAbove (range g)) : f (⨆ i, g i) = ⨅ i, f (g i) :=
Monotone.map_ciSup_of_continuousAt (show ContinuousAt (OrderDual.toDual ∘ f) (⨆ i, g i) from Cf)
Af H
#align antitone.map_csupr_of_continuous_at Antitone.map_ciSup_of_continuousAt
theorem Antitone.map_csInf_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sInf s))
(Af : Antitone f) (ne : s.Nonempty) (H : BddBelow s) : f (sInf s) = sSup (f '' s) :=
Monotone.map_csInf_of_continuousAt (show ContinuousAt (OrderDual.toDual ∘ f) (sInf s) from Cf) Af
ne H
#align antitone.map_cInf_of_continuous_at Antitone.map_csInf_of_continuousAt
theorem Antitone.map_ciInf_of_continuousAt {f : α → β} {g : γ → α} (Cf : ContinuousAt f (⨅ i, g i))
(Af : Antitone f) (H : BddBelow (range g)) : f (⨅ i, g i) = ⨆ i, f (g i) :=
Monotone.map_ciInf_of_continuousAt (show ContinuousAt (OrderDual.toDual ∘ f) (⨅ i, g i) from Cf)
Af H
#align antitone.map_cinfi_of_continuous_at Antitone.map_ciInf_of_continuousAt
| Mathlib/Topology/Order/Monotone.lean | 282 | 292 | theorem Monotone.tendsto_nhdsWithin_Iio {α β : Type*} [LinearOrder α] [TopologicalSpace α]
[OrderTopology α] [ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderTopology β]
{f : α → β} (Mf : Monotone f) (x : α) : Tendsto f (𝓝[<] x) (𝓝 (sSup (f '' Iio x))) := by |
rcases eq_empty_or_nonempty (Iio x) with (h | h); · simp [h]
refine tendsto_order.2 ⟨fun l hl => ?_, fun m hm => ?_⟩
· obtain ⟨z, zx, lz⟩ : ∃ a : α, a < x ∧ l < f a := by
simpa only [mem_image, exists_prop, exists_exists_and_eq_and] using
exists_lt_of_lt_csSup (h.image _) hl
exact mem_of_superset (Ioo_mem_nhdsWithin_Iio' zx) fun y hy => lz.trans_le (Mf hy.1.le)
· refine mem_of_superset self_mem_nhdsWithin fun _ hy => lt_of_le_of_lt ?_ hm
exact le_csSup (Mf.map_bddAbove bddAbove_Iio) (mem_image_of_mem _ hy)
| [
" f (sSup s) = sSup (f '' s)",
" IsLUB (f '' s) (f (sSup s))",
" Tendsto f (𝓝[s] sSup s) (𝓝 (f (sSup s)))",
" f (⨆ i, g i) = ⨆ i, f (g i)",
" sSup (range (f ∘ fun i => g i)) = sSup (range fun i => f (g i))",
" Tendsto f (𝓝[<] x) (𝓝 (sSup (f '' Iio x)))",
" ∀ᶠ (b : α) in 𝓝[<] x, l < f b",
" ∃ a < ... | [
" f (sSup s) = sSup (f '' s)",
" IsLUB (f '' s) (f (sSup s))",
" Tendsto f (𝓝[s] sSup s) (𝓝 (f (sSup s)))",
" f (⨆ i, g i) = ⨆ i, f (g i)",
" sSup (range (f ∘ fun i => g i)) = sSup (range fun i => f (g i))",
" Tendsto f (𝓝[<] x) (𝓝 (sSup (f '' Iio x)))"
] |
import Mathlib.RingTheory.RingHomProperties
import Mathlib.RingTheory.IntegralClosure
#align_import ring_theory.ring_hom.integral from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
namespace RingHom
open scoped TensorProduct
open TensorProduct Algebra.TensorProduct
theorem isIntegral_stableUnderComposition : StableUnderComposition fun f => f.IsIntegral := by
introv R hf hg; exact hf.trans _ _ hg
#align ring_hom.is_integral_stable_under_composition RingHom.isIntegral_stableUnderComposition
theorem isIntegral_respectsIso : RespectsIso fun f => f.IsIntegral := by
apply isIntegral_stableUnderComposition.respectsIso
introv x
rw [← e.apply_symm_apply x]
apply RingHom.isIntegralElem_map
#align ring_hom.is_integral_respects_iso RingHom.isIntegral_respectsIso
| Mathlib/RingTheory/RingHom/Integral.lean | 35 | 41 | theorem isIntegral_stableUnderBaseChange : StableUnderBaseChange fun f => f.IsIntegral := by |
refine StableUnderBaseChange.mk _ isIntegral_respectsIso ?_
introv h x
refine TensorProduct.induction_on x ?_ ?_ ?_
· apply isIntegral_zero
· intro x y; exact IsIntegral.tmul x (h y)
· intro x y hx hy; exact IsIntegral.add hx hy
| [
" StableUnderComposition fun {R S} [CommRing R] [CommRing S] f => f.IsIntegral",
" (g.comp f).IsIntegral",
" RespectsIso fun {R S} [CommRing R] [CommRing S] f => f.IsIntegral",
" ∀ {R S : Type u_1} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), e.toRingHom.IsIntegral",
" e.toRingHom.IsIntegralElem... | [
" StableUnderComposition fun {R S} [CommRing R] [CommRing S] f => f.IsIntegral",
" (g.comp f).IsIntegral",
" RespectsIso fun {R S} [CommRing R] [CommRing S] f => f.IsIntegral",
" ∀ {R S : Type u_1} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), e.toRingHom.IsIntegral",
" e.toRingHom.IsIntegralElem... |
import Mathlib.Algebra.MonoidAlgebra.Support
import Mathlib.Algebra.Polynomial.Basic
import Mathlib.Algebra.Regular.Basic
import Mathlib.Data.Nat.Choose.Sum
#align_import data.polynomial.coeff from "leanprover-community/mathlib"@"2651125b48fc5c170ab1111afd0817c903b1fc6c"
set_option linter.uppercaseLean3 false
noncomputable section
open Finsupp Finset AddMonoidAlgebra
open Polynomial
namespace Polynomial
universe u v
variable {R : Type u} {S : Type v} {a b : R} {n m : ℕ}
variable [Semiring R] {p q r : R[X]}
section Coeff
@[simp]
theorem coeff_add (p q : R[X]) (n : ℕ) : coeff (p + q) n = coeff p n + coeff q n := by
rcases p with ⟨⟩
rcases q with ⟨⟩
simp_rw [← ofFinsupp_add, coeff]
exact Finsupp.add_apply _ _ _
#align polynomial.coeff_add Polynomial.coeff_add
set_option linter.deprecated false in
@[simp]
theorem coeff_bit0 (p : R[X]) (n : ℕ) : coeff (bit0 p) n = bit0 (coeff p n) := by simp [bit0]
#align polynomial.coeff_bit0 Polynomial.coeff_bit0
@[simp]
theorem coeff_smul [SMulZeroClass S R] (r : S) (p : R[X]) (n : ℕ) :
coeff (r • p) n = r • coeff p n := by
rcases p with ⟨⟩
simp_rw [← ofFinsupp_smul, coeff]
exact Finsupp.smul_apply _ _ _
#align polynomial.coeff_smul Polynomial.coeff_smul
theorem support_smul [SMulZeroClass S R] (r : S) (p : R[X]) :
support (r • p) ⊆ support p := by
intro i hi
simp? [mem_support_iff] at hi ⊢ says simp only [mem_support_iff, coeff_smul, ne_eq] at hi ⊢
contrapose! hi
simp [hi]
#align polynomial.support_smul Polynomial.support_smul
open scoped Pointwise in
| Mathlib/Algebra/Polynomial/Coeff.lean | 69 | 74 | theorem card_support_mul_le : (p * q).support.card ≤ p.support.card * q.support.card := by |
calc (p * q).support.card
_ = (p.toFinsupp * q.toFinsupp).support.card := by rw [← support_toFinsupp, toFinsupp_mul]
_ ≤ (p.toFinsupp.support + q.toFinsupp.support).card :=
Finset.card_le_card (AddMonoidAlgebra.support_mul p.toFinsupp q.toFinsupp)
_ ≤ p.support.card * q.support.card := Finset.card_image₂_le ..
| [
" (p + q).coeff n = p.coeff n + q.coeff n",
" ({ toFinsupp := toFinsupp✝ } + q).coeff n = { toFinsupp := toFinsupp✝ }.coeff n + q.coeff n",
" ({ toFinsupp := toFinsupp✝¹ } + { toFinsupp := toFinsupp✝ }).coeff n =\n { toFinsupp := toFinsupp✝¹ }.coeff n + { toFinsupp := toFinsupp✝ }.coeff n",
" (toFinsupp✝¹ ... | [
" (p + q).coeff n = p.coeff n + q.coeff n",
" ({ toFinsupp := toFinsupp✝ } + q).coeff n = { toFinsupp := toFinsupp✝ }.coeff n + q.coeff n",
" ({ toFinsupp := toFinsupp✝¹ } + { toFinsupp := toFinsupp✝ }).coeff n =\n { toFinsupp := toFinsupp✝¹ }.coeff n + { toFinsupp := toFinsupp✝ }.coeff n",
" (toFinsupp✝¹ ... |
import Mathlib.Algebra.BigOperators.Ring
import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Int.GCD
import Mathlib.RingTheory.Coprime.Basic
#align_import ring_theory.coprime.lemmas from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226"
universe u v
section RelPrime
variable {α I} [CommMonoid α] [DecompositionMonoid α] {x y z : α} {s : I → α} {t : Finset I}
theorem IsRelPrime.prod_left : (∀ i ∈ t, IsRelPrime (s i) x) → IsRelPrime (∏ i ∈ t, s i) x := by
classical
refine Finset.induction_on t (fun _ ↦ isRelPrime_one_left) fun b t hbt ih H ↦ ?_
rw [Finset.prod_insert hbt]
rw [Finset.forall_mem_insert] at H
exact H.1.mul_left (ih H.2)
theorem IsRelPrime.prod_right : (∀ i ∈ t, IsRelPrime x (s i)) → IsRelPrime x (∏ i ∈ t, s i) := by
simpa only [isRelPrime_comm] using IsRelPrime.prod_left (α := α)
theorem IsRelPrime.prod_left_iff : IsRelPrime (∏ i ∈ t, s i) x ↔ ∀ i ∈ t, IsRelPrime (s i) x := by
classical
refine Finset.induction_on t (iff_of_true isRelPrime_one_left fun _ ↦ by simp) fun b t hbt ih ↦ ?_
rw [Finset.prod_insert hbt, IsRelPrime.mul_left_iff, ih, Finset.forall_mem_insert]
theorem IsRelPrime.prod_right_iff : IsRelPrime x (∏ i ∈ t, s i) ↔ ∀ i ∈ t, IsRelPrime x (s i) := by
simpa only [isRelPrime_comm] using IsRelPrime.prod_left_iff (α := α)
theorem IsRelPrime.of_prod_left (H1 : IsRelPrime (∏ i ∈ t, s i) x) (i : I) (hit : i ∈ t) :
IsRelPrime (s i) x :=
IsRelPrime.prod_left_iff.1 H1 i hit
theorem IsRelPrime.of_prod_right (H1 : IsRelPrime x (∏ i ∈ t, s i)) (i : I) (hit : i ∈ t) :
IsRelPrime x (s i) :=
IsRelPrime.prod_right_iff.1 H1 i hit
theorem Finset.prod_dvd_of_isRelPrime :
(t : Set I).Pairwise (IsRelPrime on s) → (∀ i ∈ t, s i ∣ z) → (∏ x ∈ t, s x) ∣ z := by
classical
exact Finset.induction_on t (fun _ _ ↦ one_dvd z)
(by
intro a r har ih Hs Hs1
rw [Finset.prod_insert har]
have aux1 : a ∈ (↑(insert a r) : Set I) := Finset.mem_insert_self a r
refine
(IsRelPrime.prod_right fun i hir ↦
Hs aux1 (Finset.mem_insert_of_mem hir) <| by
rintro rfl
exact har hir).mul_dvd
(Hs1 a aux1) (ih (Hs.mono ?_) fun i hi ↦ Hs1 i <| Finset.mem_insert_of_mem hi)
simp only [Finset.coe_insert, Set.subset_insert])
theorem Fintype.prod_dvd_of_isRelPrime [Fintype I] (Hs : Pairwise (IsRelPrime on s))
(Hs1 : ∀ i, s i ∣ z) : (∏ x, s x) ∣ z :=
Finset.prod_dvd_of_isRelPrime (Hs.set_pairwise _) fun i _ ↦ Hs1 i
theorem pairwise_isRelPrime_iff_isRelPrime_prod [DecidableEq I] :
Pairwise (IsRelPrime on fun i : t ↦ s i) ↔ ∀ i ∈ t, IsRelPrime (s i) (∏ j ∈ t \ {i}, s j) := by
refine ⟨fun hp i hi ↦ IsRelPrime.prod_right_iff.mpr fun j hj ↦ ?_, fun hp ↦ ?_⟩
· rw [Finset.mem_sdiff, Finset.mem_singleton] at hj
obtain ⟨hj, ji⟩ := hj
exact @hp ⟨i, hi⟩ ⟨j, hj⟩ fun h ↦ ji (congrArg Subtype.val h).symm
· rintro ⟨i, hi⟩ ⟨j, hj⟩ h
apply IsRelPrime.prod_right_iff.mp (hp i hi)
exact Finset.mem_sdiff.mpr ⟨hj, fun f ↦ h <| Subtype.ext (Finset.mem_singleton.mp f).symm⟩
namespace IsRelPrime
variable {m n : ℕ}
theorem pow_left (H : IsRelPrime x y) : IsRelPrime (x ^ m) y := by
rw [← Finset.card_range m, ← Finset.prod_const]
exact IsRelPrime.prod_left fun _ _ ↦ H
theorem pow_right (H : IsRelPrime x y) : IsRelPrime x (y ^ n) := by
rw [← Finset.card_range n, ← Finset.prod_const]
exact IsRelPrime.prod_right fun _ _ ↦ H
theorem pow (H : IsRelPrime x y) : IsRelPrime (x ^ m) (y ^ n) :=
H.pow_left.pow_right
| Mathlib/RingTheory/Coprime/Lemmas.lean | 306 | 309 | theorem pow_left_iff (hm : 0 < m) : IsRelPrime (x ^ m) y ↔ IsRelPrime x y := by |
refine ⟨fun h ↦ ?_, IsRelPrime.pow_left⟩
rw [← Finset.card_range m, ← Finset.prod_const] at h
exact h.of_prod_left 0 (Finset.mem_range.mpr hm)
| [
" (∀ i ∈ t, IsRelPrime (s i) x) → IsRelPrime (∏ i ∈ t, s i) x",
" IsRelPrime (∏ i ∈ insert b t, s i) x",
" IsRelPrime (s b * ∏ x ∈ t, s x) x",
" (∀ i ∈ t, IsRelPrime x (s i)) → IsRelPrime x (∏ i ∈ t, s i)",
" IsRelPrime (∏ i ∈ t, s i) x ↔ ∀ i ∈ t, IsRelPrime (s i) x",
" x✝ ∈ ∅ → IsRelPrime (s x✝) x",
" ... | [
" (∀ i ∈ t, IsRelPrime (s i) x) → IsRelPrime (∏ i ∈ t, s i) x",
" IsRelPrime (∏ i ∈ insert b t, s i) x",
" IsRelPrime (s b * ∏ x ∈ t, s x) x",
" (∀ i ∈ t, IsRelPrime x (s i)) → IsRelPrime x (∏ i ∈ t, s i)",
" IsRelPrime (∏ i ∈ t, s i) x ↔ ∀ i ∈ t, IsRelPrime (s i) x",
" x✝ ∈ ∅ → IsRelPrime (s x✝) x",
" ... |
import Mathlib.MeasureTheory.Covering.VitaliFamily
import Mathlib.MeasureTheory.Measure.Regular
import Mathlib.MeasureTheory.Function.AEMeasurableOrder
import Mathlib.MeasureTheory.Integral.Lebesgue
import Mathlib.MeasureTheory.Integral.Average
import Mathlib.MeasureTheory.Decomposition.Lebesgue
#align_import measure_theory.covering.differentiation from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2"
open MeasureTheory Metric Set Filter TopologicalSpace MeasureTheory.Measure
open scoped Filter ENNReal MeasureTheory NNReal Topology
variable {α : Type*} [MetricSpace α] {m0 : MeasurableSpace α} {μ : Measure α} (v : VitaliFamily μ)
{E : Type*} [NormedAddCommGroup E]
namespace VitaliFamily
noncomputable def limRatio (ρ : Measure α) (x : α) : ℝ≥0∞ :=
limUnder (v.filterAt x) fun a => ρ a / μ a
#align vitali_family.lim_ratio VitaliFamily.limRatio
| Mathlib/MeasureTheory/Covering/Differentiation.lean | 97 | 113 | theorem ae_eventually_measure_pos [SecondCountableTopology α] :
∀ᵐ x ∂μ, ∀ᶠ a in v.filterAt x, 0 < μ a := by |
set s := {x | ¬∀ᶠ a in v.filterAt x, 0 < μ a} with hs
simp (config := { zeta := false }) only [not_lt, not_eventually, nonpos_iff_eq_zero] at hs
change μ s = 0
let f : α → Set (Set α) := fun _ => {a | μ a = 0}
have h : v.FineSubfamilyOn f s := by
intro x hx ε εpos
rw [hs] at hx
simp only [frequently_filterAt_iff, exists_prop, gt_iff_lt, mem_setOf_eq] at hx
rcases hx ε εpos with ⟨a, a_sets, ax, μa⟩
exact ⟨a, ⟨a_sets, μa⟩, ax⟩
refine le_antisymm ?_ bot_le
calc
μ s ≤ ∑' x : h.index, μ (h.covering x) := h.measure_le_tsum
_ = ∑' x : h.index, 0 := by congr; ext1 x; exact h.covering_mem x.2
_ = 0 := by simp only [tsum_zero, add_zero]
| [
" ∀ᵐ (x : α) ∂μ, ∀ᶠ (a : Set α) in v.filterAt x, 0 < μ a",
" μ s = 0",
" v.FineSubfamilyOn f s",
" ∃ a ∈ v.setsAt x ∩ f x, a ⊆ closedBall x ε",
" μ s ≤ 0",
" ∑' (x : ↑h.index), μ (h.covering ↑x) = ∑' (x : ↑h.index), 0",
" (fun x => μ (h.covering ↑x)) = fun x => 0",
" μ (h.covering ↑x) = 0",
" ∑' (x ... | [
" ∀ᵐ (x : α) ∂μ, ∀ᶠ (a : Set α) in v.filterAt x, 0 < μ a"
] |
import Mathlib.Data.Finsupp.Defs
#align_import data.finsupp.fin from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
noncomputable section
namespace Finsupp
variable {n : ℕ} (i : Fin n) {M : Type*} [Zero M] (y : M) (t : Fin (n + 1) →₀ M) (s : Fin n →₀ M)
def tail (s : Fin (n + 1) →₀ M) : Fin n →₀ M :=
Finsupp.equivFunOnFinite.symm (Fin.tail s)
#align finsupp.tail Finsupp.tail
def cons (y : M) (s : Fin n →₀ M) : Fin (n + 1) →₀ M :=
Finsupp.equivFunOnFinite.symm (Fin.cons y s : Fin (n + 1) → M)
#align finsupp.cons Finsupp.cons
theorem tail_apply : tail t i = t i.succ :=
rfl
#align finsupp.tail_apply Finsupp.tail_apply
@[simp]
theorem cons_zero : cons y s 0 = y :=
rfl
#align finsupp.cons_zero Finsupp.cons_zero
@[simp]
theorem cons_succ : cons y s i.succ = s i :=
-- Porting note: was Fin.cons_succ _ _ _
rfl
#align finsupp.cons_succ Finsupp.cons_succ
@[simp]
theorem tail_cons : tail (cons y s) = s :=
ext fun k => by simp only [tail_apply, cons_succ]
#align finsupp.tail_cons Finsupp.tail_cons
@[simp]
theorem cons_tail : cons (t 0) (tail t) = t := by
ext a
by_cases c_a : a = 0
· rw [c_a, cons_zero]
· rw [← Fin.succ_pred a c_a, cons_succ, ← tail_apply]
#align finsupp.cons_tail Finsupp.cons_tail
@[simp]
| Mathlib/Data/Finsupp/Fin.lean | 68 | 73 | theorem cons_zero_zero : cons 0 (0 : Fin n →₀ M) = 0 := by |
ext a
by_cases c : a = 0
· simp [c]
· rw [← Fin.succ_pred a c, cons_succ]
simp
| [
" (cons y s).tail k = s k",
" cons (t 0) t.tail = t",
" (cons (t 0) t.tail) a = t a",
" cons 0 0 = 0",
" (cons 0 0) a = 0 a",
" 0 (a.pred c) = 0 (a.pred c).succ"
] | [
" (cons y s).tail k = s k",
" cons (t 0) t.tail = t",
" (cons (t 0) t.tail) a = t a",
" cons 0 0 = 0"
] |
import Mathlib.RingTheory.AdicCompletion.Basic
import Mathlib.Algebra.Module.Torsion
open Submodule
variable {R : Type*} [CommRing R] (I : Ideal R)
variable {M : Type*} [AddCommGroup M] [Module R M]
namespace AdicCompletion
attribute [-simp] smul_eq_mul Algebra.id.smul_eq_mul
@[local simp]
theorem transitionMap_ideal_mk {m n : ℕ} (hmn : m ≤ n) (x : R) :
transitionMap I R hmn (Ideal.Quotient.mk (I ^ n • ⊤ : Ideal R) x) =
Ideal.Quotient.mk (I ^ m • ⊤ : Ideal R) x :=
rfl
@[local simp]
theorem transitionMap_map_one {m n : ℕ} (hmn : m ≤ n) : transitionMap I R hmn 1 = 1 :=
rfl
@[local simp]
theorem transitionMap_map_mul {m n : ℕ} (hmn : m ≤ n) (x y : R ⧸ (I ^ n • ⊤ : Ideal R)) :
transitionMap I R hmn (x * y) = transitionMap I R hmn x * transitionMap I R hmn y :=
Quotient.inductionOn₂' x y (fun _ _ ↦ rfl)
def transitionMapₐ {m n : ℕ} (hmn : m ≤ n) :
R ⧸ (I ^ n • ⊤ : Ideal R) →ₐ[R] R ⧸ (I ^ m • ⊤ : Ideal R) :=
AlgHom.ofLinearMap (transitionMap I R hmn) rfl (transitionMap_map_mul I hmn)
def subalgebra : Subalgebra R (∀ n, R ⧸ (I ^ n • ⊤ : Ideal R)) :=
Submodule.toSubalgebra (submodule I R) (fun _ ↦ by simp)
(fun x y hx hy m n hmn ↦ by simp [hx hmn, hy hmn])
def subring : Subring (∀ n, R ⧸ (I ^ n • ⊤ : Ideal R)) :=
Subalgebra.toSubring (subalgebra I)
instance : CommRing (AdicCompletion I R) :=
inferInstanceAs <| CommRing (subring I)
instance : Algebra R (AdicCompletion I R) :=
inferInstanceAs <| Algebra R (subalgebra I)
@[simp]
theorem val_one (n : ℕ) : (1 : AdicCompletion I R).val n = 1 :=
rfl
@[simp]
theorem val_mul (n : ℕ) (x y : AdicCompletion I R) : (x * y).val n = x.val n * y.val n :=
rfl
def evalₐ (n : ℕ) : AdicCompletion I R →ₐ[R] R ⧸ I ^ n :=
have h : (I ^ n • ⊤ : Ideal R) = I ^ n := by ext x; simp
AlgHom.comp
(Ideal.quotientEquivAlgOfEq R h)
(AlgHom.ofLinearMap (eval I R n) rfl (fun _ _ ↦ rfl))
@[simp]
theorem evalₐ_mk (n : ℕ) (x : AdicCauchySequence I R) :
evalₐ I n (mk I R x) = Ideal.Quotient.mk (I ^ n) (x.val n) := by
simp [evalₐ]
def AdicCauchySequence.subalgebra : Subalgebra R (ℕ → R) :=
Submodule.toSubalgebra (AdicCauchySequence.submodule I R)
(fun {m n} _ ↦ by simp; rfl)
(fun x y hx hy {m n} hmn ↦ by
simp only [Pi.mul_apply]
exact SModEq.mul (hx hmn) (hy hmn))
def AdicCauchySequence.subring : Subring (ℕ → R) :=
Subalgebra.toSubring (AdicCauchySequence.subalgebra I)
instance : CommRing (AdicCauchySequence I R) :=
inferInstanceAs <| CommRing (AdicCauchySequence.subring I)
instance : Algebra R (AdicCauchySequence I R) :=
inferInstanceAs <| Algebra R (AdicCauchySequence.subalgebra I)
@[simp]
theorem one_apply (n : ℕ) : (1 : AdicCauchySequence I R) n = 1 :=
rfl
@[simp]
theorem mul_apply (n : ℕ) (f g : AdicCauchySequence I R) : (f * g) n = f n * g n :=
rfl
@[simps!]
def mkₐ : AdicCauchySequence I R →ₐ[R] AdicCompletion I R :=
AlgHom.ofLinearMap (mk I R) rfl (fun _ _ ↦ rfl)
@[simp]
theorem evalₐ_mkₐ (n : ℕ) (x : AdicCauchySequence I R) :
evalₐ I n (mkₐ I x) = Ideal.Quotient.mk (I ^ n) (x.val n) := by
simp [mkₐ]
theorem Ideal.mk_eq_mk {m n : ℕ} (hmn : m ≤ n) (r : AdicCauchySequence I R) :
Ideal.Quotient.mk (I ^ m) (r.val n) = Ideal.Quotient.mk (I ^ m) (r.val m) := by
have h : I ^ m = I ^ m • ⊤ := by simp
rw [h, ← Ideal.Quotient.mk_eq_mk, ← Ideal.Quotient.mk_eq_mk]
exact (r.property hmn).symm
| Mathlib/RingTheory/AdicCompletion/Algebra.lean | 133 | 139 | theorem smul_mk {m n : ℕ} (hmn : m ≤ n) (r : AdicCauchySequence I R)
(x : AdicCauchySequence I M) :
r.val n • Submodule.Quotient.mk (p := (I ^ m • ⊤ : Submodule R M)) (x.val n) =
r.val m • Submodule.Quotient.mk (p := (I ^ m • ⊤ : Submodule R M)) (x.val m) := by |
rw [← Submodule.Quotient.mk_smul, ← Module.Quotient.mk_smul_mk,
AdicCauchySequence.mk_eq_mk hmn, Ideal.mk_eq_mk I hmn, Module.Quotient.mk_smul_mk,
Submodule.Quotient.mk_smul]
| [
" (transitionMap I R x✝) (1 n✝) = 1 m✝",
" (transitionMap I R hmn) ((x * y) n) = (x * y) m",
" I ^ n • ⊤ = I ^ n",
" x ∈ I ^ n • ⊤ ↔ x ∈ I ^ n",
" (evalₐ I n) ((mk I R) x) = (Ideal.Quotient.mk (I ^ n)) (↑x n)",
" 1 m ≡ 1 n [SMOD I ^ m • ⊤]",
" 1 ≡ 1 [SMOD I ^ m]",
" (x * y) m ≡ (x * y) n [SMOD I ^ m •... | [
" (transitionMap I R x✝) (1 n✝) = 1 m✝",
" (transitionMap I R hmn) ((x * y) n) = (x * y) m",
" I ^ n • ⊤ = I ^ n",
" x ∈ I ^ n • ⊤ ↔ x ∈ I ^ n",
" (evalₐ I n) ((mk I R) x) = (Ideal.Quotient.mk (I ^ n)) (↑x n)",
" 1 m ≡ 1 n [SMOD I ^ m • ⊤]",
" 1 ≡ 1 [SMOD I ^ m]",
" (x * y) m ≡ (x * y) n [SMOD I ^ m •... |
import Mathlib.Algebra.Polynomial.Expand
import Mathlib.Algebra.Polynomial.Laurent
import Mathlib.LinearAlgebra.Matrix.Charpoly.Basic
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.RingTheory.Polynomial.Nilpotent
#align_import linear_algebra.matrix.charpoly.coeff from "leanprover-community/mathlib"@"9745b093210e9dac443af24da9dba0f9e2b6c912"
noncomputable section
-- porting note: whenever there was `∏ i : n, X - C (M i i)`, I replaced it with
-- `∏ i : n, (X - C (M i i))`, since otherwise Lean would parse as `(∏ i : n, X) - C (M i i)`
universe u v w z
open Finset Matrix Polynomial
variable {R : Type u} [CommRing R]
variable {n G : Type v} [DecidableEq n] [Fintype n]
variable {α β : Type v} [DecidableEq α]
variable {M : Matrix n n R}
namespace Matrix
theorem charmatrix_apply_natDegree [Nontrivial R] (i j : n) :
(charmatrix M i j).natDegree = ite (i = j) 1 0 := by
by_cases h : i = j <;> simp [h, ← degree_eq_iff_natDegree_eq_of_pos (Nat.succ_pos 0)]
#align charmatrix_apply_nat_degree Matrix.charmatrix_apply_natDegree
theorem charmatrix_apply_natDegree_le (i j : n) :
(charmatrix M i j).natDegree ≤ ite (i = j) 1 0 := by
split_ifs with h <;> simp [h, natDegree_X_le]
#align charmatrix_apply_nat_degree_le Matrix.charmatrix_apply_natDegree_le
variable (M)
theorem charpoly_sub_diagonal_degree_lt :
(M.charpoly - ∏ i : n, (X - C (M i i))).degree < ↑(Fintype.card n - 1) := by
rw [charpoly, det_apply', ← insert_erase (mem_univ (Equiv.refl n)),
sum_insert (not_mem_erase (Equiv.refl n) univ), add_comm]
simp only [charmatrix_apply_eq, one_mul, Equiv.Perm.sign_refl, id, Int.cast_one,
Units.val_one, add_sub_cancel_right, Equiv.coe_refl]
rw [← mem_degreeLT]
apply Submodule.sum_mem (degreeLT R (Fintype.card n - 1))
intro c hc; rw [← C_eq_intCast, C_mul']
apply Submodule.smul_mem (degreeLT R (Fintype.card n - 1)) ↑↑(Equiv.Perm.sign c)
rw [mem_degreeLT]
apply lt_of_le_of_lt degree_le_natDegree _
rw [Nat.cast_lt]
apply lt_of_le_of_lt _ (Equiv.Perm.fixed_point_card_lt_of_ne_one (ne_of_mem_erase hc))
apply le_trans (Polynomial.natDegree_prod_le univ fun i : n => charmatrix M (c i) i) _
rw [card_eq_sum_ones]; rw [sum_filter]; apply sum_le_sum
intros
apply charmatrix_apply_natDegree_le
#align matrix.charpoly_sub_diagonal_degree_lt Matrix.charpoly_sub_diagonal_degree_lt
| Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean | 81 | 86 | theorem charpoly_coeff_eq_prod_coeff_of_le {k : ℕ} (h : Fintype.card n - 1 ≤ k) :
M.charpoly.coeff k = (∏ i : n, (X - C (M i i))).coeff k := by |
apply eq_of_sub_eq_zero; rw [← coeff_sub]
apply Polynomial.coeff_eq_zero_of_degree_lt
apply lt_of_lt_of_le (charpoly_sub_diagonal_degree_lt M) ?_
rw [Nat.cast_le]; apply h
| [
" (M.charmatrix i j).natDegree = if i = j then 1 else 0",
" (M.charmatrix i j).natDegree ≤ if i = j then 1 else 0",
" (M.charmatrix i j).natDegree ≤ 1",
" (M.charmatrix i j).natDegree ≤ 0",
" (M.charpoly - ∏ i : n, (X - C (M i i))).degree < ↑(Fintype.card n - 1)",
" (∑ x ∈ univ.erase (Equiv.refl n), ↑↑(Eq... | [
" (M.charmatrix i j).natDegree = if i = j then 1 else 0",
" (M.charmatrix i j).natDegree ≤ if i = j then 1 else 0",
" (M.charmatrix i j).natDegree ≤ 1",
" (M.charmatrix i j).natDegree ≤ 0",
" (M.charpoly - ∏ i : n, (X - C (M i i))).degree < ↑(Fintype.card n - 1)",
" (∑ x ∈ univ.erase (Equiv.refl n), ↑↑(Eq... |
import Mathlib.Data.Finset.Sum
import Mathlib.Data.Sum.Order
import Mathlib.Order.Interval.Finset.Defs
#align_import data.sum.interval from "leanprover-community/mathlib"@"48a058d7e39a80ed56858505719a0b2197900999"
open Function Sum
namespace Finset
variable {α₁ α₂ β₁ β₂ γ₁ γ₂ : Type*}
section SumLift₂
variable (f f₁ g₁ : α₁ → β₁ → Finset γ₁) (g f₂ g₂ : α₂ → β₂ → Finset γ₂)
@[simp]
def sumLift₂ : ∀ (_ : Sum α₁ α₂) (_ : Sum β₁ β₂), Finset (Sum γ₁ γ₂)
| inl a, inl b => (f a b).map Embedding.inl
| inl _, inr _ => ∅
| inr _, inl _ => ∅
| inr a, inr b => (g a b).map Embedding.inr
#align finset.sum_lift₂ Finset.sumLift₂
variable {f f₁ g₁ g f₂ g₂} {a : Sum α₁ α₂} {b : Sum β₁ β₂} {c : Sum γ₁ γ₂}
theorem mem_sumLift₂ :
c ∈ sumLift₂ f g a b ↔
(∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f a₁ b₁) ∨
∃ a₂ b₂ c₂, a = inr a₂ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ g a₂ b₂ := by
constructor
· cases' a with a a <;> cases' b with b b
· rw [sumLift₂, mem_map]
rintro ⟨c, hc, rfl⟩
exact Or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩
· refine fun h ↦ (not_mem_empty _ h).elim
· refine fun h ↦ (not_mem_empty _ h).elim
· rw [sumLift₂, mem_map]
rintro ⟨c, hc, rfl⟩
exact Or.inr ⟨a, b, c, rfl, rfl, rfl, hc⟩
· rintro (⟨a, b, c, rfl, rfl, rfl, h⟩ | ⟨a, b, c, rfl, rfl, rfl, h⟩) <;> exact mem_map_of_mem _ h
#align finset.mem_sum_lift₂ Finset.mem_sumLift₂
theorem inl_mem_sumLift₂ {c₁ : γ₁} :
inl c₁ ∈ sumLift₂ f g a b ↔ ∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ c₁ ∈ f a₁ b₁ := by
rw [mem_sumLift₂, or_iff_left]
· simp only [inl.injEq, exists_and_left, exists_eq_left']
rintro ⟨_, _, c₂, _, _, h, _⟩
exact inl_ne_inr h
#align finset.inl_mem_sum_lift₂ Finset.inl_mem_sumLift₂
theorem inr_mem_sumLift₂ {c₂ : γ₂} :
inr c₂ ∈ sumLift₂ f g a b ↔ ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ c₂ ∈ g a₂ b₂ := by
rw [mem_sumLift₂, or_iff_right]
· simp only [inr.injEq, exists_and_left, exists_eq_left']
rintro ⟨_, _, c₂, _, _, h, _⟩
exact inr_ne_inl h
#align finset.inr_mem_sum_lift₂ Finset.inr_mem_sumLift₂
theorem sumLift₂_eq_empty :
sumLift₂ f g a b = ∅ ↔
(∀ a₁ b₁, a = inl a₁ → b = inl b₁ → f a₁ b₁ = ∅) ∧
∀ a₂ b₂, a = inr a₂ → b = inr b₂ → g a₂ b₂ = ∅ := by
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· constructor <;>
· rintro a b rfl rfl
exact map_eq_empty.1 h
cases a <;> cases b
· exact map_eq_empty.2 (h.1 _ _ rfl rfl)
· rfl
· rfl
· exact map_eq_empty.2 (h.2 _ _ rfl rfl)
#align finset.sum_lift₂_eq_empty Finset.sumLift₂_eq_empty
| Mathlib/Data/Sum/Interval.lean | 91 | 95 | theorem sumLift₂_nonempty :
(sumLift₂ f g a b).Nonempty ↔
(∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ (f a₁ b₁).Nonempty) ∨
∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ (g a₂ b₂).Nonempty := by |
simp only [nonempty_iff_ne_empty, Ne, sumLift₂_eq_empty, not_and_or, not_forall, exists_prop]
| [
" c ∈ sumLift₂ f g a b ↔\n (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f a₁ b₁) ∨\n ∃ a₂ b₂ c₂, a = inr a₂ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ g a₂ b₂",
" c ∈ sumLift₂ f g a b →\n (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f a₁ b₁) ∨\n ∃ a₂ b₂ c₂, a = inr a₂ ∧ b = inr b₂ ∧ ... | [
" c ∈ sumLift₂ f g a b ↔\n (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f a₁ b₁) ∨\n ∃ a₂ b₂ c₂, a = inr a₂ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ g a₂ b₂",
" c ∈ sumLift₂ f g a b →\n (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f a₁ b₁) ∨\n ∃ a₂ b₂ c₂, a = inr a₂ ∧ b = inr b₂ ∧ ... |
import Mathlib.Algebra.ContinuedFractions.Basic
import Mathlib.Algebra.GroupWithZero.Basic
#align_import algebra.continued_fractions.translations from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
namespace GeneralizedContinuedFraction
section WithDivisionRing
variable {K : Type*} {g : GeneralizedContinuedFraction K} {n : ℕ} [DivisionRing K]
theorem nth_cont_eq_succ_nth_cont_aux : g.continuants n = g.continuantsAux (n + 1) :=
rfl
#align generalized_continued_fraction.nth_cont_eq_succ_nth_cont_aux GeneralizedContinuedFraction.nth_cont_eq_succ_nth_cont_aux
theorem num_eq_conts_a : g.numerators n = (g.continuants n).a :=
rfl
#align generalized_continued_fraction.num_eq_conts_a GeneralizedContinuedFraction.num_eq_conts_a
theorem denom_eq_conts_b : g.denominators n = (g.continuants n).b :=
rfl
#align generalized_continued_fraction.denom_eq_conts_b GeneralizedContinuedFraction.denom_eq_conts_b
theorem convergent_eq_num_div_denom : g.convergents n = g.numerators n / g.denominators n :=
rfl
#align generalized_continued_fraction.convergent_eq_num_div_denom GeneralizedContinuedFraction.convergent_eq_num_div_denom
theorem convergent_eq_conts_a_div_conts_b :
g.convergents n = (g.continuants n).a / (g.continuants n).b :=
rfl
#align generalized_continued_fraction.convergent_eq_conts_a_div_conts_b GeneralizedContinuedFraction.convergent_eq_conts_a_div_conts_b
theorem exists_conts_a_of_num {A : K} (nth_num_eq : g.numerators n = A) :
∃ conts, g.continuants n = conts ∧ conts.a = A := by simpa
#align generalized_continued_fraction.exists_conts_a_of_num GeneralizedContinuedFraction.exists_conts_a_of_num
theorem exists_conts_b_of_denom {B : K} (nth_denom_eq : g.denominators n = B) :
∃ conts, g.continuants n = conts ∧ conts.b = B := by simpa
#align generalized_continued_fraction.exists_conts_b_of_denom GeneralizedContinuedFraction.exists_conts_b_of_denom
@[simp]
theorem zeroth_continuant_aux_eq_one_zero : g.continuantsAux 0 = ⟨1, 0⟩ :=
rfl
#align generalized_continued_fraction.zeroth_continuant_aux_eq_one_zero GeneralizedContinuedFraction.zeroth_continuant_aux_eq_one_zero
@[simp]
theorem first_continuant_aux_eq_h_one : g.continuantsAux 1 = ⟨g.h, 1⟩ :=
rfl
#align generalized_continued_fraction.first_continuant_aux_eq_h_one GeneralizedContinuedFraction.first_continuant_aux_eq_h_one
@[simp]
theorem zeroth_continuant_eq_h_one : g.continuants 0 = ⟨g.h, 1⟩ :=
rfl
#align generalized_continued_fraction.zeroth_continuant_eq_h_one GeneralizedContinuedFraction.zeroth_continuant_eq_h_one
@[simp]
theorem zeroth_numerator_eq_h : g.numerators 0 = g.h :=
rfl
#align generalized_continued_fraction.zeroth_numerator_eq_h GeneralizedContinuedFraction.zeroth_numerator_eq_h
@[simp]
theorem zeroth_denominator_eq_one : g.denominators 0 = 1 :=
rfl
#align generalized_continued_fraction.zeroth_denominator_eq_one GeneralizedContinuedFraction.zeroth_denominator_eq_one
@[simp]
theorem zeroth_convergent_eq_h : g.convergents 0 = g.h := by
simp [convergent_eq_num_div_denom, num_eq_conts_a, denom_eq_conts_b, div_one]
#align generalized_continued_fraction.zeroth_convergent_eq_h GeneralizedContinuedFraction.zeroth_convergent_eq_h
theorem second_continuant_aux_eq {gp : Pair K} (zeroth_s_eq : g.s.get? 0 = some gp) :
g.continuantsAux 2 = ⟨gp.b * g.h + gp.a, gp.b⟩ := by
simp [zeroth_s_eq, continuantsAux, nextContinuants, nextDenominator, nextNumerator]
#align generalized_continued_fraction.second_continuant_aux_eq GeneralizedContinuedFraction.second_continuant_aux_eq
theorem first_continuant_eq {gp : Pair K} (zeroth_s_eq : g.s.get? 0 = some gp) :
g.continuants 1 = ⟨gp.b * g.h + gp.a, gp.b⟩ := by
simp [nth_cont_eq_succ_nth_cont_aux]
-- Porting note (#10959): simp used to work here, but now it can't figure out that 1 + 1 = 2
convert second_continuant_aux_eq zeroth_s_eq
#align generalized_continued_fraction.first_continuant_eq GeneralizedContinuedFraction.first_continuant_eq
| Mathlib/Algebra/ContinuedFractions/Translations.lean | 162 | 163 | theorem first_numerator_eq {gp : Pair K} (zeroth_s_eq : g.s.get? 0 = some gp) :
g.numerators 1 = gp.b * g.h + gp.a := by | simp [num_eq_conts_a, first_continuant_eq zeroth_s_eq]
| [
" ∃ conts, g.continuants n = conts ∧ conts.a = A",
" ∃ conts, g.continuants n = conts ∧ conts.b = B",
" g.convergents 0 = g.h",
" g.continuantsAux 2 = { a := gp.b * g.h + gp.a, b := gp.b }",
" g.continuants 1 = { a := gp.b * g.h + gp.a, b := gp.b }",
" g.numerators 1 = gp.b * g.h + gp.a"
] | [
" ∃ conts, g.continuants n = conts ∧ conts.a = A",
" ∃ conts, g.continuants n = conts ∧ conts.b = B",
" g.convergents 0 = g.h",
" g.continuantsAux 2 = { a := gp.b * g.h + gp.a, b := gp.b }",
" g.continuants 1 = { a := gp.b * g.h + gp.a, b := gp.b }",
" g.numerators 1 = gp.b * g.h + gp.a"
] |
import Mathlib.Data.List.Chain
import Mathlib.Data.List.Enum
import Mathlib.Data.List.Nodup
import Mathlib.Data.List.Pairwise
import Mathlib.Data.List.Zip
#align_import data.list.range from "leanprover-community/mathlib"@"7b78d1776212a91ecc94cf601f83bdcc46b04213"
set_option autoImplicit true
universe u
open Nat
namespace List
variable {α : Type u}
@[simp] theorem range'_one {step} : range' s 1 step = [s] := rfl
#align list.length_range' List.length_range'
#align list.range'_eq_nil List.range'_eq_nil
#align list.mem_range' List.mem_range'_1
#align list.map_add_range' List.map_add_range'
#align list.map_sub_range' List.map_sub_range'
#align list.chain_succ_range' List.chain_succ_range'
#align list.chain_lt_range' List.chain_lt_range'
theorem pairwise_lt_range' : ∀ s n (step := 1) (_ : 0 < step := by simp),
Pairwise (· < ·) (range' s n step)
| _, 0, _, _ => Pairwise.nil
| s, n + 1, _, h => chain_iff_pairwise.1 (chain_lt_range' s n h)
#align list.pairwise_lt_range' List.pairwise_lt_range'
theorem nodup_range' (s n : ℕ) (step := 1) (h : 0 < step := by simp) : Nodup (range' s n step) :=
(pairwise_lt_range' s n step h).imp _root_.ne_of_lt
#align list.nodup_range' List.nodup_range'
#align list.range'_append List.range'_append
#align list.range'_sublist_right List.range'_sublist_right
#align list.range'_subset_right List.range'_subset_right
#align list.nth_range' List.get?_range'
set_option linter.deprecated false in
@[simp]
theorem nthLe_range' {n m step} (i) (H : i < (range' n m step).length) :
nthLe (range' n m step) i H = n + step * i := get_range' i H
set_option linter.deprecated false in
theorem nthLe_range'_1 {n m} (i) (H : i < (range' n m).length) :
nthLe (range' n m) i H = n + i := by simp
#align list.nth_le_range' List.nthLe_range'_1
#align list.range'_concat List.range'_concat
#align list.range_core List.range.loop
#align list.range_core_range' List.range_loop_range'
#align list.range_eq_range' List.range_eq_range'
#align list.range_succ_eq_map List.range_succ_eq_map
#align list.range'_eq_map_range List.range'_eq_map_range
#align list.length_range List.length_range
#align list.range_eq_nil List.range_eq_nil
theorem pairwise_lt_range (n : ℕ) : Pairwise (· < ·) (range n) := by
simp (config := {decide := true}) only [range_eq_range', pairwise_lt_range']
#align list.pairwise_lt_range List.pairwise_lt_range
theorem pairwise_le_range (n : ℕ) : Pairwise (· ≤ ·) (range n) :=
Pairwise.imp (@le_of_lt ℕ _) (pairwise_lt_range _)
#align list.pairwise_le_range List.pairwise_le_range
theorem take_range (m n : ℕ) : take m (range n) = range (min m n) := by
apply List.ext_get
· simp
· simp (config := { contextual := true }) [← get_take, Nat.lt_min]
theorem nodup_range (n : ℕ) : Nodup (range n) := by
simp (config := {decide := true}) only [range_eq_range', nodup_range']
#align list.nodup_range List.nodup_range
#align list.range_sublist List.range_sublist
#align list.range_subset List.range_subset
#align list.mem_range List.mem_range
#align list.not_mem_range_self List.not_mem_range_self
#align list.self_mem_range_succ List.self_mem_range_succ
#align list.nth_range List.get?_range
#align list.range_succ List.range_succ
#align list.range_zero List.range_zero
| Mathlib/Data/List/Range.lean | 104 | 112 | theorem chain'_range_succ (r : ℕ → ℕ → Prop) (n : ℕ) :
Chain' r (range n.succ) ↔ ∀ m < n, r m m.succ := by |
rw [range_succ]
induction' n with n hn
· simp
· rw [range_succ]
simp only [append_assoc, singleton_append, chain'_append_cons_cons, chain'_singleton,
and_true_iff]
rw [hn, forall_lt_succ]
| [
" (range' n m).nthLe i H = n + i",
" Pairwise (fun x x_1 => x < x_1) (range n)",
" take m (range n) = range (min m n)",
" (take m (range n)).length = (range (min m n)).length",
" ∀ (n_1 : ℕ) (h₁ : n_1 < (take m (range n)).length) (h₂ : n_1 < (range (min m n)).length),\n (take m (range n)).get ⟨n_1, h₁⟩ =... | [
" (range' n m).nthLe i H = n + i",
" Pairwise (fun x x_1 => x < x_1) (range n)",
" take m (range n) = range (min m n)",
" (take m (range n)).length = (range (min m n)).length",
" ∀ (n_1 : ℕ) (h₁ : n_1 < (take m (range n)).length) (h₂ : n_1 < (range (min m n)).length),\n (take m (range n)).get ⟨n_1, h₁⟩ =... |
import Mathlib.LinearAlgebra.Dimension.Finrank
import Mathlib.LinearAlgebra.InvariantBasisNumber
#align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5"
noncomputable section
universe u v w w'
variable {R : Type u} {M : Type v} [Ring R] [AddCommGroup M] [Module R M]
variable {ι : Type w} {ι' : Type w'}
open Cardinal Basis Submodule Function Set
attribute [local instance] nontrivial_of_invariantBasisNumber
section InvariantBasisNumber
variable [InvariantBasisNumber R]
| Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean | 58 | 83 | theorem mk_eq_mk_of_basis (v : Basis ι R M) (v' : Basis ι' R M) :
Cardinal.lift.{w'} #ι = Cardinal.lift.{w} #ι' := by |
classical
haveI := nontrivial_of_invariantBasisNumber R
cases fintypeOrInfinite ι
· -- `v` is a finite basis, so by `basis_finite_of_finite_spans` so is `v'`.
-- haveI : Finite (range v) := Set.finite_range v
haveI := basis_finite_of_finite_spans _ (Set.finite_range v) v.span_eq v'
cases nonempty_fintype ι'
-- We clean up a little:
rw [Cardinal.mk_fintype, Cardinal.mk_fintype]
simp only [Cardinal.lift_natCast, Cardinal.natCast_inj]
-- Now we can use invariant basis number to show they have the same cardinality.
apply card_eq_of_linearEquiv R
exact
(Finsupp.linearEquivFunOnFinite R R ι).symm.trans v.repr.symm ≪≫ₗ v'.repr ≪≫ₗ
Finsupp.linearEquivFunOnFinite R R ι'
· -- `v` is an infinite basis,
-- so by `infinite_basis_le_maximal_linearIndependent`, `v'` is at least as big,
-- and then applying `infinite_basis_le_maximal_linearIndependent` again
-- we see they have the same cardinality.
have w₁ := infinite_basis_le_maximal_linearIndependent' v _ v'.linearIndependent v'.maximal
rcases Cardinal.lift_mk_le'.mp w₁ with ⟨f⟩
haveI : Infinite ι' := Infinite.of_injective f f.2
have w₂ := infinite_basis_le_maximal_linearIndependent' v' _ v.linearIndependent v.maximal
exact le_antisymm w₁ w₂
| [
" lift.{w', w} #ι = lift.{w, w'} #ι'",
" lift.{w', w} ↑(Fintype.card ι) = lift.{w, w'} ↑(Fintype.card ι')",
" Fintype.card ι = Fintype.card ι'",
" (ι → R) ≃ₗ[R] ι' → R"
] | [
" lift.{w', w} #ι = lift.{w, w'} #ι'"
] |
import Mathlib.Algebra.Group.Subgroup.Basic
import Mathlib.Deprecated.Submonoid
#align_import deprecated.subgroup from "leanprover-community/mathlib"@"f93c11933efbc3c2f0299e47b8ff83e9b539cbf6"
open Set Function
variable {G : Type*} {H : Type*} {A : Type*} {a a₁ a₂ b c : G}
section Group
variable [Group G] [AddGroup A]
structure IsAddSubgroup (s : Set A) extends IsAddSubmonoid s : Prop where
neg_mem {a} : a ∈ s → -a ∈ s
#align is_add_subgroup IsAddSubgroup
@[to_additive]
structure IsSubgroup (s : Set G) extends IsSubmonoid s : Prop where
inv_mem {a} : a ∈ s → a⁻¹ ∈ s
#align is_subgroup IsSubgroup
@[to_additive]
| Mathlib/Deprecated/Subgroup.lean | 57 | 58 | theorem IsSubgroup.div_mem {s : Set G} (hs : IsSubgroup s) {x y : G} (hx : x ∈ s) (hy : y ∈ s) :
x / y ∈ s := by | simpa only [div_eq_mul_inv] using hs.mul_mem hx (hs.inv_mem hy)
| [
" x / y ∈ s"
] | [
" x / y ∈ s"
] |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {α : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice α]
section Group
variable [Group α] [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
(s t : Set α)
@[to_additive]
theorem sSup_inv (s : Set α) : sSup s⁻¹ = (sInf s)⁻¹ := by
rw [← image_inv, sSup_image]
exact ((OrderIso.inv α).map_sInf _).symm
#align Sup_inv sSup_inv
#align Sup_neg sSup_neg
@[to_additive]
theorem sInf_inv (s : Set α) : sInf s⁻¹ = (sSup s)⁻¹ := by
rw [← image_inv, sInf_image]
exact ((OrderIso.inv α).map_sSup _).symm
#align Inf_inv sInf_inv
#align Inf_neg sInf_neg
@[to_additive]
theorem sSup_mul : sSup (s * t) = sSup s * sSup t :=
(sSup_image2_eq_sSup_sSup fun _ => (OrderIso.mulRight _).to_galoisConnection) fun _ =>
(OrderIso.mulLeft _).to_galoisConnection
#align Sup_mul sSup_mul
#align Sup_add sSup_add
@[to_additive]
theorem sInf_mul : sInf (s * t) = sInf s * sInf t :=
(sInf_image2_eq_sInf_sInf fun _ => (OrderIso.mulRight _).symm.to_galoisConnection) fun _ =>
(OrderIso.mulLeft _).symm.to_galoisConnection
#align Inf_mul sInf_mul
#align Inf_add sInf_add
@[to_additive]
| Mathlib/Algebra/Order/Pointwise.lean | 89 | 89 | theorem sSup_div : sSup (s / t) = sSup s / sInf t := by | simp_rw [div_eq_mul_inv, sSup_mul, sSup_inv]
| [
" sSup s⁻¹ = (sInf s)⁻¹",
" ⨆ a ∈ s, a⁻¹ = (sInf s)⁻¹",
" sInf s⁻¹ = (sSup s)⁻¹",
" ⨅ a ∈ s, a⁻¹ = (sSup s)⁻¹",
" sSup (s / t) = sSup s / sInf t"
] | [
" sSup s⁻¹ = (sInf s)⁻¹",
" ⨆ a ∈ s, a⁻¹ = (sInf s)⁻¹",
" sInf s⁻¹ = (sSup s)⁻¹",
" ⨅ a ∈ s, a⁻¹ = (sSup s)⁻¹",
" sSup (s / t) = sSup s / sInf t"
] |
import Mathlib.Data.List.Infix
#align_import data.list.rdrop from "leanprover-community/mathlib"@"26f081a2fb920140ed5bc5cc5344e84bcc7cb2b2"
-- Make sure we don't import algebra
assert_not_exists Monoid
variable {α : Type*} (p : α → Bool) (l : List α) (n : ℕ)
namespace List
def rdrop : List α :=
l.take (l.length - n)
#align list.rdrop List.rdrop
@[simp]
| Mathlib/Data/List/DropRight.lean | 47 | 47 | theorem rdrop_nil : rdrop ([] : List α) n = [] := by | simp [rdrop]
| [
" [].rdrop n = []"
] | [
" [].rdrop n = []"
] |
import Mathlib.Topology.Metrizable.Basic
import Mathlib.Topology.Algebra.GroupWithZero
import Mathlib.Topology.Instances.Real
def preCantorSet : ℕ → Set ℝ
| 0 => Set.Icc 0 1
| n + 1 => (· / 3) '' preCantorSet n ∪ (fun x ↦ (2 + x) / 3) '' preCantorSet n
@[simp] lemma preCantorSet_zero : preCantorSet 0 = Set.Icc 0 1 := rfl
@[simp] lemma preCantorSet_succ (n : ℕ) :
preCantorSet (n + 1) = (· / 3) '' preCantorSet n ∪ (fun x ↦ (2 + x) / 3) '' preCantorSet n :=
rfl
def cantorSet : Set ℝ := ⋂ n, preCantorSet n
lemma quarters_mem_preCantorSet (n : ℕ) : 1/4 ∈ preCantorSet n ∧ 3/4 ∈ preCantorSet n := by
induction n with
| zero =>
simp only [preCantorSet_zero, inv_nonneg]
refine ⟨⟨ ?_, ?_⟩, ?_, ?_⟩ <;> norm_num
| succ n ih =>
apply And.intro
· -- goal: 1 / 4 ∈ preCantorSet (n + 1)
-- follows by the inductive hyphothesis, since 3 / 4 ∈ preCantorSet n
exact Or.inl ⟨3 / 4, ih.2, by norm_num⟩
· -- goal: 3 / 4 ∈ preCantorSet (n + 1)
-- follows by the inductive hyphothesis, since 1 / 4 ∈ preCantorSet n
exact Or.inr ⟨1 / 4, ih.1, by norm_num⟩
lemma quarter_mem_preCantorSet (n : ℕ) : 1/4 ∈ preCantorSet n := (quarters_mem_preCantorSet n).1
theorem quarter_mem_cantorSet : 1/4 ∈ cantorSet :=
Set.mem_iInter.mpr quarter_mem_preCantorSet
lemma zero_mem_preCantorSet (n : ℕ) : 0 ∈ preCantorSet n := by
induction n with
| zero =>
simp [preCantorSet]
| succ n ih =>
exact Or.inl ⟨0, ih, by simp only [zero_div]⟩
| Mathlib/Topology/Instances/CantorSet.lean | 75 | 75 | theorem zero_mem_cantorSet : 0 ∈ cantorSet := by | simp [cantorSet, zero_mem_preCantorSet]
| [
" 1 / 4 ∈ preCantorSet n ∧ 3 / 4 ∈ preCantorSet n",
" 1 / 4 ∈ preCantorSet 0 ∧ 3 / 4 ∈ preCantorSet 0",
" 1 / 4 ∈ Set.Icc 0 1 ∧ 3 / 4 ∈ Set.Icc 0 1",
" 0 ≤ 1 / 4",
" 1 / 4 ≤ 1",
" 0 ≤ 3 / 4",
" 3 / 4 ≤ 1",
" 1 / 4 ∈ preCantorSet (n + 1) ∧ 3 / 4 ∈ preCantorSet (n + 1)",
" 1 / 4 ∈ preCantorSet (n + 1)... | [
" 1 / 4 ∈ preCantorSet n ∧ 3 / 4 ∈ preCantorSet n",
" 1 / 4 ∈ preCantorSet 0 ∧ 3 / 4 ∈ preCantorSet 0",
" 1 / 4 ∈ Set.Icc 0 1 ∧ 3 / 4 ∈ Set.Icc 0 1",
" 0 ≤ 1 / 4",
" 1 / 4 ≤ 1",
" 0 ≤ 3 / 4",
" 3 / 4 ≤ 1",
" 1 / 4 ∈ preCantorSet (n + 1) ∧ 3 / 4 ∈ preCantorSet (n + 1)",
" 1 / 4 ∈ preCantorSet (n + 1)... |
import Mathlib.LinearAlgebra.Matrix.Symmetric
import Mathlib.LinearAlgebra.Matrix.Orthogonal
import Mathlib.Data.Matrix.Kronecker
#align_import linear_algebra.matrix.is_diag from "leanprover-community/mathlib"@"55e2dfde0cff928ce5c70926a3f2c7dee3e2dd99"
namespace Matrix
variable {α β R n m : Type*}
open Function
open Matrix Kronecker
def IsDiag [Zero α] (A : Matrix n n α) : Prop :=
Pairwise fun i j => A i j = 0
#align matrix.is_diag Matrix.IsDiag
@[simp]
theorem isDiag_diagonal [Zero α] [DecidableEq n] (d : n → α) : (diagonal d).IsDiag := fun _ _ =>
Matrix.diagonal_apply_ne _
#align matrix.is_diag_diagonal Matrix.isDiag_diagonal
theorem IsDiag.diagonal_diag [Zero α] [DecidableEq n] {A : Matrix n n α} (h : A.IsDiag) :
diagonal (diag A) = A :=
ext fun i j => by
obtain rfl | hij := Decidable.eq_or_ne i j
· rw [diagonal_apply_eq, diag]
· rw [diagonal_apply_ne _ hij, h hij]
#align matrix.is_diag.diagonal_diag Matrix.IsDiag.diagonal_diag
theorem isDiag_iff_diagonal_diag [Zero α] [DecidableEq n] (A : Matrix n n α) :
A.IsDiag ↔ diagonal (diag A) = A :=
⟨IsDiag.diagonal_diag, fun hd => hd ▸ isDiag_diagonal (diag A)⟩
#align matrix.is_diag_iff_diagonal_diag Matrix.isDiag_iff_diagonal_diag
theorem isDiag_of_subsingleton [Zero α] [Subsingleton n] (A : Matrix n n α) : A.IsDiag :=
fun i j h => (h <| Subsingleton.elim i j).elim
#align matrix.is_diag_of_subsingleton Matrix.isDiag_of_subsingleton
@[simp]
theorem isDiag_zero [Zero α] : (0 : Matrix n n α).IsDiag := fun _ _ _ => rfl
#align matrix.is_diag_zero Matrix.isDiag_zero
@[simp]
theorem isDiag_one [DecidableEq n] [Zero α] [One α] : (1 : Matrix n n α).IsDiag := fun _ _ =>
one_apply_ne
#align matrix.is_diag_one Matrix.isDiag_one
theorem IsDiag.map [Zero α] [Zero β] {A : Matrix n n α} (ha : A.IsDiag) {f : α → β} (hf : f 0 = 0) :
(A.map f).IsDiag := by
intro i j h
simp [ha h, hf]
#align matrix.is_diag.map Matrix.IsDiag.map
theorem IsDiag.neg [AddGroup α] {A : Matrix n n α} (ha : A.IsDiag) : (-A).IsDiag := by
intro i j h
simp [ha h]
#align matrix.is_diag.neg Matrix.IsDiag.neg
@[simp]
theorem isDiag_neg_iff [AddGroup α] {A : Matrix n n α} : (-A).IsDiag ↔ A.IsDiag :=
⟨fun ha _ _ h => neg_eq_zero.1 (ha h), IsDiag.neg⟩
#align matrix.is_diag_neg_iff Matrix.isDiag_neg_iff
theorem IsDiag.add [AddZeroClass α] {A B : Matrix n n α} (ha : A.IsDiag) (hb : B.IsDiag) :
(A + B).IsDiag := by
intro i j h
simp [ha h, hb h]
#align matrix.is_diag.add Matrix.IsDiag.add
theorem IsDiag.sub [AddGroup α] {A B : Matrix n n α} (ha : A.IsDiag) (hb : B.IsDiag) :
(A - B).IsDiag := by
intro i j h
simp [ha h, hb h]
#align matrix.is_diag.sub Matrix.IsDiag.sub
theorem IsDiag.smul [Monoid R] [AddMonoid α] [DistribMulAction R α] (k : R) {A : Matrix n n α}
(ha : A.IsDiag) : (k • A).IsDiag := by
intro i j h
simp [ha h]
#align matrix.is_diag.smul Matrix.IsDiag.smul
@[simp]
theorem isDiag_smul_one (n) [Semiring α] [DecidableEq n] (k : α) :
(k • (1 : Matrix n n α)).IsDiag :=
isDiag_one.smul k
#align matrix.is_diag_smul_one Matrix.isDiag_smul_one
theorem IsDiag.transpose [Zero α] {A : Matrix n n α} (ha : A.IsDiag) : Aᵀ.IsDiag := fun _ _ h =>
ha h.symm
#align matrix.is_diag.transpose Matrix.IsDiag.transpose
@[simp]
theorem isDiag_transpose_iff [Zero α] {A : Matrix n n α} : Aᵀ.IsDiag ↔ A.IsDiag :=
⟨IsDiag.transpose, IsDiag.transpose⟩
#align matrix.is_diag_transpose_iff Matrix.isDiag_transpose_iff
theorem IsDiag.conjTranspose [Semiring α] [StarRing α] {A : Matrix n n α} (ha : A.IsDiag) :
Aᴴ.IsDiag :=
ha.transpose.map (star_zero _)
#align matrix.is_diag.conj_transpose Matrix.IsDiag.conjTranspose
@[simp]
theorem isDiag_conjTranspose_iff [Semiring α] [StarRing α] {A : Matrix n n α} :
Aᴴ.IsDiag ↔ A.IsDiag :=
⟨fun ha => by
convert ha.conjTranspose
simp, IsDiag.conjTranspose⟩
#align matrix.is_diag_conj_transpose_iff Matrix.isDiag_conjTranspose_iff
theorem IsDiag.submatrix [Zero α] {A : Matrix n n α} (ha : A.IsDiag) {f : m → n}
(hf : Injective f) : (A.submatrix f f).IsDiag := fun _ _ h => ha (hf.ne h)
#align matrix.is_diag.submatrix Matrix.IsDiag.submatrix
theorem IsDiag.kronecker [MulZeroClass α] {A : Matrix m m α} {B : Matrix n n α} (hA : A.IsDiag)
(hB : B.IsDiag) : (A ⊗ₖ B).IsDiag := by
rintro ⟨a, b⟩ ⟨c, d⟩ h
simp only [Prod.mk.inj_iff, Ne, not_and_or] at h
cases' h with hac hbd
· simp [hA hac]
· simp [hB hbd]
#align matrix.is_diag.kronecker Matrix.IsDiag.kronecker
| Mathlib/LinearAlgebra/Matrix/IsDiag.lean | 152 | 155 | theorem IsDiag.isSymm [Zero α] {A : Matrix n n α} (h : A.IsDiag) : A.IsSymm := by |
ext i j
by_cases g : i = j; · rw [g, transpose_apply]
simp [h g, h (Ne.symm g)]
| [
" diagonal A.diag i j = A i j",
" diagonal A.diag i i = A i i",
" (A.map f).IsDiag",
" A.map f i j = 0",
" (-A).IsDiag",
" (-A) i j = 0",
" (A + B).IsDiag",
" (A + B) i j = 0",
" (A - B).IsDiag",
" (A - B) i j = 0",
" (k • A).IsDiag",
" (k • A) i j = 0",
" A.IsDiag",
" A = Aᴴᴴ",
" (krone... | [
" diagonal A.diag i j = A i j",
" diagonal A.diag i i = A i i",
" (A.map f).IsDiag",
" A.map f i j = 0",
" (-A).IsDiag",
" (-A) i j = 0",
" (A + B).IsDiag",
" (A + B) i j = 0",
" (A - B).IsDiag",
" (A - B) i j = 0",
" (k • A).IsDiag",
" (k • A) i j = 0",
" A.IsDiag",
" A = Aᴴᴴ",
" (krone... |
import Mathlib.Data.Finsupp.Defs
#align_import data.finsupp.indicator from "leanprover-community/mathlib"@"842328d9df7e96fd90fc424e115679c15fb23a71"
noncomputable section
open Finset Function
variable {ι α : Type*}
namespace Finsupp
variable [Zero α] {s : Finset ι} (f : ∀ i ∈ s, α) {i : ι}
def indicator (s : Finset ι) (f : ∀ i ∈ s, α) : ι →₀ α where
toFun i :=
haveI := Classical.decEq ι
if H : i ∈ s then f i H else 0
support :=
haveI := Classical.decEq α
(s.attach.filter fun i : s => f i.1 i.2 ≠ 0).map (Embedding.subtype _)
mem_support_toFun i := by
classical simp
#align finsupp.indicator Finsupp.indicator
theorem indicator_of_mem (hi : i ∈ s) (f : ∀ i ∈ s, α) : indicator s f i = f i hi :=
@dif_pos _ (id _) hi _ _ _
#align finsupp.indicator_of_mem Finsupp.indicator_of_mem
theorem indicator_of_not_mem (hi : i ∉ s) (f : ∀ i ∈ s, α) : indicator s f i = 0 :=
@dif_neg _ (id _) hi _ _ _
#align finsupp.indicator_of_not_mem Finsupp.indicator_of_not_mem
variable (s i)
@[simp]
theorem indicator_apply [DecidableEq ι] : indicator s f i = if hi : i ∈ s then f i hi else 0 := by
simp only [indicator, ne_eq, coe_mk]
congr
#align finsupp.indicator_apply Finsupp.indicator_apply
theorem indicator_injective : Injective fun f : ∀ i ∈ s, α => indicator s f := by
intro a b h
ext i hi
rw [← indicator_of_mem hi a, ← indicator_of_mem hi b]
exact DFunLike.congr_fun h i
#align finsupp.indicator_injective Finsupp.indicator_injective
| Mathlib/Data/Finsupp/Indicator.lean | 66 | 70 | theorem support_indicator_subset : ((indicator s f).support : Set ι) ⊆ s := by |
intro i hi
rw [mem_coe, mem_support_iff] at hi
by_contra h
exact hi (indicator_of_not_mem h _)
| [
" i ∈ map (Embedding.subtype fun x => x ∈ s) (filter (fun i => f ↑i ⋯ ≠ 0) s.attach) ↔\n (fun i => if H : i ∈ s then f i H else 0) i ≠ 0",
" (indicator s f) i = if hi : i ∈ s then f i hi else 0",
" (if H : i ∈ s then f i H else 0) = if hi : i ∈ s then f i hi else 0",
" Injective fun f => indicator s f",
... | [
" i ∈ map (Embedding.subtype fun x => x ∈ s) (filter (fun i => f ↑i ⋯ ≠ 0) s.attach) ↔\n (fun i => if H : i ∈ s then f i H else 0) i ≠ 0",
" (indicator s f) i = if hi : i ∈ s then f i hi else 0",
" (if H : i ∈ s then f i H else 0) = if hi : i ∈ s then f i hi else 0",
" Injective fun f => indicator s f",
... |
import Mathlib.Analysis.SpecificLimits.Basic
import Mathlib.Data.Rat.Denumerable
import Mathlib.Data.Set.Pointwise.Interval
import Mathlib.SetTheory.Cardinal.Continuum
#align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d"
open Nat Set
open Cardinal
noncomputable section
namespace Cardinal
variable {c : ℝ} {f g : ℕ → Bool} {n : ℕ}
def cantorFunctionAux (c : ℝ) (f : ℕ → Bool) (n : ℕ) : ℝ :=
cond (f n) (c ^ n) 0
#align cardinal.cantor_function_aux Cardinal.cantorFunctionAux
@[simp]
theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by
simp [cantorFunctionAux, h]
#align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true
@[simp]
theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by
simp [cantorFunctionAux, h]
#align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false
theorem cantorFunctionAux_nonneg (h : 0 ≤ c) : 0 ≤ cantorFunctionAux c f n := by
cases h' : f n <;> simp [h']
apply pow_nonneg h
#align cardinal.cantor_function_aux_nonneg Cardinal.cantorFunctionAux_nonneg
theorem cantorFunctionAux_eq (h : f n = g n) :
cantorFunctionAux c f n = cantorFunctionAux c g n := by simp [cantorFunctionAux, h]
#align cardinal.cantor_function_aux_eq Cardinal.cantorFunctionAux_eq
theorem cantorFunctionAux_zero (f : ℕ → Bool) : cantorFunctionAux c f 0 = cond (f 0) 1 0 := by
cases h : f 0 <;> simp [h]
#align cardinal.cantor_function_aux_zero Cardinal.cantorFunctionAux_zero
| Mathlib/Data/Real/Cardinality.lean | 86 | 90 | theorem cantorFunctionAux_succ (f : ℕ → Bool) :
(fun n => cantorFunctionAux c f (n + 1)) = fun n =>
c * cantorFunctionAux c (fun n => f (n + 1)) n := by |
ext n
cases h : f (n + 1) <;> simp [h, _root_.pow_succ']
| [
" cantorFunctionAux c f n = c ^ n",
" cantorFunctionAux c f n = 0",
" 0 ≤ cantorFunctionAux c f n",
" 0 ≤ c ^ n",
" cantorFunctionAux c f n = cantorFunctionAux c g n",
" cantorFunctionAux c f 0 = bif f 0 then 1 else 0",
" cantorFunctionAux c f 0 = bif false then 1 else 0",
" cantorFunctionAux c f 0 = ... | [
" cantorFunctionAux c f n = c ^ n",
" cantorFunctionAux c f n = 0",
" 0 ≤ cantorFunctionAux c f n",
" 0 ≤ c ^ n",
" cantorFunctionAux c f n = cantorFunctionAux c g n",
" cantorFunctionAux c f 0 = bif f 0 then 1 else 0",
" cantorFunctionAux c f 0 = bif false then 1 else 0",
" cantorFunctionAux c f 0 = ... |
import Mathlib.Data.List.Basic
import Mathlib.Order.MinMax
import Mathlib.Order.WithBot
#align_import data.list.min_max from "leanprover-community/mathlib"@"6d0adfa76594f304b4650d098273d4366edeb61b"
namespace List
variable {α β : Type*}
section ArgAux
variable (r : α → α → Prop) [DecidableRel r] {l : List α} {o : Option α} {a m : α}
def argAux (a : Option α) (b : α) : Option α :=
Option.casesOn a (some b) fun c => if r b c then some b else some c
#align list.arg_aux List.argAux
@[simp]
theorem foldl_argAux_eq_none : l.foldl (argAux r) o = none ↔ l = [] ∧ o = none :=
List.reverseRecOn l (by simp) fun tl hd => by
simp only [foldl_append, foldl_cons, argAux, foldl_nil, append_eq_nil, and_false, false_and,
iff_false]; cases foldl (argAux r) o tl <;> simp; try split_ifs <;> simp
#align list.foldl_arg_aux_eq_none List.foldl_argAux_eq_none
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
List.reverseRecOn l (by simp [eq_comm])
(by
intro tl hd ih a m
simp only [foldl_append, foldl_cons, foldl_nil, argAux]
cases hf : foldl (argAux r) (some a) tl
· simp (config := { contextual := true })
· dsimp only
split_ifs
· simp (config := { contextual := true })
· -- `finish [ih _ _ hf]` closes this goal
simp only [List.mem_cons] at ih
rcases ih _ _ hf with rfl | H
· simp (config := { contextual := true }) only [Option.mem_def, Option.some.injEq,
find?, eq_comm, mem_cons, mem_append, mem_singleton, true_or, implies_true]
· simp (config := { contextual := true }) [@eq_comm _ _ m, H])
@[simp]
theorem argAux_self (hr₀ : Irreflexive r) (a : α) : argAux r (some a) a = a :=
if_neg <| hr₀ _
#align list.arg_aux_self List.argAux_self
| Mathlib/Data/List/MinMax.lean | 69 | 86 | theorem not_of_mem_foldl_argAux (hr₀ : Irreflexive r) (hr₁ : Transitive r) :
∀ {a m : α} {o : Option α}, a ∈ l → m ∈ foldl (argAux r) o l → ¬r a m := by |
induction' l using List.reverseRecOn with tl a ih
· simp
intro b m o hb ho
rw [foldl_append, foldl_cons, foldl_nil, argAux] at ho
cases' hf : foldl (argAux r) o tl with c
· rw [hf] at ho
rw [foldl_argAux_eq_none] at hf
simp_all [hf.1, hf.2, hr₀ _]
rw [hf, Option.mem_def] at ho
dsimp only at ho
split_ifs at ho with hac <;> cases' mem_append.1 hb with h h <;>
injection ho with ho <;> subst ho
· exact fun hba => ih h hf (hr₁ hba hac)
· simp_all [hr₀ _]
· exact ih h hf
· simp_all
| [
" foldl (argAux r) o [] = none ↔ [] = [] ∧ o = none",
" (foldl (argAux r) o tl = none ↔ tl = [] ∧ o = none) →\n (foldl (argAux r) o (tl ++ [hd]) = none ↔ tl ++ [hd] = [] ∧ o = none)",
" (foldl (argAux r) o tl = none ↔ tl = [] ∧ o = none) →\n ¬Option.rec (some hd) (fun val => if r hd val then some hd else ... | [
" foldl (argAux r) o [] = none ↔ [] = [] ∧ o = none",
" (foldl (argAux r) o tl = none ↔ tl = [] ∧ o = none) →\n (foldl (argAux r) o (tl ++ [hd]) = none ↔ tl ++ [hd] = [] ∧ o = none)",
" (foldl (argAux r) o tl = none ↔ tl = [] ∧ o = none) →\n ¬Option.rec (some hd) (fun val => if r hd val then some hd else ... |
import Mathlib.LinearAlgebra.TensorAlgebra.Basic
import Mathlib.LinearAlgebra.TensorPower
#align_import linear_algebra.tensor_algebra.to_tensor_power from "leanprover-community/mathlib"@"d97a0c9f7a7efe6d76d652c5a6b7c9c634b70e0a"
suppress_compilation
open scoped DirectSum TensorProduct
variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M]
namespace TensorPower
def toTensorAlgebra {n} : ⨂[R]^n M →ₗ[R] TensorAlgebra R M :=
PiTensorProduct.lift (TensorAlgebra.tprod R M n)
#align tensor_power.to_tensor_algebra TensorPower.toTensorAlgebra
@[simp]
theorem toTensorAlgebra_tprod {n} (x : Fin n → M) :
TensorPower.toTensorAlgebra (PiTensorProduct.tprod R x) = TensorAlgebra.tprod R M n x :=
PiTensorProduct.lift.tprod _
#align tensor_power.to_tensor_algebra_tprod TensorPower.toTensorAlgebra_tprod
@[simp]
theorem toTensorAlgebra_gOne :
TensorPower.toTensorAlgebra (@GradedMonoid.GOne.one _ (fun n => ⨂[R]^n M) _ _) = 1 :=
TensorPower.toTensorAlgebra_tprod _
#align tensor_power.to_tensor_algebra_ghas_one TensorPower.toTensorAlgebra_gOne
@[simp]
| Mathlib/LinearAlgebra/TensorAlgebra/ToTensorPower.lean | 44 | 64 | theorem toTensorAlgebra_gMul {i j} (a : (⨂[R]^i) M) (b : (⨂[R]^j) M) :
TensorPower.toTensorAlgebra (@GradedMonoid.GMul.mul _ (fun n => ⨂[R]^n M) _ _ _ _ a b) =
TensorPower.toTensorAlgebra a * TensorPower.toTensorAlgebra b := by |
-- change `a` and `b` to `tprod R a` and `tprod R b`
rw [TensorPower.gMul_eq_coe_linearMap, ← LinearMap.compr₂_apply, ← @LinearMap.mul_apply' R, ←
LinearMap.compl₂_apply, ← LinearMap.comp_apply]
refine LinearMap.congr_fun (LinearMap.congr_fun ?_ a) b
clear! a b
ext (a b)
-- Porting note: pulled the next two lines out of the long `simp only` below.
simp only [LinearMap.compMultilinearMap_apply]
rw [LinearMap.compr₂_apply, ← gMul_eq_coe_linearMap]
simp only [LinearMap.compr₂_apply, LinearMap.mul_apply', LinearMap.compl₂_apply,
LinearMap.comp_apply, LinearMap.compMultilinearMap_apply, PiTensorProduct.lift.tprod,
TensorPower.tprod_mul_tprod, TensorPower.toTensorAlgebra_tprod, TensorAlgebra.tprod_apply, ←
gMul_eq_coe_linearMap]
refine Eq.trans ?_ List.prod_append
congr
-- Porting note: `erw` for `Function.comp`
erw [← List.map_ofFn _ (TensorAlgebra.ι R), ← List.map_ofFn _ (TensorAlgebra.ι R), ←
List.map_ofFn _ (TensorAlgebra.ι R), ← List.map_append, List.ofFn_fin_append]
| [
" toTensorAlgebra (GradedMonoid.GMul.mul a b) = toTensorAlgebra a * toTensorAlgebra b",
" ((((TensorProduct.mk R (⨂[R]^i M) (⨂[R]^j M)).compr₂ ↑mulEquiv).compr₂ toTensorAlgebra) a) b =\n (((LinearMap.mul R (TensorAlgebra R M)).compl₂ toTensorAlgebra ∘ₗ toTensorAlgebra) a) b",
" ((TensorProduct.mk R (⨂[R]^i M... | [
" toTensorAlgebra (GradedMonoid.GMul.mul a b) = toTensorAlgebra a * toTensorAlgebra b"
] |
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 Pi
def pi (f : ∀ i, Filter (α i)) : Filter (∀ i, α i) :=
⨅ i, comap (eval i) (f i)
#align filter.pi Filter.pi
instance pi.isCountablyGenerated [Countable ι] [∀ i, IsCountablyGenerated (f i)] :
IsCountablyGenerated (pi f) :=
iInf.isCountablyGenerated _
#align filter.pi.is_countably_generated Filter.pi.isCountablyGenerated
theorem tendsto_eval_pi (f : ∀ i, Filter (α i)) (i : ι) : Tendsto (eval i) (pi f) (f i) :=
tendsto_iInf' i tendsto_comap
#align filter.tendsto_eval_pi Filter.tendsto_eval_pi
theorem tendsto_pi {β : Type*} {m : β → ∀ i, α i} {l : Filter β} :
Tendsto m l (pi f) ↔ ∀ i, Tendsto (fun x => m x i) l (f i) := by
simp only [pi, tendsto_iInf, tendsto_comap_iff]; rfl
#align filter.tendsto_pi Filter.tendsto_pi
alias ⟨Tendsto.apply, _⟩ := tendsto_pi
theorem le_pi {g : Filter (∀ i, α i)} : g ≤ pi f ↔ ∀ i, Tendsto (eval i) g (f i) :=
tendsto_pi
#align filter.le_pi Filter.le_pi
@[mono]
theorem pi_mono (h : ∀ i, f₁ i ≤ f₂ i) : pi f₁ ≤ pi f₂ :=
iInf_mono fun i => comap_mono <| h i
#align filter.pi_mono Filter.pi_mono
theorem mem_pi_of_mem (i : ι) {s : Set (α i)} (hs : s ∈ f i) : eval i ⁻¹' s ∈ pi f :=
mem_iInf_of_mem i <| preimage_mem_comap hs
#align filter.mem_pi_of_mem Filter.mem_pi_of_mem
| Mathlib/Order/Filter/Pi.lean | 74 | 77 | theorem pi_mem_pi {I : Set ι} (hI : I.Finite) (h : ∀ i ∈ I, s i ∈ f i) : I.pi s ∈ pi f := by |
rw [pi_def, biInter_eq_iInter]
refine mem_iInf_of_iInter hI (fun i => ?_) Subset.rfl
exact preimage_mem_comap (h i i.2)
| [
" Tendsto m l (pi f) ↔ ∀ (i : ι), Tendsto (fun x => m x i) l (f i)",
" (∀ (i : ι), Tendsto (eval i ∘ m) l (f i)) ↔ ∀ (i : ι), Tendsto (fun x => m x i) l (f i)",
" I.pi s ∈ pi f",
" ⋂ x, eval ↑x ⁻¹' s ↑x ∈ pi f",
" eval ↑i ⁻¹' s ↑i ∈ comap (eval ↑i) (f ↑i)"
] | [
" Tendsto m l (pi f) ↔ ∀ (i : ι), Tendsto (fun x => m x i) l (f i)",
" (∀ (i : ι), Tendsto (eval i ∘ m) l (f i)) ↔ ∀ (i : ι), Tendsto (fun x => m x i) l (f i)",
" I.pi s ∈ pi f"
] |
import Mathlib.GroupTheory.FreeGroup.Basic
import Mathlib.GroupTheory.QuotientGroup
#align_import group_theory.presented_group from "leanprover-community/mathlib"@"d90e4e186f1d18e375dcd4e5b5f6364b01cb3e46"
variable {α : Type*}
def PresentedGroup (rels : Set (FreeGroup α)) :=
FreeGroup α ⧸ Subgroup.normalClosure rels
#align presented_group PresentedGroup
namespace PresentedGroup
instance (rels : Set (FreeGroup α)) : Group (PresentedGroup rels) :=
QuotientGroup.Quotient.group _
def of {rels : Set (FreeGroup α)} (x : α) : PresentedGroup rels :=
QuotientGroup.mk (FreeGroup.of x)
#align presented_group.of PresentedGroup.of
@[simp]
theorem closure_range_of (rels : Set (FreeGroup α)) :
Subgroup.closure (Set.range (PresentedGroup.of : α → PresentedGroup rels)) = ⊤ := by
have : (PresentedGroup.of : α → PresentedGroup rels) = QuotientGroup.mk' _ ∘ FreeGroup.of := rfl
rw [this, Set.range_comp, ← MonoidHom.map_closure (QuotientGroup.mk' _),
FreeGroup.closure_range_of, ← MonoidHom.range_eq_map]
exact MonoidHom.range_top_of_surjective _ (QuotientGroup.mk'_surjective _)
section ToGroup
variable {G : Type*} [Group G] {f : α → G} {rels : Set (FreeGroup α)}
local notation "F" => FreeGroup.lift f
-- Porting note: `F` has been expanded, because `F r = 1` produces a sorry.
variable (h : ∀ r ∈ rels, FreeGroup.lift f r = 1)
theorem closure_rels_subset_ker : Subgroup.normalClosure rels ≤ MonoidHom.ker F :=
Subgroup.normalClosure_le_normal fun x w ↦ (MonoidHom.mem_ker _).2 (h x w)
#align presented_group.closure_rels_subset_ker PresentedGroup.closure_rels_subset_ker
theorem to_group_eq_one_of_mem_closure : ∀ x ∈ Subgroup.normalClosure rels, F x = 1 :=
fun _ w ↦ (MonoidHom.mem_ker _).1 <| closure_rels_subset_ker h w
#align presented_group.to_group_eq_one_of_mem_closure PresentedGroup.to_group_eq_one_of_mem_closure
def toGroup : PresentedGroup rels →* G :=
QuotientGroup.lift (Subgroup.normalClosure rels) F (to_group_eq_one_of_mem_closure h)
#align presented_group.to_group PresentedGroup.toGroup
@[simp]
theorem toGroup.of {x : α} : toGroup h (of x) = f x :=
FreeGroup.lift.of
#align presented_group.to_group.of PresentedGroup.toGroup.of
| Mathlib/GroupTheory/PresentedGroup.lean | 93 | 97 | theorem toGroup.unique (g : PresentedGroup rels →* G)
(hg : ∀ x : α, g (PresentedGroup.of x) = f x) : ∀ {x}, g x = toGroup h x := by |
intro x
refine QuotientGroup.induction_on x ?_
exact fun _ ↦ FreeGroup.lift.unique (g.comp (QuotientGroup.mk' _)) hg
| [
" Subgroup.closure (Set.range of) = ⊤",
" (QuotientGroup.mk' (Subgroup.normalClosure rels)).range = ⊤",
" ∀ {x : PresentedGroup rels}, g x = (toGroup h) x",
" g x = (toGroup h) x",
" ∀ (z : FreeGroup α), g ↑z = (toGroup h) ↑z"
] | [
" Subgroup.closure (Set.range of) = ⊤",
" (QuotientGroup.mk' (Subgroup.normalClosure rels)).range = ⊤",
" ∀ {x : PresentedGroup rels}, g x = (toGroup h) x"
] |
import Mathlib.Data.Nat.Choose.Central
import Mathlib.Data.Nat.Factorization.Basic
import Mathlib.Data.Nat.Multiplicity
#align_import data.nat.choose.factorization from "leanprover-community/mathlib"@"dc9db541168768af03fe228703e758e649afdbfc"
namespace Nat
variable {p n k : ℕ}
| Mathlib/Data/Nat/Choose/Factorization.lean | 36 | 45 | theorem factorization_choose_le_log : (choose n k).factorization p ≤ log p n := by |
by_cases h : (choose n k).factorization p = 0
· simp [h]
have hp : p.Prime := Not.imp_symm (choose n k).factorization_eq_zero_of_non_prime h
have hkn : k ≤ n := by
refine le_of_not_lt fun hnk => h ?_
simp [choose_eq_zero_of_lt hnk]
rw [factorization_def _ hp, @padicValNat_def _ ⟨hp⟩ _ (choose_pos hkn)]
simp only [hp.multiplicity_choose hkn (lt_add_one _), PartENat.get_natCast]
exact (Finset.card_filter_le _ _).trans (le_of_eq (Nat.card_Ico _ _))
| [
" (n.choose k).factorization p ≤ p.log n",
" k ≤ n",
" (n.choose k).factorization p = 0",
" (multiplicity p (n.choose k)).get ⋯ ≤ p.log n",
" (Finset.filter (fun i => p ^ i ≤ k % p ^ i + (n - k) % p ^ i) (Finset.Ico 1 (p.log n + 1))).card ≤ p.log n"
] | [
" (n.choose k).factorization p ≤ p.log n"
] |
import Mathlib.NumberTheory.NumberField.Embeddings
#align_import number_theory.number_field.units from "leanprover-community/mathlib"@"00f91228655eecdcd3ac97a7fd8dbcb139fe990a"
open scoped NumberField
noncomputable section
open NumberField Units
variable (K : Type*) [Field K]
namespace NumberField.Units
section coe
instance : CoeHTC (𝓞 K)ˣ K :=
⟨fun x => algebraMap _ K (Units.val x)⟩
theorem coe_injective : Function.Injective ((↑) : (𝓞 K)ˣ → K) :=
RingOfIntegers.coe_injective.comp Units.ext
variable {K}
theorem coe_coe (u : (𝓞 K)ˣ) : ((u : 𝓞 K) : K) = (u : K) := rfl
theorem coe_mul (x y : (𝓞 K)ˣ) : ((x * y : (𝓞 K)ˣ) : K) = (x : K) * (y : K) := rfl
| Mathlib/NumberTheory/NumberField/Units/Basic.lean | 78 | 79 | theorem coe_pow (x : (𝓞 K)ˣ) (n : ℕ) : ((x ^ n : (𝓞 K)ˣ) : K) = (x : K) ^ n := by |
rw [← map_pow, ← val_pow_eq_pow_val]
| [
" (algebraMap (𝓞 K) K) ↑(x ^ n) = (algebraMap (𝓞 K) K) ↑x ^ n"
] | [
" (algebraMap (𝓞 K) K) ↑(x ^ n) = (algebraMap (𝓞 K) K) ↑x ^ n"
] |
import Mathlib.NumberTheory.ZetaValues
import Mathlib.NumberTheory.LSeries.RiemannZeta
open Complex Real Set
open scoped Nat
namespace HurwitzZeta
variable {k : ℕ} {x : ℝ}
| Mathlib/NumberTheory/LSeries/HurwitzZetaValues.lean | 49 | 67 | theorem cosZeta_two_mul_nat (hk : k ≠ 0) (hx : x ∈ Icc 0 1) :
cosZeta x (2 * k) = (-1) ^ (k + 1) * (2 * π) ^ (2 * k) / 2 / (2 * k)! *
((Polynomial.bernoulli (2 * k)).map (algebraMap ℚ ℂ)).eval (x : ℂ) := by |
rw [← (hasSum_nat_cosZeta x (?_ : 1 < re (2 * k))).tsum_eq]
refine Eq.trans ?_ <| (congr_arg ofReal' (hasSum_one_div_nat_pow_mul_cos hk hx).tsum_eq).trans ?_
· rw [ofReal_tsum]
refine tsum_congr fun n ↦ ?_
rw [mul_comm (1 / _), mul_one_div, ofReal_div, mul_assoc (2 * π), mul_comm x n, ← mul_assoc,
← Nat.cast_ofNat (R := ℂ), ← Nat.cast_mul, cpow_natCast, ofReal_pow, ofReal_natCast]
· simp only [ofReal_mul, ofReal_div, ofReal_pow, ofReal_natCast, ofReal_ofNat,
ofReal_neg, ofReal_one]
congr 1
have : (Polynomial.bernoulli (2 * k)).map (algebraMap ℚ ℂ) = _ :=
(Polynomial.map_map (algebraMap ℚ ℝ) ofReal _).symm
rw [this, ← ofReal_eq_coe, ← ofReal_eq_coe]
apply Polynomial.map_aeval_eq_aeval_map
simp only [Algebra.id.map_eq_id, RingHomCompTriple.comp_eq]
· rw [← Nat.cast_ofNat, ← Nat.cast_one, ← Nat.cast_mul, natCast_re, Nat.cast_lt]
omega
| [
" cosZeta (↑x) (2 * ↑k) =\n (-1) ^ (k + 1) * (2 * ↑π) ^ (2 * k) / 2 / ↑(2 * k)! *\n Polynomial.eval (↑x) (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli (2 * k)))",
" 1 < (2 * ↑k).re",
" ∑' (b : ℕ), ↑(2 * π * x * ↑b).cos / ↑b ^ (2 * ↑k) = ↑(∑' (b : ℕ), 1 / ↑b ^ (2 * k) * (2 * π * ↑b * x).cos)",
... | [
" cosZeta (↑x) (2 * ↑k) =\n (-1) ^ (k + 1) * (2 * ↑π) ^ (2 * k) / 2 / ↑(2 * k)! *\n Polynomial.eval (↑x) (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli (2 * k)))"
] |
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]
| Mathlib/Data/List/FinRange.lean | 25 | 27 | 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 _
| [
" map Fin.val (finRange n) = range n",
" map (fun a => a) (range n) = range n"
] | [
" map Fin.val (finRange n) = range n"
] |
import Mathlib.LinearAlgebra.Quotient
import Mathlib.LinearAlgebra.Prod
#align_import linear_algebra.projection from "leanprover-community/mathlib"@"6d584f1709bedbed9175bd9350df46599bdd7213"
noncomputable section Ring
variable {R : Type*} [Ring R] {E : Type*} [AddCommGroup E] [Module R E]
variable {F : Type*} [AddCommGroup F] [Module R F] {G : Type*} [AddCommGroup G] [Module R G]
variable (p q : Submodule R E)
variable {S : Type*} [Semiring S] {M : Type*} [AddCommMonoid M] [Module S M] (m : Submodule S M)
namespace Submodule
open LinearMap
def quotientEquivOfIsCompl (h : IsCompl p q) : (E ⧸ p) ≃ₗ[R] q :=
LinearEquiv.symm <|
LinearEquiv.ofBijective (p.mkQ.comp q.subtype)
⟨by rw [← ker_eq_bot, ker_comp, ker_mkQ, disjoint_iff_comap_eq_bot.1 h.symm.disjoint], by
rw [← range_eq_top, range_comp, range_subtype, map_mkQ_eq_top, h.sup_eq_top]⟩
#align submodule.quotient_equiv_of_is_compl Submodule.quotientEquivOfIsCompl
@[simp]
theorem quotientEquivOfIsCompl_symm_apply (h : IsCompl p q) (x : q) :
-- Porting note: type ascriptions needed on the RHS
(quotientEquivOfIsCompl p q h).symm x = (Quotient.mk (x:E) : E ⧸ p) := rfl
#align submodule.quotient_equiv_of_is_compl_symm_apply Submodule.quotientEquivOfIsCompl_symm_apply
@[simp]
theorem quotientEquivOfIsCompl_apply_mk_coe (h : IsCompl p q) (x : q) :
quotientEquivOfIsCompl p q h (Quotient.mk x) = x :=
(quotientEquivOfIsCompl p q h).apply_symm_apply x
#align submodule.quotient_equiv_of_is_compl_apply_mk_coe Submodule.quotientEquivOfIsCompl_apply_mk_coe
@[simp]
theorem mk_quotientEquivOfIsCompl_apply (h : IsCompl p q) (x : E ⧸ p) :
(Quotient.mk (quotientEquivOfIsCompl p q h x) : E ⧸ p) = x :=
(quotientEquivOfIsCompl p q h).symm_apply_apply x
#align submodule.mk_quotient_equiv_of_is_compl_apply Submodule.mk_quotientEquivOfIsCompl_apply
def prodEquivOfIsCompl (h : IsCompl p q) : (p × q) ≃ₗ[R] E := by
apply LinearEquiv.ofBijective (p.subtype.coprod q.subtype)
constructor
· rw [← ker_eq_bot, ker_coprod_of_disjoint_range, ker_subtype, ker_subtype, prod_bot]
rw [range_subtype, range_subtype]
exact h.1
· rw [← range_eq_top, ← sup_eq_range, h.sup_eq_top]
#align submodule.prod_equiv_of_is_compl Submodule.prodEquivOfIsCompl
@[simp]
theorem coe_prodEquivOfIsCompl (h : IsCompl p q) :
(prodEquivOfIsCompl p q h : p × q →ₗ[R] E) = p.subtype.coprod q.subtype := rfl
#align submodule.coe_prod_equiv_of_is_compl Submodule.coe_prodEquivOfIsCompl
@[simp]
theorem coe_prodEquivOfIsCompl' (h : IsCompl p q) (x : p × q) :
prodEquivOfIsCompl p q h x = x.1 + x.2 := rfl
#align submodule.coe_prod_equiv_of_is_compl' Submodule.coe_prodEquivOfIsCompl'
@[simp]
theorem prodEquivOfIsCompl_symm_apply_left (h : IsCompl p q) (x : p) :
(prodEquivOfIsCompl p q h).symm x = (x, 0) :=
(prodEquivOfIsCompl p q h).symm_apply_eq.2 <| by simp
#align submodule.prod_equiv_of_is_compl_symm_apply_left Submodule.prodEquivOfIsCompl_symm_apply_left
@[simp]
theorem prodEquivOfIsCompl_symm_apply_right (h : IsCompl p q) (x : q) :
(prodEquivOfIsCompl p q h).symm x = (0, x) :=
(prodEquivOfIsCompl p q h).symm_apply_eq.2 <| by simp
#align submodule.prod_equiv_of_is_compl_symm_apply_right Submodule.prodEquivOfIsCompl_symm_apply_right
@[simp]
| Mathlib/LinearAlgebra/Projection.lean | 131 | 135 | theorem prodEquivOfIsCompl_symm_apply_fst_eq_zero (h : IsCompl p q) {x : E} :
((prodEquivOfIsCompl p q h).symm x).1 = 0 ↔ x ∈ q := by |
conv_rhs => rw [← (prodEquivOfIsCompl p q h).apply_symm_apply x]
rw [coe_prodEquivOfIsCompl', Submodule.add_mem_iff_left _ (Submodule.coe_mem _),
mem_right_iff_eq_zero_of_disjoint h.disjoint]
| [
" Function.Injective ⇑(p.mkQ ∘ₗ q.subtype)",
" Function.Surjective ⇑(p.mkQ ∘ₗ q.subtype)",
" (↥p × ↥q) ≃ₗ[R] E",
" Function.Bijective ⇑(p.subtype.coprod q.subtype)",
" Function.Injective ⇑(p.subtype.coprod q.subtype)",
" Disjoint (range p.subtype) (range q.subtype)",
" Disjoint p q",
" Function.Surjec... | [
" Function.Injective ⇑(p.mkQ ∘ₗ q.subtype)",
" Function.Surjective ⇑(p.mkQ ∘ₗ q.subtype)",
" (↥p × ↥q) ≃ₗ[R] E",
" Function.Bijective ⇑(p.subtype.coprod q.subtype)",
" Function.Injective ⇑(p.subtype.coprod q.subtype)",
" Disjoint (range p.subtype) (range q.subtype)",
" Disjoint p q",
" Function.Surjec... |
import Mathlib.Topology.MetricSpace.PseudoMetric
open Filter
open scoped Uniformity Topology
universe u v w
variable {α : Type u} {β : Type v} {X ι : Type*}
variable [PseudoMetricSpace α]
theorem Metric.complete_of_convergent_controlled_sequences (B : ℕ → Real) (hB : ∀ n, 0 < B n)
(H : ∀ u : ℕ → α, (∀ N n m : ℕ, N ≤ n → N ≤ m → dist (u n) (u m) < B N) →
∃ x, Tendsto u atTop (𝓝 x)) :
CompleteSpace α :=
UniformSpace.complete_of_convergent_controlled_sequences
(fun n => { p : α × α | dist p.1 p.2 < B n }) (fun n => dist_mem_uniformity <| hB n) H
#align metric.complete_of_convergent_controlled_sequences Metric.complete_of_convergent_controlled_sequences
theorem Metric.complete_of_cauchySeq_tendsto :
(∀ u : ℕ → α, CauchySeq u → ∃ a, Tendsto u atTop (𝓝 a)) → CompleteSpace α :=
EMetric.complete_of_cauchySeq_tendsto
#align metric.complete_of_cauchy_seq_tendsto Metric.complete_of_cauchySeq_tendsto
section CauchySeq
variable [Nonempty β] [SemilatticeSup β]
-- Porting note: @[nolint ge_or_gt] doesn't exist
theorem Metric.cauchySeq_iff {u : β → α} :
CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ m ≥ N, ∀ n ≥ N, dist (u m) (u n) < ε :=
uniformity_basis_dist.cauchySeq_iff
#align metric.cauchy_seq_iff Metric.cauchySeq_iff
theorem Metric.cauchySeq_iff' {u : β → α} :
CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, dist (u n) (u N) < ε :=
uniformity_basis_dist.cauchySeq_iff'
#align metric.cauchy_seq_iff' Metric.cauchySeq_iff'
-- see Note [nolint_ge]
-- Porting note: no attr @[nolint ge_or_gt]
| Mathlib/Topology/MetricSpace/Cauchy.lean | 72 | 91 | theorem Metric.uniformCauchySeqOn_iff {γ : Type*} {F : β → γ → α} {s : Set γ} :
UniformCauchySeqOn F atTop s ↔ ∀ ε > (0 : ℝ),
∃ N : β, ∀ m ≥ N, ∀ n ≥ N, ∀ x ∈ s, dist (F m x) (F n x) < ε := by |
constructor
· intro h ε hε
let u := { a : α × α | dist a.fst a.snd < ε }
have hu : u ∈ 𝓤 α := Metric.mem_uniformity_dist.mpr ⟨ε, hε, by simp [u]⟩
rw [← @Filter.eventually_atTop_prod_self' _ _ _ fun m =>
∀ x ∈ s, dist (F m.fst x) (F m.snd x) < ε]
specialize h u hu
rw [prod_atTop_atTop_eq] at h
exact h.mono fun n h x hx => h x hx
· intro h u hu
rcases Metric.mem_uniformity_dist.mp hu with ⟨ε, hε, hab⟩
rcases h ε hε with ⟨N, hN⟩
rw [prod_atTop_atTop_eq, eventually_atTop]
use (N, N)
intro b hb x hx
rcases hb with ⟨hbl, hbr⟩
exact hab (hN b.fst hbl.ge b.snd hbr.ge x hx)
| [
" UniformCauchySeqOn F atTop s ↔ ∀ ε > 0, ∃ N, ∀ m ≥ N, ∀ n ≥ N, ∀ x ∈ s, dist (F m x) (F n x) < ε",
" UniformCauchySeqOn F atTop s → ∀ ε > 0, ∃ N, ∀ m ≥ N, ∀ n ≥ N, ∀ x ∈ s, dist (F m x) (F n x) < ε",
" ∃ N, ∀ m ≥ N, ∀ n ≥ N, ∀ x ∈ s, dist (F m x) (F n x) < ε",
" ∀ {a b : α}, dist a b < ε → (a, b) ∈ u",
" ... | [
" UniformCauchySeqOn F atTop s ↔ ∀ ε > 0, ∃ N, ∀ m ≥ N, ∀ n ≥ N, ∀ x ∈ s, dist (F m x) (F n x) < ε"
] |
import Mathlib.Data.Multiset.Nodup
import Mathlib.Data.List.NatAntidiagonal
#align_import data.multiset.nat_antidiagonal from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
namespace Multiset
namespace Nat
def antidiagonal (n : ℕ) : Multiset (ℕ × ℕ) :=
List.Nat.antidiagonal n
#align multiset.nat.antidiagonal Multiset.Nat.antidiagonal
@[simp]
theorem mem_antidiagonal {n : ℕ} {x : ℕ × ℕ} : x ∈ antidiagonal n ↔ x.1 + x.2 = n := by
rw [antidiagonal, mem_coe, List.Nat.mem_antidiagonal]
#align multiset.nat.mem_antidiagonal Multiset.Nat.mem_antidiagonal
@[simp]
theorem card_antidiagonal (n : ℕ) : card (antidiagonal n) = n + 1 := by
rw [antidiagonal, coe_card, List.Nat.length_antidiagonal]
#align multiset.nat.card_antidiagonal Multiset.Nat.card_antidiagonal
@[simp]
theorem antidiagonal_zero : antidiagonal 0 = {(0, 0)} :=
rfl
#align multiset.nat.antidiagonal_zero Multiset.Nat.antidiagonal_zero
@[simp]
theorem nodup_antidiagonal (n : ℕ) : Nodup (antidiagonal n) :=
coe_nodup.2 <| List.Nat.nodup_antidiagonal n
#align multiset.nat.nodup_antidiagonal Multiset.Nat.nodup_antidiagonal
@[simp]
theorem antidiagonal_succ {n : ℕ} :
antidiagonal (n + 1) = (0, n + 1) ::ₘ (antidiagonal n).map (Prod.map Nat.succ id) := by
simp only [antidiagonal, List.Nat.antidiagonal_succ, map_coe, cons_coe]
#align multiset.nat.antidiagonal_succ Multiset.Nat.antidiagonal_succ
| Mathlib/Data/Multiset/NatAntidiagonal.lean | 64 | 67 | theorem antidiagonal_succ' {n : ℕ} :
antidiagonal (n + 1) = (n + 1, 0) ::ₘ (antidiagonal n).map (Prod.map id Nat.succ) := by |
rw [antidiagonal, List.Nat.antidiagonal_succ', ← coe_add, add_comm, antidiagonal, map_coe,
coe_add, List.singleton_append, cons_coe]
| [
" x ∈ antidiagonal n ↔ x.1 + x.2 = n",
" card (antidiagonal n) = n + 1",
" antidiagonal (n + 1) = (0, n + 1) ::ₘ map (Prod.map Nat.succ id) (antidiagonal n)",
" antidiagonal (n + 1) = (n + 1, 0) ::ₘ map (Prod.map id Nat.succ) (antidiagonal n)"
] | [
" x ∈ antidiagonal n ↔ x.1 + x.2 = n",
" card (antidiagonal n) = n + 1",
" antidiagonal (n + 1) = (0, n + 1) ::ₘ map (Prod.map Nat.succ id) (antidiagonal n)",
" antidiagonal (n + 1) = (n + 1, 0) ::ₘ map (Prod.map id Nat.succ) (antidiagonal n)"
] |
import Mathlib.Algebra.Lie.Abelian
import Mathlib.Algebra.Lie.IdealOperations
import Mathlib.Order.Hom.Basic
#align_import algebra.lie.solvable from "leanprover-community/mathlib"@"a50170a88a47570ed186b809ca754110590f9476"
universe u v w w₁ w₂
variable (R : Type u) (L : Type v) (M : Type w) {L' : Type w₁}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L'] [LieAlgebra R L']
variable (I J : LieIdeal R L) {f : L' →ₗ⁅R⁆ L}
namespace LieAlgebra
def derivedSeriesOfIdeal (k : ℕ) : LieIdeal R L → LieIdeal R L :=
(fun I => ⁅I, I⁆)^[k]
#align lie_algebra.derived_series_of_ideal LieAlgebra.derivedSeriesOfIdeal
@[simp]
theorem derivedSeriesOfIdeal_zero : derivedSeriesOfIdeal R L 0 I = I :=
rfl
#align lie_algebra.derived_series_of_ideal_zero LieAlgebra.derivedSeriesOfIdeal_zero
@[simp]
theorem derivedSeriesOfIdeal_succ (k : ℕ) :
derivedSeriesOfIdeal R L (k + 1) I =
⁅derivedSeriesOfIdeal R L k I, derivedSeriesOfIdeal R L k I⁆ :=
Function.iterate_succ_apply' (fun I => ⁅I, I⁆) k I
#align lie_algebra.derived_series_of_ideal_succ LieAlgebra.derivedSeriesOfIdeal_succ
abbrev derivedSeries (k : ℕ) : LieIdeal R L :=
derivedSeriesOfIdeal R L k ⊤
#align lie_algebra.derived_series LieAlgebra.derivedSeries
theorem derivedSeries_def (k : ℕ) : derivedSeries R L k = derivedSeriesOfIdeal R L k ⊤ :=
rfl
#align lie_algebra.derived_series_def LieAlgebra.derivedSeries_def
variable {R L}
local notation "D" => derivedSeriesOfIdeal R L
theorem derivedSeriesOfIdeal_add (k l : ℕ) : D (k + l) I = D k (D l I) := by
induction' k with k ih
· rw [Nat.zero_add, derivedSeriesOfIdeal_zero]
· rw [Nat.succ_add k l, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ, ih]
#align lie_algebra.derived_series_of_ideal_add LieAlgebra.derivedSeriesOfIdeal_add
@[mono]
| Mathlib/Algebra/Lie/Solvable.lean | 89 | 97 | theorem derivedSeriesOfIdeal_le {I J : LieIdeal R L} {k l : ℕ} (h₁ : I ≤ J) (h₂ : l ≤ k) :
D k I ≤ D l J := by |
revert l; induction' k with k ih <;> intro l h₂
· rw [le_zero_iff] at h₂; rw [h₂, derivedSeriesOfIdeal_zero]; exact h₁
· have h : l = k.succ ∨ l ≤ k := by rwa [le_iff_eq_or_lt, Nat.lt_succ_iff] at h₂
cases' h with h h
· rw [h, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ]
exact LieSubmodule.mono_lie _ _ _ _ (ih (le_refl k)) (ih (le_refl k))
· rw [derivedSeriesOfIdeal_succ]; exact le_trans (LieSubmodule.lie_le_left _ _) (ih h)
| [
" D (k + l) I = D k (D l I)",
" D (0 + l) I = D 0 (D l I)",
" D (k + 1 + l) I = D (k + 1) (D l I)",
" D k I ≤ D l J",
" ∀ {l : ℕ}, l ≤ k → D k I ≤ D l J",
" ∀ {l : ℕ}, l ≤ 0 → D 0 I ≤ D l J",
" ∀ {l : ℕ}, l ≤ k + 1 → D (k + 1) I ≤ D l J",
" D 0 I ≤ D l J",
" I ≤ D 0 J",
" D (k + 1) I ≤ D l J",
"... | [
" D (k + l) I = D k (D l I)",
" D (0 + l) I = D 0 (D l I)",
" D (k + 1 + l) I = D (k + 1) (D l I)",
" D k I ≤ D l J"
] |
import Mathlib.Order.Interval.Set.Image
import Mathlib.Order.CompleteLatticeIntervals
import Mathlib.Topology.Order.DenselyOrdered
import Mathlib.Topology.Order.Monotone
#align_import topology.algebra.order.intermediate_value from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514"
open Filter OrderDual TopologicalSpace Function Set
open Topology Filter
universe u v w
section
variable {X : Type u} {α : Type v} [TopologicalSpace X] [LinearOrder α] [TopologicalSpace α]
[OrderClosedTopology α]
| Mathlib/Topology/Order/IntermediateValue.lean | 70 | 75 | theorem intermediate_value_univ₂ [PreconnectedSpace X] {a b : X} {f g : X → α} (hf : Continuous f)
(hg : Continuous g) (ha : f a ≤ g a) (hb : g b ≤ f b) : ∃ x, f x = g x := by |
obtain ⟨x, _, hfg, hgf⟩ : (univ ∩ { x | f x ≤ g x ∧ g x ≤ f x }).Nonempty :=
isPreconnected_closed_iff.1 PreconnectedSpace.isPreconnected_univ _ _ (isClosed_le hf hg)
(isClosed_le hg hf) (fun _ _ => le_total _ _) ⟨a, trivial, ha⟩ ⟨b, trivial, hb⟩
exact ⟨x, le_antisymm hfg hgf⟩
| [
" ∃ x, f x = g x"
] | [
" ∃ x, f x = g x"
] |
import Mathlib.Algebra.CharP.ExpChar
import Mathlib.GroupTheory.OrderOfElement
#align_import algebra.char_p.two from "leanprover-community/mathlib"@"7f1ba1a333d66eed531ecb4092493cd1b6715450"
variable {R ι : Type*}
namespace CharTwo
section CommSemiring
variable [CommSemiring R] [CharP R 2]
theorem add_sq (x y : R) : (x + y) ^ 2 = x ^ 2 + y ^ 2 :=
add_pow_char _ _ _
#align char_two.add_sq CharTwo.add_sq
theorem add_mul_self (x y : R) : (x + y) * (x + y) = x * x + y * y := by
rw [← pow_two, ← pow_two, ← pow_two, add_sq]
#align char_two.add_mul_self CharTwo.add_mul_self
theorem list_sum_sq (l : List R) : l.sum ^ 2 = (l.map (· ^ 2)).sum :=
list_sum_pow_char _ _
#align char_two.list_sum_sq CharTwo.list_sum_sq
| Mathlib/Algebra/CharP/Two.lean | 99 | 100 | theorem list_sum_mul_self (l : List R) : l.sum * l.sum = (List.map (fun x => x * x) l).sum := by |
simp_rw [← pow_two, list_sum_sq]
| [
" (x + y) * (x + y) = x * x + y * y",
" l.sum * l.sum = (List.map (fun x => x * x) l).sum"
] | [
" (x + y) * (x + y) = x * x + y * y",
" l.sum * l.sum = (List.map (fun x => x * x) l).sum"
] |
import Mathlib.Analysis.SpecialFunctions.Complex.Log
#align_import analysis.special_functions.pow.complex from "leanprover-community/mathlib"@"4fa54b337f7d52805480306db1b1439c741848c8"
open scoped Classical
open Real Topology Filter ComplexConjugate Finset Set
namespace Complex
noncomputable def cpow (x y : ℂ) : ℂ :=
if x = 0 then if y = 0 then 1 else 0 else exp (log x * y)
#align complex.cpow Complex.cpow
noncomputable instance : Pow ℂ ℂ :=
⟨cpow⟩
@[simp]
theorem cpow_eq_pow (x y : ℂ) : cpow x y = x ^ y :=
rfl
#align complex.cpow_eq_pow Complex.cpow_eq_pow
theorem cpow_def (x y : ℂ) : x ^ y = if x = 0 then if y = 0 then 1 else 0 else exp (log x * y) :=
rfl
#align complex.cpow_def Complex.cpow_def
theorem cpow_def_of_ne_zero {x : ℂ} (hx : x ≠ 0) (y : ℂ) : x ^ y = exp (log x * y) :=
if_neg hx
#align complex.cpow_def_of_ne_zero Complex.cpow_def_of_ne_zero
@[simp]
| Mathlib/Analysis/SpecialFunctions/Pow/Complex.lean | 45 | 45 | theorem cpow_zero (x : ℂ) : x ^ (0 : ℂ) = 1 := by | simp [cpow_def]
| [
" x ^ 0 = 1"
] | [
" x ^ 0 = 1"
] |
import Mathlib.Algebra.Ring.Semiconj
import Mathlib.Algebra.Ring.Units
import Mathlib.Algebra.Group.Commute.Defs
import Mathlib.Data.Bracket
#align_import algebra.ring.commute from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
universe u v w x
variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x}
open Function
namespace Commute
@[simp]
theorem add_right [Distrib R] {a b c : R} : Commute a b → Commute a c → Commute a (b + c) :=
SemiconjBy.add_right
#align commute.add_right Commute.add_rightₓ
-- for some reason mathport expected `Semiring` instead of `Distrib`?
@[simp]
theorem add_left [Distrib R] {a b c : R} : Commute a c → Commute b c → Commute (a + b) c :=
SemiconjBy.add_left
#align commute.add_left Commute.add_leftₓ
-- for some reason mathport expected `Semiring` instead of `Distrib`?
| Mathlib/Algebra/Ring/Commute.lean | 72 | 74 | theorem mul_self_sub_mul_self_eq [NonUnitalNonAssocRing R] {a b : R} (h : Commute a b) :
a * a - b * b = (a + b) * (a - b) := by |
rw [add_mul, mul_sub, mul_sub, h.eq, sub_add_sub_cancel]
| [
" a * a - b * b = (a + b) * (a - b)"
] | [
" a * a - b * b = (a + b) * (a - b)"
] |
import Mathlib.Algebra.Group.Commute.Basic
import Mathlib.GroupTheory.GroupAction.Basic
import Mathlib.Dynamics.PeriodicPts
import Mathlib.Data.Set.Pointwise.SMul
namespace MulAction
open Pointwise
variable {α : Type*}
variable {G : Type*} [Group G] [MulAction G α]
variable {M : Type*} [Monoid M] [MulAction M α]
section Pointwise
@[to_additive "If a set `s : Set α` is in `fixedBy (Set α) g`, then all points of `s` will stay in
`s` after being moved by `g`."]
| Mathlib/GroupTheory/GroupAction/FixedPoints.lean | 124 | 126 | theorem set_mem_fixedBy_iff (s : Set α) (g : G) :
s ∈ fixedBy (Set α) g ↔ ∀ x, g • x ∈ s ↔ x ∈ s := by |
simp_rw [mem_fixedBy, ← eq_inv_smul_iff, Set.ext_iff, Set.mem_inv_smul_set_iff, Iff.comm]
| [
" s ∈ fixedBy (Set α) g ↔ ∀ (x : α), g • x ∈ s ↔ x ∈ s"
] | [
" s ∈ fixedBy (Set α) g ↔ ∀ (x : α), g • x ∈ s ↔ x ∈ s"
] |
import Mathlib.Data.Multiset.Bind
#align_import data.multiset.fold from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
namespace Multiset
variable {α β : Type*}
section Fold
variable (op : α → α → α) [hc : Std.Commutative op] [ha : Std.Associative op]
local notation a " * " b => op a b
def fold : α → Multiset α → α :=
foldr op (left_comm _ hc.comm ha.assoc)
#align multiset.fold Multiset.fold
theorem fold_eq_foldr (b : α) (s : Multiset α) :
fold op b s = foldr op (left_comm _ hc.comm ha.assoc) b s :=
rfl
#align multiset.fold_eq_foldr Multiset.fold_eq_foldr
@[simp]
theorem coe_fold_r (b : α) (l : List α) : fold op b l = l.foldr op b :=
rfl
#align multiset.coe_fold_r Multiset.coe_fold_r
theorem coe_fold_l (b : α) (l : List α) : fold op b l = l.foldl op b :=
(coe_foldr_swap op _ b l).trans <| by simp [hc.comm]
#align multiset.coe_fold_l Multiset.coe_fold_l
theorem fold_eq_foldl (b : α) (s : Multiset α) :
fold op b s = foldl op (right_comm _ hc.comm ha.assoc) b s :=
Quot.inductionOn s fun _ => coe_fold_l _ _ _
#align multiset.fold_eq_foldl Multiset.fold_eq_foldl
@[simp]
theorem fold_zero (b : α) : (0 : Multiset α).fold op b = b :=
rfl
#align multiset.fold_zero Multiset.fold_zero
@[simp]
theorem fold_cons_left : ∀ (b a : α) (s : Multiset α), (a ::ₘ s).fold op b = a * s.fold op b :=
foldr_cons _ _
#align multiset.fold_cons_left Multiset.fold_cons_left
theorem fold_cons_right (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op b * a := by
simp [hc.comm]
#align multiset.fold_cons_right Multiset.fold_cons_right
| Mathlib/Data/Multiset/Fold.lean | 67 | 68 | theorem fold_cons'_right (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op (b * a) := by |
rw [fold_eq_foldl, foldl_cons, ← fold_eq_foldl]
| [
" List.foldl (fun x y => op y x) b l = List.foldl op b l",
" fold op b (a ::ₘ s) = op (fold op b s) a",
" fold op b (a ::ₘ s) = fold op (op b a) s"
] | [
" List.foldl (fun x y => op y x) b l = List.foldl op b l",
" fold op b (a ::ₘ s) = op (fold op b s) a",
" fold op b (a ::ₘ s) = fold op (op b a) s"
] |
import Mathlib.MeasureTheory.Measure.Regular
import Mathlib.Topology.Semicontinuous
import Mathlib.MeasureTheory.Integral.Bochner
import Mathlib.Topology.Instances.EReal
#align_import measure_theory.integral.vitali_caratheodory from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2"
open scoped ENNReal NNReal
open MeasureTheory MeasureTheory.Measure
variable {α : Type*} [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α] (μ : Measure α)
[WeaklyRegular μ]
namespace MeasureTheory
local infixr:25 " →ₛ " => SimpleFunc
theorem SimpleFunc.exists_le_lowerSemicontinuous_lintegral_ge (f : α →ₛ ℝ≥0) {ε : ℝ≥0∞}
(ε0 : ε ≠ 0) :
∃ g : α → ℝ≥0, (∀ x, f x ≤ g x) ∧ LowerSemicontinuous g ∧
(∫⁻ x, g x ∂μ) ≤ (∫⁻ x, f x ∂μ) + ε := by
induction' f using MeasureTheory.SimpleFunc.induction with c s hs f₁ f₂ _ h₁ h₂ generalizing ε
· let f := SimpleFunc.piecewise s hs (SimpleFunc.const α c) (SimpleFunc.const α 0)
by_cases h : ∫⁻ x, f x ∂μ = ⊤
· refine
⟨fun _ => c, fun x => ?_, lowerSemicontinuous_const, by
simp only [_root_.top_add, le_top, h]⟩
simp only [SimpleFunc.coe_const, SimpleFunc.const_zero, SimpleFunc.coe_zero,
Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise]
exact Set.indicator_le_self _ _ _
by_cases hc : c = 0
· refine ⟨fun _ => 0, ?_, lowerSemicontinuous_const, ?_⟩
· classical
simp only [hc, Set.indicator_zero', Pi.zero_apply, SimpleFunc.const_zero, imp_true_iff,
eq_self_iff_true, SimpleFunc.coe_zero, Set.piecewise_eq_indicator,
SimpleFunc.coe_piecewise, le_zero_iff]
· simp only [lintegral_const, zero_mul, zero_le, ENNReal.coe_zero]
have ne_top : μ s ≠ ⊤ := by
classical
simpa [f, hs, hc, lt_top_iff_ne_top, true_and_iff, SimpleFunc.coe_const,
Function.const_apply, lintegral_const, ENNReal.coe_indicator, Set.univ_inter,
ENNReal.coe_ne_top, MeasurableSet.univ, ENNReal.mul_eq_top, SimpleFunc.const_zero,
or_false_iff, lintegral_indicator, ENNReal.coe_eq_zero, Ne, not_false_iff,
SimpleFunc.coe_zero, Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise, false_and_iff,
restrict_apply] using h
have : μ s < μ s + ε / c := by
have : (0 : ℝ≥0∞) < ε / c := ENNReal.div_pos_iff.2 ⟨ε0, ENNReal.coe_ne_top⟩
simpa using ENNReal.add_lt_add_left ne_top this
obtain ⟨u, su, u_open, μu⟩ : ∃ (u : _), u ⊇ s ∧ IsOpen u ∧ μ u < μ s + ε / c :=
s.exists_isOpen_lt_of_lt _ this
refine ⟨Set.indicator u fun _ => c,
fun x => ?_, u_open.lowerSemicontinuous_indicator (zero_le _), ?_⟩
· simp only [SimpleFunc.coe_const, SimpleFunc.const_zero, SimpleFunc.coe_zero,
Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise]
exact Set.indicator_le_indicator_of_subset su (fun x => zero_le _) _
· suffices (c : ℝ≥0∞) * μ u ≤ c * μ s + ε by
classical
simpa only [ENNReal.coe_indicator, u_open.measurableSet, lintegral_indicator,
lintegral_const, MeasurableSet.univ, Measure.restrict_apply, Set.univ_inter, const_zero,
coe_piecewise, coe_const, coe_zero, Set.piecewise_eq_indicator, Function.const_apply, hs]
calc
(c : ℝ≥0∞) * μ u ≤ c * (μ s + ε / c) := mul_le_mul_left' μu.le _
_ = c * μ s + ε := by
simp_rw [mul_add]
rw [ENNReal.mul_div_cancel' _ ENNReal.coe_ne_top]
simpa using hc
· rcases h₁ (ENNReal.half_pos ε0).ne' with ⟨g₁, f₁_le_g₁, g₁cont, g₁int⟩
rcases h₂ (ENNReal.half_pos ε0).ne' with ⟨g₂, f₂_le_g₂, g₂cont, g₂int⟩
refine
⟨fun x => g₁ x + g₂ x, fun x => add_le_add (f₁_le_g₁ x) (f₂_le_g₂ x), g₁cont.add g₂cont, ?_⟩
simp only [SimpleFunc.coe_add, ENNReal.coe_add, Pi.add_apply]
rw [lintegral_add_left f₁.measurable.coe_nnreal_ennreal,
lintegral_add_left g₁cont.measurable.coe_nnreal_ennreal]
convert add_le_add g₁int g₂int using 1
conv_lhs => rw [← ENNReal.add_halves ε]
abel
#align measure_theory.simple_func.exists_le_lower_semicontinuous_lintegral_ge MeasureTheory.SimpleFunc.exists_le_lowerSemicontinuous_lintegral_ge
-- Porting note: errors with
-- `ambiguous identifier 'eapproxDiff', possible interpretations:`
-- `[SimpleFunc.eapproxDiff, SimpleFunc.eapproxDiff]`
-- open SimpleFunc (eapproxDiff tsum_eapproxDiff)
| Mathlib/MeasureTheory/Integral/VitaliCaratheodory.lean | 164 | 195 | theorem exists_le_lowerSemicontinuous_lintegral_ge (f : α → ℝ≥0∞) (hf : Measurable f) {ε : ℝ≥0∞}
(εpos : ε ≠ 0) :
∃ g : α → ℝ≥0∞,
(∀ x, f x ≤ g x) ∧ LowerSemicontinuous g ∧ (∫⁻ x, g x ∂μ) ≤ (∫⁻ x, f x ∂μ) + ε := by |
rcases ENNReal.exists_pos_sum_of_countable' εpos ℕ with ⟨δ, δpos, hδ⟩
have :
∀ n,
∃ g : α → ℝ≥0,
(∀ x, SimpleFunc.eapproxDiff f n x ≤ g x) ∧
LowerSemicontinuous g ∧
(∫⁻ x, g x ∂μ) ≤ (∫⁻ x, SimpleFunc.eapproxDiff f n x ∂μ) + δ n :=
fun n =>
SimpleFunc.exists_le_lowerSemicontinuous_lintegral_ge μ (SimpleFunc.eapproxDiff f n)
(δpos n).ne'
choose g f_le_g gcont hg using this
refine ⟨fun x => ∑' n, g n x, fun x => ?_, ?_, ?_⟩
· rw [← SimpleFunc.tsum_eapproxDiff f hf]
exact ENNReal.tsum_le_tsum fun n => ENNReal.coe_le_coe.2 (f_le_g n x)
· refine lowerSemicontinuous_tsum fun n => ?_
exact
ENNReal.continuous_coe.comp_lowerSemicontinuous (gcont n) fun x y hxy =>
ENNReal.coe_le_coe.2 hxy
· calc
∫⁻ x, ∑' n : ℕ, g n x ∂μ = ∑' n, ∫⁻ x, g n x ∂μ := by
rw [lintegral_tsum fun n => (gcont n).measurable.coe_nnreal_ennreal.aemeasurable]
_ ≤ ∑' n, ((∫⁻ x, SimpleFunc.eapproxDiff f n x ∂μ) + δ n) := ENNReal.tsum_le_tsum hg
_ = ∑' n, ∫⁻ x, SimpleFunc.eapproxDiff f n x ∂μ + ∑' n, δ n := ENNReal.tsum_add
_ ≤ (∫⁻ x : α, f x ∂μ) + ε := by
refine add_le_add ?_ hδ.le
rw [← lintegral_tsum]
· simp_rw [SimpleFunc.tsum_eapproxDiff f hf, le_refl]
· intro n; exact (SimpleFunc.measurable _).coe_nnreal_ennreal.aemeasurable
| [
" ∃ g, (∀ (x : α), ↑f x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f x) ∂μ + ε",
" ∃ g,\n (∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ g x) ∧\n LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε",
" ... | [
" ∃ g, (∀ (x : α), ↑f x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f x) ∂μ + ε",
" ∃ g,\n (∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ g x) ∧\n LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε",
" ... |
import Mathlib.Analysis.InnerProductSpace.Basic
import Mathlib.Analysis.NormedSpace.Dual
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp
import Mathlib.MeasureTheory.Integral.SetIntegral
#align_import measure_theory.function.ae_eq_of_integral from "leanprover-community/mathlib"@"915591b2bb3ea303648db07284a161a7f2a9e3d4"
open MeasureTheory TopologicalSpace NormedSpace Filter
open scoped ENNReal NNReal MeasureTheory Topology
namespace MeasureTheory
variable {α E : Type*} {m m0 : MeasurableSpace α} {μ : Measure α} {s t : Set α}
[NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {p : ℝ≥0∞}
section AeEqOfForallSetIntegralEq
theorem ae_const_le_iff_forall_lt_measure_zero {β} [LinearOrder β] [TopologicalSpace β]
[OrderTopology β] [FirstCountableTopology β] (f : α → β) (c : β) :
(∀ᵐ x ∂μ, c ≤ f x) ↔ ∀ b < c, μ {x | f x ≤ b} = 0 := by
rw [ae_iff]
push_neg
constructor
· intro h b hb
exact measure_mono_null (fun y hy => (lt_of_le_of_lt hy hb : _)) h
intro hc
by_cases h : ∀ b, c ≤ b
· have : {a : α | f a < c} = ∅ := by
apply Set.eq_empty_iff_forall_not_mem.2 fun x hx => ?_
exact (lt_irrefl _ (lt_of_lt_of_le hx (h (f x)))).elim
simp [this]
by_cases H : ¬IsLUB (Set.Iio c) c
· have : c ∈ upperBounds (Set.Iio c) := fun y hy => le_of_lt hy
obtain ⟨b, b_up, bc⟩ : ∃ b : β, b ∈ upperBounds (Set.Iio c) ∧ b < c := by
simpa [IsLUB, IsLeast, this, lowerBounds] using H
exact measure_mono_null (fun x hx => b_up hx) (hc b bc)
push_neg at H h
obtain ⟨u, _, u_lt, u_lim, -⟩ :
∃ u : ℕ → β,
StrictMono u ∧ (∀ n : ℕ, u n < c) ∧ Tendsto u atTop (𝓝 c) ∧ ∀ n : ℕ, u n ∈ Set.Iio c :=
H.exists_seq_strictMono_tendsto_of_not_mem (lt_irrefl c) h
have h_Union : {x | f x < c} = ⋃ n : ℕ, {x | f x ≤ u n} := by
ext1 x
simp_rw [Set.mem_iUnion, Set.mem_setOf_eq]
constructor <;> intro h
· obtain ⟨n, hn⟩ := ((tendsto_order.1 u_lim).1 _ h).exists; exact ⟨n, hn.le⟩
· obtain ⟨n, hn⟩ := h; exact hn.trans_lt (u_lt _)
rw [h_Union, measure_iUnion_null_iff]
intro n
exact hc _ (u_lt n)
#align measure_theory.ae_const_le_iff_forall_lt_measure_zero MeasureTheory.ae_const_le_iff_forall_lt_measure_zero
section ENNReal
open scoped Topology
| Mathlib/MeasureTheory/Function/AEEqOfIntegral.lean | 164 | 221 | theorem ae_le_of_forall_set_lintegral_le_of_sigmaFinite [SigmaFinite μ] {f g : α → ℝ≥0∞}
(hf : Measurable f) (hg : Measurable g)
(h : ∀ s, MeasurableSet s → μ s < ∞ → (∫⁻ x in s, f x ∂μ) ≤ ∫⁻ x in s, g x ∂μ) : f ≤ᵐ[μ] g := by |
have A :
∀ (ε N : ℝ≥0) (p : ℕ), 0 < ε → μ ({x | g x + ε ≤ f x ∧ g x ≤ N} ∩ spanningSets μ p) = 0 := by
intro ε N p εpos
let s := {x | g x + ε ≤ f x ∧ g x ≤ N} ∩ spanningSets μ p
have s_meas : MeasurableSet s := by
have A : MeasurableSet {x | g x + ε ≤ f x} := measurableSet_le (hg.add measurable_const) hf
have B : MeasurableSet {x | g x ≤ N} := measurableSet_le hg measurable_const
exact (A.inter B).inter (measurable_spanningSets μ p)
have s_lt_top : μ s < ∞ :=
(measure_mono (Set.inter_subset_right)).trans_lt (measure_spanningSets_lt_top μ p)
have A : (∫⁻ x in s, g x ∂μ) + ε * μ s ≤ (∫⁻ x in s, g x ∂μ) + 0 :=
calc
(∫⁻ x in s, g x ∂μ) + ε * μ s = (∫⁻ x in s, g x ∂μ) + ∫⁻ _ in s, ε ∂μ := by
simp only [lintegral_const, Set.univ_inter, MeasurableSet.univ, Measure.restrict_apply]
_ = ∫⁻ x in s, g x + ε ∂μ := (lintegral_add_right _ measurable_const).symm
_ ≤ ∫⁻ x in s, f x ∂μ :=
(set_lintegral_mono (hg.add measurable_const) hf fun x hx => hx.1.1)
_ ≤ (∫⁻ x in s, g x ∂μ) + 0 := by rw [add_zero]; exact h s s_meas s_lt_top
have B : (∫⁻ x in s, g x ∂μ) ≠ ∞ := by
apply ne_of_lt
calc
(∫⁻ x in s, g x ∂μ) ≤ ∫⁻ _ in s, N ∂μ :=
set_lintegral_mono hg measurable_const fun x hx => hx.1.2
_ = N * μ s := by
simp only [lintegral_const, Set.univ_inter, MeasurableSet.univ, Measure.restrict_apply]
_ < ∞ := by
simp only [lt_top_iff_ne_top, s_lt_top.ne, and_false_iff, ENNReal.coe_ne_top,
ENNReal.mul_eq_top, Ne, not_false_iff, false_and_iff, or_self_iff]
have : (ε : ℝ≥0∞) * μ s ≤ 0 := ENNReal.le_of_add_le_add_left B A
simpa only [ENNReal.coe_eq_zero, nonpos_iff_eq_zero, mul_eq_zero, εpos.ne', false_or_iff]
obtain ⟨u, _, u_pos, u_lim⟩ :
∃ u : ℕ → ℝ≥0, StrictAnti u ∧ (∀ n, 0 < u n) ∧ Tendsto u atTop (𝓝 0) :=
exists_seq_strictAnti_tendsto (0 : ℝ≥0)
let s := fun n : ℕ => {x | g x + u n ≤ f x ∧ g x ≤ (n : ℝ≥0)} ∩ spanningSets μ n
have μs : ∀ n, μ (s n) = 0 := fun n => A _ _ _ (u_pos n)
have B : {x | f x ≤ g x}ᶜ ⊆ ⋃ n, s n := by
intro x hx
simp only [Set.mem_compl_iff, Set.mem_setOf, not_le] at hx
have L1 : ∀ᶠ n in atTop, g x + u n ≤ f x := by
have : Tendsto (fun n => g x + u n) atTop (𝓝 (g x + (0 : ℝ≥0))) :=
tendsto_const_nhds.add (ENNReal.tendsto_coe.2 u_lim)
simp only [ENNReal.coe_zero, add_zero] at this
exact eventually_le_of_tendsto_lt hx this
have L2 : ∀ᶠ n : ℕ in (atTop : Filter ℕ), g x ≤ (n : ℝ≥0) :=
haveI : Tendsto (fun n : ℕ => ((n : ℝ≥0) : ℝ≥0∞)) atTop (𝓝 ∞) := by
simp only [ENNReal.coe_natCast]
exact ENNReal.tendsto_nat_nhds_top
eventually_ge_of_tendsto_gt (hx.trans_le le_top) this
apply Set.mem_iUnion.2
exact ((L1.and L2).and (eventually_mem_spanningSets μ x)).exists
refine le_antisymm ?_ bot_le
calc
μ {x : α | (fun x : α => f x ≤ g x) x}ᶜ ≤ μ (⋃ n, s n) := measure_mono B
_ ≤ ∑' n, μ (s n) := measure_iUnion_le _
_ = 0 := by simp only [μs, tsum_zero]
| [
" (∀ᵐ (x : α) ∂μ, c ≤ f x) ↔ ∀ b < c, μ {x | f x ≤ b} = 0",
" μ {a | ¬c ≤ f a} = 0 ↔ ∀ b < c, μ {x | f x ≤ b} = 0",
" μ {a | f a < c} = 0 ↔ ∀ b < c, μ {x | f x ≤ b} = 0",
" μ {a | f a < c} = 0 → ∀ b < c, μ {x | f x ≤ b} = 0",
" μ {x | f x ≤ b} = 0",
" (∀ b < c, μ {x | f x ≤ b} = 0) → μ {a | f a < c} = 0",... | [
" (∀ᵐ (x : α) ∂μ, c ≤ f x) ↔ ∀ b < c, μ {x | f x ≤ b} = 0",
" μ {a | ¬c ≤ f a} = 0 ↔ ∀ b < c, μ {x | f x ≤ b} = 0",
" μ {a | f a < c} = 0 ↔ ∀ b < c, μ {x | f x ≤ b} = 0",
" μ {a | f a < c} = 0 → ∀ b < c, μ {x | f x ≤ b} = 0",
" μ {x | f x ≤ b} = 0",
" (∀ b < c, μ {x | f x ≤ b} = 0) → μ {a | f a < c} = 0",... |
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
| Mathlib/Combinatorics/SimpleGraph/Dart.lean | 112 | 115 | 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
| [
" d₁ = d₂ ↔ d₁.toProd = d₂.toProd",
" { toProd := toProd✝, adj := adj✝ } = d₂ ↔ { toProd := toProd✝, adj := adj✝ }.toProd = d₂.toProd",
" { toProd := toProd✝¹, adj := adj✝¹ } = { toProd := toProd✝, adj := adj✝ } ↔\n { toProd := toProd✝¹, adj := adj✝¹ }.toProd = { toProd := toProd✝, adj := adj✝ }.toProd",
"... | [
" d₁ = d₂ ↔ d₁.toProd = d₂.toProd",
" { toProd := toProd✝, adj := adj✝ } = d₂ ↔ { toProd := toProd✝, adj := adj✝ }.toProd = d₂.toProd",
" { toProd := toProd✝¹, adj := adj✝¹ } = { toProd := toProd✝, adj := adj✝ } ↔\n { toProd := toProd✝¹, adj := adj✝¹ }.toProd = { toProd := toProd✝, adj := adj✝ }.toProd",
"... |
import Mathlib.Algebra.Quotient
import Mathlib.Algebra.Group.Subgroup.Actions
import Mathlib.Algebra.Group.Subgroup.MulOpposite
import Mathlib.GroupTheory.GroupAction.Basic
import Mathlib.SetTheory.Cardinal.Finite
#align_import group_theory.coset from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
open Function MulOpposite Set
open scoped Pointwise
variable {α : Type*}
#align left_coset HSMul.hSMul
#align left_add_coset HVAdd.hVAdd
#noalign right_coset
#noalign right_add_coset
section CosetSemigroup
variable [Semigroup α]
@[to_additive leftAddCoset_assoc]
theorem leftCoset_assoc (s : Set α) (a b : α) : a • (b • s) = (a * b) • s := by
simp [← image_smul, (image_comp _ _ _).symm, Function.comp, mul_assoc]
#align left_coset_assoc leftCoset_assoc
#align left_add_coset_assoc leftAddCoset_assoc
@[to_additive rightAddCoset_assoc]
| Mathlib/GroupTheory/Coset.lean | 111 | 112 | theorem rightCoset_assoc (s : Set α) (a b : α) : op b • op a • s = op (a * b) • s := by |
simp [← image_smul, (image_comp _ _ _).symm, Function.comp, mul_assoc]
| [
" a • b • s = (a * b) • s",
" op b • op a • s = op (a * b) • s"
] | [
" a • b • s = (a * b) • s",
" op b • op a • s = op (a * b) • s"
] |
import Mathlib.Data.Finsupp.Defs
#align_import data.finsupp.indicator from "leanprover-community/mathlib"@"842328d9df7e96fd90fc424e115679c15fb23a71"
noncomputable section
open Finset Function
variable {ι α : Type*}
namespace Finsupp
variable [Zero α] {s : Finset ι} (f : ∀ i ∈ s, α) {i : ι}
def indicator (s : Finset ι) (f : ∀ i ∈ s, α) : ι →₀ α where
toFun i :=
haveI := Classical.decEq ι
if H : i ∈ s then f i H else 0
support :=
haveI := Classical.decEq α
(s.attach.filter fun i : s => f i.1 i.2 ≠ 0).map (Embedding.subtype _)
mem_support_toFun i := by
classical simp
#align finsupp.indicator Finsupp.indicator
theorem indicator_of_mem (hi : i ∈ s) (f : ∀ i ∈ s, α) : indicator s f i = f i hi :=
@dif_pos _ (id _) hi _ _ _
#align finsupp.indicator_of_mem Finsupp.indicator_of_mem
theorem indicator_of_not_mem (hi : i ∉ s) (f : ∀ i ∈ s, α) : indicator s f i = 0 :=
@dif_neg _ (id _) hi _ _ _
#align finsupp.indicator_of_not_mem Finsupp.indicator_of_not_mem
variable (s i)
@[simp]
| Mathlib/Data/Finsupp/Indicator.lean | 54 | 56 | theorem indicator_apply [DecidableEq ι] : indicator s f i = if hi : i ∈ s then f i hi else 0 := by |
simp only [indicator, ne_eq, coe_mk]
congr
| [
" i ∈ map (Embedding.subtype fun x => x ∈ s) (filter (fun i => f ↑i ⋯ ≠ 0) s.attach) ↔\n (fun i => if H : i ∈ s then f i H else 0) i ≠ 0",
" (indicator s f) i = if hi : i ∈ s then f i hi else 0",
" (if H : i ∈ s then f i H else 0) = if hi : i ∈ s then f i hi else 0"
] | [
" i ∈ map (Embedding.subtype fun x => x ∈ s) (filter (fun i => f ↑i ⋯ ≠ 0) s.attach) ↔\n (fun i => if H : i ∈ s then f i H else 0) i ≠ 0",
" (indicator s f) i = if hi : i ∈ s then f i hi else 0"
] |
import Mathlib.Algebra.Polynomial.Degree.Definitions
import Mathlib.Algebra.Polynomial.Eval
import Mathlib.Algebra.Polynomial.Monic
import Mathlib.Algebra.Polynomial.RingDivision
import Mathlib.Tactic.Abel
#align_import ring_theory.polynomial.pochhammer from "leanprover-community/mathlib"@"53b216bcc1146df1c4a0a86877890ea9f1f01589"
universe u v
open Polynomial
open Polynomial
section Semiring
variable (S : Type u) [Semiring S]
noncomputable def ascPochhammer : ℕ → S[X]
| 0 => 1
| n + 1 => X * (ascPochhammer n).comp (X + 1)
#align pochhammer ascPochhammer
@[simp]
theorem ascPochhammer_zero : ascPochhammer S 0 = 1 :=
rfl
#align pochhammer_zero ascPochhammer_zero
@[simp]
theorem ascPochhammer_one : ascPochhammer S 1 = X := by simp [ascPochhammer]
#align pochhammer_one ascPochhammer_one
theorem ascPochhammer_succ_left (n : ℕ) :
ascPochhammer S (n + 1) = X * (ascPochhammer S n).comp (X + 1) := by
rw [ascPochhammer]
#align pochhammer_succ_left ascPochhammer_succ_left
theorem monic_ascPochhammer (n : ℕ) [Nontrivial S] [NoZeroDivisors S] :
Monic <| ascPochhammer S n := by
induction' n with n hn
· simp
· have : leadingCoeff (X + 1 : S[X]) = 1 := leadingCoeff_X_add_C 1
rw [ascPochhammer_succ_left, Monic.def, leadingCoeff_mul,
leadingCoeff_comp (ne_zero_of_eq_one <| natDegree_X_add_C 1 : natDegree (X + 1) ≠ 0), hn,
monic_X, one_mul, one_mul, this, one_pow]
section
variable {S} {T : Type v} [Semiring T]
@[simp]
theorem ascPochhammer_map (f : S →+* T) (n : ℕ) :
(ascPochhammer S n).map f = ascPochhammer T n := by
induction' n with n ih
· simp
· simp [ih, ascPochhammer_succ_left, map_comp]
#align pochhammer_map ascPochhammer_map
theorem ascPochhammer_eval₂ (f : S →+* T) (n : ℕ) (t : T) :
(ascPochhammer T n).eval t = (ascPochhammer S n).eval₂ f t := by
rw [← ascPochhammer_map f]
exact eval_map f t
theorem ascPochhammer_eval_comp {R : Type*} [CommSemiring R] (n : ℕ) (p : R[X]) [Algebra R S]
(x : S) : ((ascPochhammer S n).comp (p.map (algebraMap R S))).eval x =
(ascPochhammer S n).eval (p.eval₂ (algebraMap R S) x) := by
rw [ascPochhammer_eval₂ (algebraMap R S), ← eval₂_comp', ← ascPochhammer_map (algebraMap R S),
← map_comp, eval_map]
end
@[simp, norm_cast]
theorem ascPochhammer_eval_cast (n k : ℕ) :
(((ascPochhammer ℕ n).eval k : ℕ) : S) = ((ascPochhammer S n).eval k : S) := by
rw [← ascPochhammer_map (algebraMap ℕ S), eval_map, ← eq_natCast (algebraMap ℕ S),
eval₂_at_natCast,Nat.cast_id]
#align pochhammer_eval_cast ascPochhammer_eval_cast
theorem ascPochhammer_eval_zero {n : ℕ} : (ascPochhammer S n).eval 0 = if n = 0 then 1 else 0 := by
cases n
· simp
· simp [X_mul, Nat.succ_ne_zero, ascPochhammer_succ_left]
#align pochhammer_eval_zero ascPochhammer_eval_zero
theorem ascPochhammer_zero_eval_zero : (ascPochhammer S 0).eval 0 = 1 := by simp
#align pochhammer_zero_eval_zero ascPochhammer_zero_eval_zero
@[simp]
theorem ascPochhammer_ne_zero_eval_zero {n : ℕ} (h : n ≠ 0) : (ascPochhammer S n).eval 0 = 0 := by
simp [ascPochhammer_eval_zero, h]
#align pochhammer_ne_zero_eval_zero ascPochhammer_ne_zero_eval_zero
theorem ascPochhammer_succ_right (n : ℕ) :
ascPochhammer S (n + 1) = ascPochhammer S n * (X + (n : S[X])) := by
suffices h : ascPochhammer ℕ (n + 1) = ascPochhammer ℕ n * (X + (n : ℕ[X])) by
apply_fun Polynomial.map (algebraMap ℕ S) at h
simpa only [ascPochhammer_map, Polynomial.map_mul, Polynomial.map_add, map_X,
Polynomial.map_natCast] using h
induction' n with n ih
· simp
· conv_lhs =>
rw [ascPochhammer_succ_left, ih, mul_comp, ← mul_assoc, ← ascPochhammer_succ_left, add_comp,
X_comp, natCast_comp, add_assoc, add_comm (1 : ℕ[X]), ← Nat.cast_succ]
#align pochhammer_succ_right ascPochhammer_succ_right
| Mathlib/RingTheory/Polynomial/Pochhammer.lean | 137 | 140 | theorem ascPochhammer_succ_eval {S : Type*} [Semiring S] (n : ℕ) (k : S) :
(ascPochhammer S (n + 1)).eval k = (ascPochhammer S n).eval k * (k + n) := by |
rw [ascPochhammer_succ_right, mul_add, eval_add, eval_mul_X, ← Nat.cast_comm, ← C_eq_natCast,
eval_C_mul, Nat.cast_comm, ← mul_add]
| [
" ascPochhammer S 1 = X",
" ascPochhammer S (n + 1) = X * (ascPochhammer S n).comp (X + 1)",
" (ascPochhammer S n).Monic",
" (ascPochhammer S 0).Monic",
" (ascPochhammer S (n + 1)).Monic",
" map f (ascPochhammer S n) = ascPochhammer T n",
" map f (ascPochhammer S 0) = ascPochhammer T 0",
" map f (ascP... | [
" ascPochhammer S 1 = X",
" ascPochhammer S (n + 1) = X * (ascPochhammer S n).comp (X + 1)",
" (ascPochhammer S n).Monic",
" (ascPochhammer S 0).Monic",
" (ascPochhammer S (n + 1)).Monic",
" map f (ascPochhammer S n) = ascPochhammer T n",
" map f (ascPochhammer S 0) = ascPochhammer T 0",
" map f (ascP... |
import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace
import Mathlib.Analysis.LocallyConvex.Barrelled
import Mathlib.Topology.Baire.CompleteMetrizable
#align_import analysis.normed_space.banach_steinhaus from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Set
variable {E F 𝕜 𝕜₂ : Type*} [SeminormedAddCommGroup E] [SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜] [NontriviallyNormedField 𝕜₂] [NormedSpace 𝕜 E] [NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂} [RingHomIsometric σ₁₂]
| Mathlib/Analysis/NormedSpace/BanachSteinhaus.lean | 34 | 38 | theorem banach_steinhaus {ι : Type*} [CompleteSpace E] {g : ι → E →SL[σ₁₂] F}
(h : ∀ x, ∃ C, ∀ i, ‖g i x‖ ≤ C) : ∃ C', ∀ i, ‖g i‖ ≤ C' := by |
rw [show (∃ C, ∀ i, ‖g i‖ ≤ C) ↔ _ from (NormedSpace.equicontinuous_TFAE g).out 5 2]
refine (norm_withSeminorms 𝕜₂ F).banach_steinhaus (fun _ x ↦ ?_)
simpa [bddAbove_def, forall_mem_range] using h x
| [
" ∃ C', ∀ (i : ι), ‖g i‖ ≤ C'",
" UniformEquicontinuous (DFunLike.coe ∘ g)",
" BddAbove (range fun i => (normSeminorm 𝕜₂ F) ((g i) x))"
] | [
" ∃ C', ∀ (i : ι), ‖g i‖ ≤ C'"
] |
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.set.ncard from "leanprover-community/mathlib"@"74c2af38a828107941029b03839882c5c6f87a04"
namespace Set
variable {α β : Type*} {s t : Set α}
noncomputable def encard (s : Set α) : ℕ∞ := PartENat.withTopEquiv (PartENat.card s)
@[simp] theorem encard_univ_coe (s : Set α) : encard (univ : Set s) = encard s := by
rw [encard, encard, PartENat.card_congr (Equiv.Set.univ ↑s)]
theorem encard_univ (α : Type*) :
encard (univ : Set α) = PartENat.withTopEquiv (PartENat.card α) := by
rw [encard, PartENat.card_congr (Equiv.Set.univ α)]
| Mathlib/Data/Set/Card.lean | 73 | 76 | theorem Finite.encard_eq_coe_toFinset_card (h : s.Finite) : s.encard = h.toFinset.card := by |
have := h.fintype
rw [encard, PartENat.card_eq_coe_fintype_card,
PartENat.withTopEquiv_natCast, toFinite_toFinset, toFinset_card]
| [
" univ.encard = s.encard",
" univ.encard = PartENat.withTopEquiv (PartENat.card α)",
" s.encard = ↑h.toFinset.card"
] | [
" univ.encard = s.encard",
" univ.encard = PartENat.withTopEquiv (PartENat.card α)",
" s.encard = ↑h.toFinset.card"
] |
import Mathlib.Analysis.NormedSpace.Exponential
import Mathlib.Analysis.NormedSpace.ProdLp
import Mathlib.Topology.Instances.TrivSqZeroExt
#align_import analysis.normed_space.triv_sq_zero_ext from "leanprover-community/mathlib"@"88a563b158f59f2983cfad685664da95502e8cdd"
variable (𝕜 : Type*) {S R M : Type*}
local notation "tsze" => TrivSqZeroExt
open NormedSpace -- For `exp`.
namespace TrivSqZeroExt
section Topology
noncomputable section Seminormed
section Ring
variable [SeminormedCommRing S] [SeminormedRing R] [SeminormedAddCommGroup M]
variable [Algebra S R] [Module S M] [Module R M] [Module Rᵐᵒᵖ M]
variable [BoundedSMul S R] [BoundedSMul S M] [BoundedSMul R M] [BoundedSMul Rᵐᵒᵖ M]
variable [SMulCommClass R Rᵐᵒᵖ M] [IsScalarTower S R M] [IsScalarTower S Rᵐᵒᵖ M]
instance instL1SeminormedAddCommGroup : SeminormedAddCommGroup (tsze R M) :=
inferInstanceAs <| SeminormedAddCommGroup (WithLp 1 <| R × M)
example :
(TrivSqZeroExt.instUniformSpace : UniformSpace (tsze R M)) =
PseudoMetricSpace.toUniformSpace := rfl
| Mathlib/Analysis/NormedSpace/TrivSqZeroExt.lean | 214 | 217 | theorem norm_def (x : tsze R M) : ‖x‖ = ‖fst x‖ + ‖snd x‖ := by |
rw [WithLp.prod_norm_eq_add (by norm_num)]
simp only [ENNReal.one_toReal, Real.rpow_one, div_one]
rfl
| [
" ‖x‖ = ‖x.fst‖ + ‖x.snd‖",
" 0 < ENNReal.toReal 1",
" (‖x.1‖ ^ ENNReal.toReal 1 + ‖x.2‖ ^ ENNReal.toReal 1) ^ (1 / ENNReal.toReal 1) = ‖x.fst‖ + ‖x.snd‖",
" ‖x.1‖ + ‖x.2‖ = ‖x.fst‖ + ‖x.snd‖"
] | [
" ‖x‖ = ‖x.fst‖ + ‖x.snd‖"
] |
import Mathlib.GroupTheory.GroupAction.ConjAct
import Mathlib.GroupTheory.GroupAction.Quotient
import Mathlib.GroupTheory.QuotientGroup
import Mathlib.Topology.Algebra.Monoid
import Mathlib.Topology.Algebra.Constructions
#align_import topology.algebra.group.basic from "leanprover-community/mathlib"@"3b1890e71632be9e3b2086ab512c3259a7e9a3ef"
open scoped Classical
open Set Filter TopologicalSpace Function Topology Pointwise MulOpposite
universe u v w x
variable {G : Type w} {H : Type x} {α : Type u} {β : Type v}
section ContinuousMulGroup
variable [TopologicalSpace G] [Group G] [ContinuousMul G]
@[to_additive "Addition from the left in a topological additive group as a homeomorphism."]
protected def Homeomorph.mulLeft (a : G) : G ≃ₜ G :=
{ Equiv.mulLeft a with
continuous_toFun := continuous_const.mul continuous_id
continuous_invFun := continuous_const.mul continuous_id }
#align homeomorph.mul_left Homeomorph.mulLeft
#align homeomorph.add_left Homeomorph.addLeft
@[to_additive (attr := simp)]
theorem Homeomorph.coe_mulLeft (a : G) : ⇑(Homeomorph.mulLeft a) = (a * ·) :=
rfl
#align homeomorph.coe_mul_left Homeomorph.coe_mulLeft
#align homeomorph.coe_add_left Homeomorph.coe_addLeft
@[to_additive]
theorem Homeomorph.mulLeft_symm (a : G) : (Homeomorph.mulLeft a).symm = Homeomorph.mulLeft a⁻¹ := by
ext
rfl
#align homeomorph.mul_left_symm Homeomorph.mulLeft_symm
#align homeomorph.add_left_symm Homeomorph.addLeft_symm
@[to_additive]
lemma isOpenMap_mul_left (a : G) : IsOpenMap (a * ·) := (Homeomorph.mulLeft a).isOpenMap
#align is_open_map_mul_left isOpenMap_mul_left
#align is_open_map_add_left isOpenMap_add_left
@[to_additive IsOpen.left_addCoset]
theorem IsOpen.leftCoset {U : Set G} (h : IsOpen U) (x : G) : IsOpen (x • U) :=
isOpenMap_mul_left x _ h
#align is_open.left_coset IsOpen.leftCoset
#align is_open.left_add_coset IsOpen.left_addCoset
@[to_additive]
lemma isClosedMap_mul_left (a : G) : IsClosedMap (a * ·) := (Homeomorph.mulLeft a).isClosedMap
#align is_closed_map_mul_left isClosedMap_mul_left
#align is_closed_map_add_left isClosedMap_add_left
@[to_additive IsClosed.left_addCoset]
theorem IsClosed.leftCoset {U : Set G} (h : IsClosed U) (x : G) : IsClosed (x • U) :=
isClosedMap_mul_left x _ h
#align is_closed.left_coset IsClosed.leftCoset
#align is_closed.left_add_coset IsClosed.left_addCoset
@[to_additive "Addition from the right in a topological additive group as a homeomorphism."]
protected def Homeomorph.mulRight (a : G) : G ≃ₜ G :=
{ Equiv.mulRight a with
continuous_toFun := continuous_id.mul continuous_const
continuous_invFun := continuous_id.mul continuous_const }
#align homeomorph.mul_right Homeomorph.mulRight
#align homeomorph.add_right Homeomorph.addRight
@[to_additive (attr := simp)]
lemma Homeomorph.coe_mulRight (a : G) : ⇑(Homeomorph.mulRight a) = (· * a) := rfl
#align homeomorph.coe_mul_right Homeomorph.coe_mulRight
#align homeomorph.coe_add_right Homeomorph.coe_addRight
@[to_additive]
| Mathlib/Topology/Algebra/Group/Basic.lean | 114 | 117 | theorem Homeomorph.mulRight_symm (a : G) :
(Homeomorph.mulRight a).symm = Homeomorph.mulRight a⁻¹ := by |
ext
rfl
| [
" (Homeomorph.mulLeft a).symm = Homeomorph.mulLeft a⁻¹",
" (Homeomorph.mulLeft a).symm x✝ = (Homeomorph.mulLeft a⁻¹) x✝",
" (Homeomorph.mulRight a).symm = Homeomorph.mulRight a⁻¹",
" (Homeomorph.mulRight a).symm x✝ = (Homeomorph.mulRight a⁻¹) x✝"
] | [
" (Homeomorph.mulLeft a).symm = Homeomorph.mulLeft a⁻¹",
" (Homeomorph.mulLeft a).symm x✝ = (Homeomorph.mulLeft a⁻¹) x✝",
" (Homeomorph.mulRight a).symm = Homeomorph.mulRight a⁻¹"
] |
import Mathlib.Analysis.Normed.Group.Basic
import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace
import Mathlib.LinearAlgebra.AffineSpace.Midpoint
#align_import analysis.normed.group.add_torsor from "leanprover-community/mathlib"@"837f72de63ad6cd96519cde5f1ffd5ed8d280ad0"
noncomputable section
open NNReal Topology
open Filter
class NormedAddTorsor (V : outParam Type*) (P : Type*) [SeminormedAddCommGroup V]
[PseudoMetricSpace P] extends AddTorsor V P where
dist_eq_norm' : ∀ x y : P, dist x y = ‖(x -ᵥ y : V)‖
#align normed_add_torsor NormedAddTorsor
instance (priority := 100) NormedAddTorsor.toAddTorsor' {V P : Type*} [NormedAddCommGroup V]
[MetricSpace P] [NormedAddTorsor V P] : AddTorsor V P :=
NormedAddTorsor.toAddTorsor
#align normed_add_torsor.to_add_torsor' NormedAddTorsor.toAddTorsor'
variable {α V P W Q : Type*} [SeminormedAddCommGroup V] [PseudoMetricSpace P] [NormedAddTorsor V P]
[NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q]
instance (priority := 100) NormedAddTorsor.to_isometricVAdd : IsometricVAdd V P :=
⟨fun c => Isometry.of_dist_eq fun x y => by
-- porting note (#10745): was `simp [NormedAddTorsor.dist_eq_norm']`
rw [NormedAddTorsor.dist_eq_norm', NormedAddTorsor.dist_eq_norm', vadd_vsub_vadd_cancel_left]⟩
#align normed_add_torsor.to_has_isometric_vadd NormedAddTorsor.to_isometricVAdd
instance (priority := 100) SeminormedAddCommGroup.toNormedAddTorsor : NormedAddTorsor V V where
dist_eq_norm' := dist_eq_norm
#align seminormed_add_comm_group.to_normed_add_torsor SeminormedAddCommGroup.toNormedAddTorsor
-- Because of the AddTorsor.nonempty instance.
instance AffineSubspace.toNormedAddTorsor {R : Type*} [Ring R] [Module R V]
(s : AffineSubspace R P) [Nonempty s] : NormedAddTorsor s.direction s :=
{ AffineSubspace.toAddTorsor s with
dist_eq_norm' := fun x y => NormedAddTorsor.dist_eq_norm' x.val y.val }
#align affine_subspace.to_normed_add_torsor AffineSubspace.toNormedAddTorsor
section
variable (V W)
theorem dist_eq_norm_vsub (x y : P) : dist x y = ‖x -ᵥ y‖ :=
NormedAddTorsor.dist_eq_norm' x y
#align dist_eq_norm_vsub dist_eq_norm_vsub
theorem nndist_eq_nnnorm_vsub (x y : P) : nndist x y = ‖x -ᵥ y‖₊ :=
NNReal.eq <| dist_eq_norm_vsub V x y
#align nndist_eq_nnnorm_vsub nndist_eq_nnnorm_vsub
theorem dist_eq_norm_vsub' (x y : P) : dist x y = ‖y -ᵥ x‖ :=
(dist_comm _ _).trans (dist_eq_norm_vsub _ _ _)
#align dist_eq_norm_vsub' dist_eq_norm_vsub'
theorem nndist_eq_nnnorm_vsub' (x y : P) : nndist x y = ‖y -ᵥ x‖₊ :=
NNReal.eq <| dist_eq_norm_vsub' V x y
#align nndist_eq_nnnorm_vsub' nndist_eq_nnnorm_vsub'
end
theorem dist_vadd_cancel_left (v : V) (x y : P) : dist (v +ᵥ x) (v +ᵥ y) = dist x y :=
dist_vadd _ _ _
#align dist_vadd_cancel_left dist_vadd_cancel_left
-- Porting note (#10756): new theorem
theorem nndist_vadd_cancel_left (v : V) (x y : P) : nndist (v +ᵥ x) (v +ᵥ y) = nndist x y :=
NNReal.eq <| dist_vadd_cancel_left _ _ _
@[simp]
theorem dist_vadd_cancel_right (v₁ v₂ : V) (x : P) : dist (v₁ +ᵥ x) (v₂ +ᵥ x) = dist v₁ v₂ := by
rw [dist_eq_norm_vsub V, dist_eq_norm, vadd_vsub_vadd_cancel_right]
#align dist_vadd_cancel_right dist_vadd_cancel_right
@[simp]
theorem nndist_vadd_cancel_right (v₁ v₂ : V) (x : P) : nndist (v₁ +ᵥ x) (v₂ +ᵥ x) = nndist v₁ v₂ :=
NNReal.eq <| dist_vadd_cancel_right _ _ _
#align nndist_vadd_cancel_right nndist_vadd_cancel_right
@[simp]
theorem dist_vadd_left (v : V) (x : P) : dist (v +ᵥ x) x = ‖v‖ := by
-- porting note (#10745): was `simp [dist_eq_norm_vsub V _ x]`
rw [dist_eq_norm_vsub V _ x, vadd_vsub]
#align dist_vadd_left dist_vadd_left
@[simp]
theorem nndist_vadd_left (v : V) (x : P) : nndist (v +ᵥ x) x = ‖v‖₊ :=
NNReal.eq <| dist_vadd_left _ _
#align nndist_vadd_left nndist_vadd_left
@[simp]
| Mathlib/Analysis/Normed/Group/AddTorsor.lean | 125 | 125 | theorem dist_vadd_right (v : V) (x : P) : dist x (v +ᵥ x) = ‖v‖ := by | rw [dist_comm, dist_vadd_left]
| [
" dist (c +ᵥ x) (c +ᵥ y) = dist x y",
" dist (v₁ +ᵥ x) (v₂ +ᵥ x) = dist v₁ v₂",
" dist (v +ᵥ x) x = ‖v‖",
" dist x (v +ᵥ x) = ‖v‖"
] | [
" dist (c +ᵥ x) (c +ᵥ y) = dist x y",
" dist (v₁ +ᵥ x) (v₂ +ᵥ x) = dist v₁ v₂",
" dist (v +ᵥ x) x = ‖v‖",
" dist x (v +ᵥ x) = ‖v‖"
] |
import Mathlib.Algebra.Category.MonCat.Basic
import Mathlib.CategoryTheory.Limits.HasLimits
import Mathlib.CategoryTheory.ConcreteCategory.Elementwise
#align_import algebra.category.Mon.colimits from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe v
open CategoryTheory
open CategoryTheory.Limits
namespace MonCat.Colimits
variable {J : Type v} [SmallCategory J] (F : J ⥤ MonCat.{v})
inductive Prequotient
-- There's always `of`
| of : ∀ (j : J) (_ : F.obj j), Prequotient
-- Then one generator for each operation
| one : Prequotient
| mul : Prequotient → Prequotient → Prequotient
set_option linter.uppercaseLean3 false in
#align Mon.colimits.prequotient MonCat.Colimits.Prequotient
instance : Inhabited (Prequotient F) :=
⟨Prequotient.one⟩
open Prequotient
inductive Relation : Prequotient F → Prequotient F → Prop-- Make it an equivalence relation:
| refl : ∀ x, Relation x x
| symm : ∀ (x y) (_ : Relation x y), Relation y x
| trans : ∀ (x y z) (_ : Relation x y) (_ : Relation y z),
Relation x z-- There's always a `map` relation
| map :
∀ (j j' : J) (f : j ⟶ j') (x : F.obj j),
Relation (Prequotient.of j' ((F.map f) x))
(Prequotient.of j x)-- Then one relation per operation, describing the interaction with `of`
| mul : ∀ (j) (x y : F.obj j), Relation (Prequotient.of j (x * y))
(mul (Prequotient.of j x) (Prequotient.of j y))
| one : ∀ j, Relation (Prequotient.of j 1) one-- Then one relation per argument of each operation
| mul_1 : ∀ (x x' y) (_ : Relation x x'), Relation (mul x y) (mul x' y)
| mul_2 : ∀ (x y y') (_ : Relation y y'), Relation (mul x y) (mul x y')
-- And one relation per axiom
| mul_assoc : ∀ x y z, Relation (mul (mul x y) z) (mul x (mul y z))
| one_mul : ∀ x, Relation (mul one x) x
| mul_one : ∀ x, Relation (mul x one) x
set_option linter.uppercaseLean3 false in
#align Mon.colimits.relation MonCat.Colimits.Relation
def colimitSetoid : Setoid (Prequotient F) where
r := Relation F
iseqv := ⟨Relation.refl, Relation.symm _ _, Relation.trans _ _ _⟩
set_option linter.uppercaseLean3 false in
#align Mon.colimits.colimit_setoid MonCat.Colimits.colimitSetoid
attribute [instance] colimitSetoid
def ColimitType : Type v :=
Quotient (colimitSetoid F)
set_option linter.uppercaseLean3 false in
#align Mon.colimits.colimit_type MonCat.Colimits.ColimitType
instance : Inhabited (ColimitType F) := by
dsimp [ColimitType]
infer_instance
instance monoidColimitType : Monoid (ColimitType F) where
one := Quotient.mk _ one
mul := Quotient.map₂ mul fun x x' rx y y' ry =>
Setoid.trans (Relation.mul_1 _ _ y rx) (Relation.mul_2 x' _ _ ry)
one_mul := Quotient.ind fun _ => Quotient.sound <| Relation.one_mul _
mul_one := Quotient.ind fun _ => Quotient.sound <| Relation.mul_one _
mul_assoc := Quotient.ind fun _ => Quotient.ind₂ fun _ _ =>
Quotient.sound <| Relation.mul_assoc _ _ _
set_option linter.uppercaseLean3 false in
#align Mon.colimits.monoid_colimit_type MonCat.Colimits.monoidColimitType
@[simp]
theorem quot_one : Quot.mk Setoid.r one = (1 : ColimitType F) :=
rfl
set_option linter.uppercaseLean3 false in
#align Mon.colimits.quot_one MonCat.Colimits.quot_one
@[simp]
theorem quot_mul (x y : Prequotient F) : Quot.mk Setoid.r (mul x y) =
@HMul.hMul (ColimitType F) (ColimitType F) (ColimitType F) _
(Quot.mk Setoid.r x) (Quot.mk Setoid.r y) :=
rfl
set_option linter.uppercaseLean3 false in
#align Mon.colimits.quot_mul MonCat.Colimits.quot_mul
def colimit : MonCat :=
⟨ColimitType F, by infer_instance⟩
set_option linter.uppercaseLean3 false in
#align Mon.colimits.colimit MonCat.Colimits.colimit
def coconeFun (j : J) (x : F.obj j) : ColimitType F :=
Quot.mk _ (Prequotient.of j x)
set_option linter.uppercaseLean3 false in
#align Mon.colimits.cocone_fun MonCat.Colimits.coconeFun
def coconeMorphism (j : J) : F.obj j ⟶ colimit F where
toFun := coconeFun F j
map_one' := Quot.sound (Relation.one _)
map_mul' _ _ := Quot.sound (Relation.mul _ _ _)
set_option linter.uppercaseLean3 false in
#align Mon.colimits.cocone_morphism MonCat.Colimits.coconeMorphism
@[simp]
| Mathlib/Algebra/Category/MonCat/Colimits.lean | 179 | 183 | theorem cocone_naturality {j j' : J} (f : j ⟶ j') :
F.map f ≫ coconeMorphism F j' = coconeMorphism F j := by |
ext
apply Quot.sound
apply Relation.map
| [
" Inhabited (ColimitType F)",
" Inhabited (Quotient (colimitSetoid F))",
" Monoid (ColimitType F)",
" F.map f ≫ coconeMorphism F j' = coconeMorphism F j",
" (F.map f ≫ coconeMorphism F j') x✝ = (coconeMorphism F j) x✝",
" Setoid.r (Prequotient.of j' ((F.map f) x✝)) (Prequotient.of j x✝)"
] | [
" Inhabited (ColimitType F)",
" Inhabited (Quotient (colimitSetoid F))",
" Monoid (ColimitType F)",
" F.map f ≫ coconeMorphism F j' = coconeMorphism F j"
] |
import Mathlib.Dynamics.Ergodic.MeasurePreserving
import Mathlib.Dynamics.Minimal
import Mathlib.GroupTheory.GroupAction.Hom
import Mathlib.MeasureTheory.Group.MeasurableEquiv
import Mathlib.MeasureTheory.Measure.Regular
#align_import measure_theory.group.action from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open ENNReal NNReal Pointwise Topology MeasureTheory MeasureTheory.Measure Set Function
namespace MeasureTheory
universe u v w
variable {G : Type u} {M : Type v} {α : Type w} {s : Set α}
class VAddInvariantMeasure (M α : Type*) [VAdd M α] {_ : MeasurableSpace α} (μ : Measure α) :
Prop where
measure_preimage_vadd : ∀ (c : M) ⦃s : Set α⦄, MeasurableSet s → μ ((fun x => c +ᵥ x) ⁻¹' s) = μ s
#align measure_theory.vadd_invariant_measure MeasureTheory.VAddInvariantMeasure
#align measure_theory.vadd_invariant_measure.measure_preimage_vadd MeasureTheory.VAddInvariantMeasure.measure_preimage_vadd
@[to_additive]
class SMulInvariantMeasure (M α : Type*) [SMul M α] {_ : MeasurableSpace α} (μ : Measure α) :
Prop where
measure_preimage_smul : ∀ (c : M) ⦃s : Set α⦄, MeasurableSet s → μ ((fun x => c • x) ⁻¹' s) = μ s
#align measure_theory.smul_invariant_measure MeasureTheory.SMulInvariantMeasure
#align measure_theory.smul_invariant_measure.measure_preimage_smul MeasureTheory.SMulInvariantMeasure.measure_preimage_smul
section SMulHomClass
universe uM uN uα uβ
variable {M : Type uM} {N : Type uN} {α : Type uα} {β : Type uβ}
[MeasurableSpace M] [MeasurableSpace N] [MeasurableSpace α] [MeasurableSpace β]
@[to_additive]
| Mathlib/MeasureTheory/Group/Action.lean | 114 | 126 | theorem smulInvariantMeasure_map [SMul M α] [SMul M β]
[MeasurableSMul M β]
(μ : Measure α) [SMulInvariantMeasure M α μ] (f : α → β)
(hsmul : ∀ (m : M) a, f (m • a) = m • f a) (hf : Measurable f) :
SMulInvariantMeasure M β (map f μ) where
measure_preimage_smul m S hS := calc
map f μ ((m • ·) ⁻¹' S)
_ = μ (f ⁻¹' ((m • ·) ⁻¹' S)) := map_apply hf <| hS.preimage (measurable_const_smul _)
_ = μ ((m • f ·) ⁻¹' S) := by | rw [preimage_preimage]
_ = μ ((f <| m • ·) ⁻¹' S) := by simp_rw [hsmul]
_ = μ ((m • ·) ⁻¹' (f ⁻¹' S)) := by rw [← preimage_preimage]
_ = μ (f ⁻¹' S) := by rw [SMulInvariantMeasure.measure_preimage_smul m (hS.preimage hf)]
_ = map f μ S := (map_apply hf hS).symm
| [
" μ (f ⁻¹' ((fun x => m • x) ⁻¹' S)) = μ ((fun x => m • f x) ⁻¹' S)",
" μ ((fun x => m • f x) ⁻¹' S) = μ ((fun x => f (m • x)) ⁻¹' S)",
" μ ((fun x => f (m • x)) ⁻¹' S) = μ ((fun x => m • x) ⁻¹' (f ⁻¹' S))",
" μ ((fun x => m • x) ⁻¹' (f ⁻¹' S)) = μ (f ⁻¹' S)"
] | [
" μ (f ⁻¹' ((fun x => m • x) ⁻¹' S)) = μ ((fun x => m • f x) ⁻¹' S)"
] |
import Mathlib.Algebra.Algebra.Bilinear
import Mathlib.RingTheory.Localization.Basic
#align_import algebra.module.localized_module from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86"
section IsLocalizedModule
universe u v
variable {R : Type*} [CommSemiring R] (S : Submonoid R)
variable {M M' M'' : Type*} [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M'']
variable {A : Type*} [CommSemiring A] [Algebra R A] [Module A M'] [IsLocalization S A]
variable [Module R M] [Module R M'] [Module R M''] [IsScalarTower R A M']
variable (f : M →ₗ[R] M') (g : M →ₗ[R] M'')
@[mk_iff] class IsLocalizedModule : Prop where
map_units : ∀ x : S, IsUnit (algebraMap R (Module.End R M') x)
surj' : ∀ y : M', ∃ x : M × S, x.2 • y = f x.1
exists_of_eq : ∀ {x₁ x₂}, f x₁ = f x₂ → ∃ c : S, c • x₁ = c • x₂
#align is_localized_module IsLocalizedModule
attribute [nolint docBlame] IsLocalizedModule.map_units IsLocalizedModule.surj'
IsLocalizedModule.exists_of_eq
-- Porting note: Manually added to make `S` and `f` explicit.
lemma IsLocalizedModule.surj [IsLocalizedModule S f] (y : M') : ∃ x : M × S, x.2 • y = f x.1 :=
surj' y
-- Porting note: Manually added to make `S` and `f` explicit.
lemma IsLocalizedModule.eq_iff_exists [IsLocalizedModule S f] {x₁ x₂} :
f x₁ = f x₂ ↔ ∃ c : S, c • x₁ = c • x₂ :=
Iff.intro exists_of_eq fun ⟨c, h⟩ ↦ by
apply_fun f at h
simp_rw [f.map_smul_of_tower, Submonoid.smul_def, ← Module.algebraMap_end_apply R R] at h
exact ((Module.End_isUnit_iff _).mp <| map_units f c).1 h
theorem IsLocalizedModule.of_linearEquiv (e : M' ≃ₗ[R] M'') [hf : IsLocalizedModule S f] :
IsLocalizedModule S (e ∘ₗ f : M →ₗ[R] M'') where
map_units s := by
rw [show algebraMap R (Module.End R M'') s = e ∘ₗ (algebraMap R (Module.End R M') s) ∘ₗ e.symm
by ext; simp, Module.End_isUnit_iff, LinearMap.coe_comp, LinearMap.coe_comp,
LinearEquiv.coe_coe, LinearEquiv.coe_coe, EquivLike.comp_bijective, EquivLike.bijective_comp]
exact (Module.End_isUnit_iff _).mp <| hf.map_units s
surj' x := by
obtain ⟨p, h⟩ := hf.surj' (e.symm x)
exact ⟨p, by rw [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply, ← e.congr_arg h,
Submonoid.smul_def, Submonoid.smul_def, LinearEquiv.map_smul, LinearEquiv.apply_symm_apply]⟩
exists_of_eq h := by
simp_rw [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply,
EmbeddingLike.apply_eq_iff_eq] at h
exact hf.exists_of_eq h
variable (M) in
lemma isLocalizedModule_id (R') [CommSemiring R'] [Algebra R R'] [IsLocalization S R'] [Module R' M]
[IsScalarTower R R' M] : IsLocalizedModule S (.id : M →ₗ[R] M) where
map_units s := by
rw [← (Algebra.lsmul R (A := R') R M).commutes]; exact (IsLocalization.map_units R' s).map _
surj' m := ⟨(m, 1), one_smul _ _⟩
exists_of_eq h := ⟨1, congr_arg _ h⟩
variable {S} in
| Mathlib/Algebra/Module/LocalizedModule.lean | 599 | 610 | theorem isLocalizedModule_iff_isLocalization {A Aₛ} [CommSemiring A] [Algebra R A] [CommSemiring Aₛ]
[Algebra A Aₛ] [Algebra R Aₛ] [IsScalarTower R A Aₛ] :
IsLocalizedModule S (IsScalarTower.toAlgHom R A Aₛ).toLinearMap ↔
IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ := by |
rw [isLocalizedModule_iff, isLocalization_iff]
refine and_congr ?_ (and_congr (forall_congr' fun _ ↦ ?_) (forall₂_congr fun _ _ ↦ ?_))
· simp_rw [← (Algebra.lmul R Aₛ).commutes, Algebra.lmul_isUnit_iff, Subtype.forall,
Algebra.algebraMapSubmonoid, ← SetLike.mem_coe, Submonoid.coe_map,
Set.forall_mem_image, ← IsScalarTower.algebraMap_apply]
· simp_rw [Prod.exists, Subtype.exists, Algebra.algebraMapSubmonoid]
simp [← IsScalarTower.algebraMap_apply, Submonoid.mk_smul, Algebra.smul_def, mul_comm]
· congr!; simp_rw [Subtype.exists, Algebra.algebraMapSubmonoid]; simp [Algebra.smul_def]
| [
" f x₁ = f x₂",
" IsUnit ((algebraMap R (Module.End R M'')) ↑s)",
" (algebraMap R (Module.End R M'')) ↑s = ↑e ∘ₗ (algebraMap R (Module.End R M')) ↑s ∘ₗ ↑e.symm",
" ((algebraMap R (Module.End R M'')) ↑s) x✝ = (↑e ∘ₗ (algebraMap R (Module.End R M')) ↑s ∘ₗ ↑e.symm) x✝",
" Function.Bijective ⇑((algebraMap R (Mo... | [
" f x₁ = f x₂",
" IsUnit ((algebraMap R (Module.End R M'')) ↑s)",
" (algebraMap R (Module.End R M'')) ↑s = ↑e ∘ₗ (algebraMap R (Module.End R M')) ↑s ∘ₗ ↑e.symm",
" ((algebraMap R (Module.End R M'')) ↑s) x✝ = (↑e ∘ₗ (algebraMap R (Module.End R M')) ↑s ∘ₗ ↑e.symm) x✝",
" Function.Bijective ⇑((algebraMap R (Mo... |
import Batteries.Tactic.Init
import Batteries.Tactic.Alias
import Batteries.Tactic.Lint.Misc
instance {f : α → β} [DecidablePred p] : DecidablePred (p ∘ f) :=
inferInstanceAs <| DecidablePred fun x => p (f x)
@[deprecated] alias proofIrrel := proof_irrel
theorem Function.id_def : @id α = fun x => x := rfl
alias ⟨forall_not_of_not_exists, not_exists_of_forall_not⟩ := not_exists
protected alias ⟨Decidable.exists_not_of_not_forall, _⟩ := Decidable.not_forall
theorem heq_iff_eq : HEq a b ↔ a = b := ⟨eq_of_heq, heq_of_eq⟩
@[simp] theorem eq_rec_constant {α : Sort _} {a a' : α} {β : Sort _} (y : β) (h : a = a') :
(@Eq.rec α a (fun α _ => β) y a' h) = y := by cases h; rfl
theorem congrArg₂ (f : α → β → γ) {x x' : α} {y y' : β}
(hx : x = x') (hy : y = y') : f x y = f x' y' := by subst hx hy; rfl
theorem congrFun₂ {β : α → Sort _} {γ : ∀ a, β a → Sort _}
{f g : ∀ a b, γ a b} (h : f = g) (a : α) (b : β a) :
f a b = g a b :=
congrFun (congrFun h _) _
theorem congrFun₃ {β : α → Sort _} {γ : ∀ a, β a → Sort _} {δ : ∀ a b, γ a b → Sort _}
{f g : ∀ a b c, δ a b c} (h : f = g) (a : α) (b : β a) (c : γ a b) :
f a b c = g a b c :=
congrFun₂ (congrFun h _) _ _
theorem funext₂ {β : α → Sort _} {γ : ∀ a, β a → Sort _}
{f g : ∀ a b, γ a b} (h : ∀ a b, f a b = g a b) : f = g :=
funext fun _ => funext <| h _
theorem funext₃ {β : α → Sort _} {γ : ∀ a, β a → Sort _} {δ : ∀ a b, γ a b → Sort _}
{f g : ∀ a b c, δ a b c} (h : ∀ a b c, f a b c = g a b c) : f = g :=
funext fun _ => funext₂ <| h _
theorem Function.funext_iff {β : α → Sort u} {f₁ f₂ : ∀ x : α, β x} : f₁ = f₂ ↔ ∀ a, f₁ a = f₂ a :=
⟨congrFun, funext⟩
theorem ne_of_apply_ne {α β : Sort _} (f : α → β) {x y : α} : f x ≠ f y → x ≠ y :=
mt <| congrArg _
protected theorem Eq.congr (h₁ : x₁ = y₁) (h₂ : x₂ = y₂) : x₁ = x₂ ↔ y₁ = y₂ := by
subst h₁; subst h₂; rfl
theorem Eq.congr_left {x y z : α} (h : x = y) : x = z ↔ y = z := by rw [h]
| .lake/packages/batteries/Batteries/Logic.lean | 74 | 74 | theorem Eq.congr_right {x y z : α} (h : x = y) : z = x ↔ z = y := by | rw [h]
| [
" h ▸ y = y",
" ⋯ ▸ y = y",
" f x y = f x' y'",
" f x y = f x y",
" x₁ = x₂ ↔ y₁ = y₂",
" x₁ = x₂ ↔ x₁ = y₂",
" x₁ = x₂ ↔ x₁ = x₂",
" x = z ↔ y = z",
" z = x ↔ z = y"
] | [
" h ▸ y = y",
" ⋯ ▸ y = y",
" f x y = f x' y'",
" f x y = f x y",
" x₁ = x₂ ↔ y₁ = y₂",
" x₁ = x₂ ↔ x₁ = y₂",
" x₁ = x₂ ↔ x₁ = x₂",
" x = z ↔ y = z",
" z = x ↔ z = y"
] |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.Deriv.Slope
import Mathlib.Analysis.NormedSpace.FiniteDimension
import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic
#align_import analysis.calculus.fderiv_measurable from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
set_option linter.uppercaseLean3 false -- A B D
noncomputable section
open Set Metric Asymptotics Filter ContinuousLinearMap MeasureTheory TopologicalSpace
open scoped Topology
section fderiv
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
variable {f : E → F} (K : Set (E →L[𝕜] F))
namespace FDerivMeasurableAux
def A (f : E → F) (L : E →L[𝕜] F) (r ε : ℝ) : Set E :=
{ x | ∃ r' ∈ Ioc (r / 2) r, ∀ y ∈ ball x r', ∀ z ∈ ball x r', ‖f z - f y - L (z - y)‖ < ε * r }
#align fderiv_measurable_aux.A FDerivMeasurableAux.A
def B (f : E → F) (K : Set (E →L[𝕜] F)) (r s ε : ℝ) : Set E :=
⋃ L ∈ K, A f L r ε ∩ A f L s ε
#align fderiv_measurable_aux.B FDerivMeasurableAux.B
def D (f : E → F) (K : Set (E →L[𝕜] F)) : Set E :=
⋂ e : ℕ, ⋃ n : ℕ, ⋂ (p ≥ n) (q ≥ n), B f K ((1 / 2) ^ p) ((1 / 2) ^ q) ((1 / 2) ^ e)
#align fderiv_measurable_aux.D FDerivMeasurableAux.D
theorem isOpen_A (L : E →L[𝕜] F) (r ε : ℝ) : IsOpen (A f L r ε) := by
rw [Metric.isOpen_iff]
rintro x ⟨r', r'_mem, hr'⟩
obtain ⟨s, s_gt, s_lt⟩ : ∃ s : ℝ, r / 2 < s ∧ s < r' := exists_between r'_mem.1
have : s ∈ Ioc (r / 2) r := ⟨s_gt, le_of_lt (s_lt.trans_le r'_mem.2)⟩
refine ⟨r' - s, by linarith, fun x' hx' => ⟨s, this, ?_⟩⟩
have B : ball x' s ⊆ ball x r' := ball_subset (le_of_lt hx')
intro y hy z hz
exact hr' y (B hy) z (B hz)
#align fderiv_measurable_aux.is_open_A FDerivMeasurableAux.isOpen_A
theorem isOpen_B {K : Set (E →L[𝕜] F)} {r s ε : ℝ} : IsOpen (B f K r s ε) := by
simp [B, isOpen_biUnion, IsOpen.inter, isOpen_A]
#align fderiv_measurable_aux.is_open_B FDerivMeasurableAux.isOpen_B
theorem A_mono (L : E →L[𝕜] F) (r : ℝ) {ε δ : ℝ} (h : ε ≤ δ) : A f L r ε ⊆ A f L r δ := by
rintro x ⟨r', r'r, hr'⟩
refine ⟨r', r'r, fun y hy z hz => (hr' y hy z hz).trans_le (mul_le_mul_of_nonneg_right h ?_)⟩
linarith [mem_ball.1 hy, r'r.2, @dist_nonneg _ _ y x]
#align fderiv_measurable_aux.A_mono FDerivMeasurableAux.A_mono
| Mathlib/Analysis/Calculus/FDeriv/Measurable.lean | 154 | 159 | theorem le_of_mem_A {r ε : ℝ} {L : E →L[𝕜] F} {x : E} (hx : x ∈ A f L r ε) {y z : E}
(hy : y ∈ closedBall x (r / 2)) (hz : z ∈ closedBall x (r / 2)) :
‖f z - f y - L (z - y)‖ ≤ ε * r := by |
rcases hx with ⟨r', r'mem, hr'⟩
apply le_of_lt
exact hr' _ ((mem_closedBall.1 hy).trans_lt r'mem.1) _ ((mem_closedBall.1 hz).trans_lt r'mem.1)
| [
" IsOpen (A f L r ε)",
" ∀ x ∈ A f L r ε, ∃ ε_1 > 0, ball x ε_1 ⊆ A f L r ε",
" ∃ ε_1 > 0, ball x ε_1 ⊆ A f L r ε",
" r' - s > 0",
" ∀ y ∈ ball x' s, ∀ z ∈ ball x' s, ‖f z - f y - L (z - y)‖ < ε * r",
" ‖f z - f y - L (z - y)‖ < ε * r",
" IsOpen (B f K r s ε)",
" A f L r ε ⊆ A f L r δ",
" x ∈ A f L ... | [
" IsOpen (A f L r ε)",
" ∀ x ∈ A f L r ε, ∃ ε_1 > 0, ball x ε_1 ⊆ A f L r ε",
" ∃ ε_1 > 0, ball x ε_1 ⊆ A f L r ε",
" r' - s > 0",
" ∀ y ∈ ball x' s, ∀ z ∈ ball x' s, ‖f z - f y - L (z - y)‖ < ε * r",
" ‖f z - f y - L (z - y)‖ < ε * r",
" IsOpen (B f K r s ε)",
" A f L r ε ⊆ A f L r δ",
" x ∈ A f L ... |
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Fin.VecNotation
import Mathlib.Data.Sign
import Mathlib.LinearAlgebra.AffineSpace.Combination
import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv
import Mathlib.LinearAlgebra.Basis.VectorSpace
#align_import linear_algebra.affine_space.independent from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0"
noncomputable section
open Finset Function
open scoped Affine
section AffineIndependent
variable (k : Type*) {V : Type*} {P : Type*} [Ring k] [AddCommGroup V] [Module k V]
variable [AffineSpace V P] {ι : Type*}
def AffineIndependent (p : ι → P) : Prop :=
∀ (s : Finset ι) (w : ι → k),
∑ i ∈ s, w i = 0 → s.weightedVSub p w = (0 : V) → ∀ i ∈ s, w i = 0
#align affine_independent AffineIndependent
theorem affineIndependent_def (p : ι → P) :
AffineIndependent k p ↔
∀ (s : Finset ι) (w : ι → k),
∑ i ∈ s, w i = 0 → s.weightedVSub p w = (0 : V) → ∀ i ∈ s, w i = 0 :=
Iff.rfl
#align affine_independent_def affineIndependent_def
theorem affineIndependent_of_subsingleton [Subsingleton ι] (p : ι → P) : AffineIndependent k p :=
fun _ _ h _ i hi => Fintype.eq_of_subsingleton_of_sum_eq h i hi
#align affine_independent_of_subsingleton affineIndependent_of_subsingleton
theorem affineIndependent_iff_of_fintype [Fintype ι] (p : ι → P) :
AffineIndependent k p ↔
∀ w : ι → k, ∑ i, w i = 0 → Finset.univ.weightedVSub p w = (0 : V) → ∀ i, w i = 0 := by
constructor
· exact fun h w hw hs i => h Finset.univ w hw hs i (Finset.mem_univ _)
· intro h s w hw hs i hi
rw [Finset.weightedVSub_indicator_subset _ _ (Finset.subset_univ s)] at hs
rw [← Finset.sum_indicator_subset _ (Finset.subset_univ s)] at hw
replace h := h ((↑s : Set ι).indicator w) hw hs i
simpa [hi] using h
#align affine_independent_iff_of_fintype affineIndependent_iff_of_fintype
| Mathlib/LinearAlgebra/AffineSpace/Independent.lean | 86 | 134 | theorem affineIndependent_iff_linearIndependent_vsub (p : ι → P) (i1 : ι) :
AffineIndependent k p ↔ LinearIndependent k fun i : { x // x ≠ i1 } => (p i -ᵥ p i1 : V) := by |
classical
constructor
· intro h
rw [linearIndependent_iff']
intro s g hg i hi
set f : ι → k := fun x => if hx : x = i1 then -∑ y ∈ s, g y else g ⟨x, hx⟩ with hfdef
let s2 : Finset ι := insert i1 (s.map (Embedding.subtype _))
have hfg : ∀ x : { x // x ≠ i1 }, g x = f x := by
intro x
rw [hfdef]
dsimp only
erw [dif_neg x.property, Subtype.coe_eta]
rw [hfg]
have hf : ∑ ι ∈ s2, f ι = 0 := by
rw [Finset.sum_insert
(Finset.not_mem_map_subtype_of_not_property s (Classical.not_not.2 rfl)),
Finset.sum_subtype_map_embedding fun x _ => (hfg x).symm]
rw [hfdef]
dsimp only
rw [dif_pos rfl]
exact neg_add_self _
have hs2 : s2.weightedVSub p f = (0 : V) := by
set f2 : ι → V := fun x => f x • (p x -ᵥ p i1) with hf2def
set g2 : { x // x ≠ i1 } → V := fun x => g x • (p x -ᵥ p i1)
have hf2g2 : ∀ x : { x // x ≠ i1 }, f2 x = g2 x := by
simp only [g2, hf2def]
refine fun x => ?_
rw [hfg]
rw [Finset.weightedVSub_eq_weightedVSubOfPoint_of_sum_eq_zero s2 f p hf (p i1),
Finset.weightedVSubOfPoint_insert, Finset.weightedVSubOfPoint_apply,
Finset.sum_subtype_map_embedding fun x _ => hf2g2 x]
exact hg
exact h s2 f hf hs2 i (Finset.mem_insert_of_mem (Finset.mem_map.2 ⟨i, hi, rfl⟩))
· intro h
rw [linearIndependent_iff'] at h
intro s w hw hs i hi
rw [Finset.weightedVSub_eq_weightedVSubOfPoint_of_sum_eq_zero s w p hw (p i1), ←
s.weightedVSubOfPoint_erase w p i1, Finset.weightedVSubOfPoint_apply] at hs
let f : ι → V := fun i => w i • (p i -ᵥ p i1)
have hs2 : (∑ i ∈ (s.erase i1).subtype fun i => i ≠ i1, f i) = 0 := by
rw [← hs]
convert Finset.sum_subtype_of_mem f fun x => Finset.ne_of_mem_erase
have h2 := h ((s.erase i1).subtype fun i => i ≠ i1) (fun x => w x) hs2
simp_rw [Finset.mem_subtype] at h2
have h2b : ∀ i ∈ s, i ≠ i1 → w i = 0 := fun i his hi =>
h2 ⟨i, hi⟩ (Finset.mem_erase_of_ne_of_mem hi his)
exact Finset.eq_zero_of_sum_eq_zero hw h2b i hi
| [
" AffineIndependent k p ↔ ∀ (w : ι → k), ∑ i : ι, w i = 0 → (univ.weightedVSub p) w = 0 → ∀ (i : ι), w i = 0",
" AffineIndependent k p → ∀ (w : ι → k), ∑ i : ι, w i = 0 → (univ.weightedVSub p) w = 0 → ∀ (i : ι), w i = 0",
" (∀ (w : ι → k), ∑ i : ι, w i = 0 → (univ.weightedVSub p) w = 0 → ∀ (i : ι), w i = 0) → A... | [
" AffineIndependent k p ↔ ∀ (w : ι → k), ∑ i : ι, w i = 0 → (univ.weightedVSub p) w = 0 → ∀ (i : ι), w i = 0",
" AffineIndependent k p → ∀ (w : ι → k), ∑ i : ι, w i = 0 → (univ.weightedVSub p) w = 0 → ∀ (i : ι), w i = 0",
" (∀ (w : ι → k), ∑ i : ι, w i = 0 → (univ.weightedVSub p) w = 0 → ∀ (i : ι), w i = 0) → A... |
import Mathlib.Algebra.Order.Ring.Abs
import Mathlib.Tactic.Ring
#align_import data.nat.hyperoperation from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
def hyperoperation : ℕ → ℕ → ℕ → ℕ
| 0, _, k => k + 1
| 1, m, 0 => m
| 2, _, 0 => 0
| _ + 3, _, 0 => 1
| n + 1, m, k + 1 => hyperoperation n m (hyperoperation (n + 1) m k)
#align hyperoperation hyperoperation
-- Basic hyperoperation lemmas
@[simp]
theorem hyperoperation_zero (m : ℕ) : hyperoperation 0 m = Nat.succ :=
funext fun k => by rw [hyperoperation, Nat.succ_eq_add_one]
#align hyperoperation_zero hyperoperation_zero
theorem hyperoperation_ge_three_eq_one (n m : ℕ) : hyperoperation (n + 3) m 0 = 1 := by
rw [hyperoperation]
#align hyperoperation_ge_three_eq_one hyperoperation_ge_three_eq_one
theorem hyperoperation_recursion (n m k : ℕ) :
hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k) := by
rw [hyperoperation]
#align hyperoperation_recursion hyperoperation_recursion
-- Interesting hyperoperation lemmas
@[simp]
theorem hyperoperation_one : hyperoperation 1 = (· + ·) := by
ext m k
induction' k with bn bih
· rw [Nat.add_zero m, hyperoperation]
· rw [hyperoperation_recursion, bih, hyperoperation_zero]
exact Nat.add_assoc m bn 1
#align hyperoperation_one hyperoperation_one
@[simp]
theorem hyperoperation_two : hyperoperation 2 = (· * ·) := by
ext m k
induction' k with bn bih
· rw [hyperoperation]
exact (Nat.mul_zero m).symm
· rw [hyperoperation_recursion, hyperoperation_one, bih]
-- Porting note: was `ring`
dsimp only
nth_rewrite 1 [← mul_one m]
rw [← mul_add, add_comm]
#align hyperoperation_two hyperoperation_two
@[simp]
theorem hyperoperation_three : hyperoperation 3 = (· ^ ·) := by
ext m k
induction' k with bn bih
· rw [hyperoperation_ge_three_eq_one]
exact (pow_zero m).symm
· rw [hyperoperation_recursion, hyperoperation_two, bih]
exact (pow_succ' m bn).symm
#align hyperoperation_three hyperoperation_three
theorem hyperoperation_ge_two_eq_self (n m : ℕ) : hyperoperation (n + 2) m 1 = m := by
induction' n with nn nih
· rw [hyperoperation_two]
ring
· rw [hyperoperation_recursion, hyperoperation_ge_three_eq_one, nih]
#align hyperoperation_ge_two_eq_self hyperoperation_ge_two_eq_self
theorem hyperoperation_two_two_eq_four (n : ℕ) : hyperoperation (n + 1) 2 2 = 4 := by
induction' n with nn nih
· rw [hyperoperation_one]
· rw [hyperoperation_recursion, hyperoperation_ge_two_eq_self, nih]
#align hyperoperation_two_two_eq_four hyperoperation_two_two_eq_four
| Mathlib/Data/Nat/Hyperoperation.lean | 104 | 113 | theorem hyperoperation_ge_three_one (n : ℕ) : ∀ k : ℕ, hyperoperation (n + 3) 1 k = 1 := by |
induction' n with nn nih
· intro k
rw [hyperoperation_three]
dsimp
rw [one_pow]
· intro k
cases k
· rw [hyperoperation_ge_three_eq_one]
· rw [hyperoperation_recursion, nih]
| [
" hyperoperation 0 m k = k.succ",
" hyperoperation (n + 3) m 0 = 1",
" hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k)",
" hyperoperation 1 = fun x x_1 => x + x_1",
" hyperoperation 1 m k = m + k",
" hyperoperation 1 m 0 = m + 0",
" hyperoperation 1 m (bn + 1) = m + (b... | [
" hyperoperation 0 m k = k.succ",
" hyperoperation (n + 3) m 0 = 1",
" hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k)",
" hyperoperation 1 = fun x x_1 => x + x_1",
" hyperoperation 1 m k = m + k",
" hyperoperation 1 m 0 = m + 0",
" hyperoperation 1 m (bn + 1) = m + (b... |
import Mathlib.Order.Filter.CountableInter
set_option autoImplicit true
open Function Set Filter
class HasCountableSeparatingOn (α : Type*) (p : Set α → Prop) (t : Set α) : Prop where
exists_countable_separating : ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧
∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y
theorem exists_countable_separating (α : Type*) (p : Set α → Prop) (t : Set α)
[h : HasCountableSeparatingOn α p t] :
∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧
∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y :=
h.1
theorem exists_nonempty_countable_separating (α : Type*) {p : Set α → Prop} {s₀} (hp : p s₀)
(t : Set α) [HasCountableSeparatingOn α p t] :
∃ S : Set (Set α), S.Nonempty ∧ S.Countable ∧ (∀ s ∈ S, p s) ∧
∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y :=
let ⟨S, hSc, hSp, hSt⟩ := exists_countable_separating α p t
⟨insert s₀ S, insert_nonempty _ _, hSc.insert _, forall_insert_of_forall hSp hp,
fun x hx y hy hxy ↦ hSt x hx y hy <| forall_of_forall_insert hxy⟩
| Mathlib/Order/Filter/CountableSeparatingOn.lean | 103 | 109 | theorem exists_seq_separating (α : Type*) {p : Set α → Prop} {s₀} (hp : p s₀) (t : Set α)
[HasCountableSeparatingOn α p t] :
∃ S : ℕ → Set α, (∀ n, p (S n)) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ n, x ∈ S n ↔ y ∈ S n) → x = y := by |
rcases exists_nonempty_countable_separating α hp t with ⟨S, hSne, hSc, hS⟩
rcases hSc.exists_eq_range hSne with ⟨S, rfl⟩
use S
simpa only [forall_mem_range] using hS
| [
" ∃ S, (∀ (n : ℕ), p (S n)) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ (n : ℕ), x ∈ S n ↔ y ∈ S n) → x = y",
" (∀ (n : ℕ), p (S n)) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ (n : ℕ), x ∈ S n ↔ y ∈ S n) → x = y"
] | [
" ∃ S, (∀ (n : ℕ), p (S n)) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ (n : ℕ), x ∈ S n ↔ y ∈ S n) → x = y"
] |
import Mathlib.RingTheory.FiniteType
#align_import ring_theory.rees_algebra from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u v
variable {R M : Type u} [CommRing R] [AddCommGroup M] [Module R M] (I : Ideal R)
open Polynomial
open Polynomial
def reesAlgebra : Subalgebra R R[X] where
carrier := { f | ∀ i, f.coeff i ∈ I ^ i }
mul_mem' hf hg i := by
rw [coeff_mul]
apply Ideal.sum_mem
rintro ⟨j, k⟩ e
rw [← Finset.mem_antidiagonal.mp e, pow_add]
exact Ideal.mul_mem_mul (hf j) (hg k)
one_mem' i := by
rw [coeff_one]
split_ifs with h
· subst h
simp
· simp
add_mem' hf hg i := by
rw [coeff_add]
exact Ideal.add_mem _ (hf i) (hg i)
zero_mem' i := Ideal.zero_mem _
algebraMap_mem' r i := by
rw [algebraMap_apply, coeff_C]
split_ifs with h
· subst h
simp
· simp
#align rees_algebra reesAlgebra
theorem mem_reesAlgebra_iff (f : R[X]) : f ∈ reesAlgebra I ↔ ∀ i, f.coeff i ∈ I ^ i :=
Iff.rfl
#align mem_rees_algebra_iff mem_reesAlgebra_iff
theorem mem_reesAlgebra_iff_support (f : R[X]) :
f ∈ reesAlgebra I ↔ ∀ i ∈ f.support, f.coeff i ∈ I ^ i := by
apply forall_congr'
intro a
rw [mem_support_iff, Iff.comm, Classical.imp_iff_right_iff, Ne, ← imp_iff_not_or]
exact fun e => e.symm ▸ (I ^ a).zero_mem
#align mem_rees_algebra_iff_support mem_reesAlgebra_iff_support
theorem reesAlgebra.monomial_mem {I : Ideal R} {i : ℕ} {r : R} :
monomial i r ∈ reesAlgebra I ↔ r ∈ I ^ i := by
simp (config := { contextual := true }) [mem_reesAlgebra_iff_support, coeff_monomial, ←
imp_iff_not_or]
#align rees_algebra.monomial_mem reesAlgebra.monomial_mem
| Mathlib/RingTheory/ReesAlgebra.lean | 82 | 95 | theorem monomial_mem_adjoin_monomial {I : Ideal R} {n : ℕ} {r : R} (hr : r ∈ I ^ n) :
monomial n r ∈ Algebra.adjoin R (Submodule.map (monomial 1 : R →ₗ[R] R[X]) I : Set R[X]) := by |
induction' n with n hn generalizing r
· exact Subalgebra.algebraMap_mem _ _
· rw [pow_succ'] at hr
apply Submodule.smul_induction_on
-- Porting note: did not need help with motive previously
(p := fun r => (monomial (Nat.succ n)) r ∈ Algebra.adjoin R (Submodule.map (monomial 1) I)) hr
· intro r hr s hs
rw [Nat.succ_eq_one_add, smul_eq_mul, ← monomial_mul_monomial]
exact Subalgebra.mul_mem _ (Algebra.subset_adjoin (Set.mem_image_of_mem _ hr)) (hn hs)
· intro x y hx hy
rw [monomial_add]
exact Subalgebra.add_mem _ hx hy
| [
" (a✝ * b✝).coeff i ∈ I ^ i",
" ∑ x ∈ Finset.antidiagonal i, a✝.coeff x.1 * b✝.coeff x.2 ∈ I ^ i",
" ∀ c ∈ Finset.antidiagonal i, a✝.coeff c.1 * b✝.coeff c.2 ∈ I ^ i",
" a✝.coeff (j, k).1 * b✝.coeff (j, k).2 ∈ I ^ i",
" a✝.coeff (j, k).1 * b✝.coeff (j, k).2 ∈ I ^ (j, k).1 * I ^ (j, k).2",
" coeff 1 i ∈ I ... | [
" (a✝ * b✝).coeff i ∈ I ^ i",
" ∑ x ∈ Finset.antidiagonal i, a✝.coeff x.1 * b✝.coeff x.2 ∈ I ^ i",
" ∀ c ∈ Finset.antidiagonal i, a✝.coeff c.1 * b✝.coeff c.2 ∈ I ^ i",
" a✝.coeff (j, k).1 * b✝.coeff (j, k).2 ∈ I ^ i",
" a✝.coeff (j, k).1 * b✝.coeff (j, k).2 ∈ I ^ (j, k).1 * I ^ (j, k).2",
" coeff 1 i ∈ I ... |
import Mathlib.Algebra.Group.Subsemigroup.Basic
#align_import group_theory.subsemigroup.membership from "leanprover-community/mathlib"@"6cb77a8eaff0ddd100e87b1591c6d3ad319514ff"
assert_not_exists MonoidWithZero
variable {ι : Sort*} {M A B : Type*}
section NonAssoc
variable [Mul M]
open Set
namespace Subsemigroup
-- TODO: this section can be generalized to `[MulMemClass B M] [CompleteLattice B]`
-- such that `complete_lattice.le` coincides with `set_like.le`
@[to_additive]
theorem mem_iSup_of_directed {S : ι → Subsemigroup M} (hS : Directed (· ≤ ·) S) {x : M} :
(x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i := by
refine ⟨?_, fun ⟨i, hi⟩ ↦ le_iSup S i hi⟩
suffices x ∈ closure (⋃ i, (S i : Set M)) → ∃ i, x ∈ S i by
simpa only [closure_iUnion, closure_eq (S _)] using this
refine fun hx ↦ closure_induction hx (fun y hy ↦ mem_iUnion.mp hy) ?_
rintro x y ⟨i, hi⟩ ⟨j, hj⟩
rcases hS i j with ⟨k, hki, hkj⟩
exact ⟨k, (S k).mul_mem (hki hi) (hkj hj)⟩
#align subsemigroup.mem_supr_of_directed Subsemigroup.mem_iSup_of_directed
#align add_subsemigroup.mem_supr_of_directed AddSubsemigroup.mem_iSup_of_directed
@[to_additive]
theorem coe_iSup_of_directed {S : ι → Subsemigroup M} (hS : Directed (· ≤ ·) S) :
((⨆ i, S i : Subsemigroup M) : Set M) = ⋃ i, S i :=
Set.ext fun x => by simp [mem_iSup_of_directed hS]
#align subsemigroup.coe_supr_of_directed Subsemigroup.coe_iSup_of_directed
#align add_subsemigroup.coe_supr_of_directed AddSubsemigroup.coe_iSup_of_directed
@[to_additive]
theorem mem_sSup_of_directed_on {S : Set (Subsemigroup M)} (hS : DirectedOn (· ≤ ·) S) {x : M} :
x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by
simp only [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, SetCoe.exists, Subtype.coe_mk,
exists_prop]
#align subsemigroup.mem_Sup_of_directed_on Subsemigroup.mem_sSup_of_directed_on
#align add_subsemigroup.mem_Sup_of_directed_on AddSubsemigroup.mem_sSup_of_directed_on
@[to_additive]
theorem coe_sSup_of_directed_on {S : Set (Subsemigroup M)} (hS : DirectedOn (· ≤ ·) S) :
(↑(sSup S) : Set M) = ⋃ s ∈ S, ↑s :=
Set.ext fun x => by simp [mem_sSup_of_directed_on hS]
#align subsemigroup.coe_Sup_of_directed_on Subsemigroup.coe_sSup_of_directed_on
#align add_subsemigroup.coe_Sup_of_directed_on AddSubsemigroup.coe_sSup_of_directed_on
@[to_additive]
theorem mem_sup_left {S T : Subsemigroup M} : ∀ {x : M}, x ∈ S → x ∈ S ⊔ T := by
have : S ≤ S ⊔ T := le_sup_left
tauto
#align subsemigroup.mem_sup_left Subsemigroup.mem_sup_left
#align add_subsemigroup.mem_sup_left AddSubsemigroup.mem_sup_left
@[to_additive]
theorem mem_sup_right {S T : Subsemigroup M} : ∀ {x : M}, x ∈ T → x ∈ S ⊔ T := by
have : T ≤ S ⊔ T := le_sup_right
tauto
#align subsemigroup.mem_sup_right Subsemigroup.mem_sup_right
#align add_subsemigroup.mem_sup_right AddSubsemigroup.mem_sup_right
@[to_additive]
theorem mul_mem_sup {S T : Subsemigroup M} {x y : M} (hx : x ∈ S) (hy : y ∈ T) : x * y ∈ S ⊔ T :=
mul_mem (mem_sup_left hx) (mem_sup_right hy)
#align subsemigroup.mul_mem_sup Subsemigroup.mul_mem_sup
#align add_subsemigroup.add_mem_sup AddSubsemigroup.add_mem_sup
@[to_additive]
theorem mem_iSup_of_mem {S : ι → Subsemigroup M} (i : ι) : ∀ {x : M}, x ∈ S i → x ∈ iSup S := by
have : S i ≤ iSup S := le_iSup _ _
tauto
#align subsemigroup.mem_supr_of_mem Subsemigroup.mem_iSup_of_mem
#align add_subsemigroup.mem_supr_of_mem AddSubsemigroup.mem_iSup_of_mem
@[to_additive]
theorem mem_sSup_of_mem {S : Set (Subsemigroup M)} {s : Subsemigroup M} (hs : s ∈ S) :
∀ {x : M}, x ∈ s → x ∈ sSup S := by
have : s ≤ sSup S := le_sSup hs
tauto
#align subsemigroup.mem_Sup_of_mem Subsemigroup.mem_sSup_of_mem
#align add_subsemigroup.mem_Sup_of_mem AddSubsemigroup.mem_sSup_of_mem
@[to_additive (attr := elab_as_elim)
"An induction principle for elements of `⨆ i, S i`. If `C` holds all
elements of `S i` for all `i`, and is preserved under addition, then it holds for all elements of
the supremum of `S`."]
| Mathlib/Algebra/Group/Subsemigroup/Membership.lean | 123 | 128 | theorem iSup_induction (S : ι → Subsemigroup M) {C : M → Prop} {x₁ : M} (hx₁ : x₁ ∈ ⨆ i, S i)
(mem : ∀ i, ∀ x₂ ∈ S i, C x₂) (mul : ∀ x y, C x → C y → C (x * y)) : C x₁ := by |
rw [iSup_eq_closure] at hx₁
refine closure_induction hx₁ (fun x₂ hx₂ => ?_) mul
obtain ⟨i, hi⟩ := Set.mem_iUnion.mp hx₂
exact mem _ _ hi
| [
" x ∈ ⨆ i, S i ↔ ∃ i, x ∈ S i",
" x ∈ ⨆ i, S i → ∃ i, x ∈ S i",
" x ∈ closure (⋃ i, ↑(S i)) → ∃ i, x ∈ S i",
" ∀ (x y : M), (∃ i, x ∈ S i) → (∃ i, y ∈ S i) → ∃ i, x * y ∈ S i",
" ∃ i, x * y ∈ S i",
" x ∈ ↑(⨆ i, S i) ↔ x ∈ ⋃ i, ↑(S i)",
" x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s",
" x ∈ ↑(sSup S) ↔ x ∈ ⋃ s ∈ S, ↑s"... | [
" x ∈ ⨆ i, S i ↔ ∃ i, x ∈ S i",
" x ∈ ⨆ i, S i → ∃ i, x ∈ S i",
" x ∈ closure (⋃ i, ↑(S i)) → ∃ i, x ∈ S i",
" ∀ (x y : M), (∃ i, x ∈ S i) → (∃ i, y ∈ S i) → ∃ i, x * y ∈ S i",
" ∃ i, x * y ∈ S i",
" x ∈ ↑(⨆ i, S i) ↔ x ∈ ⋃ i, ↑(S i)",
" x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s",
" x ∈ ↑(sSup S) ↔ x ∈ ⋃ s ∈ S, ↑s"... |
import Mathlib.Order.ConditionallyCompleteLattice.Basic
#align_import order.monotone.extension from "leanprover-community/mathlib"@"422e70f7ce183d2900c586a8cda8381e788a0c62"
open Set
variable {α β : Type*} [LinearOrder α] [ConditionallyCompleteLinearOrder β] {f : α → β} {s : Set α}
{a b : α}
| Mathlib/Order/Monotone/Extension.lean | 25 | 48 | theorem MonotoneOn.exists_monotone_extension (h : MonotoneOn f s) (hl : BddBelow (f '' s))
(hu : BddAbove (f '' s)) : ∃ g : α → β, Monotone g ∧ EqOn f g s := by |
classical
/- The extension is defined by `f x = f a` for `x ≤ a`, and `f x` is the supremum of the values
of `f` to the left of `x` for `x ≥ a`. -/
rcases hl with ⟨a, ha⟩
have hu' : ∀ x, BddAbove (f '' (Iic x ∩ s)) := fun x =>
hu.mono (image_subset _ inter_subset_right)
let g : α → β := fun x => if Disjoint (Iic x) s then a else sSup (f '' (Iic x ∩ s))
have hgs : EqOn f g s := by
intro x hx
simp only [g]
have : IsGreatest (Iic x ∩ s) x := ⟨⟨right_mem_Iic, hx⟩, fun y hy => hy.1⟩
rw [if_neg this.nonempty.not_disjoint,
((h.mono inter_subset_right).map_isGreatest this).csSup_eq]
refine ⟨g, fun x y hxy => ?_, hgs⟩
by_cases hx : Disjoint (Iic x) s <;> by_cases hy : Disjoint (Iic y) s <;>
simp only [g, if_pos, if_neg, not_false_iff, *, refl]
· rcases not_disjoint_iff_nonempty_inter.1 hy with ⟨z, hz⟩
exact le_csSup_of_le (hu' _) (mem_image_of_mem _ hz) (ha <| mem_image_of_mem _ hz.2)
· exact (hx <| hy.mono_left <| Iic_subset_Iic.2 hxy).elim
· rw [not_disjoint_iff_nonempty_inter] at hx hy
refine csSup_le_csSup (hu' _) (hx.image _) (image_subset _ ?_)
exact inter_subset_inter_left _ (Iic_subset_Iic.2 hxy)
| [
" ∃ g, Monotone g ∧ EqOn f g s",
" EqOn f g s",
" f x = g x",
" f x = if Disjoint (Iic x) s then a else sSup (f '' (Iic x ∩ s))",
" g x ≤ g y",
" a ≤ sSup (f '' (Iic y ∩ s))",
" sSup (f '' (Iic x ∩ s)) ≤ a",
" sSup (f '' (Iic x ∩ s)) ≤ sSup (f '' (Iic y ∩ s))",
" Iic x ∩ s ⊆ Iic y ∩ s"
] | [
" ∃ g, Monotone g ∧ EqOn f g s"
] |
import Mathlib.Algebra.ContinuedFractions.Computation.Approximations
import Mathlib.Algebra.ContinuedFractions.Computation.CorrectnessTerminating
import Mathlib.Data.Rat.Floor
#align_import algebra.continued_fractions.computation.terminates_iff_rat from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
namespace GeneralizedContinuedFraction
open GeneralizedContinuedFraction (of)
variable {K : Type*} [LinearOrderedField K] [FloorRing K]
attribute [local simp] Pair.map IntFractPair.mapFr
section RatOfTerminates
variable (v : K) (n : ℕ)
nonrec theorem exists_gcf_pair_rat_eq_of_nth_conts_aux :
∃ conts : Pair ℚ, (of v).continuantsAux n = (conts.map (↑) : Pair K) :=
Nat.strong_induction_on n
(by
clear n
let g := of v
intro n IH
rcases n with (_ | _ | n)
-- n = 0
· suffices ∃ gp : Pair ℚ, Pair.mk (1 : K) 0 = gp.map (↑) by simpa [continuantsAux]
use Pair.mk 1 0
simp
-- n = 1
· suffices ∃ conts : Pair ℚ, Pair.mk g.h 1 = conts.map (↑) by simpa [continuantsAux]
use Pair.mk ⌊v⌋ 1
simp [g]
-- 2 ≤ n
· cases' IH (n + 1) <| lt_add_one (n + 1) with pred_conts pred_conts_eq
-- invoke the IH
cases' s_ppred_nth_eq : g.s.get? n with gp_n
-- option.none
· use pred_conts
have : g.continuantsAux (n + 2) = g.continuantsAux (n + 1) :=
continuantsAux_stable_of_terminated (n + 1).le_succ s_ppred_nth_eq
simp only [this, pred_conts_eq]
-- option.some
· -- invoke the IH a second time
cases' IH n <| lt_of_le_of_lt n.le_succ <| lt_add_one <| n + 1 with ppred_conts
ppred_conts_eq
obtain ⟨a_eq_one, z, b_eq_z⟩ : gp_n.a = 1 ∧ ∃ z : ℤ, gp_n.b = (z : K) :=
of_part_num_eq_one_and_exists_int_part_denom_eq s_ppred_nth_eq
-- finally, unfold the recurrence to obtain the required rational value.
simp only [a_eq_one, b_eq_z,
continuantsAux_recurrence s_ppred_nth_eq ppred_conts_eq pred_conts_eq]
use nextContinuants 1 (z : ℚ) ppred_conts pred_conts
cases ppred_conts; cases pred_conts
simp [nextContinuants, nextNumerator, nextDenominator])
#align generalized_continued_fraction.exists_gcf_pair_rat_eq_of_nth_conts_aux GeneralizedContinuedFraction.exists_gcf_pair_rat_eq_of_nth_conts_aux
theorem exists_gcf_pair_rat_eq_nth_conts :
∃ conts : Pair ℚ, (of v).continuants n = (conts.map (↑) : Pair K) := by
rw [nth_cont_eq_succ_nth_cont_aux]; exact exists_gcf_pair_rat_eq_of_nth_conts_aux v <| n + 1
#align generalized_continued_fraction.exists_gcf_pair_rat_eq_nth_conts GeneralizedContinuedFraction.exists_gcf_pair_rat_eq_nth_conts
theorem exists_rat_eq_nth_numerator : ∃ q : ℚ, (of v).numerators n = (q : K) := by
rcases exists_gcf_pair_rat_eq_nth_conts v n with ⟨⟨a, _⟩, nth_cont_eq⟩
use a
simp [num_eq_conts_a, nth_cont_eq]
#align generalized_continued_fraction.exists_rat_eq_nth_numerator GeneralizedContinuedFraction.exists_rat_eq_nth_numerator
theorem exists_rat_eq_nth_denominator : ∃ q : ℚ, (of v).denominators n = (q : K) := by
rcases exists_gcf_pair_rat_eq_nth_conts v n with ⟨⟨_, b⟩, nth_cont_eq⟩
use b
simp [denom_eq_conts_b, nth_cont_eq]
#align generalized_continued_fraction.exists_rat_eq_nth_denominator GeneralizedContinuedFraction.exists_rat_eq_nth_denominator
theorem exists_rat_eq_nth_convergent : ∃ q : ℚ, (of v).convergents n = (q : K) := by
rcases exists_rat_eq_nth_numerator v n with ⟨Aₙ, nth_num_eq⟩
rcases exists_rat_eq_nth_denominator v n with ⟨Bₙ, nth_denom_eq⟩
use Aₙ / Bₙ
simp [nth_num_eq, nth_denom_eq, convergent_eq_num_div_denom]
#align generalized_continued_fraction.exists_rat_eq_nth_convergent GeneralizedContinuedFraction.exists_rat_eq_nth_convergent
variable {v}
| Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean | 129 | 135 | theorem exists_rat_eq_of_terminates (terminates : (of v).Terminates) : ∃ q : ℚ, v = ↑q := by |
obtain ⟨n, v_eq_conv⟩ : ∃ n, v = (of v).convergents n :=
of_correctness_of_terminates terminates
obtain ⟨q, conv_eq_q⟩ : ∃ q : ℚ, (of v).convergents n = (↑q : K) :=
exists_rat_eq_nth_convergent v n
have : v = (↑q : K) := Eq.trans v_eq_conv conv_eq_q
use q, this
| [
" ∀ (n : ℕ),\n (∀ m < n, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts) →\n ∃ conts, (of v).continuantsAux n = Pair.map Rat.cast conts",
" ∃ conts, (of v).continuantsAux n = Pair.map Rat.cast conts",
" ∃ conts, (of v).continuantsAux 0 = Pair.map Rat.cast conts",
" ∃ gp, { a := 1, b := 0 }... | [
" ∀ (n : ℕ),\n (∀ m < n, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts) →\n ∃ conts, (of v).continuantsAux n = Pair.map Rat.cast conts",
" ∃ conts, (of v).continuantsAux n = Pair.map Rat.cast conts",
" ∃ conts, (of v).continuantsAux 0 = Pair.map Rat.cast conts",
" ∃ gp, { a := 1, b := 0 }... |
import Mathlib.Algebra.BigOperators.Intervals
import Mathlib.Topology.Algebra.InfiniteSum.Order
import Mathlib.Topology.Instances.Real
import Mathlib.Topology.Instances.ENNReal
#align_import topology.algebra.infinite_sum.real from "leanprover-community/mathlib"@"9a59dcb7a2d06bf55da57b9030169219980660cd"
open Filter Finset NNReal Topology
variable {α β : Type*} [PseudoMetricSpace α] {f : ℕ → α} {a : α}
| Mathlib/Topology/Algebra/InfiniteSum/Real.lean | 26 | 31 | theorem cauchySeq_of_dist_le_of_summable (d : ℕ → ℝ) (hf : ∀ n, dist (f n) (f n.succ) ≤ d n)
(hd : Summable d) : CauchySeq f := by |
lift d to ℕ → ℝ≥0 using fun n ↦ dist_nonneg.trans (hf n)
apply cauchySeq_of_edist_le_of_summable d (α := α) (f := f)
· exact_mod_cast hf
· exact_mod_cast hd
| [
" CauchySeq f",
" ∀ (n : ℕ), edist (f n) (f n.succ) ≤ ↑(d n)",
" Summable d"
] | [
" CauchySeq f"
] |
import Mathlib.Topology.Algebra.UniformConvergence
#align_import topology.algebra.module.strong_topology from "leanprover-community/mathlib"@"8905e5ed90859939681a725b00f6063e65096d95"
open scoped Topology UniformConvergence
section General
variable {𝕜₁ 𝕜₂ : Type*} [NormedField 𝕜₁] [NormedField 𝕜₂] (σ : 𝕜₁ →+* 𝕜₂) {E E' F F' : Type*}
[AddCommGroup E] [Module 𝕜₁ E] [AddCommGroup E'] [Module ℝ E'] [AddCommGroup F] [Module 𝕜₂ F]
[AddCommGroup F'] [Module ℝ F'] [TopologicalSpace E] [TopologicalSpace E'] (F)
@[nolint unusedArguments]
def UniformConvergenceCLM [TopologicalSpace F] [TopologicalAddGroup F] (_ : Set (Set E)) :=
E →SL[σ] F
namespace UniformConvergenceCLM
instance instFunLike [TopologicalSpace F] [TopologicalAddGroup F]
(𝔖 : Set (Set E)) : FunLike (UniformConvergenceCLM σ F 𝔖) E F :=
ContinuousLinearMap.funLike
instance instContinuousSemilinearMapClass [TopologicalSpace F] [TopologicalAddGroup F]
(𝔖 : Set (Set E)) : ContinuousSemilinearMapClass (UniformConvergenceCLM σ F 𝔖) σ E F :=
ContinuousLinearMap.continuousSemilinearMapClass
instance instTopologicalSpace [TopologicalSpace F] [TopologicalAddGroup F] (𝔖 : Set (Set E)) :
TopologicalSpace (UniformConvergenceCLM σ F 𝔖) :=
(@UniformOnFun.topologicalSpace E F (TopologicalAddGroup.toUniformSpace F) 𝔖).induced
(DFunLike.coe : (UniformConvergenceCLM σ F 𝔖) → (E →ᵤ[𝔖] F))
#align continuous_linear_map.strong_topology UniformConvergenceCLM.instTopologicalSpace
theorem topologicalSpace_eq [UniformSpace F] [UniformAddGroup F] (𝔖 : Set (Set E)) :
instTopologicalSpace σ F 𝔖 = TopologicalSpace.induced DFunLike.coe
(UniformOnFun.topologicalSpace E F 𝔖) := by
rw [instTopologicalSpace]
congr
exact UniformAddGroup.toUniformSpace_eq
instance instUniformSpace [UniformSpace F] [UniformAddGroup F]
(𝔖 : Set (Set E)) : UniformSpace (UniformConvergenceCLM σ F 𝔖) :=
UniformSpace.replaceTopology
((UniformOnFun.uniformSpace E F 𝔖).comap
(DFunLike.coe : (UniformConvergenceCLM σ F 𝔖) → (E →ᵤ[𝔖] F)))
(by rw [UniformConvergenceCLM.instTopologicalSpace, UniformAddGroup.toUniformSpace_eq]; rfl)
#align continuous_linear_map.strong_uniformity UniformConvergenceCLM.instUniformSpace
| Mathlib/Topology/Algebra/Module/StrongTopology.lean | 113 | 115 | theorem uniformSpace_eq [UniformSpace F] [UniformAddGroup F] (𝔖 : Set (Set E)) :
instUniformSpace σ F 𝔖 = UniformSpace.comap DFunLike.coe (UniformOnFun.uniformSpace E F 𝔖) := by |
rw [instUniformSpace, UniformSpace.replaceTopology_eq]
| [
" instTopologicalSpace σ F 𝔖 = TopologicalSpace.induced DFunLike.coe (UniformOnFun.topologicalSpace E F 𝔖)",
" TopologicalSpace.induced DFunLike.coe (UniformOnFun.topologicalSpace E F 𝔖) =\n TopologicalSpace.induced DFunLike.coe (UniformOnFun.topologicalSpace E F 𝔖)",
" TopologicalAddGroup.toUniformSpace... | [
" instTopologicalSpace σ F 𝔖 = TopologicalSpace.induced DFunLike.coe (UniformOnFun.topologicalSpace E F 𝔖)",
" TopologicalSpace.induced DFunLike.coe (UniformOnFun.topologicalSpace E F 𝔖) =\n TopologicalSpace.induced DFunLike.coe (UniformOnFun.topologicalSpace E F 𝔖)",
" TopologicalAddGroup.toUniformSpace... |
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]
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]
#align finset.fold_cons Finset.fold_cons
@[simp]
theorem fold_insert [DecidableEq α] (h : a ∉ s) :
(insert a s).fold op b f = f a * s.fold op b f := by
unfold fold
rw [insert_val, ndinsert_of_not_mem h, Multiset.map_cons, fold_cons_left]
#align finset.fold_insert Finset.fold_insert
@[simp]
theorem fold_singleton : ({a} : Finset α).fold op b f = f a * b :=
rfl
#align finset.fold_singleton Finset.fold_singleton
@[simp]
theorem fold_map {g : γ ↪ α} {s : Finset γ} : (s.map g).fold op b f = s.fold op b (f ∘ g) := by
simp only [fold, map, Multiset.map_map]
#align finset.fold_map Finset.fold_map
@[simp]
theorem fold_image [DecidableEq α] {g : γ → α} {s : Finset γ}
(H : ∀ x ∈ s, ∀ y ∈ s, g x = g y → x = y) : (s.image g).fold op b f = s.fold op b (f ∘ g) := by
simp only [fold, image_val_of_injOn H, Multiset.map_map]
#align finset.fold_image Finset.fold_image
@[congr]
theorem fold_congr {g : α → β} (H : ∀ x ∈ s, f x = g x) : s.fold op b f = s.fold op b g := by
rw [fold, fold, map_congr rfl H]
#align finset.fold_congr Finset.fold_congr
theorem fold_op_distrib {f g : α → β} {b₁ b₂ : β} :
(s.fold op (b₁ * b₂) fun x => f x * g x) = s.fold op b₁ f * s.fold op b₂ g := by
simp only [fold, fold_distrib]
#align finset.fold_op_distrib Finset.fold_op_distrib
theorem fold_const [hd : Decidable (s = ∅)] (c : β) (h : op c (op b c) = op b c) :
Finset.fold op b (fun _ => c) s = if s = ∅ then b else op b c := by
classical
induction' s using Finset.induction_on with x s hx IH generalizing hd
· simp
· simp only [Finset.fold_insert hx, IH, if_false, Finset.insert_ne_empty]
split_ifs
· rw [hc.comm]
· exact h
#align finset.fold_const Finset.fold_const
theorem fold_hom {op' : γ → γ → γ} [Std.Commutative op'] [Std.Associative op'] {m : β → γ}
(hm : ∀ x y, m (op x y) = op' (m x) (m y)) :
(s.fold op' (m b) fun x => m (f x)) = m (s.fold op b f) := by
rw [fold, fold, ← Multiset.fold_hom op hm, Multiset.map_map]
simp only [Function.comp_apply]
#align finset.fold_hom Finset.fold_hom
theorem fold_disjUnion {s₁ s₂ : Finset α} {b₁ b₂ : β} (h) :
(s₁.disjUnion s₂ h).fold op (b₁ * b₂) f = s₁.fold op b₁ f * s₂.fold op b₂ f :=
(congr_arg _ <| Multiset.map_add _ _ _).trans (Multiset.fold_add _ _ _ _ _)
#align finset.fold_disj_union Finset.fold_disjUnion
theorem fold_disjiUnion {ι : Type*} {s : Finset ι} {t : ι → Finset α} {b : ι → β} {b₀ : β} (h) :
(s.disjiUnion t h).fold op (s.fold op b₀ b) f = s.fold op b₀ fun i => (t i).fold op (b i) f :=
(congr_arg _ <| Multiset.map_bind _ _ _).trans (Multiset.fold_bind _ _ _ _ _)
#align finset.fold_disj_Union Finset.fold_disjiUnion
theorem fold_union_inter [DecidableEq α] {s₁ s₂ : Finset α} {b₁ b₂ : β} :
((s₁ ∪ s₂).fold op b₁ f * (s₁ ∩ s₂).fold op b₂ f) = s₁.fold op b₂ f * s₂.fold op b₁ f := by
unfold fold
rw [← fold_add op, ← Multiset.map_add, union_val, inter_val, union_add_inter, Multiset.map_add,
hc.comm, fold_add]
#align finset.fold_union_inter Finset.fold_union_inter
@[simp]
| Mathlib/Data/Finset/Fold.lean | 124 | 129 | theorem fold_insert_idem [DecidableEq α] [hi : Std.IdempotentOp op] :
(insert a s).fold op b f = f a * s.fold op b f := by |
by_cases h : a ∈ s
· rw [← insert_erase h]
simp [← ha.assoc, hi.idempotent]
· apply fold_insert h
| [
" fold op b f (cons a s h) = op (f a) (fold op b f s)",
" Multiset.fold op b (Multiset.map f (cons a s h).val) = op (f a) (Multiset.fold op b (Multiset.map f s.val))",
" fold op b f (insert a s) = op (f a) (fold op b f s)",
" Multiset.fold op b (Multiset.map f (insert a s).val) = op (f a) (Multiset.fold op b ... | [
" fold op b f (cons a s h) = op (f a) (fold op b f s)",
" Multiset.fold op b (Multiset.map f (cons a s h).val) = op (f a) (Multiset.fold op b (Multiset.map f s.val))",
" fold op b f (insert a s) = op (f a) (fold op b f s)",
" Multiset.fold op b (Multiset.map f (insert a s).val) = op (f a) (Multiset.fold op b ... |
import Mathlib.Analysis.SpecialFunctions.Complex.Arg
import Mathlib.Analysis.SpecialFunctions.Log.Basic
#align_import analysis.special_functions.complex.log from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
namespace Complex
open Set Filter Bornology
open scoped Real Topology ComplexConjugate
-- Porting note: @[pp_nodot] does not exist in mathlib4
noncomputable def log (x : ℂ) : ℂ :=
x.abs.log + arg x * I
#align complex.log Complex.log
theorem log_re (x : ℂ) : x.log.re = x.abs.log := by simp [log]
#align complex.log_re Complex.log_re
theorem log_im (x : ℂ) : x.log.im = x.arg := by simp [log]
#align complex.log_im Complex.log_im
theorem neg_pi_lt_log_im (x : ℂ) : -π < (log x).im := by simp only [log_im, neg_pi_lt_arg]
#align complex.neg_pi_lt_log_im Complex.neg_pi_lt_log_im
theorem log_im_le_pi (x : ℂ) : (log x).im ≤ π := by simp only [log_im, arg_le_pi]
#align complex.log_im_le_pi Complex.log_im_le_pi
| Mathlib/Analysis/SpecialFunctions/Complex/Log.lean | 45 | 49 | theorem exp_log {x : ℂ} (hx : x ≠ 0) : exp (log x) = x := by |
rw [log, exp_add_mul_I, ← ofReal_sin, sin_arg, ← ofReal_cos, cos_arg hx, ← ofReal_exp,
Real.exp_log (abs.pos hx), mul_add, ofReal_div, ofReal_div,
mul_div_cancel₀ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), ← mul_assoc,
mul_div_cancel₀ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), re_add_im]
| [
" x.log.re = (abs x).log",
" x.log.im = x.arg",
" -π < x.log.im",
" x.log.im ≤ π",
" cexp x.log = x"
] | [
" x.log.re = (abs x).log",
" x.log.im = x.arg",
" -π < x.log.im",
" x.log.im ≤ π",
" cexp x.log = x"
] |
import Mathlib.LinearAlgebra.TensorProduct.Basic
import Mathlib.RingTheory.Finiteness
open scoped TensorProduct
open Submodule
variable {R M N : Type*}
variable [CommSemiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N]
variable {M₁ M₂ : Submodule R M} {N₁ N₂ : Submodule R N}
namespace TensorProduct
theorem exists_multiset (x : M ⊗[R] N) :
∃ S : Multiset (M × N), x = (S.map fun i ↦ i.1 ⊗ₜ[R] i.2).sum := by
induction x using TensorProduct.induction_on with
| zero => exact ⟨0, by simp⟩
| tmul x y => exact ⟨{(x, y)}, by simp⟩
| add x y hx hy =>
obtain ⟨Sx, hx⟩ := hx
obtain ⟨Sy, hy⟩ := hy
exact ⟨Sx + Sy, by rw [Multiset.map_add, Multiset.sum_add, hx, hy]⟩
theorem exists_finsupp_left (x : M ⊗[R] N) :
∃ S : M →₀ N, x = S.sum fun m n ↦ m ⊗ₜ[R] n := by
induction x using TensorProduct.induction_on with
| zero => exact ⟨0, by simp⟩
| tmul x y => exact ⟨Finsupp.single x y, by simp⟩
| add x y hx hy =>
obtain ⟨Sx, hx⟩ := hx
obtain ⟨Sy, hy⟩ := hy
use Sx + Sy
rw [hx, hy]
exact (Finsupp.sum_add_index' (by simp) TensorProduct.tmul_add).symm
theorem exists_finsupp_right (x : M ⊗[R] N) :
∃ S : N →₀ M, x = S.sum fun n m ↦ m ⊗ₜ[R] n := by
obtain ⟨S, h⟩ := exists_finsupp_left (TensorProduct.comm R M N x)
refine ⟨S, (TensorProduct.comm R M N).injective ?_⟩
simp_rw [h, Finsupp.sum, map_sum, comm_tmul]
theorem exists_finset (x : M ⊗[R] N) :
∃ S : Finset (M × N), x = S.sum fun i ↦ i.1 ⊗ₜ[R] i.2 := by
obtain ⟨S, h⟩ := exists_finsupp_left x
use S.graph
rw [h, Finsupp.sum]
apply Finset.sum_nbij' (fun m ↦ ⟨m, S m⟩) Prod.fst <;> simp
theorem exists_finite_submodule_of_finite (s : Set (M ⊗[R] N)) (hs : s.Finite) :
∃ (M' : Submodule R M) (N' : Submodule R N), Module.Finite R M' ∧ Module.Finite R N' ∧
s ⊆ LinearMap.range (mapIncl M' N') := by
simp_rw [Module.Finite.iff_fg]
refine hs.induction_on ⟨_, _, fg_bot, fg_bot, Set.empty_subset _⟩ ?_
rintro a s - - ⟨M', N', hM', hN', h⟩
refine TensorProduct.induction_on a ?_ (fun x y ↦ ?_) fun x y hx hy ↦ ?_
· exact ⟨M', N', hM', hN', Set.insert_subset (zero_mem _) h⟩
· refine ⟨_, _, hM'.sup (fg_span_singleton x),
hN'.sup (fg_span_singleton y), Set.insert_subset ?_ fun z hz ↦ ?_⟩
· exact ⟨⟨x, mem_sup_right (mem_span_singleton_self x)⟩ ⊗ₜ
⟨y, mem_sup_right (mem_span_singleton_self y)⟩, rfl⟩
· exact range_mapIncl_mono le_sup_left le_sup_left (h hz)
· obtain ⟨M₁', N₁', hM₁', hN₁', h₁⟩ := hx
obtain ⟨M₂', N₂', hM₂', hN₂', h₂⟩ := hy
refine ⟨_, _, hM₁'.sup hM₂', hN₁'.sup hN₂', Set.insert_subset (add_mem ?_ ?_) fun z hz ↦ ?_⟩
· exact range_mapIncl_mono le_sup_left le_sup_left (h₁ (Set.mem_insert x s))
· exact range_mapIncl_mono le_sup_right le_sup_right (h₂ (Set.mem_insert y s))
· exact range_mapIncl_mono le_sup_left le_sup_left (h₁ (Set.subset_insert x s hz))
theorem exists_finite_submodule_left_of_finite (s : Set (M ⊗[R] N)) (hs : s.Finite) :
∃ M' : Submodule R M, Module.Finite R M' ∧ s ⊆ LinearMap.range (M'.subtype.rTensor N) := by
obtain ⟨M', _, hfin, _, h⟩ := exists_finite_submodule_of_finite s hs
refine ⟨M', hfin, ?_⟩
rw [mapIncl, ← LinearMap.rTensor_comp_lTensor] at h
exact h.trans (LinearMap.range_comp_le_range _ _)
| Mathlib/LinearAlgebra/TensorProduct/Finiteness.lean | 131 | 136 | theorem exists_finite_submodule_right_of_finite (s : Set (M ⊗[R] N)) (hs : s.Finite) :
∃ N' : Submodule R N, Module.Finite R N' ∧ s ⊆ LinearMap.range (N'.subtype.lTensor M) := by |
obtain ⟨_, N', _, hfin, h⟩ := exists_finite_submodule_of_finite s hs
refine ⟨N', hfin, ?_⟩
rw [mapIncl, ← LinearMap.lTensor_comp_rTensor] at h
exact h.trans (LinearMap.range_comp_le_range _ _)
| [
" ∃ S, x = (Multiset.map (fun i => i.1 ⊗ₜ[R] i.2) S).sum",
" ∃ S, 0 = (Multiset.map (fun i => i.1 ⊗ₜ[R] i.2) S).sum",
" 0 = (Multiset.map (fun i => i.1 ⊗ₜ[R] i.2) 0).sum",
" ∃ S, x ⊗ₜ[R] y = (Multiset.map (fun i => i.1 ⊗ₜ[R] i.2) S).sum",
" x ⊗ₜ[R] y = (Multiset.map (fun i => i.1 ⊗ₜ[R] i.2) {(x, y)}).sum",
... | [
" ∃ S, x = (Multiset.map (fun i => i.1 ⊗ₜ[R] i.2) S).sum",
" ∃ S, 0 = (Multiset.map (fun i => i.1 ⊗ₜ[R] i.2) S).sum",
" 0 = (Multiset.map (fun i => i.1 ⊗ₜ[R] i.2) 0).sum",
" ∃ S, x ⊗ₜ[R] y = (Multiset.map (fun i => i.1 ⊗ₜ[R] i.2) S).sum",
" x ⊗ₜ[R] y = (Multiset.map (fun i => i.1 ⊗ₜ[R] i.2) {(x, y)}).sum",
... |
import Mathlib.Algebra.Group.Subgroup.MulOpposite
import Mathlib.Algebra.Group.Submonoid.Pointwise
import Mathlib.GroupTheory.GroupAction.ConjAct
#align_import group_theory.subgroup.pointwise from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802"
open Set
open Pointwise
variable {α G A S : Type*}
@[to_additive (attr := simp, norm_cast)]
theorem inv_coe_set [InvolutiveInv G] [SetLike S G] [InvMemClass S G] {H : S} : (H : Set G)⁻¹ = H :=
Set.ext fun _ => inv_mem_iff
#align inv_coe_set inv_coe_set
#align neg_coe_set neg_coe_set
@[to_additive (attr := simp)]
lemma smul_coe_set [Group G] [SetLike S G] [SubgroupClass S G] {s : S} {a : G} (ha : a ∈ s) :
a • (s : Set G) = s := by
ext; simp [Set.mem_smul_set_iff_inv_smul_mem, mul_mem_cancel_left, ha]
@[to_additive (attr := simp)]
lemma op_smul_coe_set [Group G] [SetLike S G] [SubgroupClass S G] {s : S} {a : G} (ha : a ∈ s) :
MulOpposite.op a • (s : Set G) = s := by
ext; simp [Set.mem_smul_set_iff_inv_smul_mem, mul_mem_cancel_right, ha]
@[to_additive (attr := simp, norm_cast)]
lemma coe_mul_coe [SetLike S G] [DivInvMonoid G] [SubgroupClass S G] (H : S) :
H * H = (H : Set G) := by aesop (add simp mem_mul)
@[to_additive (attr := simp, norm_cast)]
lemma coe_div_coe [SetLike S G] [DivisionMonoid G] [SubgroupClass S G] (H : S) :
H / H = (H : Set G) := by simp [div_eq_mul_inv]
variable [Group G] [AddGroup A] {s : Set G}
namespace Subgroup
@[to_additive (attr := simp)]
theorem inv_subset_closure (S : Set G) : S⁻¹ ⊆ closure S := fun s hs => by
rw [SetLike.mem_coe, ← Subgroup.inv_mem_iff]
exact subset_closure (mem_inv.mp hs)
#align subgroup.inv_subset_closure Subgroup.inv_subset_closure
#align add_subgroup.neg_subset_closure AddSubgroup.neg_subset_closure
@[to_additive]
theorem closure_toSubmonoid (S : Set G) :
(closure S).toSubmonoid = Submonoid.closure (S ∪ S⁻¹) := by
refine le_antisymm (fun x hx => ?_) (Submonoid.closure_le.2 ?_)
· refine
closure_induction hx
(fun x hx => Submonoid.closure_mono subset_union_left (Submonoid.subset_closure hx))
(Submonoid.one_mem _) (fun x y hx hy => Submonoid.mul_mem _ hx hy) fun x hx => ?_
rwa [← Submonoid.mem_closure_inv, Set.union_inv, inv_inv, Set.union_comm]
· simp only [true_and_iff, coe_toSubmonoid, union_subset_iff, subset_closure, inv_subset_closure]
#align subgroup.closure_to_submonoid Subgroup.closure_toSubmonoid
#align add_subgroup.closure_to_add_submonoid AddSubgroup.closure_toAddSubmonoid
@[to_additive (attr := elab_as_elim)
"For additive subgroups generated by a single element, see the simpler
`zsmul_induction_left`."]
theorem closure_induction_left {p : (x : G) → x ∈ closure s → Prop} (one : p 1 (one_mem _))
(mul_left : ∀ x (hx : x ∈ s), ∀ (y) hy, p y hy → p (x * y) (mul_mem (subset_closure hx) hy))
(mul_left_inv : ∀ x (hx : x ∈ s), ∀ (y) hy, p y hy →
p (x⁻¹ * y) (mul_mem (inv_mem (subset_closure hx)) hy))
{x : G} (h : x ∈ closure s) : p x h := by
revert h
simp_rw [← mem_toSubmonoid, closure_toSubmonoid] at *
intro h
induction h using Submonoid.closure_induction_left with
| one => exact one
| mul_left x hx y hy ih =>
cases hx with
| inl hx => exact mul_left _ hx _ hy ih
| inr hx => simpa only [inv_inv] using mul_left_inv _ hx _ hy ih
#align subgroup.closure_induction_left Subgroup.closure_induction_left
#align add_subgroup.closure_induction_left AddSubgroup.closure_induction_left
@[to_additive (attr := elab_as_elim)
"For additive subgroups generated by a single element, see the simpler
`zsmul_induction_right`."]
theorem closure_induction_right {p : (x : G) → x ∈ closure s → Prop} (one : p 1 (one_mem _))
(mul_right : ∀ (x) hx, ∀ y (hy : y ∈ s), p x hx → p (x * y) (mul_mem hx (subset_closure hy)))
(mul_right_inv : ∀ (x) hx, ∀ y (hy : y ∈ s), p x hx →
p (x * y⁻¹) (mul_mem hx (inv_mem (subset_closure hy))))
{x : G} (h : x ∈ closure s) : p x h :=
closure_induction_left (s := MulOpposite.unop ⁻¹' s)
(p := fun m hm => p m.unop <| by rwa [← op_closure] at hm)
one
(fun _x hx _y hy => mul_right _ _ _ hx)
(fun _x hx _y hy => mul_right_inv _ _ _ hx)
(by rwa [← op_closure])
#align subgroup.closure_induction_right Subgroup.closure_induction_right
#align add_subgroup.closure_induction_right AddSubgroup.closure_induction_right
@[to_additive (attr := simp)]
| Mathlib/Algebra/Group/Subgroup/Pointwise.lean | 125 | 126 | theorem closure_inv (s : Set G) : closure s⁻¹ = closure s := by |
simp only [← toSubmonoid_eq, closure_toSubmonoid, inv_inv, union_comm]
| [
" a • ↑s = ↑s",
" x✝ ∈ a • ↑s ↔ x✝ ∈ ↑s",
" MulOpposite.op a • ↑s = ↑s",
" x✝ ∈ MulOpposite.op a • ↑s ↔ x✝ ∈ ↑s",
" ↑H * ↑H = ↑H",
" ↑H / ↑H = ↑H",
" s ∈ ↑(closure S)",
" s⁻¹ ∈ closure S",
" (closure S).toSubmonoid = Submonoid.closure (S ∪ S⁻¹)",
" x ∈ Submonoid.closure (S ∪ S⁻¹)",
" x⁻¹ ∈ Submo... | [
" a • ↑s = ↑s",
" x✝ ∈ a • ↑s ↔ x✝ ∈ ↑s",
" MulOpposite.op a • ↑s = ↑s",
" x✝ ∈ MulOpposite.op a • ↑s ↔ x✝ ∈ ↑s",
" ↑H * ↑H = ↑H",
" ↑H / ↑H = ↑H",
" s ∈ ↑(closure S)",
" s⁻¹ ∈ closure S",
" (closure S).toSubmonoid = Submonoid.closure (S ∪ S⁻¹)",
" x ∈ Submonoid.closure (S ∪ S⁻¹)",
" x⁻¹ ∈ Submo... |
import Mathlib.MeasureTheory.Measure.MeasureSpaceDef
#align_import measure_theory.measure.ae_disjoint from "leanprover-community/mathlib"@"bc7d81beddb3d6c66f71449c5bc76c38cb77cf9e"
open Set Function
namespace MeasureTheory
variable {ι α : Type*} {m : MeasurableSpace α} (μ : Measure α)
def AEDisjoint (s t : Set α) :=
μ (s ∩ t) = 0
#align measure_theory.ae_disjoint MeasureTheory.AEDisjoint
variable {μ} {s t u v : Set α}
| Mathlib/MeasureTheory/Measure/AEDisjoint.lean | 34 | 46 | theorem exists_null_pairwise_disjoint_diff [Countable ι] {s : ι → Set α}
(hd : Pairwise (AEDisjoint μ on s)) : ∃ t : ι → Set α, (∀ i, MeasurableSet (t i)) ∧
(∀ i, μ (t i) = 0) ∧ Pairwise (Disjoint on fun i => s i \ t i) := by |
refine ⟨fun i => toMeasurable μ (s i ∩ ⋃ j ∈ ({i}ᶜ : Set ι), s j), fun i =>
measurableSet_toMeasurable _ _, fun i => ?_, ?_⟩
· simp only [measure_toMeasurable, inter_iUnion]
exact (measure_biUnion_null_iff <| to_countable _).2 fun j hj => hd (Ne.symm hj)
· simp only [Pairwise, disjoint_left, onFun, mem_diff, not_and, and_imp, Classical.not_not]
intro i j hne x hi hU hj
replace hU : x ∉ s i ∩ iUnion fun j ↦ iUnion fun _ ↦ s j :=
fun h ↦ hU (subset_toMeasurable _ _ h)
simp only [mem_inter_iff, mem_iUnion, not_and, not_exists] at hU
exact (hU hi j hne.symm hj).elim
| [
" ∃ t, (∀ (i : ι), MeasurableSet (t i)) ∧ (∀ (i : ι), μ (t i) = 0) ∧ Pairwise (Disjoint on fun i => s i \\ t i)",
" μ ((fun i => toMeasurable μ (s i ∩ ⋃ j ∈ {i}ᶜ, s j)) i) = 0",
" μ (⋃ i_1 ∈ {i}ᶜ, s i ∩ s i_1) = 0",
" Pairwise (Disjoint on fun i => s i \\ (fun i => toMeasurable μ (s i ∩ ⋃ j ∈ {i}ᶜ, s j)) i)",... | [
" ∃ t, (∀ (i : ι), MeasurableSet (t i)) ∧ (∀ (i : ι), μ (t i) = 0) ∧ Pairwise (Disjoint on fun i => s i \\ t i)"
] |
import Mathlib.Algebra.Associated
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Algebra.Order.Group.Abs
import Mathlib.Algebra.Ring.Divisibility.Basic
#align_import ring_theory.prime from "leanprover-community/mathlib"@"008205aa645b3f194c1da47025c5f110c8406eab"
section CancelCommMonoidWithZero
variable {R : Type*} [CancelCommMonoidWithZero R]
open Finset
theorem mul_eq_mul_prime_prod {α : Type*} [DecidableEq α] {x y a : R} {s : Finset α} {p : α → R}
(hp : ∀ i ∈ s, Prime (p i)) (hx : x * y = a * ∏ i ∈ s, p i) :
∃ (t u : Finset α) (b c : R),
t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ (x = b * ∏ i ∈ t, p i) ∧ y = c * ∏ i ∈ u, p i := by
induction' s using Finset.induction with i s his ih generalizing x y a
· exact ⟨∅, ∅, x, y, by simp [hx]⟩
· rw [prod_insert his, ← mul_assoc] at hx
have hpi : Prime (p i) := hp i (mem_insert_self _ _)
rcases ih (fun i hi ↦ hp i (mem_insert_of_mem hi)) hx with
⟨t, u, b, c, htus, htu, hbc, rfl, rfl⟩
have hit : i ∉ t := fun hit ↦ his (htus ▸ mem_union_left _ hit)
have hiu : i ∉ u := fun hiu ↦ his (htus ▸ mem_union_right _ hiu)
obtain ⟨d, rfl⟩ | ⟨d, rfl⟩ : p i ∣ b ∨ p i ∣ c := hpi.dvd_or_dvd ⟨a, by rw [← hbc, mul_comm]⟩
· rw [mul_assoc, mul_comm a, mul_right_inj' hpi.ne_zero] at hbc
exact ⟨insert i t, u, d, c, by rw [insert_union, htus], disjoint_insert_left.2 ⟨hiu, htu⟩, by
simp [hbc, prod_insert hit, mul_assoc, mul_comm, mul_left_comm]⟩
· rw [← mul_assoc, mul_right_comm b, mul_left_inj' hpi.ne_zero] at hbc
exact ⟨t, insert i u, b, d, by rw [union_insert, htus], disjoint_insert_right.2 ⟨hit, htu⟩, by
simp [← hbc, prod_insert hiu, mul_assoc, mul_comm, mul_left_comm]⟩
#align mul_eq_mul_prime_prod mul_eq_mul_prime_prod
| Mathlib/RingTheory/Prime.lean | 51 | 56 | theorem mul_eq_mul_prime_pow {x y a p : R} {n : ℕ} (hp : Prime p) (hx : x * y = a * p ^ n) :
∃ (i j : ℕ) (b c : R), i + j = n ∧ a = b * c ∧ x = b * p ^ i ∧ y = c * p ^ j := by |
rcases mul_eq_mul_prime_prod (fun _ _ ↦ hp)
(show x * y = a * (range n).prod fun _ ↦ p by simpa) with
⟨t, u, b, c, htus, htu, rfl, rfl, rfl⟩
exact ⟨t.card, u.card, b, c, by rw [← card_union_of_disjoint htu, htus, card_range], by simp⟩
| [
" ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i ∈ t, p i ∧ y = c * ∏ i ∈ u, p i",
" ∃ t u b c, t ∪ u = ∅ ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i ∈ t, p i ∧ y = c * ∏ i ∈ u, p i",
" ∅ ∪ ∅ = ∅ ∧ Disjoint ∅ ∅ ∧ a = x * y ∧ x = x * ∏ i ∈ ∅, p i ∧ y = y * ∏ i ∈ ∅, p i",
" ∃ t u b c, t ∪ u = insert... | [
" ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i ∈ t, p i ∧ y = c * ∏ i ∈ u, p i",
" ∃ t u b c, t ∪ u = ∅ ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i ∈ t, p i ∧ y = c * ∏ i ∈ u, p i",
" ∅ ∪ ∅ = ∅ ∧ Disjoint ∅ ∅ ∧ a = x * y ∧ x = x * ∏ i ∈ ∅, p i ∧ y = y * ∏ i ∈ ∅, p i",
" ∃ t u b c, t ∪ u = insert... |
import Mathlib.Algebra.ContinuedFractions.Computation.Approximations
import Mathlib.Algebra.ContinuedFractions.Computation.CorrectnessTerminating
import Mathlib.Data.Rat.Floor
#align_import algebra.continued_fractions.computation.terminates_iff_rat from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
namespace GeneralizedContinuedFraction
open GeneralizedContinuedFraction (of)
variable {K : Type*} [LinearOrderedField K] [FloorRing K]
attribute [local simp] Pair.map IntFractPair.mapFr
section RatTranslation
-- The lifting works for arbitrary linear ordered fields with a floor function.
variable {v : K} {q : ℚ} (v_eq_q : v = (↑q : K)) (n : ℕ)
namespace IntFractPair
theorem coe_of_rat_eq : ((IntFractPair.of q).mapFr (↑) : IntFractPair K) = IntFractPair.of v := by
simp [IntFractPair.of, v_eq_q]
#align generalized_continued_fraction.int_fract_pair.coe_of_rat_eq GeneralizedContinuedFraction.IntFractPair.coe_of_rat_eq
| Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean | 174 | 194 | theorem coe_stream_nth_rat_eq :
((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
IntFractPair.stream v n := by |
induction n with
| zero =>
-- Porting note: was
-- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
| succ n IH =>
rw [v_eq_q] at IH
cases stream_q_nth_eq : IntFractPair.stream q n with
| none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
| some ifp_n =>
cases' ifp_n with b fr
cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
· simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]
· replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n := by
rwa [stream_q_nth_eq] at IH
have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast
have coe_of_fr := coe_of_rat_eq this
simpa [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_ne_zero]
| [
" mapFr Rat.cast (IntFractPair.of q) = IntFractPair.of v",
" Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream v n",
" Option.map (mapFr Rat.cast) (IntFractPair.stream q 0) = IntFractPair.stream v 0",
" Option.map (mapFr Rat.cast) (IntFractPair.stream q (n + 1)) = IntFractPair.stream... | [
" mapFr Rat.cast (IntFractPair.of q) = IntFractPair.of v",
" Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream v n"
] |
import Mathlib.NumberTheory.Divisors
import Mathlib.Data.Nat.Digits
import Mathlib.Data.Nat.MaxPowDiv
import Mathlib.Data.Nat.Multiplicity
import Mathlib.Tactic.IntervalCases
#align_import number_theory.padics.padic_val from "leanprover-community/mathlib"@"60fa54e778c9e85d930efae172435f42fb0d71f7"
universe u
open Nat
open Rat
open multiplicity
def padicValNat (p : ℕ) (n : ℕ) : ℕ :=
if h : p ≠ 1 ∧ 0 < n then (multiplicity p n).get (multiplicity.finite_nat_iff.2 h) else 0
#align padic_val_nat padicValNat
namespace padicValNat
open multiplicity
variable {p : ℕ}
@[simp]
protected theorem zero : padicValNat p 0 = 0 := by simp [padicValNat]
#align padic_val_nat.zero padicValNat.zero
@[simp]
protected theorem one : padicValNat p 1 = 0 := by
unfold padicValNat
split_ifs
· simp
· rfl
#align padic_val_nat.one padicValNat.one
@[simp]
theorem self (hp : 1 < p) : padicValNat p p = 1 := by
have neq_one : ¬p = 1 ↔ True := iff_of_true hp.ne' trivial
have eq_zero_false : p = 0 ↔ False := iff_false_intro (zero_lt_one.trans hp).ne'
simp [padicValNat, neq_one, eq_zero_false]
#align padic_val_nat.self padicValNat.self
@[simp]
theorem eq_zero_iff {n : ℕ} : padicValNat p n = 0 ↔ p = 1 ∨ n = 0 ∨ ¬p ∣ n := by
simp only [padicValNat, dite_eq_right_iff, PartENat.get_eq_iff_eq_coe, Nat.cast_zero,
multiplicity_eq_zero, and_imp, pos_iff_ne_zero, Ne, ← or_iff_not_imp_left]
#align padic_val_nat.eq_zero_iff padicValNat.eq_zero_iff
theorem eq_zero_of_not_dvd {n : ℕ} (h : ¬p ∣ n) : padicValNat p n = 0 :=
eq_zero_iff.2 <| Or.inr <| Or.inr h
#align padic_val_nat.eq_zero_of_not_dvd padicValNat.eq_zero_of_not_dvd
open Nat.maxPowDiv
theorem maxPowDiv_eq_multiplicity {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
p.maxPowDiv n = multiplicity p n := by
apply multiplicity.unique <| pow_dvd p n
intro h
apply Nat.not_lt.mpr <| le_of_dvd hp hn h
simp
theorem maxPowDiv_eq_multiplicity_get {p n : ℕ} (hp : 1 < p) (hn : 0 < n) (h : Finite p n) :
p.maxPowDiv n = (multiplicity p n).get h := by
rw [PartENat.get_eq_iff_eq_coe.mpr]
apply maxPowDiv_eq_multiplicity hp hn|>.symm
@[csimp]
| Mathlib/NumberTheory/Padics/PadicVal.lean | 133 | 146 | theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by |
ext p n
by_cases h : 1 < p ∧ 0 < n
· dsimp [padicValNat]
rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
· simp only [not_and_or,not_gt_eq,Nat.le_zero] at h
apply h.elim
· intro h
interval_cases p
· simp [Classical.em]
· dsimp [padicValNat, maxPowDiv]
rw [go, if_neg, dif_neg] <;> simp
· intro h
simp [h]
| [
" padicValNat p 0 = 0",
" padicValNat p 1 = 0",
" (if h : p ≠ 1 ∧ 0 < 1 then (multiplicity p 1).get ⋯ else 0) = 0",
" (multiplicity p 1).get ⋯ = 0",
" 0 = 0",
" padicValNat p p = 1",
" padicValNat p n = 0 ↔ p = 1 ∨ n = 0 ∨ ¬p ∣ n",
" ↑(p.maxPowDiv n) = multiplicity p n",
" ¬p ^ (p.maxPowDiv n + 1) ∣... | [
" padicValNat p 0 = 0",
" padicValNat p 1 = 0",
" (if h : p ≠ 1 ∧ 0 < 1 then (multiplicity p 1).get ⋯ else 0) = 0",
" (multiplicity p 1).get ⋯ = 0",
" 0 = 0",
" padicValNat p p = 1",
" padicValNat p n = 0 ↔ p = 1 ∨ n = 0 ∨ ¬p ∣ n",
" ↑(p.maxPowDiv n) = multiplicity p n",
" ¬p ^ (p.maxPowDiv n + 1) ∣... |
import Mathlib.CategoryTheory.Sites.Grothendieck
import Mathlib.CategoryTheory.Sites.Pretopology
import Mathlib.CategoryTheory.Limits.Lattice
import Mathlib.Topology.Sets.Opens
#align_import category_theory.sites.spaces from "leanprover-community/mathlib"@"b6fa3beb29f035598cf0434d919694c5e98091eb"
universe u
namespace Opens
variable (T : Type u) [TopologicalSpace T]
open CategoryTheory TopologicalSpace CategoryTheory.Limits
def grothendieckTopology : GrothendieckTopology (Opens T) where
sieves X S := ∀ x ∈ X, ∃ (U : _) (f : U ⟶ X), S f ∧ x ∈ U
top_mem' X x hx := ⟨_, 𝟙 _, trivial, hx⟩
pullback_stable' X Y S f hf y hy := by
rcases hf y (f.le hy) with ⟨U, g, hg, hU⟩
refine ⟨U ⊓ Y, homOfLE inf_le_right, ?_, hU, hy⟩
apply S.downward_closed hg (homOfLE inf_le_left)
transitive' X S hS R hR x hx := by
rcases hS x hx with ⟨U, f, hf, hU⟩
rcases hR hf _ hU with ⟨V, g, hg, hV⟩
exact ⟨_, g ≫ f, hg, hV⟩
#align opens.grothendieck_topology Opens.grothendieckTopology
def pretopology : Pretopology (Opens T) where
coverings X R := ∀ x ∈ X, ∃ (U : _) (f : U ⟶ X), R f ∧ x ∈ U
has_isos X Y f i x hx := ⟨_, _, Presieve.singleton_self _, (inv f).le hx⟩
pullbacks X Y f S hS x hx := by
rcases hS _ (f.le hx) with ⟨U, g, hg, hU⟩
refine ⟨_, _, Presieve.pullbackArrows.mk _ _ hg, ?_⟩
have : U ⊓ Y ≤ pullback g f :=
leOfHom (pullback.lift (homOfLE inf_le_left) (homOfLE inf_le_right) rfl)
apply this ⟨hU, hx⟩
transitive X S Ti hS hTi x hx := by
rcases hS x hx with ⟨U, f, hf, hU⟩
rcases hTi f hf x hU with ⟨V, g, hg, hV⟩
exact ⟨_, _, ⟨_, g, f, hf, hg, rfl⟩, hV⟩
#align opens.pretopology Opens.pretopology
@[simp]
| Mathlib/CategoryTheory/Sites/Spaces.lean | 78 | 86 | theorem pretopology_ofGrothendieck :
Pretopology.ofGrothendieck _ (Opens.grothendieckTopology T) = Opens.pretopology T := by |
apply le_antisymm
· intro X R hR x hx
rcases hR x hx with ⟨U, f, ⟨V, g₁, g₂, hg₂, _⟩, hU⟩
exact ⟨V, g₂, hg₂, g₁.le hU⟩
· intro X R hR x hx
rcases hR x hx with ⟨U, f, hf, hU⟩
exact ⟨U, f, Sieve.le_generate R U hf, hU⟩
| [
" ∃ U f_1, (Sieve.pullback f S).arrows f_1 ∧ y ∈ U",
" (Sieve.pullback f S).arrows (homOfLE ⋯)",
" ∃ U f, R.arrows f ∧ x ∈ U",
" ∃ U f_1, Presieve.pullbackArrows f S f_1 ∧ x ∈ U",
" x ∈ pullback g f",
" ∃ U f, S.bind Ti f ∧ x ∈ U",
" Pretopology.ofGrothendieck (Opens T) (grothendieckTopology T) = pretop... | [
" ∃ U f_1, (Sieve.pullback f S).arrows f_1 ∧ y ∈ U",
" (Sieve.pullback f S).arrows (homOfLE ⋯)",
" ∃ U f, R.arrows f ∧ x ∈ U",
" ∃ U f_1, Presieve.pullbackArrows f S f_1 ∧ x ∈ U",
" x ∈ pullback g f",
" ∃ U f, S.bind Ti f ∧ x ∈ U",
" Pretopology.ofGrothendieck (Opens T) (grothendieckTopology T) = pretop... |
import Mathlib.Algebra.Algebra.Quasispectrum
import Mathlib.FieldTheory.IsAlgClosed.Spectrum
import Mathlib.Analysis.Complex.Liouville
import Mathlib.Analysis.Complex.Polynomial
import Mathlib.Analysis.Analytic.RadiusLiminf
import Mathlib.Topology.Algebra.Module.CharacterSpace
import Mathlib.Analysis.NormedSpace.Exponential
import Mathlib.Analysis.NormedSpace.UnitizationL1
#align_import analysis.normed_space.spectrum from "leanprover-community/mathlib"@"d608fc5d4e69d4cc21885913fb573a88b0deb521"
open scoped ENNReal NNReal
open NormedSpace -- For `NormedSpace.exp`.
noncomputable def spectralRadius (𝕜 : Type*) {A : Type*} [NormedField 𝕜] [Ring A] [Algebra 𝕜 A]
(a : A) : ℝ≥0∞ :=
⨆ k ∈ spectrum 𝕜 a, ‖k‖₊
#align spectral_radius spectralRadius
variable {𝕜 : Type*} {A : Type*}
namespace spectrum
section SpectrumCompact
open Filter
variable [NormedField 𝕜] [NormedRing A] [NormedAlgebra 𝕜 A]
local notation "σ" => spectrum 𝕜
local notation "ρ" => resolventSet 𝕜
local notation "↑ₐ" => algebraMap 𝕜 A
@[simp]
theorem SpectralRadius.of_subsingleton [Subsingleton A] (a : A) : spectralRadius 𝕜 a = 0 := by
simp [spectralRadius]
#align spectrum.spectral_radius.of_subsingleton spectrum.SpectralRadius.of_subsingleton
@[simp]
| Mathlib/Analysis/NormedSpace/Spectrum.lean | 84 | 86 | theorem spectralRadius_zero : spectralRadius 𝕜 (0 : A) = 0 := by |
nontriviality A
simp [spectralRadius]
| [
" spectralRadius 𝕜 a = 0",
" spectralRadius 𝕜 0 = 0"
] | [
" spectralRadius 𝕜 a = 0",
" spectralRadius 𝕜 0 = 0"
] |
import Mathlib.Combinatorics.SimpleGraph.Dart
import Mathlib.Data.FunLike.Fintype
open Function
namespace SimpleGraph
variable {V W X : Type*} (G : SimpleGraph V) (G' : SimpleGraph W) {u v : V}
protected def map (f : V ↪ W) (G : SimpleGraph V) : SimpleGraph W where
Adj := Relation.Map G.Adj f f
symm a b := by -- Porting note: `obviously` used to handle this
rintro ⟨v, w, h, rfl, rfl⟩
use w, v, h.symm, rfl
loopless a := by -- Porting note: `obviously` used to handle this
rintro ⟨v, w, h, rfl, h'⟩
exact h.ne (f.injective h'.symm)
#align simple_graph.map SimpleGraph.map
instance instDecidableMapAdj {f : V ↪ W} {a b} [Decidable (Relation.Map G.Adj f f a b)] :
Decidable ((G.map f).Adj a b) := ‹Decidable (Relation.Map G.Adj f f a b)›
#align simple_graph.decidable_map SimpleGraph.instDecidableMapAdj
@[simp]
theorem map_adj (f : V ↪ W) (G : SimpleGraph V) (u v : W) :
(G.map f).Adj u v ↔ ∃ u' v' : V, G.Adj u' v' ∧ f u' = u ∧ f v' = v :=
Iff.rfl
#align simple_graph.map_adj SimpleGraph.map_adj
lemma map_adj_apply {G : SimpleGraph V} {f : V ↪ W} {a b : V} :
(G.map f).Adj (f a) (f b) ↔ G.Adj a b := by simp
#align simple_graph.map_adj_apply SimpleGraph.map_adj_apply
theorem map_monotone (f : V ↪ W) : Monotone (SimpleGraph.map f) := by
rintro G G' h _ _ ⟨u, v, ha, rfl, rfl⟩
exact ⟨_, _, h ha, rfl, rfl⟩
#align simple_graph.map_monotone SimpleGraph.map_monotone
@[simp] lemma map_id : G.map (Function.Embedding.refl _) = G :=
SimpleGraph.ext _ _ <| Relation.map_id_id _
#align simple_graph.map_id SimpleGraph.map_id
@[simp] lemma map_map (f : V ↪ W) (g : W ↪ X) : (G.map f).map g = G.map (f.trans g) :=
SimpleGraph.ext _ _ <| Relation.map_map _ _ _ _ _
#align simple_graph.map_map SimpleGraph.map_map
protected def comap (f : V → W) (G : SimpleGraph W) : SimpleGraph V where
Adj u v := G.Adj (f u) (f v)
symm _ _ h := h.symm
loopless _ := G.loopless _
#align simple_graph.comap SimpleGraph.comap
@[simp] lemma comap_adj {G : SimpleGraph W} {f : V → W} :
(G.comap f).Adj u v ↔ G.Adj (f u) (f v) := Iff.rfl
@[simp] lemma comap_id {G : SimpleGraph V} : G.comap id = G := SimpleGraph.ext _ _ rfl
#align simple_graph.comap_id SimpleGraph.comap_id
@[simp] lemma comap_comap {G : SimpleGraph X} (f : V → W) (g : W → X) :
(G.comap g).comap f = G.comap (g ∘ f) := rfl
#align simple_graph.comap_comap SimpleGraph.comap_comap
instance instDecidableComapAdj (f : V → W) (G : SimpleGraph W) [DecidableRel G.Adj] :
DecidableRel (G.comap f).Adj := fun _ _ ↦ ‹DecidableRel G.Adj› _ _
lemma comap_symm (G : SimpleGraph V) (e : V ≃ W) :
G.comap e.symm.toEmbedding = G.map e.toEmbedding := by
ext; simp only [Equiv.apply_eq_iff_eq_symm_apply, comap_adj, map_adj, Equiv.toEmbedding_apply,
exists_eq_right_right, exists_eq_right]
#align simple_graph.comap_symm SimpleGraph.comap_symm
lemma map_symm (G : SimpleGraph W) (e : V ≃ W) :
G.map e.symm.toEmbedding = G.comap e.toEmbedding := by rw [← comap_symm, e.symm_symm]
#align simple_graph.map_symm SimpleGraph.map_symm
theorem comap_monotone (f : V ↪ W) : Monotone (SimpleGraph.comap f) := by
intro G G' h _ _ ha
exact h ha
#align simple_graph.comap_monotone SimpleGraph.comap_monotone
@[simp]
theorem comap_map_eq (f : V ↪ W) (G : SimpleGraph V) : (G.map f).comap f = G := by
ext
simp
#align simple_graph.comap_map_eq SimpleGraph.comap_map_eq
theorem leftInverse_comap_map (f : V ↪ W) :
Function.LeftInverse (SimpleGraph.comap f) (SimpleGraph.map f) :=
comap_map_eq f
#align simple_graph.left_inverse_comap_map SimpleGraph.leftInverse_comap_map
theorem map_injective (f : V ↪ W) : Function.Injective (SimpleGraph.map f) :=
(leftInverse_comap_map f).injective
#align simple_graph.map_injective SimpleGraph.map_injective
theorem comap_surjective (f : V ↪ W) : Function.Surjective (SimpleGraph.comap f) :=
(leftInverse_comap_map f).surjective
#align simple_graph.comap_surjective SimpleGraph.comap_surjective
theorem map_le_iff_le_comap (f : V ↪ W) (G : SimpleGraph V) (G' : SimpleGraph W) :
G.map f ≤ G' ↔ G ≤ G'.comap f :=
⟨fun h u v ha => h ⟨_, _, ha, rfl, rfl⟩, by
rintro h _ _ ⟨u, v, ha, rfl, rfl⟩
exact h ha⟩
#align simple_graph.map_le_iff_le_comap SimpleGraph.map_le_iff_le_comap
| Mathlib/Combinatorics/SimpleGraph/Maps.lean | 154 | 155 | theorem map_comap_le (f : V ↪ W) (G : SimpleGraph W) : (G.comap f).map f ≤ G := by |
rw [map_le_iff_le_comap]
| [
" Relation.Map G.Adj (⇑f) (⇑f) a b → Relation.Map G.Adj (⇑f) (⇑f) b a",
" Relation.Map G.Adj (⇑f) (⇑f) (f w) (f v)",
" ¬Relation.Map G.Adj (⇑f) (⇑f) a a",
" False",
" (SimpleGraph.map f G).Adj (f a) (f b) ↔ G.Adj a b",
" Monotone (SimpleGraph.map f)",
" (SimpleGraph.map f G').Adj (f u) (f v)",
" Simpl... | [
" Relation.Map G.Adj (⇑f) (⇑f) a b → Relation.Map G.Adj (⇑f) (⇑f) b a",
" Relation.Map G.Adj (⇑f) (⇑f) (f w) (f v)",
" ¬Relation.Map G.Adj (⇑f) (⇑f) a a",
" False",
" (SimpleGraph.map f G).Adj (f a) (f b) ↔ G.Adj a b",
" Monotone (SimpleGraph.map f)",
" (SimpleGraph.map f G').Adj (f u) (f v)",
" Simpl... |
import Mathlib.Combinatorics.SimpleGraph.Dart
import Mathlib.Data.FunLike.Fintype
open Function
namespace SimpleGraph
variable {V W X : Type*} (G : SimpleGraph V) (G' : SimpleGraph W) {u v : V}
protected def map (f : V ↪ W) (G : SimpleGraph V) : SimpleGraph W where
Adj := Relation.Map G.Adj f f
symm a b := by -- Porting note: `obviously` used to handle this
rintro ⟨v, w, h, rfl, rfl⟩
use w, v, h.symm, rfl
loopless a := by -- Porting note: `obviously` used to handle this
rintro ⟨v, w, h, rfl, h'⟩
exact h.ne (f.injective h'.symm)
#align simple_graph.map SimpleGraph.map
instance instDecidableMapAdj {f : V ↪ W} {a b} [Decidable (Relation.Map G.Adj f f a b)] :
Decidable ((G.map f).Adj a b) := ‹Decidable (Relation.Map G.Adj f f a b)›
#align simple_graph.decidable_map SimpleGraph.instDecidableMapAdj
@[simp]
theorem map_adj (f : V ↪ W) (G : SimpleGraph V) (u v : W) :
(G.map f).Adj u v ↔ ∃ u' v' : V, G.Adj u' v' ∧ f u' = u ∧ f v' = v :=
Iff.rfl
#align simple_graph.map_adj SimpleGraph.map_adj
lemma map_adj_apply {G : SimpleGraph V} {f : V ↪ W} {a b : V} :
(G.map f).Adj (f a) (f b) ↔ G.Adj a b := by simp
#align simple_graph.map_adj_apply SimpleGraph.map_adj_apply
| Mathlib/Combinatorics/SimpleGraph/Maps.lean | 76 | 78 | theorem map_monotone (f : V ↪ W) : Monotone (SimpleGraph.map f) := by |
rintro G G' h _ _ ⟨u, v, ha, rfl, rfl⟩
exact ⟨_, _, h ha, rfl, rfl⟩
| [
" Relation.Map G.Adj (⇑f) (⇑f) a b → Relation.Map G.Adj (⇑f) (⇑f) b a",
" Relation.Map G.Adj (⇑f) (⇑f) (f w) (f v)",
" ¬Relation.Map G.Adj (⇑f) (⇑f) a a",
" False",
" (SimpleGraph.map f G).Adj (f a) (f b) ↔ G.Adj a b",
" Monotone (SimpleGraph.map f)",
" (SimpleGraph.map f G').Adj (f u) (f v)"
] | [
" Relation.Map G.Adj (⇑f) (⇑f) a b → Relation.Map G.Adj (⇑f) (⇑f) b a",
" Relation.Map G.Adj (⇑f) (⇑f) (f w) (f v)",
" ¬Relation.Map G.Adj (⇑f) (⇑f) a a",
" False",
" (SimpleGraph.map f G).Adj (f a) (f b) ↔ G.Adj a b",
" Monotone (SimpleGraph.map f)"
] |
import Mathlib.Dynamics.Ergodic.Ergodic
import Mathlib.MeasureTheory.Function.AEEqFun
open Function Set Filter MeasureTheory Topology TopologicalSpace
variable {α X : Type*} [MeasurableSpace α] {μ : MeasureTheory.Measure α}
theorem QuasiErgodic.ae_eq_const_of_ae_eq_comp_of_ae_range₀ [Nonempty X] [MeasurableSpace X]
{s : Set X} [MeasurableSpace.CountablySeparated s] {f : α → α} {g : α → X}
(h : QuasiErgodic f μ) (hs : ∀ᵐ x ∂μ, g x ∈ s) (hgm : NullMeasurable g μ)
(hg_eq : g ∘ f =ᵐ[μ] g) :
∃ c, g =ᵐ[μ] const α c := by
refine exists_eventuallyEq_const_of_eventually_mem_of_forall_separating MeasurableSet hs ?_
refine fun U hU ↦ h.ae_mem_or_ae_nmem₀ (s := g ⁻¹' U) (hgm hU) ?_b
refine (hg_eq.mono fun x hx ↦ ?_).set_eq
rw [← preimage_comp, mem_preimage, mem_preimage, hx]
variable [TopologicalSpace X] [MetrizableSpace X] [Nonempty X] {f : α → α}
namespace QuasiErgodic
| Mathlib/Dynamics/Ergodic/Function.lean | 77 | 82 | theorem ae_eq_const_of_ae_eq_comp_ae {g : α → X} (h : QuasiErgodic f μ)
(hgm : AEStronglyMeasurable g μ) (hg_eq : g ∘ f =ᵐ[μ] g) : ∃ c, g =ᵐ[μ] const α c := by |
borelize X
rcases hgm.isSeparable_ae_range with ⟨t, ht, hgt⟩
haveI := ht.secondCountableTopology
exact h.ae_eq_const_of_ae_eq_comp_of_ae_range₀ hgt hgm.aemeasurable.nullMeasurable hg_eq
| [
" ∃ c, g =ᶠ[ae μ] const α c",
" ∀ (U : Set X), MeasurableSet U → (∀ᵐ (x : α) ∂μ, g x ∈ U) ∨ ∀ᵐ (x : α) ∂μ, g x ∉ U",
" f ⁻¹' (g ⁻¹' U) =ᶠ[ae μ] g ⁻¹' U",
" x ∈ f ⁻¹' (g ⁻¹' U) ↔ x ∈ g ⁻¹' U"
] | [
" ∃ c, g =ᶠ[ae μ] const α c",
" ∀ (U : Set X), MeasurableSet U → (∀ᵐ (x : α) ∂μ, g x ∈ U) ∨ ∀ᵐ (x : α) ∂μ, g x ∉ U",
" f ⁻¹' (g ⁻¹' U) =ᶠ[ae μ] g ⁻¹' U",
" x ∈ f ⁻¹' (g ⁻¹' U) ↔ x ∈ g ⁻¹' U"
] |
import Mathlib.Data.Finset.Prod
import Mathlib.Data.Set.Finite
#align_import data.finset.n_ary from "leanprover-community/mathlib"@"eba7871095e834365616b5e43c8c7bb0b37058d0"
open Function Set
variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type*}
namespace Finset
variable [DecidableEq α'] [DecidableEq β'] [DecidableEq γ] [DecidableEq γ'] [DecidableEq δ]
[DecidableEq δ'] [DecidableEq ε] [DecidableEq ε'] {f f' : α → β → γ} {g g' : α → β → γ → δ}
{s s' : Finset α} {t t' : Finset β} {u u' : Finset γ} {a a' : α} {b b' : β} {c : γ}
def image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) : Finset γ :=
(s ×ˢ t).image <| uncurry f
#align finset.image₂ Finset.image₂
@[simp]
theorem mem_image₂ : c ∈ image₂ f s t ↔ ∃ a ∈ s, ∃ b ∈ t, f a b = c := by
simp [image₂, and_assoc]
#align finset.mem_image₂ Finset.mem_image₂
@[simp, norm_cast]
theorem coe_image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) :
(image₂ f s t : Set γ) = Set.image2 f s t :=
Set.ext fun _ => mem_image₂
#align finset.coe_image₂ Finset.coe_image₂
theorem card_image₂_le (f : α → β → γ) (s : Finset α) (t : Finset β) :
(image₂ f s t).card ≤ s.card * t.card :=
card_image_le.trans_eq <| card_product _ _
#align finset.card_image₂_le Finset.card_image₂_le
theorem card_image₂_iff :
(image₂ f s t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × β)).InjOn fun x => f x.1 x.2 := by
rw [← card_product, ← coe_product]
exact card_image_iff
#align finset.card_image₂_iff Finset.card_image₂_iff
theorem card_image₂ (hf : Injective2 f) (s : Finset α) (t : Finset β) :
(image₂ f s t).card = s.card * t.card :=
(card_image_of_injective _ hf.uncurry).trans <| card_product _ _
#align finset.card_image₂ Finset.card_image₂
theorem mem_image₂_of_mem (ha : a ∈ s) (hb : b ∈ t) : f a b ∈ image₂ f s t :=
mem_image₂.2 ⟨a, ha, b, hb, rfl⟩
#align finset.mem_image₂_of_mem Finset.mem_image₂_of_mem
theorem mem_image₂_iff (hf : Injective2 f) : f a b ∈ image₂ f s t ↔ a ∈ s ∧ b ∈ t := by
rw [← mem_coe, coe_image₂, mem_image2_iff hf, mem_coe, mem_coe]
#align finset.mem_image₂_iff Finset.mem_image₂_iff
theorem image₂_subset (hs : s ⊆ s') (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s' t' := by
rw [← coe_subset, coe_image₂, coe_image₂]
exact image2_subset hs ht
#align finset.image₂_subset Finset.image₂_subset
theorem image₂_subset_left (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s t' :=
image₂_subset Subset.rfl ht
#align finset.image₂_subset_left Finset.image₂_subset_left
theorem image₂_subset_right (hs : s ⊆ s') : image₂ f s t ⊆ image₂ f s' t :=
image₂_subset hs Subset.rfl
#align finset.image₂_subset_right Finset.image₂_subset_right
theorem image_subset_image₂_left (hb : b ∈ t) : s.image (fun a => f a b) ⊆ image₂ f s t :=
image_subset_iff.2 fun _ ha => mem_image₂_of_mem ha hb
#align finset.image_subset_image₂_left Finset.image_subset_image₂_left
theorem image_subset_image₂_right (ha : a ∈ s) : t.image (fun b => f a b) ⊆ image₂ f s t :=
image_subset_iff.2 fun _ => mem_image₂_of_mem ha
#align finset.image_subset_image₂_right Finset.image_subset_image₂_right
theorem forall_image₂_iff {p : γ → Prop} :
(∀ z ∈ image₂ f s t, p z) ↔ ∀ x ∈ s, ∀ y ∈ t, p (f x y) := by
simp_rw [← mem_coe, coe_image₂, forall_image2_iff]
#align finset.forall_image₂_iff Finset.forall_image₂_iff
@[simp]
theorem image₂_subset_iff : image₂ f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u :=
forall_image₂_iff
#align finset.image₂_subset_iff Finset.image₂_subset_iff
| Mathlib/Data/Finset/NAry.lean | 108 | 109 | theorem image₂_subset_iff_left : image₂ f s t ⊆ u ↔ ∀ a ∈ s, (t.image fun b => f a b) ⊆ u := by |
simp_rw [image₂_subset_iff, image_subset_iff]
| [
" c ∈ image₂ f s t ↔ ∃ a ∈ s, ∃ b ∈ t, f a b = c",
" (image₂ f s t).card = s.card * t.card ↔ InjOn (fun x => f x.1 x.2) (↑s ×ˢ ↑t)",
" (image₂ f s t).card = (s ×ˢ t).card ↔ InjOn (fun x => f x.1 x.2) ↑(s ×ˢ t)",
" f a b ∈ image₂ f s t ↔ a ∈ s ∧ b ∈ t",
" image₂ f s t ⊆ image₂ f s' t'",
" image2 f ↑s ↑t ⊆ ... | [
" c ∈ image₂ f s t ↔ ∃ a ∈ s, ∃ b ∈ t, f a b = c",
" (image₂ f s t).card = s.card * t.card ↔ InjOn (fun x => f x.1 x.2) (↑s ×ˢ ↑t)",
" (image₂ f s t).card = (s ×ˢ t).card ↔ InjOn (fun x => f x.1 x.2) ↑(s ×ˢ t)",
" f a b ∈ image₂ f s t ↔ a ∈ s ∧ b ∈ t",
" image₂ f s t ⊆ image₂ f s' t'",
" image2 f ↑s ↑t ⊆ ... |
import Mathlib.Init.Function
#align_import data.option.n_ary from "leanprover-community/mathlib"@"995b47e555f1b6297c7cf16855f1023e355219fb"
universe u
open Function
namespace Option
variable {α β γ δ : Type*} {f : α → β → γ} {a : Option α} {b : Option β} {c : Option γ}
def map₂ (f : α → β → γ) (a : Option α) (b : Option β) : Option γ :=
a.bind fun a => b.map <| f a
#align option.map₂ Option.map₂
theorem map₂_def {α β γ : Type u} (f : α → β → γ) (a : Option α) (b : Option β) :
map₂ f a b = f <$> a <*> b := by
cases a <;> rfl
#align option.map₂_def Option.map₂_def
-- Porting note (#10618): In Lean3, was `@[simp]` but now `simp` can prove it
theorem map₂_some_some (f : α → β → γ) (a : α) (b : β) : map₂ f (some a) (some b) = f a b := rfl
#align option.map₂_some_some Option.map₂_some_some
theorem map₂_coe_coe (f : α → β → γ) (a : α) (b : β) : map₂ f a b = f a b := rfl
#align option.map₂_coe_coe Option.map₂_coe_coe
@[simp]
theorem map₂_none_left (f : α → β → γ) (b : Option β) : map₂ f none b = none := rfl
#align option.map₂_none_left Option.map₂_none_left
@[simp]
theorem map₂_none_right (f : α → β → γ) (a : Option α) : map₂ f a none = none := by cases a <;> rfl
#align option.map₂_none_right Option.map₂_none_right
@[simp]
theorem map₂_coe_left (f : α → β → γ) (a : α) (b : Option β) : map₂ f a b = b.map fun b => f a b :=
rfl
#align option.map₂_coe_left Option.map₂_coe_left
-- Porting note: This proof was `rfl` in Lean3, but now is not.
@[simp]
theorem map₂_coe_right (f : α → β → γ) (a : Option α) (b : β) :
map₂ f a b = a.map fun a => f a b := by cases a <;> rfl
#align option.map₂_coe_right Option.map₂_coe_right
-- Porting note: Removed the `@[simp]` tag as membership of an `Option` is no-longer simp-normal.
theorem mem_map₂_iff {c : γ} : c ∈ map₂ f a b ↔ ∃ a' b', a' ∈ a ∧ b' ∈ b ∧ f a' b' = c := by
simp [map₂, bind_eq_some]
#align option.mem_map₂_iff Option.mem_map₂_iff
@[simp]
theorem map₂_eq_none_iff : map₂ f a b = none ↔ a = none ∨ b = none := by
cases a <;> cases b <;> simp
#align option.map₂_eq_none_iff Option.map₂_eq_none_iff
| Mathlib/Data/Option/NAry.lean | 87 | 88 | theorem map₂_swap (f : α → β → γ) (a : Option α) (b : Option β) :
map₂ f a b = map₂ (fun a b => f b a) b a := by | cases a <;> cases b <;> rfl
| [
" map₂ f a b = Seq.seq (f <$> a) fun x => b",
" map₂ f none b = Seq.seq (f <$> none) fun x => b",
" map₂ f (some val✝) b = Seq.seq (f <$> some val✝) fun x => b",
" map₂ f a none = none",
" map₂ f none none = none",
" map₂ f (some val✝) none = none",
" map₂ f a (some b) = Option.map (fun a => f a b) a",
... | [
" map₂ f a b = Seq.seq (f <$> a) fun x => b",
" map₂ f none b = Seq.seq (f <$> none) fun x => b",
" map₂ f (some val✝) b = Seq.seq (f <$> some val✝) fun x => b",
" map₂ f a none = none",
" map₂ f none none = none",
" map₂ f (some val✝) none = none",
" map₂ f a (some b) = Option.map (fun a => f a b) a",
... |
import Mathlib.Geometry.Manifold.ContMDiff.Basic
open Set Function Filter ChartedSpace SmoothManifoldWithCorners
open scoped Topology Manifold
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜]
-- declare a smooth manifold `M` over the pair `(E, H)`.
{E : Type*}
[NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H) {M : Type*} [TopologicalSpace M] [ChartedSpace H M]
[SmoothManifoldWithCorners I M]
-- declare a smooth manifold `M'` over the pair `(E', H')`.
{E' : Type*}
[NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H') {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
-- declare a manifold `M''` over the pair `(E'', H'')`.
{E'' : Type*}
[NormedAddCommGroup E''] [NormedSpace 𝕜 E''] {H'' : Type*} [TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''} {M'' : Type*} [TopologicalSpace M''] [ChartedSpace H'' M'']
-- declare a smooth manifold `N` over the pair `(F, G)`.
{F : Type*}
[NormedAddCommGroup F] [NormedSpace 𝕜 F] {G : Type*} [TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G} {N : Type*} [TopologicalSpace N] [ChartedSpace G N]
[SmoothManifoldWithCorners J N]
-- declare a smooth manifold `N'` over the pair `(F', G')`.
{F' : Type*}
[NormedAddCommGroup F'] [NormedSpace 𝕜 F'] {G' : Type*} [TopologicalSpace G']
{J' : ModelWithCorners 𝕜 F' G'} {N' : Type*} [TopologicalSpace N'] [ChartedSpace G' N']
[SmoothManifoldWithCorners J' N']
-- F₁, F₂, F₃, F₄ are normed spaces
{F₁ : Type*}
[NormedAddCommGroup F₁] [NormedSpace 𝕜 F₁] {F₂ : Type*} [NormedAddCommGroup F₂]
[NormedSpace 𝕜 F₂] {F₃ : Type*} [NormedAddCommGroup F₃] [NormedSpace 𝕜 F₃] {F₄ : Type*}
[NormedAddCommGroup F₄] [NormedSpace 𝕜 F₄]
-- declare functions, sets, points and smoothness indices
{e : PartialHomeomorph M H}
{e' : PartialHomeomorph M' H'} {f f₁ : M → M'} {s s₁ t : Set M} {x : M} {m n : ℕ∞}
variable {I I'}
section ProdMk
| Mathlib/Geometry/Manifold/ContMDiff/Product.lean | 59 | 63 | theorem ContMDiffWithinAt.prod_mk {f : M → M'} {g : M → N'} (hf : ContMDiffWithinAt I I' n f s x)
(hg : ContMDiffWithinAt I J' n g s x) :
ContMDiffWithinAt I (I'.prod J') n (fun x => (f x, g x)) s x := by |
rw [contMDiffWithinAt_iff] at *
exact ⟨hf.1.prod hg.1, hf.2.prod hg.2⟩
| [
" ContMDiffWithinAt I (I'.prod J') n (fun x => (f x, g x)) s x",
" ContinuousWithinAt (fun x => (f x, g x)) s x ∧\n ContDiffWithinAt 𝕜 n (↑(extChartAt (I'.prod J') (f x, g x)) ∘ (fun x => (f x, g x)) ∘ ↑(extChartAt I x).symm)\n (↑(extChartAt I x).symm ⁻¹' s ∩ range ↑I) (↑(extChartAt I x) x)"
] | [
" ContMDiffWithinAt I (I'.prod J') n (fun x => (f x, g x)) s x"
] |
import Mathlib.MeasureTheory.Function.LpOrder
#align_import measure_theory.function.l1_space from "leanprover-community/mathlib"@"ccdbfb6e5614667af5aa3ab2d50885e0ef44a46f"
noncomputable section
open scoped Classical
open Topology ENNReal MeasureTheory NNReal
open Set Filter TopologicalSpace ENNReal EMetric MeasureTheory
variable {α β γ δ : Type*} {m : MeasurableSpace α} {μ ν : Measure α} [MeasurableSpace δ]
variable [NormedAddCommGroup β]
variable [NormedAddCommGroup γ]
namespace MeasureTheory
theorem lintegral_nnnorm_eq_lintegral_edist (f : α → β) :
∫⁻ a, ‖f a‖₊ ∂μ = ∫⁻ a, edist (f a) 0 ∂μ := by simp only [edist_eq_coe_nnnorm]
#align measure_theory.lintegral_nnnorm_eq_lintegral_edist MeasureTheory.lintegral_nnnorm_eq_lintegral_edist
theorem lintegral_norm_eq_lintegral_edist (f : α → β) :
∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ = ∫⁻ a, edist (f a) 0 ∂μ := by
simp only [ofReal_norm_eq_coe_nnnorm, edist_eq_coe_nnnorm]
#align measure_theory.lintegral_norm_eq_lintegral_edist MeasureTheory.lintegral_norm_eq_lintegral_edist
theorem lintegral_edist_triangle {f g h : α → β} (hf : AEStronglyMeasurable f μ)
(hh : AEStronglyMeasurable h μ) :
(∫⁻ a, edist (f a) (g a) ∂μ) ≤ (∫⁻ a, edist (f a) (h a) ∂μ) + ∫⁻ a, edist (g a) (h a) ∂μ := by
rw [← lintegral_add_left' (hf.edist hh)]
refine lintegral_mono fun a => ?_
apply edist_triangle_right
#align measure_theory.lintegral_edist_triangle MeasureTheory.lintegral_edist_triangle
theorem lintegral_nnnorm_zero : (∫⁻ _ : α, ‖(0 : β)‖₊ ∂μ) = 0 := by simp
#align measure_theory.lintegral_nnnorm_zero MeasureTheory.lintegral_nnnorm_zero
theorem lintegral_nnnorm_add_left {f : α → β} (hf : AEStronglyMeasurable f μ) (g : α → γ) :
∫⁻ a, ‖f a‖₊ + ‖g a‖₊ ∂μ = (∫⁻ a, ‖f a‖₊ ∂μ) + ∫⁻ a, ‖g a‖₊ ∂μ :=
lintegral_add_left' hf.ennnorm _
#align measure_theory.lintegral_nnnorm_add_left MeasureTheory.lintegral_nnnorm_add_left
theorem lintegral_nnnorm_add_right (f : α → β) {g : α → γ} (hg : AEStronglyMeasurable g μ) :
∫⁻ a, ‖f a‖₊ + ‖g a‖₊ ∂μ = (∫⁻ a, ‖f a‖₊ ∂μ) + ∫⁻ a, ‖g a‖₊ ∂μ :=
lintegral_add_right' _ hg.ennnorm
#align measure_theory.lintegral_nnnorm_add_right MeasureTheory.lintegral_nnnorm_add_right
theorem lintegral_nnnorm_neg {f : α → β} : (∫⁻ a, ‖(-f) a‖₊ ∂μ) = ∫⁻ a, ‖f a‖₊ ∂μ := by
simp only [Pi.neg_apply, nnnorm_neg]
#align measure_theory.lintegral_nnnorm_neg MeasureTheory.lintegral_nnnorm_neg
def HasFiniteIntegral {_ : MeasurableSpace α} (f : α → β) (μ : Measure α := by volume_tac) : Prop :=
(∫⁻ a, ‖f a‖₊ ∂μ) < ∞
#align measure_theory.has_finite_integral MeasureTheory.HasFiniteIntegral
theorem hasFiniteIntegral_def {_ : MeasurableSpace α} (f : α → β) (μ : Measure α) :
HasFiniteIntegral f μ ↔ ((∫⁻ a, ‖f a‖₊ ∂μ) < ∞) :=
Iff.rfl
theorem hasFiniteIntegral_iff_norm (f : α → β) :
HasFiniteIntegral f μ ↔ (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ) < ∞ := by
simp only [HasFiniteIntegral, ofReal_norm_eq_coe_nnnorm]
#align measure_theory.has_finite_integral_iff_norm MeasureTheory.hasFiniteIntegral_iff_norm
theorem hasFiniteIntegral_iff_edist (f : α → β) :
HasFiniteIntegral f μ ↔ (∫⁻ a, edist (f a) 0 ∂μ) < ∞ := by
simp only [hasFiniteIntegral_iff_norm, edist_dist, dist_zero_right]
#align measure_theory.has_finite_integral_iff_edist MeasureTheory.hasFiniteIntegral_iff_edist
| Mathlib/MeasureTheory/Function/L1Space.lean | 123 | 125 | theorem hasFiniteIntegral_iff_ofReal {f : α → ℝ} (h : 0 ≤ᵐ[μ] f) :
HasFiniteIntegral f μ ↔ (∫⁻ a, ENNReal.ofReal (f a) ∂μ) < ∞ := by |
rw [HasFiniteIntegral, lintegral_nnnorm_eq_of_ae_nonneg h]
| [
" ∫⁻ (a : α), ↑‖f a‖₊ ∂μ = ∫⁻ (a : α), edist (f a) 0 ∂μ",
" ∫⁻ (a : α), ENNReal.ofReal ‖f a‖ ∂μ = ∫⁻ (a : α), edist (f a) 0 ∂μ",
" ∫⁻ (a : α), edist (f a) (g a) ∂μ ≤ ∫⁻ (a : α), edist (f a) (h a) ∂μ + ∫⁻ (a : α), edist (g a) (h a) ∂μ",
" ∫⁻ (a : α), edist (f a) (g a) ∂μ ≤ ∫⁻ (a : α), edist (f a) (h a) + edist... | [
" ∫⁻ (a : α), ↑‖f a‖₊ ∂μ = ∫⁻ (a : α), edist (f a) 0 ∂μ",
" ∫⁻ (a : α), ENNReal.ofReal ‖f a‖ ∂μ = ∫⁻ (a : α), edist (f a) 0 ∂μ",
" ∫⁻ (a : α), edist (f a) (g a) ∂μ ≤ ∫⁻ (a : α), edist (f a) (h a) ∂μ + ∫⁻ (a : α), edist (g a) (h a) ∂μ",
" ∫⁻ (a : α), edist (f a) (g a) ∂μ ≤ ∫⁻ (a : α), edist (f a) (h a) + edist... |
import Mathlib.Order.Interval.Set.Basic
import Mathlib.Order.Hom.Set
#align_import data.set.intervals.order_iso from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105"
open Set
namespace OrderIso
section Preorder
variable {α β : Type*} [Preorder α] [Preorder β]
@[simp]
theorem preimage_Iic (e : α ≃o β) (b : β) : e ⁻¹' Iic b = Iic (e.symm b) := by
ext x
simp [← e.le_iff_le]
#align order_iso.preimage_Iic OrderIso.preimage_Iic
@[simp]
theorem preimage_Ici (e : α ≃o β) (b : β) : e ⁻¹' Ici b = Ici (e.symm b) := by
ext x
simp [← e.le_iff_le]
#align order_iso.preimage_Ici OrderIso.preimage_Ici
@[simp]
| Mathlib/Order/Interval/Set/OrderIso.lean | 36 | 38 | theorem preimage_Iio (e : α ≃o β) (b : β) : e ⁻¹' Iio b = Iio (e.symm b) := by |
ext x
simp [← e.lt_iff_lt]
| [
" ⇑e ⁻¹' Iic b = Iic (e.symm b)",
" x ∈ ⇑e ⁻¹' Iic b ↔ x ∈ Iic (e.symm b)",
" ⇑e ⁻¹' Ici b = Ici (e.symm b)",
" x ∈ ⇑e ⁻¹' Ici b ↔ x ∈ Ici (e.symm b)",
" ⇑e ⁻¹' Iio b = Iio (e.symm b)",
" x ∈ ⇑e ⁻¹' Iio b ↔ x ∈ Iio (e.symm b)"
] | [
" ⇑e ⁻¹' Iic b = Iic (e.symm b)",
" x ∈ ⇑e ⁻¹' Iic b ↔ x ∈ Iic (e.symm b)",
" ⇑e ⁻¹' Ici b = Ici (e.symm b)",
" x ∈ ⇑e ⁻¹' Ici b ↔ x ∈ Ici (e.symm b)",
" ⇑e ⁻¹' Iio b = Iio (e.symm b)"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.