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 220 |
|---|---|---|---|---|---|---|---|
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.set.ncard from "leanprover-community/mathlib"@"74c2af38a828107941029b03839882c5c6f87a04"
namespace Set
variable {Ξ± Ξ² : Type*} {s t : Set Ξ±}
noncomputable def encard (s : Set Ξ±) : ββ := PartENat.withTopEquiv (PartENat.card s)
@[simp] theorem encard_univ_coe (s : Set Ξ±) : encard (univ : Set s) = encard s := by
rw [encard, encard, PartENat.card_congr (Equiv.Set.univ βs)]
theorem encard_univ (Ξ± : Type*) :
encard (univ : Set Ξ±) = PartENat.withTopEquiv (PartENat.card Ξ±) := by
rw [encard, PartENat.card_congr (Equiv.Set.univ Ξ±)]
theorem Finite.encard_eq_coe_toFinset_card (h : s.Finite) : s.encard = h.toFinset.card := by
have := h.fintype
rw [encard, PartENat.card_eq_coe_fintype_card,
PartENat.withTopEquiv_natCast, toFinite_toFinset, toFinset_card]
theorem encard_eq_coe_toFinset_card (s : Set Ξ±) [Fintype s] : encard s = s.toFinset.card := by
have h := toFinite s
rw [h.encard_eq_coe_toFinset_card, toFinite_toFinset]
theorem encard_coe_eq_coe_finsetCard (s : Finset Ξ±) : encard (s : Set Ξ±) = s.card := by
rw [Finite.encard_eq_coe_toFinset_card (Finset.finite_toSet s)]; simp
theorem Infinite.encard_eq {s : Set Ξ±} (h : s.Infinite) : s.encard = β€ := by
have := h.to_subtype
rw [encard, β PartENat.withTopEquiv.symm.injective.eq_iff, Equiv.symm_apply_apply,
PartENat.withTopEquiv_symm_top, PartENat.card_eq_top_of_infinite]
@[simp] theorem encard_eq_zero : s.encard = 0 β s = β
:= by
rw [encard, β PartENat.withTopEquiv.symm.injective.eq_iff, Equiv.symm_apply_apply,
PartENat.withTopEquiv_symm_zero, PartENat.card_eq_zero_iff_empty, isEmpty_subtype,
eq_empty_iff_forall_not_mem]
@[simp] theorem encard_empty : (β
: Set Ξ±).encard = 0 := by
rw [encard_eq_zero]
theorem nonempty_of_encard_ne_zero (h : s.encard β 0) : s.Nonempty := by
rwa [nonempty_iff_ne_empty, Ne, β encard_eq_zero]
theorem encard_ne_zero : s.encard β 0 β s.Nonempty := by
rw [ne_eq, encard_eq_zero, nonempty_iff_ne_empty]
@[simp] theorem encard_pos : 0 < s.encard β s.Nonempty := by
rw [pos_iff_ne_zero, encard_ne_zero]
@[simp] theorem encard_singleton (e : Ξ±) : ({e} : Set Ξ±).encard = 1 := by
rw [encard, β PartENat.withTopEquiv.symm.injective.eq_iff, Equiv.symm_apply_apply,
PartENat.card_eq_coe_fintype_card, Fintype.card_ofSubsingleton, Nat.cast_one]; rfl
theorem encard_union_eq (h : Disjoint s t) : (s βͺ t).encard = s.encard + t.encard := by
classical
have e := (Equiv.Set.union (by rwa [subset_empty_iff, β disjoint_iff_inter_eq_empty])).symm
simp [encard, β PartENat.card_congr e, PartENat.card_sum, PartENat.withTopEquiv]
theorem encard_insert_of_not_mem {a : Ξ±} (has : a β s) : (insert a s).encard = s.encard + 1 := by
rw [β union_singleton, encard_union_eq (by simpa), encard_singleton]
theorem Finite.encard_lt_top (h : s.Finite) : s.encard < β€ := by
refine h.induction_on (by simp) ?_
rintro a t hat _ ht'
rw [encard_insert_of_not_mem hat]
exact lt_tsub_iff_right.1 ht'
theorem Finite.encard_eq_coe (h : s.Finite) : s.encard = ENat.toNat s.encard :=
(ENat.coe_toNat h.encard_lt_top.ne).symm
theorem Finite.exists_encard_eq_coe (h : s.Finite) : β (n : β), s.encard = n :=
β¨_, h.encard_eq_coeβ©
@[simp] theorem encard_lt_top_iff : s.encard < β€ β s.Finite :=
β¨fun h β¦ by_contra fun h' β¦ h.ne (Infinite.encard_eq h'), Finite.encard_lt_topβ©
@[simp] theorem encard_eq_top_iff : s.encard = β€ β s.Infinite := by
rw [β not_iff_not, β Ne, β lt_top_iff_ne_top, encard_lt_top_iff, not_infinite]
theorem encard_ne_top_iff : s.encard β β€ β s.Finite := by
simp
| Mathlib/Data/Set/Card.lean | 140 | 141 | theorem finite_of_encard_le_coe {k : β} (h : s.encard β€ k) : s.Finite := by |
rw [β encard_lt_top_iff]; exact h.trans_lt (WithTop.coe_lt_top _)
| [
" univ.encard = s.encard",
" univ.encard = PartENat.withTopEquiv (PartENat.card Ξ±)",
" s.encard = βh.toFinset.card",
" s.encard = βs.toFinset.card",
" (βs).encard = βs.card",
" ββ―.toFinset.card = βs.card",
" s.encard = β€",
" s.encard = 0 β s = β
",
" β
.encard = 0",
" s.Nonempty",
" s.encard β 0 β... | [
" univ.encard = s.encard",
" univ.encard = PartENat.withTopEquiv (PartENat.card Ξ±)",
" s.encard = βh.toFinset.card",
" s.encard = βs.toFinset.card",
" (βs).encard = βs.card",
" ββ―.toFinset.card = βs.card",
" s.encard = β€",
" s.encard = 0 β s = β
",
" β
.encard = 0",
" s.Nonempty",
" s.encard β 0 β... |
import Mathlib.Topology.Homeomorph
import Mathlib.Topology.StoneCech
#align_import topology.extremally_disconnected from "leanprover-community/mathlib"@"7e281deff072232a3c5b3e90034bd65dde396312"
noncomputable section
open scoped Classical
open Function Set
universe u
section
variable (X : Type u) [TopologicalSpace X]
class ExtremallyDisconnected : Prop where
open_closure : β U : Set X, IsOpen U β IsOpen (closure U)
#align extremally_disconnected ExtremallyDisconnected
section
def CompactT2.Projective : Prop :=
β {Y Z : Type u} [TopologicalSpace Y] [TopologicalSpace Z],
β [CompactSpace Y] [T2Space Y] [CompactSpace Z] [T2Space Z],
β {f : X β Z} {g : Y β Z} (_ : Continuous f) (_ : Continuous g) (_ : Surjective g),
β h : X β Y, Continuous h β§ g β h = f
#align compact_t2.projective CompactT2.Projective
variable {X}
| Mathlib/Topology/ExtremallyDisconnected.lean | 83 | 92 | theorem StoneCech.projective [DiscreteTopology X] : CompactT2.Projective (StoneCech X) := by |
intro Y Z _tsY _tsZ _csY _t2Y _csZ _csZ f g hf hg g_sur
let s : Z β Y := fun z => Classical.choose <| g_sur z
have hs : g β s = id := funext fun z => Classical.choose_spec (g_sur z)
let t := s β f β stoneCechUnit
have ht : Continuous t := continuous_of_discreteTopology
let h : StoneCech X β Y := stoneCechExtend ht
have hh : Continuous h := continuous_stoneCechExtend ht
refine β¨h, hh, denseRange_stoneCechUnit.equalizer (hg.comp hh) hf ?_β©
rw [comp.assoc, stoneCechExtend_extends ht, β comp.assoc, hs, id_comp]
| [
" CompactT2.Projective (StoneCech X)",
" β h, Continuous h β§ g β h = f",
" (g β h) β stoneCechUnit = f β stoneCechUnit"
] | [] |
import Mathlib.MeasureTheory.Measure.FiniteMeasure
import Mathlib.MeasureTheory.Integral.Average
#align_import measure_theory.measure.probability_measure from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
noncomputable section
open MeasureTheory
open Set
open Filter
open BoundedContinuousFunction
open scoped Topology ENNReal NNReal BoundedContinuousFunction
namespace MeasureTheory
section ProbabilityMeasure
def ProbabilityMeasure (Ξ© : Type*) [MeasurableSpace Ξ©] : Type _ :=
{ ΞΌ : Measure Ξ© // IsProbabilityMeasure ΞΌ }
#align measure_theory.probability_measure MeasureTheory.ProbabilityMeasure
namespace ProbabilityMeasure
variable {Ξ© : Type*} [MeasurableSpace Ξ©]
instance [Inhabited Ξ©] : Inhabited (ProbabilityMeasure Ξ©) :=
β¨β¨Measure.dirac default, Measure.dirac.isProbabilityMeasureβ©β©
-- Porting note: as with other subtype synonyms (e.g., `ββ₯0`), we need a new function for the
-- coercion instead of relying on `Subtype.val`.
@[coe]
def toMeasure : ProbabilityMeasure Ξ© β Measure Ξ© := Subtype.val
instance : Coe (ProbabilityMeasure Ξ©) (MeasureTheory.Measure Ξ©) where
coe := toMeasure
instance (ΞΌ : ProbabilityMeasure Ξ©) : IsProbabilityMeasure (ΞΌ : Measure Ξ©) :=
ΞΌ.prop
@[simp, norm_cast] lemma coe_mk (ΞΌ : Measure Ξ©) (hΞΌ) : toMeasure β¨ΞΌ, hΞΌβ© = ΞΌ := rfl
@[simp]
theorem val_eq_to_measure (Ξ½ : ProbabilityMeasure Ξ©) : Ξ½.val = (Ξ½ : Measure Ξ©) :=
rfl
#align measure_theory.probability_measure.val_eq_to_measure MeasureTheory.ProbabilityMeasure.val_eq_to_measure
theorem toMeasure_injective : Function.Injective ((β) : ProbabilityMeasure Ξ© β Measure Ξ©) :=
Subtype.coe_injective
#align measure_theory.probability_measure.coe_injective MeasureTheory.ProbabilityMeasure.toMeasure_injective
instance instFunLike : FunLike (ProbabilityMeasure Ξ©) (Set Ξ©) ββ₯0 where
coe ΞΌ s := ((ΞΌ : Measure Ξ©) s).toNNReal
coe_injective' ΞΌ Ξ½ h := toMeasure_injective $ Measure.ext fun s _ β¦ by
simpa [ENNReal.toNNReal_eq_toNNReal_iff, measure_ne_top] using congr_fun h s
lemma coeFn_def (ΞΌ : ProbabilityMeasure Ξ©) : ΞΌ = fun s β¦ ((ΞΌ : Measure Ξ©) s).toNNReal := rfl
#align measure_theory.probability_measure.coe_fn_eq_to_nnreal_coe_fn_to_measure MeasureTheory.ProbabilityMeasure.coeFn_def
lemma coeFn_mk (ΞΌ : Measure Ξ©) (hΞΌ) :
DFunLike.coe (F := ProbabilityMeasure Ξ©) β¨ΞΌ, hΞΌβ© = fun s β¦ (ΞΌ s).toNNReal := rfl
@[simp, norm_cast]
lemma mk_apply (ΞΌ : Measure Ξ©) (hΞΌ) (s : Set Ξ©) :
DFunLike.coe (F := ProbabilityMeasure Ξ©) β¨ΞΌ, hΞΌβ© s = (ΞΌ s).toNNReal := rfl
@[simp, norm_cast]
theorem coeFn_univ (Ξ½ : ProbabilityMeasure Ξ©) : Ξ½ univ = 1 :=
congr_arg ENNReal.toNNReal Ξ½.prop.measure_univ
#align measure_theory.probability_measure.coe_fn_univ MeasureTheory.ProbabilityMeasure.coeFn_univ
theorem coeFn_univ_ne_zero (Ξ½ : ProbabilityMeasure Ξ©) : Ξ½ univ β 0 := by
simp only [coeFn_univ, Ne, one_ne_zero, not_false_iff]
#align measure_theory.probability_measure.coe_fn_univ_ne_zero MeasureTheory.ProbabilityMeasure.coeFn_univ_ne_zero
def toFiniteMeasure (ΞΌ : ProbabilityMeasure Ξ©) : FiniteMeasure Ξ© :=
β¨ΞΌ, inferInstanceβ©
#align measure_theory.probability_measure.to_finite_measure MeasureTheory.ProbabilityMeasure.toFiniteMeasure
@[simp] lemma coeFn_toFiniteMeasure (ΞΌ : ProbabilityMeasure Ξ©) : βΞΌ.toFiniteMeasure = ΞΌ := rfl
lemma toFiniteMeasure_apply (ΞΌ : ProbabilityMeasure Ξ©) (s : Set Ξ©) :
ΞΌ.toFiniteMeasure s = ΞΌ s := rfl
@[simp]
theorem toMeasure_comp_toFiniteMeasure_eq_toMeasure (Ξ½ : ProbabilityMeasure Ξ©) :
(Ξ½.toFiniteMeasure : Measure Ξ©) = (Ξ½ : Measure Ξ©) :=
rfl
#align measure_theory.probability_measure.coe_comp_to_finite_measure_eq_coe MeasureTheory.ProbabilityMeasure.toMeasure_comp_toFiniteMeasure_eq_toMeasure
@[simp]
theorem coeFn_comp_toFiniteMeasure_eq_coeFn (Ξ½ : ProbabilityMeasure Ξ©) :
(Ξ½.toFiniteMeasure : Set Ξ© β ββ₯0) = (Ξ½ : Set Ξ© β ββ₯0) :=
rfl
#align measure_theory.probability_measure.coe_fn_comp_to_finite_measure_eq_coe_fn MeasureTheory.ProbabilityMeasure.coeFn_comp_toFiniteMeasure_eq_coeFn
@[simp]
theorem toFiniteMeasure_apply_eq_apply (Ξ½ : ProbabilityMeasure Ξ©) (s : Set Ξ©) :
Ξ½.toFiniteMeasure s = Ξ½ s := rfl
@[simp]
theorem ennreal_coeFn_eq_coeFn_toMeasure (Ξ½ : ProbabilityMeasure Ξ©) (s : Set Ξ©) :
(Ξ½ s : ββ₯0β) = (Ξ½ : Measure Ξ©) s := by
rw [β coeFn_comp_toFiniteMeasure_eq_coeFn, FiniteMeasure.ennreal_coeFn_eq_coeFn_toMeasure,
toMeasure_comp_toFiniteMeasure_eq_toMeasure]
#align measure_theory.probability_measure.ennreal_coe_fn_eq_coe_fn_to_measure MeasureTheory.ProbabilityMeasure.ennreal_coeFn_eq_coeFn_toMeasure
| Mathlib/MeasureTheory/Measure/ProbabilityMeasure.lean | 199 | 201 | theorem apply_mono (ΞΌ : ProbabilityMeasure Ξ©) {sβ sβ : Set Ξ©} (h : sβ β sβ) : ΞΌ sβ β€ ΞΌ sβ := by |
rw [β coeFn_comp_toFiniteMeasure_eq_coeFn]
exact MeasureTheory.FiniteMeasure.apply_mono _ h
| [
" βΞΌ s = βΞ½ s",
" Ξ½ univ β 0",
" β(Ξ½ s) = βΞ½ s",
" ΞΌ sβ β€ ΞΌ sβ",
" ΞΌ.toFiniteMeasure sβ β€ ΞΌ.toFiniteMeasure sβ"
] | [
" βΞΌ s = βΞ½ s",
" Ξ½ univ β 0",
" β(Ξ½ s) = βΞ½ s"
] |
import Mathlib.SetTheory.Game.Short
#align_import set_theory.game.state from "leanprover-community/mathlib"@"b134b2f5cf6dd25d4bbfd3c498b6e36c11a17225"
universe u
namespace SetTheory
namespace PGame
class State (S : Type u) where
turnBound : S β β
l : S β Finset S
r : S β Finset S
left_bound : β {s t : S}, t β l s β turnBound t < turnBound s
right_bound : β {s t : S}, t β r s β turnBound t < turnBound s
#align pgame.state SetTheory.PGame.State
open State
variable {S : Type u} [State S]
theorem turnBound_ne_zero_of_left_move {s t : S} (m : t β l s) : turnBound s β 0 := by
intro h
have t := left_bound m
rw [h] at t
exact Nat.not_succ_le_zero _ t
#align pgame.turn_bound_ne_zero_of_left_move SetTheory.PGame.turnBound_ne_zero_of_left_move
| Mathlib/SetTheory/Game/State.lean | 57 | 61 | theorem turnBound_ne_zero_of_right_move {s t : S} (m : t β r s) : turnBound s β 0 := by |
intro h
have t := right_bound m
rw [h] at t
exact Nat.not_succ_le_zero _ t
| [
" turnBound s β 0",
" False"
] | [
" turnBound s β 0",
" False"
] |
import Mathlib.Topology.Algebra.GroupWithZero
import Mathlib.Topology.Order.OrderClosed
#align_import topology.algebra.with_zero_topology from "leanprover-community/mathlib"@"3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064"
open Topology Filter TopologicalSpace Filter Set Function
namespace WithZeroTopology
variable {Ξ± Ξβ : Type*} [LinearOrderedCommGroupWithZero Ξβ] {Ξ³ Ξ³β Ξ³β : Ξβ} {l : Filter Ξ±}
{f : Ξ± β Ξβ}
scoped instance (priority := 100) topologicalSpace : TopologicalSpace Ξβ :=
nhdsAdjoint 0 <| β¨
Ξ³ β 0, π (Iio Ξ³)
#align with_zero_topology.topological_space WithZeroTopology.topologicalSpace
theorem nhds_eq_update : (π : Ξβ β Filter Ξβ) = update pure 0 (β¨
Ξ³ β 0, π (Iio Ξ³)) := by
rw [nhds_nhdsAdjoint, sup_of_le_right]
exact le_iInfβ fun Ξ³ hΞ³ β¦ le_principal_iff.2 <| zero_lt_iff.2 hΞ³
#align with_zero_topology.nhds_eq_update WithZeroTopology.nhds_eq_update
theorem nhds_zero : π (0 : Ξβ) = β¨
Ξ³ β 0, π (Iio Ξ³) := by
rw [nhds_eq_update, update_same]
#align with_zero_topology.nhds_zero WithZeroTopology.nhds_zero
theorem hasBasis_nhds_zero : (π (0 : Ξβ)).HasBasis (fun Ξ³ : Ξβ => Ξ³ β 0) Iio := by
rw [nhds_zero]
refine hasBasis_biInf_principal ?_ β¨1, one_ne_zeroβ©
exact directedOn_iff_directed.2 (Monotone.directed_ge fun a b hab => Iio_subset_Iio hab)
#align with_zero_topology.has_basis_nhds_zero WithZeroTopology.hasBasis_nhds_zero
theorem Iio_mem_nhds_zero (hΞ³ : Ξ³ β 0) : Iio Ξ³ β π (0 : Ξβ) :=
hasBasis_nhds_zero.mem_of_mem hΞ³
#align with_zero_topology.Iio_mem_nhds_zero WithZeroTopology.Iio_mem_nhds_zero
theorem nhds_zero_of_units (Ξ³ : ΞβΛ£) : Iio βΞ³ β π (0 : Ξβ) :=
Iio_mem_nhds_zero Ξ³.ne_zero
#align with_zero_topology.nhds_zero_of_units WithZeroTopology.nhds_zero_of_units
theorem tendsto_zero : Tendsto f l (π (0 : Ξβ)) β β (Ξ³β) (_ : Ξ³β β 0), βαΆ x in l, f x < Ξ³β := by
simp [nhds_zero]
#align with_zero_topology.tendsto_zero WithZeroTopology.tendsto_zero
@[simp]
theorem nhds_of_ne_zero {Ξ³ : Ξβ} (hβ : Ξ³ β 0) : π Ξ³ = pure Ξ³ :=
nhds_nhdsAdjoint_of_ne _ hβ
#align with_zero_topology.nhds_of_ne_zero WithZeroTopology.nhds_of_ne_zero
theorem nhds_coe_units (Ξ³ : ΞβΛ£) : π (Ξ³ : Ξβ) = pure (Ξ³ : Ξβ) :=
nhds_of_ne_zero Ξ³.ne_zero
#align with_zero_topology.nhds_coe_units WithZeroTopology.nhds_coe_units
theorem singleton_mem_nhds_of_units (Ξ³ : ΞβΛ£) : ({βΞ³} : Set Ξβ) β π (Ξ³ : Ξβ) := by simp
#align with_zero_topology.singleton_mem_nhds_of_units WithZeroTopology.singleton_mem_nhds_of_units
theorem singleton_mem_nhds_of_ne_zero (h : Ξ³ β 0) : ({Ξ³} : Set Ξβ) β π (Ξ³ : Ξβ) := by simp [h]
#align with_zero_topology.singleton_mem_nhds_of_ne_zero WithZeroTopology.singleton_mem_nhds_of_ne_zero
theorem hasBasis_nhds_of_ne_zero {x : Ξβ} (h : x β 0) :
HasBasis (π x) (fun _ : Unit => True) fun _ => {x} := by
rw [nhds_of_ne_zero h]
exact hasBasis_pure _
#align with_zero_topology.has_basis_nhds_of_ne_zero WithZeroTopology.hasBasis_nhds_of_ne_zero
theorem hasBasis_nhds_units (Ξ³ : ΞβΛ£) :
HasBasis (π (Ξ³ : Ξβ)) (fun _ : Unit => True) fun _ => {βΞ³} :=
hasBasis_nhds_of_ne_zero Ξ³.ne_zero
#align with_zero_topology.has_basis_nhds_units WithZeroTopology.hasBasis_nhds_units
theorem tendsto_of_ne_zero {Ξ³ : Ξβ} (h : Ξ³ β 0) : Tendsto f l (π Ξ³) β βαΆ x in l, f x = Ξ³ := by
rw [nhds_of_ne_zero h, tendsto_pure]
#align with_zero_topology.tendsto_of_ne_zero WithZeroTopology.tendsto_of_ne_zero
theorem tendsto_units {Ξ³β : ΞβΛ£} : Tendsto f l (π (Ξ³β : Ξβ)) β βαΆ x in l, f x = Ξ³β :=
tendsto_of_ne_zero Ξ³β.ne_zero
#align with_zero_topology.tendsto_units WithZeroTopology.tendsto_units
theorem Iio_mem_nhds (h : Ξ³β < Ξ³β) : Iio Ξ³β β π Ξ³β := by
rcases eq_or_ne Ξ³β 0 with (rfl | hβ) <;> simp [*, h.ne', Iio_mem_nhds_zero]
#align with_zero_topology.Iio_mem_nhds WithZeroTopology.Iio_mem_nhds
| Mathlib/Topology/Algebra/WithZeroTopology.lean | 136 | 139 | theorem isOpen_iff {s : Set Ξβ} : IsOpen s β (0 : Ξβ) β s β¨ β Ξ³, Ξ³ β 0 β§ Iio Ξ³ β s := by |
rw [isOpen_iff_mem_nhds, β and_forall_ne (0 : Ξβ)]
simp (config := { contextual := true }) [nhds_of_ne_zero, imp_iff_not_or,
hasBasis_nhds_zero.mem_iff]
| [
" π = update pure 0 (β¨
Ξ³, β¨
(_ : Ξ³ β 0), π (Iio Ξ³))",
" pure 0 β€ β¨
Ξ³, β¨
(_ : Ξ³ β 0), π (Iio Ξ³)",
" π 0 = β¨
Ξ³, β¨
(_ : Ξ³ β 0), π (Iio Ξ³)",
" (π 0).HasBasis (fun Ξ³ => Ξ³ β 0) Iio",
" (β¨
Ξ³, β¨
(_ : Ξ³ β 0), π (Iio Ξ³)).HasBasis (fun Ξ³ => Ξ³ β 0) Iio",
" DirectedOn ((fun Ξ³ => Iio Ξ³) β»ΒΉ'o fun x x_1 => x β₯ x_1... | [
" π = update pure 0 (β¨
Ξ³, β¨
(_ : Ξ³ β 0), π (Iio Ξ³))",
" pure 0 β€ β¨
Ξ³, β¨
(_ : Ξ³ β 0), π (Iio Ξ³)",
" π 0 = β¨
Ξ³, β¨
(_ : Ξ³ β 0), π (Iio Ξ³)",
" (π 0).HasBasis (fun Ξ³ => Ξ³ β 0) Iio",
" (β¨
Ξ³, β¨
(_ : Ξ³ β 0), π (Iio Ξ³)).HasBasis (fun Ξ³ => Ξ³ β 0) Iio",
" DirectedOn ((fun Ξ³ => Iio Ξ³) β»ΒΉ'o fun x x_1 => x β₯ x_1... |
import Mathlib.AlgebraicTopology.DoldKan.Faces
import Mathlib.CategoryTheory.Idempotents.Basic
#align_import algebraic_topology.dold_kan.projections from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504"
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Preadditive
CategoryTheory.SimplicialObject Opposite CategoryTheory.Idempotents
open Simplicial DoldKan
noncomputable section
namespace AlgebraicTopology
namespace DoldKan
variable {C : Type*} [Category C] [Preadditive C] {X : SimplicialObject C}
noncomputable def P : β β (K[X] βΆ K[X])
| 0 => π _
| q + 1 => P q β« (π _ + HΟ q)
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.P AlgebraicTopology.DoldKan.P
-- Porting note: `P_zero` and `P_succ` have been added to ease the port, because
-- `unfold P` would sometimes unfold to a `match` rather than the induction formula
lemma P_zero : (P 0 : K[X] βΆ K[X]) = π _ := rfl
lemma P_succ (q : β) : (P (q+1) : K[X] βΆ K[X]) = P q β« (π _ + HΟ q) := rfl
@[simp]
| Mathlib/AlgebraicTopology/DoldKan/Projections.lean | 61 | 65 | theorem P_f_0_eq (q : β) : ((P q).f 0 : X _[0] βΆ X _[0]) = π _ := by |
induction' q with q hq
Β· rfl
Β· simp only [P_succ, HomologicalComplex.add_f_apply, HomologicalComplex.comp_f,
HomologicalComplex.id_f, id_comp, hq, HΟ_eq_zero, add_zero]
| [
" (P q).f 0 = π (K[X].X 0)",
" (P 0).f 0 = π (K[X].X 0)",
" (P (q + 1)).f 0 = π (K[X].X 0)"
] | [] |
import Mathlib.Algebra.Module.BigOperators
import Mathlib.Data.Fintype.BigOperators
import Mathlib.LinearAlgebra.AffineSpace.AffineMap
import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.Tactic.FinCases
#align_import linear_algebra.affine_space.combination from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0"
noncomputable section
open Affine
namespace Finset
theorem univ_fin2 : (univ : Finset (Fin 2)) = {0, 1} := by
ext x
fin_cases x <;> simp
#align finset.univ_fin2 Finset.univ_fin2
variable {k : Type*} {V : Type*} {P : Type*} [Ring k] [AddCommGroup V] [Module k V]
variable [S : AffineSpace V P]
variable {ΞΉ : Type*} (s : Finset ΞΉ)
variable {ΞΉβ : Type*} (sβ : Finset ΞΉβ)
def weightedVSubOfPoint (p : ΞΉ β P) (b : P) : (ΞΉ β k) ββ[k] V :=
β i β s, (LinearMap.proj i : (ΞΉ β k) ββ[k] k).smulRight (p i -α΅₯ b)
#align finset.weighted_vsub_of_point Finset.weightedVSubOfPoint
@[simp]
theorem weightedVSubOfPoint_apply (w : ΞΉ β k) (p : ΞΉ β P) (b : P) :
s.weightedVSubOfPoint p b w = β i β s, w i β’ (p i -α΅₯ b) := by
simp [weightedVSubOfPoint, LinearMap.sum_apply]
#align finset.weighted_vsub_of_point_apply Finset.weightedVSubOfPoint_apply
@[simp (high)]
theorem weightedVSubOfPoint_apply_const (w : ΞΉ β k) (p : P) (b : P) :
s.weightedVSubOfPoint (fun _ => p) b w = (β i β s, w i) β’ (p -α΅₯ b) := by
rw [weightedVSubOfPoint_apply, sum_smul]
#align finset.weighted_vsub_of_point_apply_const Finset.weightedVSubOfPoint_apply_const
theorem weightedVSubOfPoint_congr {wβ wβ : ΞΉ β k} (hw : β i β s, wβ i = wβ i) {pβ pβ : ΞΉ β P}
(hp : β i β s, pβ i = pβ i) (b : P) :
s.weightedVSubOfPoint pβ b wβ = s.weightedVSubOfPoint pβ b wβ := by
simp_rw [weightedVSubOfPoint_apply]
refine sum_congr rfl fun i hi => ?_
rw [hw i hi, hp i hi]
#align finset.weighted_vsub_of_point_congr Finset.weightedVSubOfPoint_congr
| Mathlib/LinearAlgebra/AffineSpace/Combination.lean | 96 | 104 | theorem weightedVSubOfPoint_eq_of_weights_eq (p : ΞΉ β P) (j : ΞΉ) (wβ wβ : ΞΉ β k)
(hw : β i, i β j β wβ i = wβ i) :
s.weightedVSubOfPoint p (p j) wβ = s.weightedVSubOfPoint p (p j) wβ := by |
simp only [Finset.weightedVSubOfPoint_apply]
congr
ext i
rcases eq_or_ne i j with h | h
Β· simp [h]
Β· simp [hw i h]
| [
" univ = {0, 1}",
" x β univ β x β {0, 1}",
" β¨0, β―β© β univ β β¨0, β―β© β {0, 1}",
" β¨1, β―β© β univ β β¨1, β―β© β {0, 1}",
" (s.weightedVSubOfPoint p b) w = β i β s, w i β’ (p i -α΅₯ b)",
" (s.weightedVSubOfPoint (fun x => p) b) w = (β i β s, w i) β’ (p -α΅₯ b)",
" (s.weightedVSubOfPoint pβ b) wβ = (s.weightedVSubOf... | [
" univ = {0, 1}",
" x β univ β x β {0, 1}",
" β¨0, β―β© β univ β β¨0, β―β© β {0, 1}",
" β¨1, β―β© β univ β β¨1, β―β© β {0, 1}",
" (s.weightedVSubOfPoint p b) w = β i β s, w i β’ (p i -α΅₯ b)",
" (s.weightedVSubOfPoint (fun x => p) b) w = (β i β s, w i) β’ (p -α΅₯ b)",
" (s.weightedVSubOfPoint pβ b) wβ = (s.weightedVSubOf... |
import Batteries.Data.UInt
@[ext] theorem Char.ext : {a b : Char} β a.val = b.val β a = b
| β¨_,_β©, β¨_,_β©, rfl => rfl
theorem Char.ext_iff {x y : Char} : x = y β x.val = y.val := β¨congrArg _, Char.extβ©
theorem Char.le_antisymm_iff {x y : Char} : x = y β x β€ y β§ y β€ x :=
Char.ext_iff.trans UInt32.le_antisymm_iff
theorem Char.le_antisymm {x y : Char} (h1 : x β€ y) (h2 : y β€ x) : x = y :=
Char.le_antisymm_iff.2 β¨h1, h2β©
instance : Batteries.LawfulOrd Char := .compareOfLessAndEq
(fun _ => Nat.lt_irrefl _) Nat.lt_trans Nat.not_lt Char.le_antisymm
namespace String
private theorem csize_eq (c) :
csize c = 1 β¨ csize c = 2 β¨ csize c = 3 β¨
csize c = 4 := by
simp only [csize, Char.utf8Size]
repeat (first | split | (solve | simp (config := {decide := true})))
| .lake/packages/batteries/Batteries/Data/Char.lean | 30 | 31 | theorem csize_pos (c) : 0 < csize c := by |
rcases csize_eq c with _|_|_|_ <;> simp_all (config := {decide := true})
| [] | [] |
import Mathlib.Data.ENNReal.Inv
#align_import data.real.ennreal from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520"
open Set NNReal ENNReal
namespace ENNReal
section iInf
variable {ΞΉ : Sort*} {f g : ΞΉ β ββ₯0β}
variable {a b c d : ββ₯0β} {r p q : ββ₯0}
theorem toNNReal_iInf (hf : β i, f i β β) : (iInf f).toNNReal = β¨
i, (f i).toNNReal := by
cases isEmpty_or_nonempty ΞΉ
Β· rw [iInf_of_empty, top_toNNReal, NNReal.iInf_empty]
Β· lift f to ΞΉ β ββ₯0 using hf
simp_rw [β coe_iInf, toNNReal_coe]
#align ennreal.to_nnreal_infi ENNReal.toNNReal_iInf
theorem toNNReal_sInf (s : Set ββ₯0β) (hs : β r β s, r β β) :
(sInf s).toNNReal = sInf (ENNReal.toNNReal '' s) := by
have hf : β i, ((β) : s β ββ₯0β) i β β := fun β¨r, rsβ© => hs r rs
-- Porting note: `β sInf_image'` had to be replaced by `β image_eq_range` as the lemmas are used
-- in a different order.
simpa only [β sInf_range, β image_eq_range, Subtype.range_coe_subtype] using (toNNReal_iInf hf)
#align ennreal.to_nnreal_Inf ENNReal.toNNReal_sInf
theorem toNNReal_iSup (hf : β i, f i β β) : (iSup f).toNNReal = β¨ i, (f i).toNNReal := by
lift f to ΞΉ β ββ₯0 using hf
simp_rw [toNNReal_coe]
by_cases h : BddAbove (range f)
Β· rw [β coe_iSup h, toNNReal_coe]
Β· rw [NNReal.iSup_of_not_bddAbove h, iSup_coe_eq_top.2 h, top_toNNReal]
#align ennreal.to_nnreal_supr ENNReal.toNNReal_iSup
theorem toNNReal_sSup (s : Set ββ₯0β) (hs : β r β s, r β β) :
(sSup s).toNNReal = sSup (ENNReal.toNNReal '' s) := by
have hf : β i, ((β) : s β ββ₯0β) i β β := fun β¨r, rsβ© => hs r rs
-- Porting note: `β sSup_image'` had to be replaced by `β image_eq_range` as the lemmas are used
-- in a different order.
simpa only [β sSup_range, β image_eq_range, Subtype.range_coe_subtype] using (toNNReal_iSup hf)
#align ennreal.to_nnreal_Sup ENNReal.toNNReal_sSup
theorem toReal_iInf (hf : β i, f i β β) : (iInf f).toReal = β¨
i, (f i).toReal := by
simp only [ENNReal.toReal, toNNReal_iInf hf, NNReal.coe_iInf]
#align ennreal.to_real_infi ENNReal.toReal_iInf
theorem toReal_sInf (s : Set ββ₯0β) (hf : β r β s, r β β) :
(sInf s).toReal = sInf (ENNReal.toReal '' s) := by
simp only [ENNReal.toReal, toNNReal_sInf s hf, NNReal.coe_sInf, Set.image_image]
#align ennreal.to_real_Inf ENNReal.toReal_sInf
theorem toReal_iSup (hf : β i, f i β β) : (iSup f).toReal = β¨ i, (f i).toReal := by
simp only [ENNReal.toReal, toNNReal_iSup hf, NNReal.coe_iSup]
#align ennreal.to_real_supr ENNReal.toReal_iSup
theorem toReal_sSup (s : Set ββ₯0β) (hf : β r β s, r β β) :
(sSup s).toReal = sSup (ENNReal.toReal '' s) := by
simp only [ENNReal.toReal, toNNReal_sSup s hf, NNReal.coe_sSup, Set.image_image]
#align ennreal.to_real_Sup ENNReal.toReal_sSup
theorem iInf_add : iInf f + a = β¨
i, f i + a :=
le_antisymm (le_iInf fun _ => add_le_add (iInf_le _ _) <| le_rfl)
(tsub_le_iff_right.1 <| le_iInf fun _ => tsub_le_iff_right.2 <| iInf_le _ _)
#align ennreal.infi_add ENNReal.iInf_add
theorem iSup_sub : (β¨ i, f i) - a = β¨ i, f i - a :=
le_antisymm (tsub_le_iff_right.2 <| iSup_le fun i => tsub_le_iff_right.1 <| le_iSup (f Β· - a) i)
(iSup_le fun _ => tsub_le_tsub (le_iSup _ _) (le_refl a))
#align ennreal.supr_sub ENNReal.iSup_sub
theorem sub_iInf : (a - β¨
i, f i) = β¨ i, a - f i := by
refine eq_of_forall_ge_iff fun c => ?_
rw [tsub_le_iff_right, add_comm, iInf_add]
simp [tsub_le_iff_right, sub_eq_add_neg, add_comm]
#align ennreal.sub_infi ENNReal.sub_iInf
theorem sInf_add {s : Set ββ₯0β} : sInf s + a = β¨
b β s, b + a := by simp [sInf_eq_iInf, iInf_add]
#align ennreal.Inf_add ENNReal.sInf_add
| Mathlib/Data/ENNReal/Real.lean | 609 | 610 | theorem add_iInf {a : ββ₯0β} : a + iInf f = β¨
b, a + f b := by |
rw [add_comm, iInf_add]; simp [add_comm]
| [
" (iInf f).toNNReal = β¨
i, (f i).toNNReal",
" (β¨
i, β(f i)).toNNReal = β¨
i, ((fun i => β(f i)) i).toNNReal",
" (sInf s).toNNReal = sInf (ENNReal.toNNReal '' s)",
" (iSup f).toNNReal = β¨ i, (f i).toNNReal",
" (β¨ i, β(f i)).toNNReal = β¨ i, ((fun i => β(f i)) i).toNNReal",
" (β¨ i, β(f i)).toNNReal = β¨ i, f i... | [
" (iInf f).toNNReal = β¨
i, (f i).toNNReal",
" (β¨
i, β(f i)).toNNReal = β¨
i, ((fun i => β(f i)) i).toNNReal",
" (sInf s).toNNReal = sInf (ENNReal.toNNReal '' s)",
" (iSup f).toNNReal = β¨ i, (f i).toNNReal",
" (β¨ i, β(f i)).toNNReal = β¨ i, ((fun i => β(f i)) i).toNNReal",
" (β¨ i, β(f i)).toNNReal = β¨ i, f i... |
import Mathlib.Analysis.Convex.Topology
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.Seminorm
import Mathlib.Analysis.LocallyConvex.Bounded
import Mathlib.Analysis.RCLike.Basic
#align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d"
open NormedField Set
open scoped Pointwise Topology NNReal
noncomputable section
variable {π E F : Type*}
section AddCommGroup
variable [AddCommGroup E] [Module β E]
def gauge (s : Set E) (x : E) : β :=
sInf { r : β | 0 < r β§ x β r β’ s }
#align gauge gauge
variable {s t : Set E} {x : E} {a : β}
theorem gauge_def : gauge s x = sInf ({ r β Set.Ioi (0 : β) | x β r β’ s }) :=
rfl
#align gauge_def gauge_def
| Mathlib/Analysis/Convex/Gauge.lean | 66 | 68 | theorem gauge_def' : gauge s x = sInf {r β Set.Ioi (0 : β) | rβ»ΒΉ β’ x β s} := by |
congrm sInf {r | ?_}
exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ hr.ne' _ _
| [
" gauge s x = sInf {r | r β Ioi 0 β§ rβ»ΒΉ β’ x β s}",
" 0 < r β§ x β r β’ s β r β Ioi 0 β§ rβ»ΒΉ β’ x β s"
] | [] |
import Mathlib.Algebra.Group.Fin
import Mathlib.Algebra.NeZero
import Mathlib.Data.Nat.ModEq
import Mathlib.Data.Fintype.Card
#align_import data.zmod.defs from "leanprover-community/mathlib"@"3a2b5524a138b5d0b818b858b516d4ac8a484b03"
def ZMod : β β Type
| 0 => β€
| n + 1 => Fin (n + 1)
#align zmod ZMod
instance ZMod.decidableEq : β n : β, DecidableEq (ZMod n)
| 0 => inferInstanceAs (DecidableEq β€)
| n + 1 => inferInstanceAs (DecidableEq (Fin (n + 1)))
#align zmod.decidable_eq ZMod.decidableEq
instance ZMod.repr : β n : β, Repr (ZMod n)
| 0 => by dsimp [ZMod]; infer_instance
| n + 1 => by dsimp [ZMod]; infer_instance
#align zmod.has_repr ZMod.repr
namespace ZMod
instance instUnique : Unique (ZMod 1) := Fin.uniqueFinOne
instance fintype : β (n : β) [NeZero n], Fintype (ZMod n)
| 0, h => (h.ne rfl).elim
| n + 1, _ => Fin.fintype (n + 1)
#align zmod.fintype ZMod.fintype
instance infinite : Infinite (ZMod 0) :=
Int.infinite
#align zmod.infinite ZMod.infinite
@[simp]
| Mathlib/Data/ZMod/Defs.lean | 124 | 127 | theorem card (n : β) [Fintype (ZMod n)] : Fintype.card (ZMod n) = n := by |
cases n with
| zero => exact (not_finite (ZMod 0)).elim
| succ n => convert Fintype.card_fin (n + 1) using 2
| [
" Repr (ZMod 0)",
" Repr β€",
" Repr (ZMod (n + 1))",
" Repr (Fin (n + 1))",
" Fintype.card (ZMod n) = n",
" Fintype.card (ZMod 0) = 0",
" Fintype.card (ZMod (n + 1)) = n + 1"
] | [
" Repr (ZMod 0)",
" Repr β€",
" Repr (ZMod (n + 1))",
" Repr (Fin (n + 1))"
] |
import Mathlib.Algebra.Ring.Prod
import Mathlib.GroupTheory.OrderOfElement
import Mathlib.Tactic.FinCases
#align_import data.zmod.basic from "leanprover-community/mathlib"@"74ad1c88c77e799d2fea62801d1dbbd698cff1b7"
assert_not_exists Submodule
open Function
namespace ZMod
instance charZero : CharZero (ZMod 0) := inferInstanceAs (CharZero β€)
def val : β {n : β}, ZMod n β β
| 0 => Int.natAbs
| n + 1 => ((β) : Fin (n + 1) β β)
#align zmod.val ZMod.val
theorem val_lt {n : β} [NeZero n] (a : ZMod n) : a.val < n := by
cases n
Β· cases NeZero.ne 0 rfl
exact Fin.is_lt a
#align zmod.val_lt ZMod.val_lt
theorem val_le {n : β} [NeZero n] (a : ZMod n) : a.val β€ n :=
a.val_lt.le
#align zmod.val_le ZMod.val_le
@[simp]
theorem val_zero : β {n}, (0 : ZMod n).val = 0
| 0 => rfl
| _ + 1 => rfl
#align zmod.val_zero ZMod.val_zero
@[simp]
theorem val_one' : (1 : ZMod 0).val = 1 :=
rfl
#align zmod.val_one' ZMod.val_one'
@[simp]
theorem val_neg' {n : ZMod 0} : (-n).val = n.val :=
Int.natAbs_neg n
#align zmod.val_neg' ZMod.val_neg'
@[simp]
theorem val_mul' {m n : ZMod 0} : (m * n).val = m.val * n.val :=
Int.natAbs_mul m n
#align zmod.val_mul' ZMod.val_mul'
@[simp]
theorem val_natCast {n : β} (a : β) : (a : ZMod n).val = a % n := by
cases n
Β· rw [Nat.mod_zero]
exact Int.natAbs_ofNat a
Β· apply Fin.val_natCast
#align zmod.val_nat_cast ZMod.val_natCast
@[deprecated (since := "2024-04-17")]
alias val_nat_cast := val_natCast
theorem val_unit' {n : ZMod 0} : IsUnit n β n.val = 1 := by
simp only [val]
rw [Int.isUnit_iff, Int.natAbs_eq_iff, Nat.cast_one]
lemma eq_one_of_isUnit_natCast {n : β} (h : IsUnit (n : ZMod 0)) : n = 1 := by
rw [β Nat.mod_zero n, β val_natCast, val_unit'.mp h]
theorem val_natCast_of_lt {n a : β} (h : a < n) : (a : ZMod n).val = a := by
rwa [val_natCast, Nat.mod_eq_of_lt]
@[deprecated (since := "2024-04-17")]
alias val_nat_cast_of_lt := val_natCast_of_lt
instance charP (n : β) : CharP (ZMod n) n where
cast_eq_zero_iff' := by
intro k
cases' n with n
Β· simp [zero_dvd_iff, Int.natCast_eq_zero, Nat.zero_eq]
Β· exact Fin.natCast_eq_zero
@[simp]
theorem addOrderOf_one (n : β) : addOrderOf (1 : ZMod n) = n :=
CharP.eq _ (CharP.addOrderOf_one _) (ZMod.charP n)
#align zmod.add_order_of_one ZMod.addOrderOf_one
@[simp]
theorem addOrderOf_coe (a : β) {n : β} (n0 : n β 0) : addOrderOf (a : ZMod n) = n / n.gcd a := by
cases' a with a
Β· simp only [Nat.zero_eq, Nat.cast_zero, addOrderOf_zero, Nat.gcd_zero_right,
Nat.pos_of_ne_zero n0, Nat.div_self]
rw [β Nat.smul_one_eq_cast, addOrderOf_nsmul' _ a.succ_ne_zero, ZMod.addOrderOf_one]
#align zmod.add_order_of_coe ZMod.addOrderOf_coe
@[simp]
theorem addOrderOf_coe' {a : β} (n : β) (a0 : a β 0) : addOrderOf (a : ZMod n) = n / n.gcd a := by
rw [β Nat.smul_one_eq_cast, addOrderOf_nsmul' _ a0, ZMod.addOrderOf_one]
#align zmod.add_order_of_coe' ZMod.addOrderOf_coe'
theorem ringChar_zmod_n (n : β) : ringChar (ZMod n) = n := by
rw [ringChar.eq_iff]
exact ZMod.charP n
#align zmod.ring_char_zmod_n ZMod.ringChar_zmod_n
-- @[simp] -- Porting note (#10618): simp can prove this
theorem natCast_self (n : β) : (n : ZMod n) = 0 :=
CharP.cast_eq_zero (ZMod n) n
#align zmod.nat_cast_self ZMod.natCast_self
@[deprecated (since := "2024-04-17")]
alias nat_cast_self := natCast_self
@[simp]
theorem natCast_self' (n : β) : (n + 1 : ZMod (n + 1)) = 0 := by
rw [β Nat.cast_add_one, natCast_self (n + 1)]
#align zmod.nat_cast_self' ZMod.natCast_self'
@[deprecated (since := "2024-04-17")]
alias nat_cast_self' := natCast_self'
section UniversalProperty
variable {n : β} {R : Type*}
section
variable [AddGroupWithOne R]
def cast : β {n : β}, ZMod n β R
| 0 => Int.cast
| _ + 1 => fun i => i.val
#align zmod.cast ZMod.cast
@[simp]
theorem cast_zero : (cast (0 : ZMod n) : R) = 0 := by
delta ZMod.cast
cases n
Β· exact Int.cast_zero
Β· simp
#align zmod.cast_zero ZMod.cast_zero
| Mathlib/Data/ZMod/Basic.lean | 183 | 186 | theorem cast_eq_val [NeZero n] (a : ZMod n) : (cast a : R) = a.val := by |
cases n
Β· cases NeZero.ne 0 rfl
rfl
| [
" a.val < n",
" a.val < 0",
" a.val < nβ + 1",
" (βa).val = a % n",
" (βa).val = a % 0",
" (βa).val = a",
" (βa).val = a % (nβ + 1)",
" IsUnit n β n.val = 1",
" IsUnit n β Int.natAbs n = 1",
" n = 1",
" β (x : β), βx = 0 β n β£ x",
" βk = 0 β n β£ k",
" βk = 0 β 0 β£ k",
" βk = 0 β n + 1 β£ k"... | [
" a.val < n",
" a.val < 0",
" a.val < nβ + 1",
" (βa).val = a % n",
" (βa).val = a % 0",
" (βa).val = a",
" (βa).val = a % (nβ + 1)",
" IsUnit n β n.val = 1",
" IsUnit n β Int.natAbs n = 1",
" n = 1",
" β (x : β), βx = 0 β n β£ x",
" βk = 0 β n β£ k",
" βk = 0 β 0 β£ k",
" βk = 0 β n + 1 β£ k"... |
import Mathlib.Algebra.Group.Units
import Mathlib.Algebra.GroupWithZero.Basic
import Mathlib.Logic.Equiv.Defs
import Mathlib.Tactic.Contrapose
import Mathlib.Tactic.Nontriviality
import Mathlib.Tactic.Spread
import Mathlib.Util.AssertExists
#align_import algebra.group_with_zero.units.basic from "leanprover-community/mathlib"@"df5e9937a06fdd349fc60106f54b84d47b1434f0"
-- Guard against import creep
assert_not_exists Multiplicative
assert_not_exists DenselyOrdered
variable {Ξ± Mβ Gβ Mβ' Gβ' F F' : Type*}
variable [MonoidWithZero Mβ]
@[simp]
theorem isUnit_zero_iff : IsUnit (0 : Mβ) β (0 : Mβ) = 1 :=
β¨fun β¨β¨_, a, (a0 : 0 * a = 1), _β©, rflβ© => by rwa [zero_mul] at a0, fun h =>
@isUnit_of_subsingleton _ _ (subsingleton_of_zero_eq_one h) 0β©
#align is_unit_zero_iff isUnit_zero_iff
-- Porting note: removed `simp` tag because `simpNF` says it's redundant
theorem not_isUnit_zero [Nontrivial Mβ] : Β¬IsUnit (0 : Mβ) :=
mt isUnit_zero_iff.1 zero_ne_one
#align not_is_unit_zero not_isUnit_zero
namespace Ring
open scoped Classical
noncomputable def inverse : Mβ β Mβ := fun x => if h : IsUnit x then ((h.unitβ»ΒΉ : MβΛ£) : Mβ) else 0
#align ring.inverse Ring.inverse
@[simp]
theorem inverse_unit (u : MβΛ£) : inverse (u : Mβ) = (uβ»ΒΉ : MβΛ£) := by
rw [inverse, dif_pos u.isUnit, IsUnit.unit_of_val_units]
#align ring.inverse_unit Ring.inverse_unit
@[simp]
theorem inverse_non_unit (x : Mβ) (h : Β¬IsUnit x) : inverse x = 0 :=
dif_neg h
#align ring.inverse_non_unit Ring.inverse_non_unit
theorem mul_inverse_cancel (x : Mβ) (h : IsUnit x) : x * inverse x = 1 := by
rcases h with β¨u, rflβ©
rw [inverse_unit, Units.mul_inv]
#align ring.mul_inverse_cancel Ring.mul_inverse_cancel
theorem inverse_mul_cancel (x : Mβ) (h : IsUnit x) : inverse x * x = 1 := by
rcases h with β¨u, rflβ©
rw [inverse_unit, Units.inv_mul]
#align ring.inverse_mul_cancel Ring.inverse_mul_cancel
| Mathlib/Algebra/GroupWithZero/Units/Basic.lean | 118 | 119 | theorem mul_inverse_cancel_right (x y : Mβ) (h : IsUnit x) : y * x * inverse x = y := by |
rw [mul_assoc, mul_inverse_cancel x h, mul_one]
| [
" 0 = 1",
" inverse βu = βuβ»ΒΉ",
" x * inverse x = 1",
" βu * inverse βu = 1",
" inverse x * x = 1",
" inverse βu * βu = 1",
" y * x * inverse x = y"
] | [
" 0 = 1",
" inverse βu = βuβ»ΒΉ",
" x * inverse x = 1",
" βu * inverse βu = 1",
" inverse x * x = 1",
" inverse βu * βu = 1"
] |
import Mathlib.CategoryTheory.Limits.Shapes.CommSq
import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial
import Mathlib.CategoryTheory.Limits.Shapes.Types
import Mathlib.Topology.Category.TopCat.Limits.Pullbacks
import Mathlib.CategoryTheory.Limits.FunctorCategory
import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts
import Mathlib.CategoryTheory.Limits.VanKampen
#align_import category_theory.extensive from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1"
open CategoryTheory.Limits
namespace CategoryTheory
universe v' u' v u v'' u''
variable {J : Type v'} [Category.{u'} J] {C : Type u} [Category.{v} C]
variable {D : Type u''} [Category.{v''} D]
section Extensive
variable {X Y : C}
class HasPullbacksOfInclusions (C : Type u) [Category.{v} C] [HasBinaryCoproducts C] : Prop where
[hasPullbackInl : β {X Y Z : C} (f : Z βΆ X β¨Ώ Y), HasPullback coprod.inl f]
attribute [instance] HasPullbacksOfInclusions.hasPullbackInl
class PreservesPullbacksOfInclusions {C : Type*} [Category C] {D : Type*} [Category D]
(F : C β₯€ D) [HasBinaryCoproducts C] where
[preservesPullbackInl : β {X Y Z : C} (f : Z βΆ X β¨Ώ Y), PreservesLimit (cospan coprod.inl f) F]
attribute [instance] PreservesPullbacksOfInclusions.preservesPullbackInl
class FinitaryPreExtensive (C : Type u) [Category.{v} C] : Prop where
[hasFiniteCoproducts : HasFiniteCoproducts C]
[hasPullbacksOfInclusions : HasPullbacksOfInclusions C]
universal' : β {X Y : C} (c : BinaryCofan X Y), IsColimit c β IsUniversalColimit c
attribute [instance] FinitaryPreExtensive.hasFiniteCoproducts
attribute [instance] FinitaryPreExtensive.hasPullbacksOfInclusions
class FinitaryExtensive (C : Type u) [Category.{v} C] : Prop where
[hasFiniteCoproducts : HasFiniteCoproducts C]
[hasPullbacksOfInclusions : HasPullbacksOfInclusions C]
van_kampen' : β {X Y : C} (c : BinaryCofan X Y), IsColimit c β IsVanKampenColimit c
#align category_theory.finitary_extensive CategoryTheory.FinitaryExtensive
attribute [instance] FinitaryExtensive.hasFiniteCoproducts
attribute [instance] FinitaryExtensive.hasPullbacksOfInclusions
| Mathlib/CategoryTheory/Extensive.lean | 102 | 112 | theorem FinitaryExtensive.vanKampen [FinitaryExtensive C] {F : Discrete WalkingPair β₯€ C}
(c : Cocone F) (hc : IsColimit c) : IsVanKampenColimit c := by |
let X := F.obj β¨WalkingPair.leftβ©
let Y := F.obj β¨WalkingPair.rightβ©
have : F = pair X Y := by
apply Functor.hext
Β· rintro β¨β¨β©β© <;> rfl
Β· rintro β¨β¨β©β© β¨jβ© β¨β¨rfl : _ = jβ©β© <;> simp
clear_value X Y
subst this
exact FinitaryExtensive.van_kampen' c hc
| [
" IsVanKampenColimit c",
" F = pair X Y",
" β (X_1 : Discrete WalkingPair), F.obj X_1 = (pair X Y).obj X_1",
" F.obj { as := WalkingPair.left } = (pair X Y).obj { as := WalkingPair.left }",
" F.obj { as := WalkingPair.right } = (pair X Y).obj { as := WalkingPair.right }",
" β (X_1 Y_1 : Discrete WalkingPa... | [] |
import Mathlib.Analysis.Analytic.Composition
#align_import analysis.analytic.inverse from "leanprover-community/mathlib"@"284fdd2962e67d2932fa3a79ce19fcf92d38e228"
open scoped Classical Topology
open Finset Filter
namespace FormalMultilinearSeries
variable {π : Type*} [NontriviallyNormedField π] {E : Type*} [NormedAddCommGroup E]
[NormedSpace π E] {F : Type*} [NormedAddCommGroup F] [NormedSpace π F]
noncomputable def leftInv (p : FormalMultilinearSeries π E F) (i : E βL[π] F) :
FormalMultilinearSeries π F E
| 0 => 0
| 1 => (continuousMultilinearCurryFin1 π F E).symm i.symm
| n + 2 =>
-β c : { c : Composition (n + 2) // c.length < n + 2 },
(leftInv p i (c : Composition (n + 2)).length).compAlongComposition
(p.compContinuousLinearMap i.symm) c
#align formal_multilinear_series.left_inv FormalMultilinearSeries.leftInv
@[simp]
theorem leftInv_coeff_zero (p : FormalMultilinearSeries π E F) (i : E βL[π] F) :
p.leftInv i 0 = 0 := by rw [leftInv]
#align formal_multilinear_series.left_inv_coeff_zero FormalMultilinearSeries.leftInv_coeff_zero
@[simp]
theorem leftInv_coeff_one (p : FormalMultilinearSeries π E F) (i : E βL[π] F) :
p.leftInv i 1 = (continuousMultilinearCurryFin1 π F E).symm i.symm := by rw [leftInv]
#align formal_multilinear_series.left_inv_coeff_one FormalMultilinearSeries.leftInv_coeff_one
theorem leftInv_removeZero (p : FormalMultilinearSeries π E F) (i : E βL[π] F) :
p.removeZero.leftInv i = p.leftInv i := by
ext1 n
induction' n using Nat.strongRec' with n IH
match n with
| 0 => simp -- if one replaces `simp` with `refl`, the proof times out in the kernel.
| 1 => simp -- TODO: why?
| n + 2 =>
simp only [leftInv, neg_inj]
refine Finset.sum_congr rfl fun c cuniv => ?_
rcases c with β¨c, hcβ©
ext v
dsimp
simp [IH _ hc]
#align formal_multilinear_series.left_inv_remove_zero FormalMultilinearSeries.leftInv_removeZero
| Mathlib/Analysis/Analytic/Inverse.lean | 97 | 148 | theorem leftInv_comp (p : FormalMultilinearSeries π E F) (i : E βL[π] F)
(h : p 1 = (continuousMultilinearCurryFin1 π E F).symm i) : (leftInv p i).comp p = id π E := by |
ext (n v)
match n with
| 0 =>
simp only [leftInv_coeff_zero, ContinuousMultilinearMap.zero_apply, id_apply_ne_one, Ne,
not_false_iff, zero_ne_one, comp_coeff_zero']
| 1 =>
simp only [leftInv_coeff_one, comp_coeff_one, h, id_apply_one, ContinuousLinearEquiv.coe_apply,
ContinuousLinearEquiv.symm_apply_apply, continuousMultilinearCurryFin1_symm_apply]
| n + 2 =>
have A :
(Finset.univ : Finset (Composition (n + 2))) =
{c | Composition.length c < n + 2}.toFinset βͺ {Composition.ones (n + 2)} := by
refine Subset.antisymm (fun c _ => ?_) (subset_univ _)
by_cases h : c.length < n + 2
Β· simp [h, Set.mem_toFinset (s := {c | Composition.length c < n + 2})]
Β· simp [Composition.eq_ones_iff_le_length.2 (not_lt.1 h)]
have B :
Disjoint ({c | Composition.length c < n + 2} : Set (Composition (n + 2))).toFinset
{Composition.ones (n + 2)} := by
simp [Set.mem_toFinset (s := {c | Composition.length c < n + 2})]
have C :
((p.leftInv i (Composition.ones (n + 2)).length)
fun j : Fin (Composition.ones n.succ.succ).length =>
p 1 fun _ => v ((Fin.castLE (Composition.length_le _)) j)) =
p.leftInv i (n + 2) fun j : Fin (n + 2) => p 1 fun _ => v j := by
apply FormalMultilinearSeries.congr _ (Composition.ones_length _) fun j hj1 hj2 => ?_
exact FormalMultilinearSeries.congr _ rfl fun k _ _ => by congr
have D :
(p.leftInv i (n + 2) fun j : Fin (n + 2) => p 1 fun _ => v j) =
-β c β {c : Composition (n + 2) | c.length < n + 2}.toFinset,
(p.leftInv i c.length) (p.applyComposition c v) := by
simp only [leftInv, ContinuousMultilinearMap.neg_apply, neg_inj,
ContinuousMultilinearMap.sum_apply]
convert
(sum_toFinset_eq_subtype
(fun c : Composition (n + 2) => c.length < n + 2)
(fun c : Composition (n + 2) =>
(ContinuousMultilinearMap.compAlongComposition
(p.compContinuousLinearMap (i.symm : F βL[π] E)) c (p.leftInv i c.length))
fun j : Fin (n + 2) => p 1 fun _ : Fin 1 => v j)).symm.trans
_
simp only [compContinuousLinearMap_applyComposition,
ContinuousMultilinearMap.compAlongComposition_apply]
congr
ext c
congr
ext k
simp [h, Function.comp]
simp [FormalMultilinearSeries.comp, show n + 2 β 1 by omega, A, Finset.sum_union B,
applyComposition_ones, C, D, -Set.toFinset_setOf]
| [
" p.leftInv i 0 = 0",
" p.leftInv i 1 = (continuousMultilinearCurryFin1 π F E).symm βi.symm",
" p.removeZero.leftInv i = p.leftInv i",
" p.removeZero.leftInv i n = p.leftInv i n",
" p.removeZero.leftInv i 0 = p.leftInv i 0",
" p.removeZero.leftInv i 1 = p.leftInv i 1",
" p.removeZero.leftInv i (n + 2) ... | [
" p.leftInv i 0 = 0",
" p.leftInv i 1 = (continuousMultilinearCurryFin1 π F E).symm βi.symm",
" p.removeZero.leftInv i = p.leftInv i",
" p.removeZero.leftInv i n = p.leftInv i n",
" p.removeZero.leftInv i 0 = p.leftInv i 0",
" p.removeZero.leftInv i 1 = p.leftInv i 1",
" p.removeZero.leftInv i (n + 2) ... |
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Data.Int.Log
#align_import analysis.special_functions.log.base from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690"
open Set Filter Function
open Topology
noncomputable section
namespace Real
variable {b x y : β}
-- @[pp_nodot] -- Porting note: removed
noncomputable def logb (b x : β) : β :=
log x / log b
#align real.logb Real.logb
theorem log_div_log : log x / log b = logb b x :=
rfl
#align real.log_div_log Real.log_div_log
@[simp]
theorem logb_zero : logb b 0 = 0 := by simp [logb]
#align real.logb_zero Real.logb_zero
@[simp]
theorem logb_one : logb b 1 = 0 := by simp [logb]
#align real.logb_one Real.logb_one
@[simp]
lemma logb_self_eq_one (hb : 1 < b) : logb b b = 1 :=
div_self (log_pos hb).ne'
lemma logb_self_eq_one_iff : logb b b = 1 β b β 0 β§ b β 1 β§ b β -1 :=
Iff.trans β¨fun h h' => by simp [logb, h'] at h, div_selfβ© log_ne_zero
@[simp]
theorem logb_abs (x : β) : logb b |x| = logb b x := by rw [logb, logb, log_abs]
#align real.logb_abs Real.logb_abs
@[simp]
theorem logb_neg_eq_logb (x : β) : logb b (-x) = logb b x := by
rw [β logb_abs x, β logb_abs (-x), abs_neg]
#align real.logb_neg_eq_logb Real.logb_neg_eq_logb
theorem logb_mul (hx : x β 0) (hy : y β 0) : logb b (x * y) = logb b x + logb b y := by
simp_rw [logb, log_mul hx hy, add_div]
#align real.logb_mul Real.logb_mul
theorem logb_div (hx : x β 0) (hy : y β 0) : logb b (x / y) = logb b x - logb b y := by
simp_rw [logb, log_div hx hy, sub_div]
#align real.logb_div Real.logb_div
@[simp]
theorem logb_inv (x : β) : logb b xβ»ΒΉ = -logb b x := by simp [logb, neg_div]
#align real.logb_inv Real.logb_inv
theorem inv_logb (a b : β) : (logb a b)β»ΒΉ = logb b a := by simp_rw [logb, inv_div]
#align real.inv_logb Real.inv_logb
theorem inv_logb_mul_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
(logb (a * b) c)β»ΒΉ = (logb a c)β»ΒΉ + (logb b c)β»ΒΉ := by
simp_rw [inv_logb]; exact logb_mul hβ hβ
#align real.inv_logb_mul_base Real.inv_logb_mul_base
theorem inv_logb_div_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
(logb (a / b) c)β»ΒΉ = (logb a c)β»ΒΉ - (logb b c)β»ΒΉ := by
simp_rw [inv_logb]; exact logb_div hβ hβ
#align real.inv_logb_div_base Real.inv_logb_div_base
theorem logb_mul_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
logb (a * b) c = ((logb a c)β»ΒΉ + (logb b c)β»ΒΉ)β»ΒΉ := by rw [β inv_logb_mul_base hβ hβ c, inv_inv]
#align real.logb_mul_base Real.logb_mul_base
theorem logb_div_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
logb (a / b) c = ((logb a c)β»ΒΉ - (logb b c)β»ΒΉ)β»ΒΉ := by rw [β inv_logb_div_base hβ hβ c, inv_inv]
#align real.logb_div_base Real.logb_div_base
theorem mul_logb {a b c : β} (hβ : b β 0) (hβ : b β 1) (hβ : b β -1) :
logb a b * logb b c = logb a c := by
unfold logb
rw [mul_comm, div_mul_div_cancel _ (log_ne_zero.mpr β¨hβ, hβ, hββ©)]
#align real.mul_logb Real.mul_logb
theorem div_logb {a b c : β} (hβ : c β 0) (hβ : c β 1) (hβ : c β -1) :
logb a c / logb b c = logb a b :=
div_div_div_cancel_left' _ _ <| log_ne_zero.mpr β¨hβ, hβ, hββ©
#align real.div_logb Real.div_logb
theorem logb_rpow_eq_mul_logb_of_pos (hx : 0 < x) : logb b (x ^ y) = y * logb b x := by
rw [logb, log_rpow hx, logb, mul_div_assoc]
| Mathlib/Analysis/SpecialFunctions/Log/Base.lean | 119 | 120 | theorem logb_pow {k : β} (hx : 0 < x) : logb b (x ^ k) = k * logb b x := by |
rw [β rpow_natCast, logb_rpow_eq_mul_logb_of_pos hx]
| [
" b.logb 0 = 0",
" b.logb 1 = 0",
" False",
" b.logb |x| = b.logb x",
" b.logb (-x) = b.logb x",
" b.logb (x * y) = b.logb x + b.logb y",
" b.logb (x / y) = b.logb x - b.logb y",
" b.logb xβ»ΒΉ = -b.logb x",
" (a.logb b)β»ΒΉ = b.logb a",
" ((a * b).logb c)β»ΒΉ = (a.logb c)β»ΒΉ + (b.logb c)β»ΒΉ",
" c.logb ... | [
" b.logb 0 = 0",
" b.logb 1 = 0",
" False",
" b.logb |x| = b.logb x",
" b.logb (-x) = b.logb x",
" b.logb (x * y) = b.logb x + b.logb y",
" b.logb (x / y) = b.logb x - b.logb y",
" b.logb xβ»ΒΉ = -b.logb x",
" (a.logb b)β»ΒΉ = b.logb a",
" ((a * b).logb c)β»ΒΉ = (a.logb c)β»ΒΉ + (b.logb c)β»ΒΉ",
" c.logb ... |
import Mathlib.Data.Set.Image
import Mathlib.Data.SProd
#align_import data.set.prod from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4"
open Function
namespace Set
section Prod
variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {s sβ sβ : Set Ξ±} {t tβ tβ : Set Ξ²} {a : Ξ±} {b : Ξ²}
theorem Subsingleton.prod (hs : s.Subsingleton) (ht : t.Subsingleton) :
(s ΓΛ’ t).Subsingleton := fun _x hx _y hy β¦
Prod.ext (hs hx.1 hy.1) (ht hx.2 hy.2)
noncomputable instance decidableMemProd [DecidablePred (Β· β s)] [DecidablePred (Β· β t)] :
DecidablePred (Β· β s ΓΛ’ t) := fun _ => And.decidable
#align set.decidable_mem_prod Set.decidableMemProd
@[gcongr]
theorem prod_mono (hs : sβ β sβ) (ht : tβ β tβ) : sβ ΓΛ’ tβ β sβ ΓΛ’ tβ :=
fun _ β¨hβ, hββ© => β¨hs hβ, ht hββ©
#align set.prod_mono Set.prod_mono
@[gcongr]
theorem prod_mono_left (hs : sβ β sβ) : sβ ΓΛ’ t β sβ ΓΛ’ t :=
prod_mono hs Subset.rfl
#align set.prod_mono_left Set.prod_mono_left
@[gcongr]
theorem prod_mono_right (ht : tβ β tβ) : s ΓΛ’ tβ β s ΓΛ’ tβ :=
prod_mono Subset.rfl ht
#align set.prod_mono_right Set.prod_mono_right
@[simp]
theorem prod_self_subset_prod_self : sβ ΓΛ’ sβ β sβ ΓΛ’ sβ β sβ β sβ :=
β¨fun h _ hx => (h (mk_mem_prod hx hx)).1, fun h _ hx => β¨h hx.1, h hx.2β©β©
#align set.prod_self_subset_prod_self Set.prod_self_subset_prod_self
@[simp]
theorem prod_self_ssubset_prod_self : sβ ΓΛ’ sβ β sβ ΓΛ’ sβ β sβ β sβ :=
and_congr prod_self_subset_prod_self <| not_congr prod_self_subset_prod_self
#align set.prod_self_ssubset_prod_self Set.prod_self_ssubset_prod_self
theorem prod_subset_iff {P : Set (Ξ± Γ Ξ²)} : s ΓΛ’ t β P β β x β s, β y β t, (x, y) β P :=
β¨fun h _ hx _ hy => h (mk_mem_prod hx hy), fun h β¨_, _β© hp => h _ hp.1 _ hp.2β©
#align set.prod_subset_iff Set.prod_subset_iff
theorem forall_prod_set {p : Ξ± Γ Ξ² β Prop} : (β x β s ΓΛ’ t, p x) β β x β s, β y β t, p (x, y) :=
prod_subset_iff
#align set.forall_prod_set Set.forall_prod_set
theorem exists_prod_set {p : Ξ± Γ Ξ² β Prop} : (β x β s ΓΛ’ t, p x) β β x β s, β y β t, p (x, y) := by
simp [and_assoc]
#align set.exists_prod_set Set.exists_prod_set
@[simp]
theorem prod_empty : s ΓΛ’ (β
: Set Ξ²) = β
:= by
ext
exact and_false_iff _
#align set.prod_empty Set.prod_empty
@[simp]
theorem empty_prod : (β
: Set Ξ±) ΓΛ’ t = β
:= by
ext
exact false_and_iff _
#align set.empty_prod Set.empty_prod
@[simp, mfld_simps]
theorem univ_prod_univ : @univ Ξ± ΓΛ’ @univ Ξ² = univ := by
ext
exact true_and_iff _
#align set.univ_prod_univ Set.univ_prod_univ
theorem univ_prod {t : Set Ξ²} : (univ : Set Ξ±) ΓΛ’ t = Prod.snd β»ΒΉ' t := by simp [prod_eq]
#align set.univ_prod Set.univ_prod
theorem prod_univ {s : Set Ξ±} : s ΓΛ’ (univ : Set Ξ²) = Prod.fst β»ΒΉ' s := by simp [prod_eq]
#align set.prod_univ Set.prod_univ
@[simp] lemma prod_eq_univ [Nonempty Ξ±] [Nonempty Ξ²] : s ΓΛ’ t = univ β s = univ β§ t = univ := by
simp [eq_univ_iff_forall, forall_and]
@[simp]
theorem singleton_prod : ({a} : Set Ξ±) ΓΛ’ t = Prod.mk a '' t := by
ext β¨x, yβ©
simp [and_left_comm, eq_comm]
#align set.singleton_prod Set.singleton_prod
@[simp]
theorem prod_singleton : s ΓΛ’ ({b} : Set Ξ²) = (fun a => (a, b)) '' s := by
ext β¨x, yβ©
simp [and_left_comm, eq_comm]
#align set.prod_singleton Set.prod_singleton
theorem singleton_prod_singleton : ({a} : Set Ξ±) ΓΛ’ ({b} : Set Ξ²) = {(a, b)} := by simp
#align set.singleton_prod_singleton Set.singleton_prod_singleton
@[simp]
theorem union_prod : (sβ βͺ sβ) ΓΛ’ t = sβ ΓΛ’ t βͺ sβ ΓΛ’ t := by
ext β¨x, yβ©
simp [or_and_right]
#align set.union_prod Set.union_prod
@[simp]
theorem prod_union : s ΓΛ’ (tβ βͺ tβ) = s ΓΛ’ tβ βͺ s ΓΛ’ tβ := by
ext β¨x, yβ©
simp [and_or_left]
#align set.prod_union Set.prod_union
| Mathlib/Data/Set/Prod.lean | 137 | 139 | theorem inter_prod : (sβ β© sβ) ΓΛ’ t = sβ ΓΛ’ t β© sβ ΓΛ’ t := by |
ext β¨x, yβ©
simp only [β and_and_right, mem_inter_iff, mem_prod]
| [
" (β x β s ΓΛ’ t, p x) β β x β s, β y β t, p (x, y)",
" s ΓΛ’ β
= β
",
" xβ β s ΓΛ’ β
β xβ β β
",
" β
ΓΛ’ t = β
",
" xβ β β
ΓΛ’ t β xβ β β
",
" univ ΓΛ’ univ = univ",
" xβ β univ ΓΛ’ univ β xβ β univ",
" univ ΓΛ’ t = Prod.snd β»ΒΉ' t",
" s ΓΛ’ univ = Prod.fst β»ΒΉ' s",
" s ΓΛ’ t = univ β s = univ β§ t = univ",
" {... | [
" (β x β s ΓΛ’ t, p x) β β x β s, β y β t, p (x, y)",
" s ΓΛ’ β
= β
",
" xβ β s ΓΛ’ β
β xβ β β
",
" β
ΓΛ’ t = β
",
" xβ β β
ΓΛ’ t β xβ β β
",
" univ ΓΛ’ univ = univ",
" xβ β univ ΓΛ’ univ β xβ β univ",
" univ ΓΛ’ t = Prod.snd β»ΒΉ' t",
" s ΓΛ’ univ = Prod.fst β»ΒΉ' s",
" s ΓΛ’ t = univ β s = univ β§ t = univ",
" {... |
import Mathlib.NumberTheory.ModularForms.SlashInvariantForms
import Mathlib.NumberTheory.ModularForms.CongruenceSubgroups
noncomputable section
open ModularForm UpperHalfPlane Matrix
namespace SlashInvariantForm
theorem vAdd_width_periodic (N : β) (k n : β€) (f : SlashInvariantForm (Gamma N) k) (z : β) :
f (((N * n) : β) +α΅₯ z) = f z := by
norm_cast
rw [β modular_T_zpow_smul z (N * n)]
have Hn := (ModularGroup_T_pow_mem_Gamma N (N * n) (by simp))
simp only [zpow_natCast, Int.natAbs_ofNat] at Hn
convert (SlashInvariantForm.slash_action_eqn' k (Gamma N) f β¨((ModularGroup.T ^ (N * n))), Hnβ© z)
unfold SpecialLinearGroup.coeToGL
simp only [Fin.isValue, ModularGroup.coe_T_zpow (N * n), of_apply, cons_val', cons_val_zero,
empty_val', cons_val_fin_one, cons_val_one, head_fin_const, Int.cast_zero, zero_mul, head_cons,
Int.cast_one, zero_add, one_zpow, one_mul]
| Mathlib/NumberTheory/ModularForms/Identities.lean | 34 | 37 | theorem T_zpow_width_invariant (N : β) (k n : β€) (f : SlashInvariantForm (Gamma N) k) (z : β) :
f (((ModularGroup.T ^ (N * n))) β’ z) = f z := by |
rw [modular_T_zpow_smul z (N * n)]
simpa only [Int.cast_mul, Int.cast_natCast] using vAdd_width_periodic N k n f z
| [
" f (βN * βn +α΅₯ z) = f z",
" f (β(βN * n) +α΅₯ z) = f z",
" f (ModularGroup.T ^ (βN * n) β’ z) = f z",
" βN β£ βN * n",
" f z = (β(ββββ¨ModularGroup.T ^ (βN * n), Hnβ© 1 0) * βz + β(ββββ¨ModularGroup.T ^ (βN * n), Hnβ© 1 1)) ^ k * f z",
" f z =\n (β(β{ val := βββ¨ModularGroup.T ^ (βN * n), Hnβ©, inv := β(ββ¨Modul... | [
" f (βN * βn +α΅₯ z) = f z",
" f (β(βN * n) +α΅₯ z) = f z",
" f (ModularGroup.T ^ (βN * n) β’ z) = f z",
" βN β£ βN * n",
" f z = (β(ββββ¨ModularGroup.T ^ (βN * n), Hnβ© 1 0) * βz + β(ββββ¨ModularGroup.T ^ (βN * n), Hnβ© 1 1)) ^ k * f z",
" f z =\n (β(β{ val := βββ¨ModularGroup.T ^ (βN * n), Hnβ©, inv := β(ββ¨Modul... |
import Mathlib.Analysis.InnerProductSpace.PiL2
import Mathlib.Analysis.SpecialFunctions.Sqrt
import Mathlib.Analysis.NormedSpace.HomeomorphBall
#align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88"
noncomputable section
open RCLike Real Filter
open scoped Classical Topology
section PiLike
open ContinuousLinearMap
variable {π ΞΉ H : Type*} [RCLike π] [NormedAddCommGroup H] [NormedSpace π H] [Fintype ΞΉ]
{f : H β EuclideanSpace π ΞΉ} {f' : H βL[π] EuclideanSpace π ΞΉ} {t : Set H} {y : H}
theorem differentiableWithinAt_euclidean :
DifferentiableWithinAt π f t y β β i, DifferentiableWithinAt π (fun x => f x i) t y := by
rw [β (EuclideanSpace.equiv ΞΉ π).comp_differentiableWithinAt_iff, differentiableWithinAt_pi]
rfl
#align differentiable_within_at_euclidean differentiableWithinAt_euclidean
theorem differentiableAt_euclidean :
DifferentiableAt π f y β β i, DifferentiableAt π (fun x => f x i) y := by
rw [β (EuclideanSpace.equiv ΞΉ π).comp_differentiableAt_iff, differentiableAt_pi]
rfl
#align differentiable_at_euclidean differentiableAt_euclidean
theorem differentiableOn_euclidean :
DifferentiableOn π f t β β i, DifferentiableOn π (fun x => f x i) t := by
rw [β (EuclideanSpace.equiv ΞΉ π).comp_differentiableOn_iff, differentiableOn_pi]
rfl
#align differentiable_on_euclidean differentiableOn_euclidean
theorem differentiable_euclidean : Differentiable π f β β i, Differentiable π fun x => f x i := by
rw [β (EuclideanSpace.equiv ΞΉ π).comp_differentiable_iff, differentiable_pi]
rfl
#align differentiable_euclidean differentiable_euclidean
| Mathlib/Analysis/InnerProductSpace/Calculus.lean | 333 | 337 | theorem hasStrictFDerivAt_euclidean :
HasStrictFDerivAt f f' y β
β i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i βL f') y := by |
rw [β (EuclideanSpace.equiv ΞΉ π).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi']
rfl
| [
" DifferentiableWithinAt π f t y β β (i : ΞΉ), DifferentiableWithinAt π (fun x => f x i) t y",
" (β (i : ΞΉ), DifferentiableWithinAt π (fun x => (β(EuclideanSpace.equiv ΞΉ π) β f) x i) t y) β\n β (i : ΞΉ), DifferentiableWithinAt π (fun x => f x i) t y",
" DifferentiableAt π f y β β (i : ΞΉ), DifferentiableA... | [
" DifferentiableWithinAt π f t y β β (i : ΞΉ), DifferentiableWithinAt π (fun x => f x i) t y",
" (β (i : ΞΉ), DifferentiableWithinAt π (fun x => (β(EuclideanSpace.equiv ΞΉ π) β f) x i) t y) β\n β (i : ΞΉ), DifferentiableWithinAt π (fun x => f x i) t y",
" DifferentiableAt π f y β β (i : ΞΉ), DifferentiableA... |
import Mathlib.Algebra.Module.Submodule.Basic
import Mathlib.Topology.Algebra.Monoid
import Mathlib.Analysis.Asymptotics.Asymptotics
import Mathlib.Algebra.Algebra.Pi
#align_import order.filter.zero_and_bounded_at_filter from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
namespace Filter
variable {π Ξ± Ξ² : Type*}
open Topology
def ZeroAtFilter [Zero Ξ²] [TopologicalSpace Ξ²] (l : Filter Ξ±) (f : Ξ± β Ξ²) : Prop :=
Filter.Tendsto f l (π 0)
#align filter.zero_at_filter Filter.ZeroAtFilter
theorem zero_zeroAtFilter [Zero Ξ²] [TopologicalSpace Ξ²] (l : Filter Ξ±) :
ZeroAtFilter l (0 : Ξ± β Ξ²) :=
tendsto_const_nhds
#align filter.zero_zero_at_filter Filter.zero_zeroAtFilter
nonrec theorem ZeroAtFilter.add [TopologicalSpace Ξ²] [AddZeroClass Ξ²] [ContinuousAdd Ξ²]
{l : Filter Ξ±} {f g : Ξ± β Ξ²} (hf : ZeroAtFilter l f) (hg : ZeroAtFilter l g) :
ZeroAtFilter l (f + g) := by
simpa using hf.add hg
#align filter.zero_at_filter.add Filter.ZeroAtFilter.add
nonrec theorem ZeroAtFilter.neg [TopologicalSpace Ξ²] [AddGroup Ξ²] [ContinuousNeg Ξ²] {l : Filter Ξ±}
{f : Ξ± β Ξ²} (hf : ZeroAtFilter l f) : ZeroAtFilter l (-f) := by simpa using hf.neg
#align filter.zero_at_filter.neg Filter.ZeroAtFilter.neg
theorem ZeroAtFilter.smul [TopologicalSpace Ξ²] [Zero π] [Zero Ξ²]
[SMulWithZero π Ξ²] [ContinuousConstSMul π Ξ²] {l : Filter Ξ±} {f : Ξ± β Ξ²} (c : π)
(hf : ZeroAtFilter l f) : ZeroAtFilter l (c β’ f) := by simpa using hf.const_smul c
#align filter.zero_at_filter.smul Filter.ZeroAtFilter.smul
variable (π) in
def zeroAtFilterSubmodule
[TopologicalSpace Ξ²] [Semiring π] [AddCommMonoid Ξ²] [Module π Ξ²]
[ContinuousAdd Ξ²] [ContinuousConstSMul π Ξ²]
(l : Filter Ξ±) : Submodule π (Ξ± β Ξ²) where
carrier := ZeroAtFilter l
zero_mem' := zero_zeroAtFilter l
add_mem' ha hb := ha.add hb
smul_mem' c _ hf := hf.smul c
#align filter.zero_at_filter_submodule Filter.zeroAtFilterSubmodule
def zeroAtFilterAddSubmonoid [TopologicalSpace Ξ²] [AddZeroClass Ξ²] [ContinuousAdd Ξ²]
(l : Filter Ξ±) : AddSubmonoid (Ξ± β Ξ²) where
carrier := ZeroAtFilter l
add_mem' ha hb := ha.add hb
zero_mem' := zero_zeroAtFilter l
#align filter.zero_at_filter_add_submonoid Filter.zeroAtFilterAddSubmonoid
def BoundedAtFilter [Norm Ξ²] (l : Filter Ξ±) (f : Ξ± β Ξ²) : Prop :=
Asymptotics.IsBigO l f (1 : Ξ± β β)
#align filter.bounded_at_filter Filter.BoundedAtFilter
| Mathlib/Order/Filter/ZeroAndBoundedAtFilter.lean | 84 | 87 | theorem ZeroAtFilter.boundedAtFilter [NormedAddCommGroup Ξ²] {l : Filter Ξ±} {f : Ξ± β Ξ²}
(hf : ZeroAtFilter l f) : BoundedAtFilter l f := by |
rw [ZeroAtFilter, β Asymptotics.isLittleO_const_iff (one_ne_zero' β)] at hf
exact hf.isBigO
| [
" l.ZeroAtFilter (f + g)",
" l.ZeroAtFilter (-f)",
" l.ZeroAtFilter (c β’ f)",
" l.BoundedAtFilter f"
] | [
" l.ZeroAtFilter (f + g)",
" l.ZeroAtFilter (-f)",
" l.ZeroAtFilter (c β’ f)"
] |
import Mathlib.ModelTheory.Syntax
import Mathlib.ModelTheory.Semantics
import Mathlib.ModelTheory.Algebra.Ring.Basic
import Mathlib.Algebra.Field.MinimalAxioms
variable {K : Type*}
namespace FirstOrder
namespace Field
open Language Ring Structure BoundedFormula
inductive FieldAxiom : Type
| addAssoc : FieldAxiom
| zeroAdd : FieldAxiom
| addLeftNeg : FieldAxiom
| mulAssoc : FieldAxiom
| mulComm : FieldAxiom
| oneMul : FieldAxiom
| existsInv : FieldAxiom
| leftDistrib : FieldAxiom
| existsPairNE : FieldAxiom
@[simp]
def FieldAxiom.toSentence : FieldAxiom β Language.ring.Sentence
| .addAssoc => β' β' β' (((&0 + &1) + &2) =' (&0 + (&1 + &2)))
| .zeroAdd => β' (((0 : Language.ring.Term _) + &0) =' &0)
| .addLeftNeg => β' β' ((-&0 + &0) =' 0)
| .mulAssoc => β' β' β' (((&0 * &1) * &2) =' (&0 * (&1 * &2)))
| .mulComm => β' β' ((&0 * &1) =' (&1 * &0))
| .oneMul => β' (((1 : Language.ring.Term _) * &0) =' &0)
| .existsInv => β' (βΌ(&0 =' 0) βΉ β' ((&0 * &1) =' 1))
| .leftDistrib => β' β' β' ((&0 * (&1 + &2)) =' ((&0 * &1) + (&0 * &2)))
| .existsPairNE => β' β' (βΌ(&0 =' &1))
@[simp]
def FieldAxiom.toProp (K : Type*) [Add K] [Mul K] [Neg K] [Zero K] [One K] :
FieldAxiom β Prop
| .addAssoc => β x y z : K, (x + y) + z = x + (y + z)
| .zeroAdd => β x : K, 0 + x = x
| .addLeftNeg => β x : K, -x + x = 0
| .mulAssoc => β x y z : K, (x * y) * z = x * (y * z)
| .mulComm => β x y : K, x * y = y * x
| .oneMul => β x : K, 1 * x = x
| .existsInv => β x : K, x β 0 β β y, x * y = 1
| .leftDistrib => β x y z : K, x * (y + z) = x * y + x * z
| .existsPairNE => β x y : K, x β y
def _root_.FirstOrder.Language.Theory.field : Language.ring.Theory :=
Set.range FieldAxiom.toSentence
| Mathlib/ModelTheory/Algebra/Field/Basic.lean | 81 | 86 | theorem FieldAxiom.realize_toSentence_iff_toProp {K : Type*}
[Add K] [Mul K] [Neg K] [Zero K] [One K] [CompatibleRing K]
(ax : FieldAxiom) :
(K β¨ (ax.toSentence : Sentence Language.ring)) β ax.toProp K := by |
cases ax <;>
simp [Sentence.Realize, Formula.Realize, Fin.snoc]
| [
" K β¨ ax.toSentence β toProp K ax",
" K β¨ addAssoc.toSentence β toProp K addAssoc",
" K β¨ zeroAdd.toSentence β toProp K zeroAdd",
" K β¨ addLeftNeg.toSentence β toProp K addLeftNeg",
" K β¨ mulAssoc.toSentence β toProp K mulAssoc",
" K β¨ mulComm.toSentence β toProp K mulComm",
" K β¨ oneMul.toSentence β to... | [] |
import Mathlib.Topology.Order.Basic
#align_import topology.algebra.order.monotone_convergence from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514"
open Filter Set Function
open scoped Classical
open Filter Topology
variable {Ξ± Ξ² : Type*}
class SupConvergenceClass (Ξ± : Type*) [Preorder Ξ±] [TopologicalSpace Ξ±] : Prop where
tendsto_coe_atTop_isLUB :
β (a : Ξ±) (s : Set Ξ±), IsLUB s a β Tendsto (CoeTC.coe : s β Ξ±) atTop (π a)
#align Sup_convergence_class SupConvergenceClass
class InfConvergenceClass (Ξ± : Type*) [Preorder Ξ±] [TopologicalSpace Ξ±] : Prop where
tendsto_coe_atBot_isGLB :
β (a : Ξ±) (s : Set Ξ±), IsGLB s a β Tendsto (CoeTC.coe : s β Ξ±) atBot (π a)
#align Inf_convergence_class InfConvergenceClass
instance OrderDual.supConvergenceClass [Preorder Ξ±] [TopologicalSpace Ξ±] [InfConvergenceClass Ξ±] :
SupConvergenceClass Ξ±α΅α΅ :=
β¨βΉInfConvergenceClass Ξ±βΊ.1β©
#align order_dual.Sup_convergence_class OrderDual.supConvergenceClass
instance OrderDual.infConvergenceClass [Preorder Ξ±] [TopologicalSpace Ξ±] [SupConvergenceClass Ξ±] :
InfConvergenceClass Ξ±α΅α΅ :=
β¨βΉSupConvergenceClass Ξ±βΊ.1β©
#align order_dual.Inf_convergence_class OrderDual.infConvergenceClass
-- see Note [lower instance priority]
instance (priority := 100) LinearOrder.supConvergenceClass [TopologicalSpace Ξ±] [LinearOrder Ξ±]
[OrderTopology Ξ±] : SupConvergenceClass Ξ± := by
refine β¨fun a s ha => tendsto_order.2 β¨fun b hb => ?_, fun b hb => ?_β©β©
Β· rcases ha.exists_between hb with β¨c, hcs, bc, bcaβ©
lift c to s using hcs
exact (eventually_ge_atTop c).mono fun x hx => bc.trans_le hx
Β· exact eventually_of_forall fun x => (ha.1 x.2).trans_lt hb
#align linear_order.Sup_convergence_class LinearOrder.supConvergenceClass
-- see Note [lower instance priority]
instance (priority := 100) LinearOrder.infConvergenceClass [TopologicalSpace Ξ±] [LinearOrder Ξ±]
[OrderTopology Ξ±] : InfConvergenceClass Ξ± :=
show InfConvergenceClass Ξ±α΅α΅α΅α΅ from OrderDual.infConvergenceClass
#align linear_order.Inf_convergence_class LinearOrder.infConvergenceClass
section
variable {ΞΉ : Type*} [Preorder ΞΉ] [TopologicalSpace Ξ±]
section IsLUB
variable [Preorder Ξ±] [SupConvergenceClass Ξ±] {f : ΞΉ β Ξ±} {a : Ξ±}
| Mathlib/Topology/Order/MonotoneConvergence.lean | 96 | 100 | theorem tendsto_atTop_isLUB (h_mono : Monotone f) (ha : IsLUB (Set.range f) a) :
Tendsto f atTop (π a) := by |
suffices Tendsto (rangeFactorization f) atTop atTop from
(SupConvergenceClass.tendsto_coe_atTop_isLUB _ _ ha).comp this
exact h_mono.rangeFactorization.tendsto_atTop_atTop fun b => b.2.imp fun a ha => ha.ge
| [
" SupConvergenceClass Ξ±",
" βαΆ (b_1 : βs) in atTop, b < CoeTC.coe b_1",
" βαΆ (b_1 : βs) in atTop, CoeTC.coe b_1 < b",
" Tendsto f atTop (π a)",
" Tendsto (rangeFactorization f) atTop atTop"
] | [
" SupConvergenceClass Ξ±",
" βαΆ (b_1 : βs) in atTop, b < CoeTC.coe b_1",
" βαΆ (b_1 : βs) in atTop, CoeTC.coe b_1 < b"
] |
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
namespace Subobject
-- Porting note: made it a def rather than an abbreviation
-- because Lean would make it too transparent
def mk {X A : C} (f : A βΆ X) [Mono f] : Subobject X :=
(toThinSkeleton _).obj (MonoOver.mk' f)
#align category_theory.subobject.mk CategoryTheory.Subobject.mk
section
attribute [local ext] CategoryTheory.Comma
protected theorem ind {X : C} (p : Subobject X β Prop)
(h : β β¦A : Cβ¦ (f : A βΆ X) [Mono f], p (Subobject.mk f)) (P : Subobject X) : p P := by
apply Quotient.inductionOn'
intro a
exact h a.arrow
#align category_theory.subobject.ind CategoryTheory.Subobject.ind
protected theorem indβ {X : C} (p : Subobject X β Subobject X β Prop)
(h : β β¦A B : Cβ¦ (f : A βΆ X) (g : B βΆ X) [Mono f] [Mono g],
p (Subobject.mk f) (Subobject.mk g))
(P Q : Subobject X) : p P Q := by
apply Quotient.inductionOnβ'
intro a b
exact h a.arrow b.arrow
#align category_theory.subobject.indβ CategoryTheory.Subobject.indβ
end
protected def lift {Ξ± : Sort*} {X : C} (F : β β¦A : Cβ¦ (f : A βΆ X) [Mono f], Ξ±)
(h :
β β¦A B : Cβ¦ (f : A βΆ X) (g : B βΆ X) [Mono f] [Mono g] (i : A β
B),
i.hom β« g = f β F f = F g) :
Subobject X β Ξ± := fun P =>
Quotient.liftOn' P (fun m => F m.arrow) fun m n β¨iβ© =>
h m.arrow n.arrow ((MonoOver.forget X β Over.forget X).mapIso i) (Over.w i.hom)
#align category_theory.subobject.lift CategoryTheory.Subobject.lift
@[simp]
protected theorem lift_mk {Ξ± : Sort*} {X : C} (F : β β¦A : Cβ¦ (f : A βΆ X) [Mono f], Ξ±) {h A}
(f : A βΆ X) [Mono f] : Subobject.lift F h (Subobject.mk f) = F f :=
rfl
#align category_theory.subobject.lift_mk CategoryTheory.Subobject.lift_mk
noncomputable def equivMonoOver (X : C) : Subobject X β MonoOver X :=
ThinSkeleton.equivalence _
#align category_theory.subobject.equiv_mono_over CategoryTheory.Subobject.equivMonoOver
noncomputable def representative {X : C} : Subobject X β₯€ MonoOver X :=
(equivMonoOver X).functor
#align category_theory.subobject.representative CategoryTheory.Subobject.representative
noncomputable def representativeIso {X : C} (A : MonoOver X) :
representative.obj ((toThinSkeleton _).obj A) β
A :=
(equivMonoOver X).counitIso.app A
#align category_theory.subobject.representative_iso CategoryTheory.Subobject.representativeIso
noncomputable def underlying {X : C} : Subobject X β₯€ C :=
representative β MonoOver.forget _ β Over.forget _
#align category_theory.subobject.underlying CategoryTheory.Subobject.underlying
instance : CoeOut (Subobject X) C where coe Y := underlying.obj Y
-- Porting note: removed as it has become a syntactic tautology
-- @[simp]
-- theorem underlying_as_coe {X : C} (P : Subobject X) : underlying.obj P = P :=
-- rfl
-- #align category_theory.subobject.underlying_as_coe CategoryTheory.Subobject.underlying_as_coe
noncomputable def underlyingIso {X Y : C} (f : X βΆ Y) [Mono f] : (Subobject.mk f : C) β
X :=
(MonoOver.forget _ β Over.forget _).mapIso (representativeIso (MonoOver.mk' f))
#align category_theory.subobject.underlying_iso CategoryTheory.Subobject.underlyingIso
noncomputable def arrow {X : C} (Y : Subobject X) : (Y : C) βΆ X :=
(representative.obj Y).obj.hom
#align category_theory.subobject.arrow CategoryTheory.Subobject.arrow
instance arrow_mono {X : C} (Y : Subobject X) : Mono Y.arrow :=
(representative.obj Y).property
#align category_theory.subobject.arrow_mono CategoryTheory.Subobject.arrow_mono
@[simp]
| Mathlib/CategoryTheory/Subobject/Basic.lean | 210 | 213 | theorem arrow_congr {A : C} (X Y : Subobject A) (h : X = Y) :
eqToHom (congr_arg (fun X : Subobject A => (X : C)) h) β« Y.arrow = X.arrow := by |
induction h
simp
| [
" PartialOrder (Subobject X)",
" PartialOrder (ThinSkeleton (MonoOver X))",
" p P",
" β (a : MonoOver X), p (Quotient.mk'' a)",
" p (Quotient.mk'' a)",
" p P Q",
" β (aβ aβ : MonoOver X), p (Quotient.mk'' aβ) (Quotient.mk'' aβ)",
" p (Quotient.mk'' a) (Quotient.mk'' b)",
" eqToHom β― β« Y.arrow = X.ar... | [
" PartialOrder (Subobject X)",
" PartialOrder (ThinSkeleton (MonoOver X))",
" p P",
" β (a : MonoOver X), p (Quotient.mk'' a)",
" p (Quotient.mk'' a)",
" p P Q",
" β (aβ aβ : MonoOver X), p (Quotient.mk'' aβ) (Quotient.mk'' aβ)",
" p (Quotient.mk'' a) (Quotient.mk'' b)"
] |
import Mathlib.Algebra.Order.Hom.Monoid
import Mathlib.SetTheory.Game.Ordinal
#align_import set_theory.surreal.basic from "leanprover-community/mathlib"@"8900d545017cd21961daa2a1734bb658ef52c618"
universe u
namespace SetTheory
open scoped PGame
namespace PGame
def Numeric : PGame β Prop
| β¨_, _, L, Rβ© => (β i j, L i < R j) β§ (β i, Numeric (L i)) β§ β j, Numeric (R j)
#align pgame.numeric SetTheory.PGame.Numeric
| Mathlib/SetTheory/Surreal/Basic.lean | 71 | 75 | theorem numeric_def {x : PGame} :
Numeric x β
(β i j, x.moveLeft i < x.moveRight j) β§
(β i, Numeric (x.moveLeft i)) β§ β j, Numeric (x.moveRight j) := by |
cases x; rfl
| [
" x.Numeric β\n (β (i : x.LeftMoves) (j : x.RightMoves), x.moveLeft i < x.moveRight j) β§\n (β (i : x.LeftMoves), (x.moveLeft i).Numeric) β§ β (j : x.RightMoves), (x.moveRight j).Numeric",
" (mk Ξ±β Ξ²β aβΒΉ aβ).Numeric β\n (β (i : (mk Ξ±β Ξ²β aβΒΉ aβ).LeftMoves) (j : (mk Ξ±β Ξ²β aβΒΉ aβ).RightMoves),\n (m... | [] |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
theorem isQuadratic_Οβ : Οβ.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_Οβ ZMod.isQuadratic_Οβ
theorem Οβ_nat_mod_four (n : β) : Οβ n = Οβ (n % 4 : β) := by rw [β ZMod.natCast_mod n 4]
#align zmod.Οβ_nat_mod_four ZMod.Οβ_nat_mod_four
theorem Οβ_int_mod_four (n : β€) : Οβ n = Οβ (n % 4 : β€) := by
rw [β ZMod.intCast_mod n 4]
norm_cast
#align zmod.Οβ_int_mod_four ZMod.Οβ_int_mod_four
theorem Οβ_int_eq_if_mod_four (n : β€) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := by
have help : β m : β€, 0 β€ m β m < 4 β Οβ m = if m % 2 = 0 then 0 else if m = 1 then 1 else -1 := by
decide
rw [β Int.emod_emod_of_dvd n (by decide : (2 : β€) β£ 4), β ZMod.intCast_mod n 4]
exact help (n % 4) (Int.emod_nonneg n (by norm_num)) (Int.emod_lt n (by norm_num))
#align zmod.Οβ_int_eq_if_mod_four ZMod.Οβ_int_eq_if_mod_four
theorem Οβ_nat_eq_if_mod_four (n : β) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 :=
mod_cast Οβ_int_eq_if_mod_four n
#align zmod.Οβ_nat_eq_if_mod_four ZMod.Οβ_nat_eq_if_mod_four
theorem Οβ_eq_neg_one_pow {n : β} (hn : n % 2 = 1) : Οβ n = (-1) ^ (n / 2) := by
rw [Οβ_nat_eq_if_mod_four]
simp only [hn, Nat.one_ne_zero, if_false]
conv_rhs => -- Porting note: was `nth_rw`
arg 2; rw [β Nat.div_add_mod n 4]
enter [1, 1, 1]; rw [(by norm_num : 4 = 2 * 2)]
rw [mul_assoc, add_comm, Nat.add_mul_div_left _ _ (by norm_num : 0 < 2), pow_add, pow_mul,
neg_one_sq, one_pow, mul_one]
have help : β m : β, m < 4 β m % 2 = 1 β ite (m = 1) (1 : β€) (-1) = (-1) ^ (m / 2) := by decide
exact
help (n % 4) (Nat.mod_lt n (by norm_num))
((Nat.mod_mod_of_dvd n (by decide : 2 β£ 4)).trans hn)
#align zmod.Οβ_eq_neg_one_pow ZMod.Οβ_eq_neg_one_pow
theorem Οβ_nat_one_mod_four {n : β} (hn : n % 4 = 1) : Οβ n = 1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_one_mod_four ZMod.Οβ_nat_one_mod_four
theorem Οβ_nat_three_mod_four {n : β} (hn : n % 4 = 3) : Οβ n = -1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_three_mod_four ZMod.Οβ_nat_three_mod_four
theorem Οβ_int_one_mod_four {n : β€} (hn : n % 4 = 1) : Οβ n = 1 := by
rw [Οβ_int_mod_four, hn]
rfl
#align zmod.Οβ_int_one_mod_four ZMod.Οβ_int_one_mod_four
theorem Οβ_int_three_mod_four {n : β€} (hn : n % 4 = 3) : Οβ n = -1 := by
rw [Οβ_int_mod_four, hn]
rfl
#align zmod.Οβ_int_three_mod_four ZMod.Οβ_int_three_mod_four
theorem neg_one_pow_div_two_of_one_mod_four {n : β} (hn : n % 4 = 1) : (-1 : β€) ^ (n / 2) = 1 := by
rw [β Οβ_eq_neg_one_pow (Nat.odd_of_mod_four_eq_one hn), β natCast_mod, hn]
rfl
#align zmod.neg_one_pow_div_two_of_one_mod_four ZMod.neg_one_pow_div_two_of_one_mod_four
theorem neg_one_pow_div_two_of_three_mod_four {n : β} (hn : n % 4 = 3) :
(-1 : β€) ^ (n / 2) = -1 := by
rw [β Οβ_eq_neg_one_pow (Nat.odd_of_mod_four_eq_three hn), β natCast_mod, hn]
rfl
#align zmod.neg_one_pow_div_two_of_three_mod_four ZMod.neg_one_pow_div_two_of_three_mod_four
@[simps]
def Οβ : MulChar (ZMod 8) β€ where
toFun := (![0, 1, 0, -1, 0, -1, 0, 1] : ZMod 8 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 142 | 146 | theorem isQuadratic_Οβ : Οβ.IsQuadratic := by |
intro a
-- Porting note: was `decide!`
fin_cases a
all_goals decide
| [
" β (x y : ZMod 4),\n { toFun := ![0, 1, 0, -1], map_one' := β― }.toFun (x * y) =\n { toFun := ![0, 1, 0, -1], map_one' := β― }.toFun x * { toFun := ![0, 1, 0, -1], map_one' := β― }.toFun y",
" β (a : ZMod 4), Β¬IsUnit a β (β{ toFun := ![0, 1, 0, -1], map_one' := β―, map_mul' := β― }).toFun a = 0",
" Οβ.IsQua... | [
" β (x y : ZMod 4),\n { toFun := ![0, 1, 0, -1], map_one' := β― }.toFun (x * y) =\n { toFun := ![0, 1, 0, -1], map_one' := β― }.toFun x * { toFun := ![0, 1, 0, -1], map_one' := β― }.toFun y",
" β (a : ZMod 4), Β¬IsUnit a β (β{ toFun := ![0, 1, 0, -1], map_one' := β―, map_mul' := β― }).toFun a = 0",
" Οβ.IsQua... |
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Algebra.Module.LinearMap.Basic
import Mathlib.Data.Finset.Preimage
import Mathlib.Data.Set.Finite
import Mathlib.GroupTheory.GroupAction.BigOperators
#align_import data.dfinsupp.basic from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1"
universe u uβ uβ v vβ vβ vβ w x y l
variable {ΞΉ : Type u} {Ξ³ : Type w} {Ξ² : ΞΉ β Type v} {Ξ²β : ΞΉ β Type vβ} {Ξ²β : ΞΉ β Type vβ}
variable (Ξ²)
structure DFinsupp [β i, Zero (Ξ² i)] : Type max u v where mk' ::
toFun : β i, Ξ² i
support' : Trunc { s : Multiset ΞΉ // β i, i β s β¨ toFun i = 0 }
#align dfinsupp DFinsupp
variable {Ξ²}
notation3 "Ξ β "(...)", "r:(scoped f => DFinsupp f) => r
namespace DFinsupp
section Basic
variable [β i, Zero (Ξ² i)] [β i, Zero (Ξ²β i)] [β i, Zero (Ξ²β i)]
instance instDFunLike : DFunLike (Ξ β i, Ξ² i) ΞΉ Ξ² :=
β¨fun f => f.toFun, fun β¨fβ, sββ© β¨fβ, sββ© β¦ fun (h : fβ = fβ) β¦ by
subst h
congr
apply Subsingleton.elim β©
#align dfinsupp.fun_like DFinsupp.instDFunLike
instance : CoeFun (Ξ β i, Ξ² i) fun _ => β i, Ξ² i :=
inferInstance
@[simp]
theorem toFun_eq_coe (f : Ξ β i, Ξ² i) : f.toFun = f :=
rfl
#align dfinsupp.to_fun_eq_coe DFinsupp.toFun_eq_coe
@[ext]
theorem ext {f g : Ξ β i, Ξ² i} (h : β i, f i = g i) : f = g :=
DFunLike.ext _ _ h
#align dfinsupp.ext DFinsupp.ext
#align dfinsupp.ext_iff DFunLike.ext_iff
#align dfinsupp.coe_fn_injective DFunLike.coe_injective
lemma ne_iff {f g : Ξ β i, Ξ² i} : f β g β β i, f i β g i := DFunLike.ne_iff
instance : Zero (Ξ β i, Ξ² i) :=
β¨β¨0, Trunc.mk <| β¨β
, fun _ => Or.inr rflβ©β©β©
instance : Inhabited (Ξ β i, Ξ² i) :=
β¨0β©
@[simp, norm_cast] lemma coe_mk' (f : β i, Ξ² i) (s) : β(β¨f, sβ© : Ξ β i, Ξ² i) = f := rfl
#align dfinsupp.coe_mk' DFinsupp.coe_mk'
@[simp, norm_cast] lemma coe_zero : β(0 : Ξ β i, Ξ² i) = 0 := rfl
#align dfinsupp.coe_zero DFinsupp.coe_zero
theorem zero_apply (i : ΞΉ) : (0 : Ξ β i, Ξ² i) i = 0 :=
rfl
#align dfinsupp.zero_apply DFinsupp.zero_apply
def mapRange (f : β i, Ξ²β i β Ξ²β i) (hf : β i, f i 0 = 0) (x : Ξ β i, Ξ²β i) : Ξ β i, Ξ²β i :=
β¨fun i => f i (x i),
x.support'.map fun s => β¨s.1, fun i => (s.2 i).imp_right fun h : x i = 0 => by
rw [β hf i, β h]β©β©
#align dfinsupp.map_range DFinsupp.mapRange
@[simp]
theorem mapRange_apply (f : β i, Ξ²β i β Ξ²β i) (hf : β i, f i 0 = 0) (g : Ξ β i, Ξ²β i) (i : ΞΉ) :
mapRange f hf g i = f i (g i) :=
rfl
#align dfinsupp.map_range_apply DFinsupp.mapRange_apply
@[simp]
| Mathlib/Data/DFinsupp/Basic.lean | 144 | 147 | theorem mapRange_id (h : β i, id (0 : Ξ²β i) = 0 := fun i => rfl) (g : Ξ β i : ΞΉ, Ξ²β i) :
mapRange (fun i => (id : Ξ²β i β Ξ²β i)) h g = g := by |
ext
rfl
| [
" { toFun := fβ, support' := sββ } = { toFun := fβ, support' := sβ }",
" { toFun := fβ, support' := sββ } = { toFun := fβ, support' := sβ }",
" sββ = sβ",
" (fun i => f i (x i)) i = 0",
" mapRange (fun i => id) h g = g",
" (mapRange (fun i => id) h g) iβ = g iβ"
] | [
" { toFun := fβ, support' := sββ } = { toFun := fβ, support' := sβ }",
" { toFun := fβ, support' := sββ } = { toFun := fβ, support' := sβ }",
" sββ = sβ",
" (fun i => f i (x i)) i = 0"
] |
import Mathlib.CategoryTheory.Abelian.Basic
#align_import category_theory.idempotents.basic from "leanprover-community/mathlib"@"3a061790136d13594ec10c7c90d202335ac5d854"
open CategoryTheory
open CategoryTheory.Category
open CategoryTheory.Limits
open CategoryTheory.Preadditive
open Opposite
namespace CategoryTheory
variable (C : Type*) [Category C]
class IsIdempotentComplete : Prop where
idempotents_split :
β (X : C) (p : X βΆ X), p β« p = p β β (Y : C) (i : Y βΆ X) (e : X βΆ Y), i β« e = π Y β§ e β« i = p
#align category_theory.is_idempotent_complete CategoryTheory.IsIdempotentComplete
namespace Idempotents
theorem isIdempotentComplete_iff_hasEqualizer_of_id_and_idempotent :
IsIdempotentComplete C β β (X : C) (p : X βΆ X), p β« p = p β HasEqualizer (π X) p := by
constructor
Β· intro
intro X p hp
rcases IsIdempotentComplete.idempotents_split X p hp with β¨Y, i, e, β¨hβ, hββ©β©
exact
β¨Nonempty.intro
{ cone := Fork.ofΞΉ i (show i β« π X = i β« p by rw [comp_id, β hβ, β assoc, hβ, id_comp])
isLimit := by
apply Fork.IsLimit.mk'
intro s
refine β¨s.ΞΉ β« e, ?_β©
constructor
Β· erw [assoc, hβ, β Limits.Fork.condition s, comp_id]
Β· intro m hm
rw [Fork.ΞΉ_ofΞΉ] at hm
rw [β hm]
simp only [β hm, assoc, hβ]
exact (comp_id m).symm }β©
Β· intro h
refine β¨?_β©
intro X p hp
haveI : HasEqualizer (π X) p := h X p hp
refine β¨equalizer (π X) p, equalizer.ΞΉ (π X) p,
equalizer.lift p (show p β« π X = p β« p by rw [hp, comp_id]), ?_, equalizer.lift_ΞΉ _ _β©
ext
simp only [assoc, limit.lift_Ο, Eq.ndrec, id_eq, eq_mpr_eq_cast, Fork.ofΞΉ_pt,
Fork.ofΞΉ_Ο_app, id_comp]
rw [β equalizer.condition, comp_id]
#align category_theory.idempotents.is_idempotent_complete_iff_has_equalizer_of_id_and_idempotent CategoryTheory.Idempotents.isIdempotentComplete_iff_hasEqualizer_of_id_and_idempotent
variable {C}
theorem idem_of_id_sub_idem [Preadditive C] {X : C} (p : X βΆ X) (hp : p β« p = p) :
(π _ - p) β« (π _ - p) = π _ - p := by
simp only [comp_sub, sub_comp, id_comp, comp_id, hp, sub_self, sub_zero]
#align category_theory.idempotents.idem_of_id_sub_idem CategoryTheory.Idempotents.idem_of_id_sub_idem
variable (C)
theorem isIdempotentComplete_iff_idempotents_have_kernels [Preadditive C] :
IsIdempotentComplete C β β (X : C) (p : X βΆ X), p β« p = p β HasKernel p := by
rw [isIdempotentComplete_iff_hasEqualizer_of_id_and_idempotent]
constructor
Β· intro h X p hp
haveI : HasEqualizer (π X) (π X - p) := h X (π _ - p) (idem_of_id_sub_idem p hp)
convert hasKernel_of_hasEqualizer (π X) (π X - p)
rw [sub_sub_cancel]
Β· intro h X p hp
haveI : HasKernel (π _ - p) := h X (π _ - p) (idem_of_id_sub_idem p hp)
apply Preadditive.hasEqualizer_of_hasKernel
#align category_theory.idempotents.is_idempotent_complete_iff_idempotents_have_kernels CategoryTheory.Idempotents.isIdempotentComplete_iff_idempotents_have_kernels
instance (priority := 100) isIdempotentComplete_of_abelian (D : Type*) [Category D] [Abelian D] :
IsIdempotentComplete D := by
rw [isIdempotentComplete_iff_idempotents_have_kernels]
intros
infer_instance
#align category_theory.idempotents.is_idempotent_complete_of_abelian CategoryTheory.Idempotents.isIdempotentComplete_of_abelian
variable {C}
theorem split_imp_of_iso {X X' : C} (Ο : X β
X') (p : X βΆ X) (p' : X' βΆ X')
(hpp' : p β« Ο.hom = Ο.hom β« p')
(h : β (Y : C) (i : Y βΆ X) (e : X βΆ Y), i β« e = π Y β§ e β« i = p) :
β (Y' : C) (i' : Y' βΆ X') (e' : X' βΆ Y'), i' β« e' = π Y' β§ e' β« i' = p' := by
rcases h with β¨Y, i, e, β¨hβ, hββ©β©
use Y, i β« Ο.hom, Ο.inv β« e
constructor
Β· slice_lhs 2 3 => rw [Ο.hom_inv_id]
rw [id_comp, hβ]
Β· slice_lhs 2 3 => rw [hβ]
rw [hpp', β assoc, Ο.inv_hom_id, id_comp]
#align category_theory.idempotents.split_imp_of_iso CategoryTheory.Idempotents.split_imp_of_iso
| Mathlib/CategoryTheory/Idempotents/Basic.lean | 143 | 154 | theorem split_iff_of_iso {X X' : C} (Ο : X β
X') (p : X βΆ X) (p' : X' βΆ X')
(hpp' : p β« Ο.hom = Ο.hom β« p') :
(β (Y : C) (i : Y βΆ X) (e : X βΆ Y), i β« e = π Y β§ e β« i = p) β
β (Y' : C) (i' : Y' βΆ X') (e' : X' βΆ Y'), i' β« e' = π Y' β§ e' β« i' = p' := by |
constructor
Β· exact split_imp_of_iso Ο p p' hpp'
Β· apply split_imp_of_iso Ο.symm p' p
rw [β comp_id p, β Ο.hom_inv_id]
slice_rhs 2 3 => rw [hpp']
slice_rhs 1 2 => erw [Ο.inv_hom_id]
simp only [id_comp]
rfl
| [
" IsIdempotentComplete C β β (X : C) (p : X βΆ X), p β« p = p β HasEqualizer (π X) p",
" IsIdempotentComplete C β β (X : C) (p : X βΆ X), p β« p = p β HasEqualizer (π X) p",
" β (X : C) (p : X βΆ X), p β« p = p β HasEqualizer (π X) p",
" HasEqualizer (π X) p",
" i β« π X = i β« p",
" IsLimit (Fork.ofΞΉ i β―)",... | [
" IsIdempotentComplete C β β (X : C) (p : X βΆ X), p β« p = p β HasEqualizer (π X) p",
" IsIdempotentComplete C β β (X : C) (p : X βΆ X), p β« p = p β HasEqualizer (π X) p",
" β (X : C) (p : X βΆ X), p β« p = p β HasEqualizer (π X) p",
" HasEqualizer (π X) p",
" i β« π X = i β« p",
" IsLimit (Fork.ofΞΉ i β―)",... |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section gcd
def gcd (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.gcd 0 f
#align finset.gcd Finset.gcd
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem gcd_def : s.gcd f = (s.1.map f).gcd :=
rfl
#align finset.gcd_def Finset.gcd_def
@[simp]
theorem gcd_empty : (β
: Finset Ξ²).gcd f = 0 :=
fold_empty
#align finset.gcd_empty Finset.gcd_empty
theorem dvd_gcd_iff {a : Ξ±} : a β£ s.gcd f β β b β s, a β£ f b := by
apply Iff.trans Multiset.dvd_gcd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.dvd_gcd_iff Finset.dvd_gcd_iff
theorem gcd_dvd {b : Ξ²} (hb : b β s) : s.gcd f β£ f b :=
dvd_gcd_iff.1 dvd_rfl _ hb
#align finset.gcd_dvd Finset.gcd_dvd
theorem dvd_gcd {a : Ξ±} : (β b β s, a β£ f b) β a β£ s.gcd f :=
dvd_gcd_iff.2
#align finset.dvd_gcd Finset.dvd_gcd
@[simp]
theorem gcd_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).gcd f = GCDMonoid.gcd (f b) (s.gcd f) := by
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(gcd_eq_right_iff (f b) (s.gcd f) (Multiset.normalize_gcd (s.1.map f))).2 (gcd_dvd h)]
apply fold_insert h
#align finset.gcd_insert Finset.gcd_insert
@[simp]
theorem gcd_singleton {b : Ξ²} : ({b} : Finset Ξ²).gcd f = normalize (f b) :=
Multiset.gcd_singleton
#align finset.gcd_singleton Finset.gcd_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
| Mathlib/Algebra/GCDMonoid/Finset.lean | 181 | 181 | theorem normalize_gcd : normalize (s.gcd f) = s.gcd f := by | simp [gcd_def]
| [
" a β£ s.gcd f β β b β s, a β£ f b",
" (β b β Multiset.map f s.val, a β£ b) β β b β s, a β£ f b",
" (β (b : Ξ±), β x β s.val, f x = b β a β£ b) β β b β s, a β£ f b",
" (insert b s).gcd f = GCDMonoid.gcd (f b) (s.gcd f)",
" normalize (s.gcd f) = s.gcd f"
] | [
" a β£ s.gcd f β β b β s, a β£ f b",
" (β b β Multiset.map f s.val, a β£ b) β β b β s, a β£ f b",
" (β (b : Ξ±), β x β s.val, f x = b β a β£ b) β β b β s, a β£ f b",
" (insert b s).gcd f = GCDMonoid.gcd (f b) (s.gcd f)"
] |
import Mathlib.Topology.Compactness.Compact
open Set Filter Topology TopologicalSpace Classical
variable {X : Type*} {Y : Type*} {ΞΉ : Type*}
variable [TopologicalSpace X] [TopologicalSpace Y] {s t : Set X}
instance [WeaklyLocallyCompactSpace X] [WeaklyLocallyCompactSpace Y] :
WeaklyLocallyCompactSpace (X Γ Y) where
exists_compact_mem_nhds x :=
let β¨sβ, hcβ, hββ© := exists_compact_mem_nhds x.1
let β¨sβ, hcβ, hββ© := exists_compact_mem_nhds x.2
β¨sβ ΓΛ’ sβ, hcβ.prod hcβ, prod_mem_nhds hβ hββ©
instance {ΞΉ : Type*} [Finite ΞΉ] {X : ΞΉ β Type*} [(i : ΞΉ) β TopologicalSpace (X i)]
[(i : ΞΉ) β WeaklyLocallyCompactSpace (X i)] :
WeaklyLocallyCompactSpace ((i : ΞΉ) β X i) where
exists_compact_mem_nhds := fun f β¦ by
choose s hsc hs using fun i β¦ exists_compact_mem_nhds (f i)
exact β¨pi univ s, isCompact_univ_pi hsc, set_pi_mem_nhds univ.toFinite fun i _ β¦ hs iβ©
instance (priority := 100) [CompactSpace X] : WeaklyLocallyCompactSpace X where
exists_compact_mem_nhds _ := β¨univ, isCompact_univ, univ_memβ©
| Mathlib/Topology/Compactness/LocallyCompact.lean | 40 | 45 | theorem exists_compact_superset [WeaklyLocallyCompactSpace X] {K : Set X} (hK : IsCompact K) :
β K', IsCompact K' β§ K β interior K' := by |
choose s hc hmem using fun x : X β¦ exists_compact_mem_nhds x
rcases hK.elim_nhds_subcover _ fun x _ β¦ interior_mem_nhds.2 (hmem x) with β¨I, -, hIKβ©
refine β¨β x β I, s x, I.isCompact_biUnion fun _ _ β¦ hc _, hIK.trans ?_β©
exact iUnionβ_subset fun x hx β¦ interior_mono <| subset_iUnionβ (s := fun x _ β¦ s x) x hx
| [
" β s, IsCompact s β§ s β π f",
" β K', IsCompact K' β§ K β interior K'",
" β x β I, interior (s x) β interior (β x β I, s x)"
] | [
" β s, IsCompact s β§ s β π f"
] |
import Mathlib.Data.Matrix.Basic
import Mathlib.Data.PEquiv
#align_import data.matrix.pequiv from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1"
namespace PEquiv
open Matrix
universe u v
variable {k l m n : Type*}
variable {Ξ± : Type v}
open Matrix
def toMatrix [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m β. n) : Matrix m n Ξ± :=
of fun i j => if j β f i then (1 : Ξ±) else 0
#align pequiv.to_matrix PEquiv.toMatrix
-- TODO: set as an equation lemma for `toMatrix`, see mathlib4#3024
@[simp]
theorem toMatrix_apply [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m β. n) (i j) :
toMatrix f i j = if j β f i then (1 : Ξ±) else 0 :=
rfl
#align pequiv.to_matrix_apply PEquiv.toMatrix_apply
theorem mul_matrix_apply [Fintype m] [DecidableEq m] [Semiring Ξ±] (f : l β. m) (M : Matrix m n Ξ±)
(i j) : (f.toMatrix * M :) i j = Option.casesOn (f i) 0 fun fi => M fi j := by
dsimp [toMatrix, Matrix.mul_apply]
cases' h : f i with fi
Β· simp [h]
Β· rw [Finset.sum_eq_single fi] <;> simp (config := { contextual := true }) [h, eq_comm]
#align pequiv.mul_matrix_apply PEquiv.mul_matrix_apply
theorem toMatrix_symm [DecidableEq m] [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m β. n) :
(f.symm.toMatrix : Matrix n m Ξ±) = f.toMatrixα΅ := by
ext
simp only [transpose, mem_iff_mem f, toMatrix_apply]
congr
#align pequiv.to_matrix_symm PEquiv.toMatrix_symm
@[simp]
theorem toMatrix_refl [DecidableEq n] [Zero Ξ±] [One Ξ±] :
((PEquiv.refl n).toMatrix : Matrix n n Ξ±) = 1 := by
ext
simp [toMatrix_apply, one_apply]
#align pequiv.to_matrix_refl PEquiv.toMatrix_refl
theorem matrix_mul_apply [Fintype m] [Semiring Ξ±] [DecidableEq n] (M : Matrix l m Ξ±) (f : m β. n)
(i j) : (M * f.toMatrix :) i j = Option.casesOn (f.symm j) 0 fun fj => M i fj := by
dsimp [toMatrix, Matrix.mul_apply]
cases' h : f.symm j with fj
Β· simp [h, β f.eq_some_iff]
Β· rw [Finset.sum_eq_single fj]
Β· simp [h, β f.eq_some_iff]
Β· rintro b - n
simp [h, β f.eq_some_iff, n.symm]
Β· simp
#align pequiv.matrix_mul_apply PEquiv.matrix_mul_apply
theorem toPEquiv_mul_matrix [Fintype m] [DecidableEq m] [Semiring Ξ±] (f : m β m)
(M : Matrix m n Ξ±) : f.toPEquiv.toMatrix * M = M.submatrix f id := by
ext i j
rw [mul_matrix_apply, Equiv.toPEquiv_apply, submatrix_apply, id]
#align pequiv.to_pequiv_mul_matrix PEquiv.toPEquiv_mul_matrix
theorem mul_toPEquiv_toMatrix {m n Ξ± : Type*} [Fintype n] [DecidableEq n] [Semiring Ξ±] (f : n β n)
(M : Matrix m n Ξ±) : M * f.toPEquiv.toMatrix = M.submatrix id f.symm :=
Matrix.ext fun i j => by
rw [PEquiv.matrix_mul_apply, β Equiv.toPEquiv_symm, Equiv.toPEquiv_apply,
Matrix.submatrix_apply, id]
#align pequiv.mul_to_pequiv_to_matrix PEquiv.mul_toPEquiv_toMatrix
theorem toMatrix_trans [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring Ξ±] (f : l β. m)
(g : m β. n) : ((f.trans g).toMatrix : Matrix l n Ξ±) = f.toMatrix * g.toMatrix := by
ext i j
rw [mul_matrix_apply]
dsimp [toMatrix, PEquiv.trans]
cases f i <;> simp
#align pequiv.to_matrix_trans PEquiv.toMatrix_trans
@[simp]
theorem toMatrix_bot [DecidableEq n] [Zero Ξ±] [One Ξ±] :
((β₯ : PEquiv m n).toMatrix : Matrix m n Ξ±) = 0 :=
rfl
#align pequiv.to_matrix_bot PEquiv.toMatrix_bot
theorem toMatrix_injective [DecidableEq n] [MonoidWithZero Ξ±] [Nontrivial Ξ±] :
Function.Injective (@toMatrix m n Ξ± _ _ _) := by
classical
intro f g
refine not_imp_not.1 ?_
simp only [Matrix.ext_iff.symm, toMatrix_apply, PEquiv.ext_iff, not_forall, exists_imp]
intro i hi
use i
cases' hf : f i with fi
Β· cases' hg : g i with gi
-- Porting note: was `cc`
Β· rw [hf, hg] at hi
exact (hi rfl).elim
Β· use gi
simp
Β· use fi
simp [hf.symm, Ne.symm hi]
#align pequiv.to_matrix_injective PEquiv.toMatrix_injective
| Mathlib/Data/Matrix/PEquiv.lean | 142 | 148 | theorem toMatrix_swap [DecidableEq n] [Ring Ξ±] (i j : n) :
(Equiv.swap i j).toPEquiv.toMatrix =
(1 : Matrix n n Ξ±) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
(single j i).toMatrix := by |
ext
dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
split_ifs <;> simp_all
| [
" (f.toMatrix * M) i j = Option.casesOn (f i) 0 fun fi => M fi j",
" β j_1 : m, (if j_1 β f i then 1 else 0) * M j_1 j = Option.rec 0 (fun val => M val j) (f i)",
" β j_1 : m, (if j_1 β none then 1 else 0) * M j_1 j = Option.rec 0 (fun val => M val j) none",
" β j_1 : m, (if j_1 β some fi then 1 else 0) * M j... | [
" (f.toMatrix * M) i j = Option.casesOn (f i) 0 fun fi => M fi j",
" β j_1 : m, (if j_1 β f i then 1 else 0) * M j_1 j = Option.rec 0 (fun val => M val j) (f i)",
" β j_1 : m, (if j_1 β none then 1 else 0) * M j_1 j = Option.rec 0 (fun val => M val j) none",
" β j_1 : m, (if j_1 β some fi then 1 else 0) * M j... |
import Mathlib.Data.List.Join
#align_import data.list.permutation from "leanprover-community/mathlib"@"dd71334db81d0bd444af1ee339a29298bef40734"
-- Make sure we don't import algebra
assert_not_exists Monoid
open Nat
variable {Ξ± Ξ² : Type*}
namespace List
theorem permutationsAux2_fst (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) :
β (ys : List Ξ±) (f : List Ξ± β Ξ²), (permutationsAux2 t ts r ys f).1 = ys ++ ts
| [], f => rfl
| y :: ys, f => by simp [permutationsAux2, permutationsAux2_fst t _ _ ys]
#align list.permutations_aux2_fst List.permutationsAux2_fst
@[simp]
theorem permutationsAux2_snd_nil (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) (f : List Ξ± β Ξ²) :
(permutationsAux2 t ts r [] f).2 = r :=
rfl
#align list.permutations_aux2_snd_nil List.permutationsAux2_snd_nil
@[simp]
theorem permutationsAux2_snd_cons (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) (y : Ξ±) (ys : List Ξ±)
(f : List Ξ± β Ξ²) :
(permutationsAux2 t ts r (y :: ys) f).2 =
f (t :: y :: ys ++ ts) :: (permutationsAux2 t ts r ys fun x : List Ξ± => f (y :: x)).2 := by
simp [permutationsAux2, permutationsAux2_fst t _ _ ys]
#align list.permutations_aux2_snd_cons List.permutationsAux2_snd_cons
theorem permutationsAux2_append (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) (ys : List Ξ±) (f : List Ξ± β Ξ²) :
(permutationsAux2 t ts nil ys f).2 ++ r = (permutationsAux2 t ts r ys f).2 := by
induction ys generalizing f <;> simp [*]
#align list.permutations_aux2_append List.permutationsAux2_append
theorem permutationsAux2_comp_append {t : Ξ±} {ts ys : List Ξ±} {r : List Ξ²} (f : List Ξ± β Ξ²) :
((permutationsAux2 t [] r ys) fun x => f (x ++ ts)).2 = (permutationsAux2 t ts r ys f).2 := by
induction' ys with ys_hd _ ys_ih generalizing f
Β· simp
Β· simp [ys_ih fun xs => f (ys_hd :: xs)]
#align list.permutations_aux2_comp_append List.permutationsAux2_comp_append
theorem map_permutationsAux2' {Ξ±' Ξ²'} (g : Ξ± β Ξ±') (g' : Ξ² β Ξ²') (t : Ξ±) (ts ys : List Ξ±)
(r : List Ξ²) (f : List Ξ± β Ξ²) (f' : List Ξ±' β Ξ²') (H : β a, g' (f a) = f' (map g a)) :
map g' (permutationsAux2 t ts r ys f).2 =
(permutationsAux2 (g t) (map g ts) (map g' r) (map g ys) f').2 := by
induction' ys with ys_hd _ ys_ih generalizing f f'
Β· simp
Β· simp only [map, permutationsAux2_snd_cons, cons_append, cons.injEq]
rw [ys_ih, permutationsAux2_fst]
Β· refine β¨?_, rflβ©
simp only [β map_cons, β map_append]; apply H
Β· intro a; apply H
#align list.map_permutations_aux2' List.map_permutationsAux2'
theorem map_permutationsAux2 (t : Ξ±) (ts : List Ξ±) (ys : List Ξ±) (f : List Ξ± β Ξ²) :
(permutationsAux2 t ts [] ys id).2.map f = (permutationsAux2 t ts [] ys f).2 := by
rw [map_permutationsAux2' id, map_id, map_id]
Β· rfl
simp
#align list.map_permutations_aux2 List.map_permutationsAux2
theorem permutationsAux2_snd_eq (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) (ys : List Ξ±) (f : List Ξ± β Ξ²) :
(permutationsAux2 t ts r ys f).2 =
((permutationsAux2 t [] [] ys id).2.map fun x => f (x ++ ts)) ++ r := by
rw [β permutationsAux2_append, map_permutationsAux2, permutationsAux2_comp_append]
#align list.permutations_aux2_snd_eq List.permutationsAux2_snd_eq
theorem map_map_permutationsAux2 {Ξ±'} (g : Ξ± β Ξ±') (t : Ξ±) (ts ys : List Ξ±) :
map (map g) (permutationsAux2 t ts [] ys id).2 =
(permutationsAux2 (g t) (map g ts) [] (map g ys) id).2 :=
map_permutationsAux2' _ _ _ _ _ _ _ _ fun _ => rfl
#align list.map_map_permutations_aux2 List.map_map_permutationsAux2
theorem map_map_permutations'Aux (f : Ξ± β Ξ²) (t : Ξ±) (ts : List Ξ±) :
map (map f) (permutations'Aux t ts) = permutations'Aux (f t) (map f ts) := by
induction' ts with a ts ih
Β· rfl
Β· simp only [permutations'Aux, map_cons, map_map, β ih, cons.injEq, true_and, Function.comp_def]
#align list.map_map_permutations'_aux List.map_map_permutations'Aux
theorem permutations'Aux_eq_permutationsAux2 (t : Ξ±) (ts : List Ξ±) :
permutations'Aux t ts = (permutationsAux2 t [] [ts ++ [t]] ts id).2 := by
induction' ts with a ts ih; Β· rfl
simp only [permutations'Aux, ih, cons_append, permutationsAux2_snd_cons, append_nil, id_eq,
cons.injEq, true_and]
simp (config := { singlePass := true }) only [β permutationsAux2_append]
simp [map_permutationsAux2]
#align list.permutations'_aux_eq_permutations_aux2 List.permutations'Aux_eq_permutationsAux2
| Mathlib/Data/List/Permutation.lean | 149 | 164 | theorem mem_permutationsAux2 {t : Ξ±} {ts : List Ξ±} {ys : List Ξ±} {l l' : List Ξ±} :
l' β (permutationsAux2 t ts [] ys (l ++ Β·)).2 β
β lβ lβ, lβ β [] β§ ys = lβ ++ lβ β§ l' = l ++ lβ ++ t :: lβ ++ ts := by |
induction' ys with y ys ih generalizing l
Β· simp (config := { contextual := true })
rw [permutationsAux2_snd_cons,
show (fun x : List Ξ± => l ++ y :: x) = (l ++ [y] ++ Β·) by funext _; simp, mem_cons, ih]
constructor
Β· rintro (rfl | β¨lβ, lβ, l0, rfl, rflβ©)
Β· exact β¨[], y :: ys, by simpβ©
Β· exact β¨y :: lβ, lβ, l0, by simpβ©
Β· rintro β¨_ | β¨y', lββ©, lβ, l0, ye, rflβ©
Β· simp [ye]
Β· simp only [cons_append] at ye
rcases ye with β¨rfl, rflβ©
exact Or.inr β¨lβ, lβ, l0, by simpβ©
| [
" (permutationsAux2 t ts r (y :: ys) f).1 = y :: ys ++ ts",
" (permutationsAux2 t ts r (y :: ys) f).2 = f (t :: y :: ys ++ ts) :: (permutationsAux2 t ts r ys fun x => f (y :: x)).2",
" (permutationsAux2 t ts [] ys f).2 ++ r = (permutationsAux2 t ts r ys f).2",
" (permutationsAux2 t ts [] [] f).2 ++ r = (permu... | [
" (permutationsAux2 t ts r (y :: ys) f).1 = y :: ys ++ ts",
" (permutationsAux2 t ts r (y :: ys) f).2 = f (t :: y :: ys ++ ts) :: (permutationsAux2 t ts r ys fun x => f (y :: x)).2",
" (permutationsAux2 t ts [] ys f).2 ++ r = (permutationsAux2 t ts r ys f).2",
" (permutationsAux2 t ts [] [] f).2 ++ r = (permu... |
import Mathlib.Init.Function
import Mathlib.Logic.Function.Basic
#align_import data.sigma.basic from "leanprover-community/mathlib"@"a148d797a1094ab554ad4183a4ad6f130358ef64"
open Function
section Sigma
variable {Ξ± Ξ±β Ξ±β : Type*} {Ξ² : Ξ± β Type*} {Ξ²β : Ξ±β β Type*} {Ξ²β : Ξ±β β Type*}
namespace Sigma
instance instInhabitedSigma [Inhabited Ξ±] [Inhabited (Ξ² default)] : Inhabited (Sigma Ξ²) :=
β¨β¨default, defaultβ©β©
instance instDecidableEqSigma [hβ : DecidableEq Ξ±] [hβ : β a, DecidableEq (Ξ² a)] :
DecidableEq (Sigma Ξ²)
| β¨aβ, bββ©, β¨aβ, bββ© =>
match aβ, bβ, aβ, bβ, hβ aβ aβ with
| _, bβ, _, bβ, isTrue (Eq.refl _) =>
match bβ, bβ, hβ _ bβ bβ with
| _, _, isTrue (Eq.refl _) => isTrue rfl
| _, _, isFalse n => isFalse fun h β¦ Sigma.noConfusion h fun _ eβ β¦ n <| eq_of_heq eβ
| _, _, _, _, isFalse n => isFalse fun h β¦ Sigma.noConfusion h fun eβ _ β¦ n eβ
-- sometimes the built-in injectivity support does not work
@[simp] -- @[nolint simpNF]
theorem mk.inj_iff {aβ aβ : Ξ±} {bβ : Ξ² aβ} {bβ : Ξ² aβ} :
Sigma.mk aβ bβ = β¨aβ, bββ© β aβ = aβ β§ HEq bβ bβ :=
β¨fun h β¦ by cases h; simp,
fun β¨hβ, hββ© β¦ by subst hβ; rw [eq_of_heq hβ]β©
#align sigma.mk.inj_iff Sigma.mk.inj_iff
@[simp]
theorem eta : β x : Ξ£a, Ξ² a, Sigma.mk x.1 x.2 = x
| β¨_, _β© => rfl
#align sigma.eta Sigma.eta
#align sigma.ext Sigma.ext
| Mathlib/Data/Sigma/Basic.lean | 70 | 71 | theorem ext_iff {xβ xβ : Sigma Ξ²} : xβ = xβ β xβ.1 = xβ.1 β§ HEq xβ.2 xβ.2 := by |
cases xβ; cases xβ; exact Sigma.mk.inj_iff
| [
" aβ = aβ β§ HEq bβ bβ",
" aβ = aβ β§ HEq bβ bβ",
" β¨aβ, bββ© = β¨aβ, bββ©",
" β¨aβ, bββ© = β¨aβ, bββ©",
" xβ = xβ β xβ.fst = xβ.fst β§ HEq xβ.snd xβ.snd",
" β¨fstβ, sndββ© = xβ β β¨fstβ, sndββ©.fst = xβ.fst β§ HEq β¨fstβ, sndββ©.snd xβ.snd",
" β¨fstβΒΉ, sndβΒΉβ© = β¨fstβ, sndββ© β β¨fstβΒΉ, sndβΒΉβ©.fst = β¨fstβ, sndββ©.fst β§ HEq ... | [
" aβ = aβ β§ HEq bβ bβ",
" aβ = aβ β§ HEq bβ bβ",
" β¨aβ, bββ© = β¨aβ, bββ©",
" β¨aβ, bββ© = β¨aβ, bββ©"
] |
import Mathlib.Analysis.SpecialFunctions.Pow.Complex
import Qq
#align_import analysis.special_functions.pow.real from "leanprover-community/mathlib"@"4fa54b337f7d52805480306db1b1439c741848c8"
noncomputable section
open scoped Classical
open Real ComplexConjugate
open Finset Set
namespace Real
variable {x y z : β}
noncomputable def rpow (x y : β) :=
((x : β) ^ (y : β)).re
#align real.rpow Real.rpow
noncomputable instance : Pow β β := β¨rpowβ©
@[simp]
theorem rpow_eq_pow (x y : β) : rpow x y = x ^ y := rfl
#align real.rpow_eq_pow Real.rpow_eq_pow
theorem rpow_def (x y : β) : x ^ y = ((x : β) ^ (y : β)).re := rfl
#align real.rpow_def Real.rpow_def
theorem rpow_def_of_nonneg {x : β} (hx : 0 β€ x) (y : β) :
x ^ y = if x = 0 then if y = 0 then 1 else 0 else exp (log x * y) := by
simp only [rpow_def, Complex.cpow_def]; split_ifs <;>
simp_all [(Complex.ofReal_log hx).symm, -Complex.ofReal_mul, -RCLike.ofReal_mul,
(Complex.ofReal_mul _ _).symm, Complex.exp_ofReal_re, Complex.ofReal_eq_zero]
#align real.rpow_def_of_nonneg Real.rpow_def_of_nonneg
theorem rpow_def_of_pos {x : β} (hx : 0 < x) (y : β) : x ^ y = exp (log x * y) := by
rw [rpow_def_of_nonneg (le_of_lt hx), if_neg (ne_of_gt hx)]
#align real.rpow_def_of_pos Real.rpow_def_of_pos
theorem exp_mul (x y : β) : exp (x * y) = exp x ^ y := by rw [rpow_def_of_pos (exp_pos _), log_exp]
#align real.exp_mul Real.exp_mul
@[simp, norm_cast]
theorem rpow_intCast (x : β) (n : β€) : x ^ (n : β) = x ^ n := by
simp only [rpow_def, β Complex.ofReal_zpow, Complex.cpow_intCast, Complex.ofReal_intCast,
Complex.ofReal_re]
#align real.rpow_int_cast Real.rpow_intCast
@[deprecated (since := "2024-04-17")]
alias rpow_int_cast := rpow_intCast
@[simp, norm_cast]
theorem rpow_natCast (x : β) (n : β) : x ^ (n : β) = x ^ n := by simpa using rpow_intCast x n
#align real.rpow_nat_cast Real.rpow_natCast
@[deprecated (since := "2024-04-17")]
alias rpow_nat_cast := rpow_natCast
@[simp]
theorem exp_one_rpow (x : β) : exp 1 ^ x = exp x := by rw [β exp_mul, one_mul]
#align real.exp_one_rpow Real.exp_one_rpow
@[simp] lemma exp_one_pow (n : β) : exp 1 ^ n = exp n := by rw [β rpow_natCast, exp_one_rpow]
theorem rpow_eq_zero_iff_of_nonneg (hx : 0 β€ x) : x ^ y = 0 β x = 0 β§ y β 0 := by
simp only [rpow_def_of_nonneg hx]
split_ifs <;> simp [*, exp_ne_zero]
#align real.rpow_eq_zero_iff_of_nonneg Real.rpow_eq_zero_iff_of_nonneg
@[simp]
lemma rpow_eq_zero (hx : 0 β€ x) (hy : y β 0) : x ^ y = 0 β x = 0 := by
simp [rpow_eq_zero_iff_of_nonneg, *]
@[simp]
lemma rpow_ne_zero (hx : 0 β€ x) (hy : y β 0) : x ^ y β 0 β x β 0 :=
Real.rpow_eq_zero hx hy |>.not
open Real
theorem rpow_def_of_neg {x : β} (hx : x < 0) (y : β) : x ^ y = exp (log x * y) * cos (y * Ο) := by
rw [rpow_def, Complex.cpow_def, if_neg]
Β· have : Complex.log x * y = β(log (-x) * y) + β(y * Ο) * Complex.I := by
simp only [Complex.log, abs_of_neg hx, Complex.arg_ofReal_of_neg hx, Complex.abs_ofReal,
Complex.ofReal_mul]
ring
rw [this, Complex.exp_add_mul_I, β Complex.ofReal_exp, β Complex.ofReal_cos, β
Complex.ofReal_sin, mul_add, β Complex.ofReal_mul, β mul_assoc, β Complex.ofReal_mul,
Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.I_re, Complex.ofReal_im,
Real.log_neg_eq_log]
ring
Β· rw [Complex.ofReal_eq_zero]
exact ne_of_lt hx
#align real.rpow_def_of_neg Real.rpow_def_of_neg
| Mathlib/Analysis/SpecialFunctions/Pow/Real.lean | 115 | 117 | theorem rpow_def_of_nonpos {x : β} (hx : x β€ 0) (y : β) :
x ^ y = if x = 0 then if y = 0 then 1 else 0 else exp (log x * y) * cos (y * Ο) := by |
split_ifs with h <;> simp [rpow_def, *]; exact rpow_def_of_neg (lt_of_le_of_ne hx h) _
| [
" x ^ y = if x = 0 then if y = 0 then 1 else 0 else rexp (x.log * y)",
" (if βx = 0 then if βy = 0 then 1 else 0 else ((βx).log * βy).exp).re =\n if x = 0 then if y = 0 then 1 else 0 else rexp (x.log * y)",
" Complex.re 1 = 1",
" Complex.re 1 = 0",
" Complex.re 1 = rexp (x.log * y)",
" Complex.re 0 = 1... | [
" x ^ y = if x = 0 then if y = 0 then 1 else 0 else rexp (x.log * y)",
" (if βx = 0 then if βy = 0 then 1 else 0 else ((βx).log * βy).exp).re =\n if x = 0 then if y = 0 then 1 else 0 else rexp (x.log * y)",
" Complex.re 1 = 1",
" Complex.re 1 = 0",
" Complex.re 1 = rexp (x.log * y)",
" Complex.re 0 = 1... |
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
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]
#align measure_theory.measure.integral_comp_inv_smul MeasureTheory.Measure.integral_comp_inv_smul
| Mathlib/MeasureTheory/Measure/Haar/NormedSpace.lean | 105 | 107 | theorem integral_comp_inv_smul_of_nonneg (f : E β F) {R : β} (hR : 0 β€ R) :
β« x, f (Rβ»ΒΉ β’ x) βΞΌ = R ^ finrank β E β’ β« x, f x βΞΌ := by |
rw [integral_comp_inv_smul ΞΌ f R, abs_of_nonneg (pow_nonneg hR _)]
| [
" 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.CategoryTheory.Adjunction.FullyFaithful
import Mathlib.CategoryTheory.Adjunction.Limits
import Mathlib.CategoryTheory.Limits.Shapes.CommSq
import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial
import Mathlib.CategoryTheory.Limits.FunctorCategory
import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts
#align_import category_theory.extensive from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1"
open CategoryTheory.Limits
namespace CategoryTheory
universe v' u' v u
variable {J : Type v'} [Category.{u'} J] {C : Type u} [Category.{v} C]
variable {K : Type*} [Category K] {D : Type*} [Category D]
section NatTrans
def NatTrans.Equifibered {F G : J β₯€ C} (Ξ± : F βΆ G) : Prop :=
β β¦i j : Jβ¦ (f : i βΆ j), IsPullback (F.map f) (Ξ±.app i) (Ξ±.app j) (G.map f)
#align category_theory.nat_trans.equifibered CategoryTheory.NatTrans.Equifibered
theorem NatTrans.equifibered_of_isIso {F G : J β₯€ C} (Ξ± : F βΆ G) [IsIso Ξ±] : Equifibered Ξ± :=
fun _ _ f => IsPullback.of_vert_isIso β¨NatTrans.naturality _ fβ©
#align category_theory.nat_trans.equifibered_of_is_iso CategoryTheory.NatTrans.equifibered_of_isIso
theorem NatTrans.Equifibered.comp {F G H : J β₯€ C} {Ξ± : F βΆ G} {Ξ² : G βΆ H} (hΞ± : Equifibered Ξ±)
(hΞ² : Equifibered Ξ²) : Equifibered (Ξ± β« Ξ²) :=
fun _ _ f => (hΞ± f).paste_vert (hΞ² f)
#align category_theory.nat_trans.equifibered.comp CategoryTheory.NatTrans.Equifibered.comp
theorem NatTrans.Equifibered.whiskerRight {F G : J β₯€ C} {Ξ± : F βΆ G} (hΞ± : Equifibered Ξ±)
(H : C β₯€ D) [β (i j : J) (f : j βΆ i), PreservesLimit (cospan (Ξ±.app i) (G.map f)) H] :
Equifibered (whiskerRight Ξ± H) :=
fun _ _ f => (hΞ± f).map H
#align category_theory.nat_trans.equifibered.whisker_right CategoryTheory.NatTrans.Equifibered.whiskerRight
theorem NatTrans.Equifibered.whiskerLeft {K : Type*} [Category K] {F G : J β₯€ C} {Ξ± : F βΆ G}
(hΞ± : Equifibered Ξ±) (H : K β₯€ J) : Equifibered (whiskerLeft H Ξ±) :=
fun _ _ f => hΞ± (H.map f)
| Mathlib/CategoryTheory/Limits/VanKampen.lean | 75 | 80 | theorem mapPair_equifibered {F F' : Discrete WalkingPair β₯€ C} (Ξ± : F βΆ F') :
NatTrans.Equifibered Ξ± := by |
rintro β¨β¨β©β© β¨jβ© β¨β¨rfl : _ = jβ©β©
all_goals
dsimp; simp only [Discrete.functor_map_id]
exact IsPullback.of_horiz_isIso β¨by simp only [Category.comp_id, Category.id_comp]β©
| [
" NatTrans.Equifibered Ξ±",
" IsPullback (F.map { down := { down := β― } }) (Ξ±.app { as := WalkingPair.right })\n (Ξ±.app { as := { as := WalkingPair.right }.as }) (F'.map { down := { down := β― } })",
" IsPullback (F.map { down := { down := β― } }) (Ξ±.app { as := WalkingPair.left })\n (Ξ±.app { as := { as := W... | [] |
import Mathlib.LinearAlgebra.FiniteDimensional
#align_import linear_algebra.projective_space.basic from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23"
variable (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V]
def projectivizationSetoid : Setoid { v : V // v β 0 } :=
(MulAction.orbitRel KΛ£ V).comap (β)
#align projectivization_setoid projectivizationSetoid
def Projectivization := Quotient (projectivizationSetoid K V)
#align projectivization Projectivization
scoped[LinearAlgebra.Projectivization] notation "β" => Projectivization
namespace Projectivization
open scoped LinearAlgebra.Projectivization
variable {V}
def mk (v : V) (hv : v β 0) : β K V :=
Quotient.mk'' β¨v, hvβ©
#align projectivization.mk Projectivization.mk
def mk' (v : { v : V // v β 0 }) : β K V :=
Quotient.mk'' v
#align projectivization.mk' Projectivization.mk'
@[simp]
theorem mk'_eq_mk (v : { v : V // v β 0 }) : mk' K v = mk K βv v.2 := rfl
#align projectivization.mk'_eq_mk Projectivization.mk'_eq_mk
instance [Nontrivial V] : Nonempty (β K V) :=
let β¨v, hvβ© := exists_ne (0 : V)
β¨mk K v hvβ©
variable {K}
protected noncomputable def rep (v : β K V) : V :=
v.out'
#align projectivization.rep Projectivization.rep
theorem rep_nonzero (v : β K V) : v.rep β 0 :=
v.out'.2
#align projectivization.rep_nonzero Projectivization.rep_nonzero
@[simp]
theorem mk_rep (v : β K V) : mk K v.rep v.rep_nonzero = v := Quotient.out_eq' _
#align projectivization.mk_rep Projectivization.mk_rep
open FiniteDimensional
protected def submodule (v : β K V) : Submodule K V :=
(Quotient.liftOn' v fun v => K β (v : V)) <| by
rintro β¨a, haβ© β¨b, hbβ© β¨x, rfl : x β’ b = aβ©
exact Submodule.span_singleton_group_smul_eq _ x _
#align projectivization.submodule Projectivization.submodule
variable (K)
theorem mk_eq_mk_iff (v w : V) (hv : v β 0) (hw : w β 0) :
mk K v hv = mk K w hw β β a : KΛ£, a β’ w = v :=
Quotient.eq''
#align projectivization.mk_eq_mk_iff Projectivization.mk_eq_mk_iff
theorem mk_eq_mk_iff' (v w : V) (hv : v β 0) (hw : w β 0) :
mk K v hv = mk K w hw β β a : K, a β’ w = v := by
rw [mk_eq_mk_iff K v w hv hw]
constructor
Β· rintro β¨a, haβ©
exact β¨a, haβ©
Β· rintro β¨a, haβ©
refine β¨Units.mk0 a fun c => hv.symm ?_, haβ©
rwa [c, zero_smul] at ha
#align projectivization.mk_eq_mk_iff' Projectivization.mk_eq_mk_iff'
theorem exists_smul_eq_mk_rep (v : V) (hv : v β 0) : β a : KΛ£, a β’ v = (mk K v hv).rep :=
(mk_eq_mk_iff K _ _ (rep_nonzero _) hv).1 (mk_rep _)
#align projectivization.exists_smul_eq_mk_rep Projectivization.exists_smul_eq_mk_rep
variable {K}
@[elab_as_elim]
theorem ind {P : β K V β Prop} (h : β (v : V) (h : v β 0), P (mk K v h)) : β p, P p :=
Quotient.ind' <| Subtype.rec <| h
#align projectivization.ind Projectivization.ind
@[simp]
theorem submodule_mk (v : V) (hv : v β 0) : (mk K v hv).submodule = K β v :=
rfl
#align projectivization.submodule_mk Projectivization.submodule_mk
| Mathlib/LinearAlgebra/Projectivization/Basic.lean | 137 | 139 | theorem submodule_eq (v : β K V) : v.submodule = K β v.rep := by |
conv_lhs => rw [β v.mk_rep]
rfl
| [
" β (a b : { v // v β 0 }), Setoid.r a b β Submodule.span K {βa} = Submodule.span K {βb}",
" Submodule.span K {ββ¨x β’ b, haβ©} = Submodule.span K {ββ¨b, hbβ©}",
" mk K v hv = mk K w hw β β a, a β’ w = v",
" (β a, a β’ w = v) β β a, a β’ w = v",
" (β a, a β’ w = v) β β a, a β’ w = v",
" β a, a β’ w = v",
" 0 = v",... | [
" β (a b : { v // v β 0 }), Setoid.r a b β Submodule.span K {βa} = Submodule.span K {βb}",
" Submodule.span K {ββ¨x β’ b, haβ©} = Submodule.span K {ββ¨b, hbβ©}",
" mk K v hv = mk K w hw β β a, a β’ w = v",
" (β a, a β’ w = v) β β a, a β’ w = v",
" (β a, a β’ w = v) β β a, a β’ w = v",
" β a, a β’ w = v",
" 0 = v"
... |
import Mathlib.Algebra.Group.Submonoid.Pointwise
#align_import group_theory.submonoid.inverses from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf"
variable {M : Type*}
namespace Submonoid
@[to_additive]
noncomputable instance [Monoid M] : Group (IsUnit.submonoid M) :=
{ inferInstanceAs (Monoid (IsUnit.submonoid M)) with
inv := fun x β¦ β¨x.prop.unitβ»ΒΉ.val, x.prop.unitβ»ΒΉ.isUnitβ©
mul_left_inv := fun x β¦
Subtype.ext ((Units.val_mul x.prop.unitβ»ΒΉ _).trans x.prop.unit.inv_val) }
@[to_additive]
noncomputable instance [CommMonoid M] : CommGroup (IsUnit.submonoid M) :=
{ inferInstanceAs (Group (IsUnit.submonoid M)) with
mul_comm := fun a b β¦ by convert mul_comm a b }
@[to_additive]
theorem IsUnit.Submonoid.coe_inv [Monoid M] (x : IsUnit.submonoid M) :
βxβ»ΒΉ = (βx.prop.unitβ»ΒΉ : M) :=
rfl
#align submonoid.is_unit.submonoid.coe_inv Submonoid.IsUnit.Submonoid.coe_inv
#align add_submonoid.is_unit.submonoid.coe_neg AddSubmonoid.IsUnit.Submonoid.coe_neg
section Monoid
variable [Monoid M] (S : Submonoid M)
@[to_additive
"`S.leftNeg` is the additive submonoid containing all the left additive inverses of `S`."]
def leftInv : Submonoid M where
carrier := { x : M | β y : S, x * y = 1 }
one_mem' := β¨1, mul_one 1β©
mul_mem' := fun {a} _b β¨a', haβ© β¨b', hbβ© β¦
β¨b' * a', by simp only [coe_mul, β mul_assoc, mul_assoc a, hb, mul_one, ha]β©
#align submonoid.left_inv Submonoid.leftInv
#align add_submonoid.left_neg AddSubmonoid.leftNeg
@[to_additive]
| Mathlib/GroupTheory/Submonoid/Inverses.lean | 73 | 76 | theorem leftInv_leftInv_le : S.leftInv.leftInv β€ S := by |
rintro x β¨β¨y, z, hββ©, hβ : x * y = 1β©
convert z.prop
rw [β mul_one x, β hβ, β mul_assoc, hβ, one_mul]
| [
" a * b = b * a",
" a * _b * β(b' * a') = 1",
" S.leftInv.leftInv β€ S",
" x β S",
" x = βz"
] | [
" a * b = b * a",
" a * _b * β(b' * a') = 1"
] |
import Mathlib.CategoryTheory.Idempotents.Basic
import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor
import Mathlib.CategoryTheory.Equivalence
#align_import category_theory.idempotents.karoubi from "leanprover-community/mathlib"@"200eda15d8ff5669854ff6bcc10aaf37cb70498f"
noncomputable section
open CategoryTheory.Category CategoryTheory.Preadditive CategoryTheory.Limits BigOperators
namespace CategoryTheory
variable (C : Type*) [Category C]
namespace Idempotents
-- porting note (#5171): removed @[nolint has_nonempty_instance]
structure Karoubi where
X : C
p : X βΆ X
idem : p β« p = p := by aesop_cat
#align category_theory.idempotents.karoubi CategoryTheory.Idempotents.Karoubi
namespace Karoubi
variable {C}
attribute [reassoc (attr := simp)] idem
@[ext]
theorem ext {P Q : Karoubi C} (h_X : P.X = Q.X) (h_p : P.p β« eqToHom h_X = eqToHom h_X β« Q.p) :
P = Q := by
cases P
cases Q
dsimp at h_X h_p
subst h_X
simpa only [mk.injEq, heq_eq_eq, true_and, eqToHom_refl, comp_id, id_comp] using h_p
#align category_theory.idempotents.karoubi.ext CategoryTheory.Idempotents.Karoubi.ext
@[ext]
structure Hom (P Q : Karoubi C) where
f : P.X βΆ Q.X
comm : f = P.p β« f β« Q.p := by aesop_cat
#align category_theory.idempotents.karoubi.hom CategoryTheory.Idempotents.Karoubi.Hom
instance [Preadditive C] (P Q : Karoubi C) : Inhabited (Hom P Q) :=
β¨β¨0, by rw [zero_comp, comp_zero]β©β©
@[reassoc (attr := simp)]
theorem p_comp {P Q : Karoubi C} (f : Hom P Q) : P.p β« f.f = f.f := by rw [f.comm, β assoc, P.idem]
#align category_theory.idempotents.karoubi.p_comp CategoryTheory.Idempotents.Karoubi.p_comp
@[reassoc (attr := simp)]
theorem comp_p {P Q : Karoubi C} (f : Hom P Q) : f.f β« Q.p = f.f := by
rw [f.comm, assoc, assoc, Q.idem]
#align category_theory.idempotents.karoubi.comp_p CategoryTheory.Idempotents.Karoubi.comp_p
@[reassoc]
| Mathlib/CategoryTheory/Idempotents/Karoubi.lean | 94 | 94 | theorem p_comm {P Q : Karoubi C} (f : Hom P Q) : P.p β« f.f = f.f β« Q.p := by | rw [p_comp, comp_p]
| [
" P = Q",
" { X := Xβ, p := pβ, idem := idemβ } = Q",
" { X := XβΒΉ, p := pβΒΉ, idem := idemβΒΉ } = { X := Xβ, p := pβ, idem := idemβ }",
" { X := Xβ, p := pβΒΉ, idem := idemβΒΉ } = { X := Xβ, p := pβ, idem := idemβ }",
" 0 = P.p β« 0 β« Q.p",
" P.p β« f.f = f.f",
" f.f β« Q.p = f.f",
" P.p β« f.f = f.f β« Q.p"
... | [
" P = Q",
" { X := Xβ, p := pβ, idem := idemβ } = Q",
" { X := XβΒΉ, p := pβΒΉ, idem := idemβΒΉ } = { X := Xβ, p := pβ, idem := idemβ }",
" { X := Xβ, p := pβΒΉ, idem := idemβΒΉ } = { X := Xβ, p := pβ, idem := idemβ }",
" 0 = P.p β« 0 β« Q.p",
" P.p β« f.f = f.f",
" f.f β« Q.p = f.f"
] |
import Mathlib.LinearAlgebra.Matrix.Spectrum
import Mathlib.LinearAlgebra.QuadraticForm.Basic
#align_import linear_algebra.matrix.pos_def from "leanprover-community/mathlib"@"07992a1d1f7a4176c6d3f160209608be4e198566"
open scoped ComplexOrder
namespace Matrix
variable {m n R π : Type*}
variable [Fintype m] [Fintype n]
variable [CommRing R] [PartialOrder R] [StarRing R] [StarOrderedRing R]
variable [RCLike π]
open scoped Matrix
def PosSemidef (M : Matrix n n R) :=
M.IsHermitian β§ β x : n β R, 0 β€ dotProduct (star x) (M *α΅₯ x)
#align matrix.pos_semidef Matrix.PosSemidef
lemma posSemidef_diagonal_iff [DecidableEq n] {d : n β R} :
PosSemidef (diagonal d) β (β i : n, 0 β€ d i) := by
refine β¨fun β¨_, hPβ© i β¦ by simpa using hP (Pi.single i 1), ?_β©
refine fun hd β¦ β¨isHermitian_diagonal_iff.2 fun i β¦ IsSelfAdjoint.of_nonneg (hd i), ?_β©
refine fun x β¦ Finset.sum_nonneg fun i _ β¦ ?_
simpa only [mulVec_diagonal, mul_assoc] using conjugate_nonneg (hd i) _
namespace PosSemidef
theorem isHermitian {M : Matrix n n R} (hM : M.PosSemidef) : M.IsHermitian :=
hM.1
theorem re_dotProduct_nonneg {M : Matrix n n π} (hM : M.PosSemidef) (x : n β π) :
0 β€ RCLike.re (dotProduct (star x) (M *α΅₯ x)) :=
RCLike.nonneg_iff.mp (hM.2 _) |>.1
lemma conjTranspose_mul_mul_same {A : Matrix n n R} (hA : PosSemidef A)
{m : Type*} [Fintype m] (B : Matrix n m R) :
PosSemidef (Bα΄΄ * A * B) := by
constructor
Β· exact isHermitian_conjTranspose_mul_mul B hA.1
Β· intro x
simpa only [star_mulVec, dotProduct_mulVec, vecMul_vecMul] using hA.2 (B *α΅₯ x)
lemma mul_mul_conjTranspose_same {A : Matrix n n R} (hA : PosSemidef A)
{m : Type*} [Fintype m] (B : Matrix m n R):
PosSemidef (B * A * Bα΄΄) := by
simpa only [conjTranspose_conjTranspose] using hA.conjTranspose_mul_mul_same Bα΄΄
| Mathlib/LinearAlgebra/Matrix/PosDef.lean | 81 | 87 | theorem submatrix {M : Matrix n n R} (hM : M.PosSemidef) (e : m β n) :
(M.submatrix e e).PosSemidef := by |
classical
rw [(by simp : M = 1 * M * 1), submatrix_mul (heβ := Function.bijective_id),
submatrix_mul (heβ := Function.bijective_id), submatrix_id_id]
simpa only [conjTranspose_submatrix, conjTranspose_one] using
conjTranspose_mul_mul_same hM (Matrix.submatrix 1 id e)
| [
" (diagonal d).PosSemidef β β (i : n), 0 β€ d i",
" 0 β€ d i",
" (β (i : n), 0 β€ d i) β (diagonal d).PosSemidef",
" β (x : n β R), 0 β€ star x β¬α΅₯ diagonal d *α΅₯ x",
" 0 β€ star x i * (diagonal d *α΅₯ x) i",
" (Bα΄΄ * A * B).PosSemidef",
" (Bα΄΄ * A * B).IsHermitian",
" β (x : m β R), 0 β€ star x β¬α΅₯ (Bα΄΄ * A * B) *... | [
" (diagonal d).PosSemidef β β (i : n), 0 β€ d i",
" 0 β€ d i",
" (β (i : n), 0 β€ d i) β (diagonal d).PosSemidef",
" β (x : n β R), 0 β€ star x β¬α΅₯ diagonal d *α΅₯ x",
" 0 β€ star x i * (diagonal d *α΅₯ x) i",
" (Bα΄΄ * A * B).PosSemidef",
" (Bα΄΄ * A * B).IsHermitian",
" β (x : m β R), 0 β€ star x β¬α΅₯ (Bα΄΄ * A * B) *... |
import Mathlib.Control.EquivFunctor
import Mathlib.CategoryTheory.Groupoid
import Mathlib.CategoryTheory.Whiskering
import Mathlib.CategoryTheory.Types
#align_import category_theory.core from "leanprover-community/mathlib"@"369525b73f229ccd76a6ec0e0e0bf2be57599768"
namespace CategoryTheory
universe vβ vβ uβ uβ
-- morphism levels before object levels. See note [CategoryTheory universes].
-- Porting note(#5171): linter not yet ported
-- @[nolint has_nonempty_instance]
def Core (C : Type uβ) := C
#align category_theory.core CategoryTheory.Core
variable {C : Type uβ} [Category.{vβ} C]
instance coreCategory : Groupoid.{vβ} (Core C) where
Hom (X Y : C) := X β
Y
id (X : C) := Iso.refl X
comp f g := Iso.trans f g
inv {X Y} f := Iso.symm f
#align category_theory.core_category CategoryTheory.coreCategory
namespace Core
@[simp]
| Mathlib/CategoryTheory/Core.lean | 52 | 53 | theorem id_hom (X : C) : Iso.hom (coreCategory.id X) = @CategoryStruct.id C _ X := by |
rfl
| [
" (π X).hom = π X"
] | [] |
import Mathlib.ModelTheory.Syntax
import Mathlib.ModelTheory.Semantics
import Mathlib.Algebra.Ring.Equiv
variable {Ξ± : Type*}
namespace FirstOrder
open FirstOrder
inductive ringFunc : β β Type
| add : ringFunc 2
| mul : ringFunc 2
| neg : ringFunc 1
| zero : ringFunc 0
| one : ringFunc 0
deriving DecidableEq
def Language.ring : Language :=
{ Functions := ringFunc
Relations := fun _ => Empty }
namespace Ring
open ringFunc Language
instance (n : β) : DecidableEq (Language.ring.Functions n) := by
dsimp [Language.ring]; infer_instance
instance (n : β) : DecidableEq (Language.ring.Relations n) := by
dsimp [Language.ring]; infer_instance
abbrev addFunc : Language.ring.Functions 2 := add
abbrev mulFunc : Language.ring.Functions 2 := mul
abbrev negFunc : Language.ring.Functions 1 := neg
abbrev zeroFunc : Language.ring.Functions 0 := zero
abbrev oneFunc : Language.ring.Functions 0 := one
instance (Ξ± : Type*) : Zero (Language.ring.Term Ξ±) :=
{ zero := Constants.term zeroFunc }
theorem zero_def (Ξ± : Type*) : (0 : Language.ring.Term Ξ±) = Constants.term zeroFunc := rfl
instance (Ξ± : Type*) : One (Language.ring.Term Ξ±) :=
{ one := Constants.term oneFunc }
theorem one_def (Ξ± : Type*) : (1 : Language.ring.Term Ξ±) = Constants.term oneFunc := rfl
instance (Ξ± : Type*) : Add (Language.ring.Term Ξ±) :=
{ add := addFunc.applyβ }
theorem add_def (Ξ± : Type*) (tβ tβ : Language.ring.Term Ξ±) :
tβ + tβ = addFunc.applyβ tβ tβ := rfl
instance (Ξ± : Type*) : Mul (Language.ring.Term Ξ±) :=
{ mul := mulFunc.applyβ }
theorem mul_def (Ξ± : Type*) (tβ tβ : Language.ring.Term Ξ±) :
tβ * tβ = mulFunc.applyβ tβ tβ := rfl
instance (Ξ± : Type*) : Neg (Language.ring.Term Ξ±) :=
{ neg := negFunc.applyβ }
theorem neg_def (Ξ± : Type*) (t : Language.ring.Term Ξ±) :
-t = negFunc.applyβ t := rfl
instance : Fintype Language.ring.Symbols :=
β¨β¨Multiset.ofList
[Sum.inl β¨2, .addβ©,
Sum.inl β¨2, .mulβ©,
Sum.inl β¨1, .negβ©,
Sum.inl β¨0, .zeroβ©,
Sum.inl β¨0, .oneβ©], by
dsimp [Language.Symbols]; decideβ©, by
intro x
dsimp [Language.Symbols]
rcases x with β¨_, fβ© | β¨_, fβ©
Β· cases f <;> decide
Β· cases f β©
@[simp]
theorem card_ring : card Language.ring = 5 := by
have : Fintype.card Language.ring.Symbols = 5 := rfl
simp [Language.card, this]
open Language ring Structure
class CompatibleRing (R : Type*) [Add R] [Mul R] [Neg R] [One R] [Zero R]
extends Language.ring.Structure R where
funMap_add : β x, funMap addFunc x = x 0 + x 1
funMap_mul : β x, funMap mulFunc x = x 0 * x 1
funMap_neg : β x, funMap negFunc x = -x 0
funMap_zero : β x, funMap (zeroFunc : Language.ring.Constants) x = 0
funMap_one : β x, funMap (oneFunc : Language.ring.Constants) x = 1
open CompatibleRing
attribute [simp] funMap_add funMap_mul funMap_neg funMap_zero funMap_one
section
variable {R : Type*} [Add R] [Mul R] [Neg R] [One R] [Zero R] [CompatibleRing R]
@[simp]
theorem realize_add (x y : ring.Term Ξ±) (v : Ξ± β R) :
Term.realize v (x + y) = Term.realize v x + Term.realize v y := by
simp [add_def, funMap_add]
@[simp]
theorem realize_mul (x y : ring.Term Ξ±) (v : Ξ± β R) :
Term.realize v (x * y) = Term.realize v x * Term.realize v y := by
simp [mul_def, funMap_mul]
@[simp]
theorem realize_neg (x : ring.Term Ξ±) (v : Ξ± β R) :
Term.realize v (-x) = -Term.realize v x := by
simp [neg_def, funMap_neg]
@[simp]
| Mathlib/ModelTheory/Algebra/Ring/Basic.lean | 195 | 196 | theorem realize_zero (v : Ξ± β R) : Term.realize v (0 : ring.Term Ξ±) = 0 := by |
simp [zero_def, funMap_zero, constantMap]
| [
" DecidableEq (ring.Functions n)",
" DecidableEq (ringFunc n)",
" DecidableEq (ring.Relations n)",
" DecidableEq Empty",
" (β[Sum.inl β¨2, addβ©, Sum.inl β¨2, mulβ©, Sum.inl β¨1, negβ©, Sum.inl β¨0, zeroβ©, Sum.inl β¨0, oneβ©]).Nodup",
" β (x : ring.Symbols),\n x β\n { val := β[Sum.inl β¨2, addβ©, Sum.inl β¨2,... | [
" DecidableEq (ring.Functions n)",
" DecidableEq (ringFunc n)",
" DecidableEq (ring.Relations n)",
" DecidableEq Empty",
" (β[Sum.inl β¨2, addβ©, Sum.inl β¨2, mulβ©, Sum.inl β¨1, negβ©, Sum.inl β¨0, zeroβ©, Sum.inl β¨0, oneβ©]).Nodup",
" β (x : ring.Symbols),\n x β\n { val := β[Sum.inl β¨2, addβ©, Sum.inl β¨2,... |
import Mathlib.Analysis.Calculus.FDeriv.Add
import Mathlib.Analysis.Calculus.FDeriv.Equiv
import Mathlib.Analysis.Calculus.FDeriv.Prod
import Mathlib.Analysis.Calculus.Monotone
import Mathlib.Data.Set.Function
import Mathlib.Algebra.Group.Basic
import Mathlib.Tactic.WLOG
#align_import analysis.bounded_variation from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
open scoped NNReal ENNReal Topology UniformConvergence
open Set MeasureTheory Filter
-- Porting note: sectioned variables because a `wlog` was broken due to extra variables in context
variable {Ξ± : Type*} [LinearOrder Ξ±] {E : Type*} [PseudoEMetricSpace E]
noncomputable def eVariationOn (f : Ξ± β E) (s : Set Ξ±) : ββ₯0β :=
β¨ p : β Γ { u : β β Ξ± // Monotone u β§ β i, u i β s },
β i β Finset.range p.1, edist (f (p.2.1 (i + 1))) (f (p.2.1 i))
#align evariation_on eVariationOn
def BoundedVariationOn (f : Ξ± β E) (s : Set Ξ±) :=
eVariationOn f s β β
#align has_bounded_variation_on BoundedVariationOn
def LocallyBoundedVariationOn (f : Ξ± β E) (s : Set Ξ±) :=
β a b, a β s β b β s β BoundedVariationOn f (s β© Icc a b)
#align has_locally_bounded_variation_on LocallyBoundedVariationOn
namespace eVariationOn
theorem nonempty_monotone_mem {s : Set Ξ±} (hs : s.Nonempty) :
Nonempty { u // Monotone u β§ β i : β, u i β s } := by
obtain β¨x, hxβ© := hs
exact β¨β¨fun _ => x, fun i j _ => le_rfl, fun _ => hxβ©β©
#align evariation_on.nonempty_monotone_mem eVariationOn.nonempty_monotone_mem
theorem eq_of_edist_zero_on {f f' : Ξ± β E} {s : Set Ξ±} (h : β β¦xβ¦, x β s β edist (f x) (f' x) = 0) :
eVariationOn f s = eVariationOn f' s := by
dsimp only [eVariationOn]
congr 1 with p : 1
congr 1 with i : 1
rw [edist_congr_right (h <| p.snd.prop.2 (i + 1)), edist_congr_left (h <| p.snd.prop.2 i)]
#align evariation_on.eq_of_edist_zero_on eVariationOn.eq_of_edist_zero_on
theorem eq_of_eqOn {f f' : Ξ± β E} {s : Set Ξ±} (h : EqOn f f' s) :
eVariationOn f s = eVariationOn f' s :=
eq_of_edist_zero_on fun x xs => by rw [h xs, edist_self]
#align evariation_on.eq_of_eq_on eVariationOn.eq_of_eqOn
theorem sum_le (f : Ξ± β E) {s : Set Ξ±} (n : β) {u : β β Ξ±} (hu : Monotone u) (us : β i, u i β s) :
(β i β Finset.range n, edist (f (u (i + 1))) (f (u i))) β€ eVariationOn f s :=
le_iSup_of_le β¨n, u, hu, usβ© le_rfl
#align evariation_on.sum_le eVariationOn.sum_le
theorem sum_le_of_monotoneOn_Icc (f : Ξ± β E) {s : Set Ξ±} {m n : β} {u : β β Ξ±}
(hu : MonotoneOn u (Icc m n)) (us : β i β Icc m n, u i β s) :
(β i β Finset.Ico m n, edist (f (u (i + 1))) (f (u i))) β€ eVariationOn f s := by
rcases le_total n m with hnm | hmn
Β· simp [Finset.Ico_eq_empty_of_le hnm]
let Ο := projIcc m n hmn
let v i := u (Ο i)
calc
β i β Finset.Ico m n, edist (f (u (i + 1))) (f (u i))
= β i β Finset.Ico m n, edist (f (v (i + 1))) (f (v i)) :=
Finset.sum_congr rfl fun i hi β¦ by
rw [Finset.mem_Ico] at hi
simp only [v, Ο, projIcc_of_mem hmn β¨hi.1, hi.2.leβ©,
projIcc_of_mem hmn β¨hi.1.trans i.le_succ, hi.2β©]
_ β€ β i β Finset.range n, edist (f (v (i + 1))) (f (v i)) :=
Finset.sum_mono_set _ (Nat.Iio_eq_range βΈ Finset.Ico_subset_Iio_self)
_ β€ eVariationOn f s :=
sum_le _ _ (fun i j h β¦ hu (Ο i).2 (Ο j).2 (monotone_projIcc hmn h)) fun i β¦ us _ (Ο i).2
#align evariation_on.sum_le_of_monotone_on_Icc eVariationOn.sum_le_of_monotoneOn_Icc
| Mathlib/Analysis/BoundedVariation.lean | 127 | 130 | theorem sum_le_of_monotoneOn_Iic (f : Ξ± β E) {s : Set Ξ±} {n : β} {u : β β Ξ±}
(hu : MonotoneOn u (Iic n)) (us : β i β€ n, u i β s) :
(β i β Finset.range n, edist (f (u (i + 1))) (f (u i))) β€ eVariationOn f s := by |
simpa using sum_le_of_monotoneOn_Icc f (m := 0) (hu.mono Icc_subset_Iic_self) fun i hi β¦ us i hi.2
| [
" Nonempty { u // Monotone u β§ β (i : β), u i β s }",
" eVariationOn f s = eVariationOn f' s",
" β¨ p, β i β Finset.range p.1, edist (f (βp.2 (i + 1))) (f (βp.2 i)) =\n β¨ p, β i β Finset.range p.1, edist (f' (βp.2 (i + 1))) (f' (βp.2 i))",
" β i β Finset.range p.1, edist (f (βp.2 (i + 1))) (f (βp.2 i)) =\n ... | [
" Nonempty { u // Monotone u β§ β (i : β), u i β s }",
" eVariationOn f s = eVariationOn f' s",
" β¨ p, β i β Finset.range p.1, edist (f (βp.2 (i + 1))) (f (βp.2 i)) =\n β¨ p, β i β Finset.range p.1, edist (f' (βp.2 (i + 1))) (f' (βp.2 i))",
" β i β Finset.range p.1, edist (f (βp.2 (i + 1))) (f (βp.2 i)) =\n ... |
import Mathlib.Algebra.Group.Equiv.TypeTags
import Mathlib.GroupTheory.FreeAbelianGroup
import Mathlib.GroupTheory.FreeGroup.IsFreeGroup
import Mathlib.LinearAlgebra.Dimension.StrongRankCondition
#align_import group_theory.free_abelian_group_finsupp from "leanprover-community/mathlib"@"47b51515e69f59bca5cf34ef456e6000fe205a69"
noncomputable section
variable {X : Type*}
def FreeAbelianGroup.toFinsupp : FreeAbelianGroup X β+ X ββ β€ :=
FreeAbelianGroup.lift fun x => Finsupp.single x (1 : β€)
#align free_abelian_group.to_finsupp FreeAbelianGroup.toFinsupp
def Finsupp.toFreeAbelianGroup : (X ββ β€) β+ FreeAbelianGroup X :=
Finsupp.liftAddHom fun x => (smulAddHom β€ (FreeAbelianGroup X)).flip (FreeAbelianGroup.of x)
#align finsupp.to_free_abelian_group Finsupp.toFreeAbelianGroup
open Finsupp FreeAbelianGroup
@[simp]
theorem Finsupp.toFreeAbelianGroup_comp_singleAddHom (x : X) :
Finsupp.toFreeAbelianGroup.comp (Finsupp.singleAddHom x) =
(smulAddHom β€ (FreeAbelianGroup X)).flip (of x) := by
ext
simp only [AddMonoidHom.coe_comp, Finsupp.singleAddHom_apply, Function.comp_apply, one_smul,
toFreeAbelianGroup, Finsupp.liftAddHom_apply_single]
#align finsupp.to_free_abelian_group_comp_single_add_hom Finsupp.toFreeAbelianGroup_comp_singleAddHom
@[simp]
theorem FreeAbelianGroup.toFinsupp_comp_toFreeAbelianGroup :
toFinsupp.comp toFreeAbelianGroup = AddMonoidHom.id (X ββ β€) := by
ext x y; simp only [AddMonoidHom.id_comp]
rw [AddMonoidHom.comp_assoc, Finsupp.toFreeAbelianGroup_comp_singleAddHom]
simp only [toFinsupp, AddMonoidHom.coe_comp, Finsupp.singleAddHom_apply, Function.comp_apply,
one_smul, lift.of, AddMonoidHom.flip_apply, smulAddHom_apply, AddMonoidHom.id_apply]
#align free_abelian_group.to_finsupp_comp_to_free_abelian_group FreeAbelianGroup.toFinsupp_comp_toFreeAbelianGroup
@[simp]
theorem Finsupp.toFreeAbelianGroup_comp_toFinsupp :
toFreeAbelianGroup.comp toFinsupp = AddMonoidHom.id (FreeAbelianGroup X) := by
ext
rw [toFreeAbelianGroup, toFinsupp, AddMonoidHom.comp_apply, lift.of,
liftAddHom_apply_single, AddMonoidHom.flip_apply, smulAddHom_apply, one_smul,
AddMonoidHom.id_apply]
#align finsupp.to_free_abelian_group_comp_to_finsupp Finsupp.toFreeAbelianGroup_comp_toFinsupp
@[simp]
theorem Finsupp.toFreeAbelianGroup_toFinsupp {X} (x : FreeAbelianGroup X) :
Finsupp.toFreeAbelianGroup (FreeAbelianGroup.toFinsupp x) = x := by
rw [β AddMonoidHom.comp_apply, Finsupp.toFreeAbelianGroup_comp_toFinsupp, AddMonoidHom.id_apply]
#align finsupp.to_free_abelian_group_to_finsupp Finsupp.toFreeAbelianGroup_toFinsupp
namespace FreeAbelianGroup
open Finsupp
@[simp]
theorem toFinsupp_of (x : X) : toFinsupp (of x) = Finsupp.single x 1 := by
simp only [toFinsupp, lift.of]
#align free_abelian_group.to_finsupp_of FreeAbelianGroup.toFinsupp_of
@[simp]
| Mathlib/GroupTheory/FreeAbelianGroupFinsupp.lean | 87 | 89 | theorem toFinsupp_toFreeAbelianGroup (f : X ββ β€) :
FreeAbelianGroup.toFinsupp (Finsupp.toFreeAbelianGroup f) = f := by |
rw [β AddMonoidHom.comp_apply, toFinsupp_comp_toFreeAbelianGroup, AddMonoidHom.id_apply]
| [
" toFreeAbelianGroup.comp (singleAddHom x) = (smulAddHom β€ (FreeAbelianGroup X)).flip (of x)",
" (toFreeAbelianGroup.comp (singleAddHom x)) 1 = ((smulAddHom β€ (FreeAbelianGroup X)).flip (of x)) 1",
" toFinsupp.comp toFreeAbelianGroup = AddMonoidHom.id (X ββ β€)",
" (((toFinsupp.comp toFreeAbelianGroup).comp (s... | [
" toFreeAbelianGroup.comp (singleAddHom x) = (smulAddHom β€ (FreeAbelianGroup X)).flip (of x)",
" (toFreeAbelianGroup.comp (singleAddHom x)) 1 = ((smulAddHom β€ (FreeAbelianGroup X)).flip (of x)) 1",
" toFinsupp.comp toFreeAbelianGroup = AddMonoidHom.id (X ββ β€)",
" (((toFinsupp.comp toFreeAbelianGroup).comp (s... |
import Mathlib.Topology.Constructions
import Mathlib.Topology.Algebra.Monoid
import Mathlib.Order.Filter.ListTraverse
import Mathlib.Tactic.AdaptationNote
#align_import topology.list from "leanprover-community/mathlib"@"48085f140e684306f9e7da907cd5932056d1aded"
open TopologicalSpace Set Filter
open Topology Filter
variable {Ξ± : Type*} {Ξ² : Type*} [TopologicalSpace Ξ±] [TopologicalSpace Ξ²]
instance : TopologicalSpace (List Ξ±) :=
TopologicalSpace.mkOfNhds (traverse nhds)
| Mathlib/Topology/List.lean | 28 | 66 | theorem nhds_list (as : List Ξ±) : π as = traverse π as := by |
refine nhds_mkOfNhds _ _ ?_ ?_
Β· intro l
induction l with
| nil => exact le_rfl
| cons a l ih =>
suffices List.cons <$> pure a <*> pure l β€ List.cons <$> π a <*> traverse π l by
simpa only [functor_norm] using this
exact Filter.seq_mono (Filter.map_mono <| pure_le_nhds a) ih
Β· intro l s hs
rcases (mem_traverse_iff _ _).1 hs with β¨u, hu, husβ©
clear as hs
have : β v : List (Set Ξ±), l.Forallβ (fun a s => IsOpen s β§ a β s) v β§ sequence v β s := by
induction hu generalizing s with
| nil =>
exists []
simp only [List.forallβ_nil_left_iff, exists_eq_left]
exact β¨trivial, husβ©
-- porting note -- renamed reordered variables based on previous types
| cons ht _ ih =>
rcases mem_nhds_iff.1 ht with β¨u, hut, huβ©
rcases ih _ Subset.rfl with β¨v, hv, hvssβ©
exact
β¨u::v, List.Forallβ.cons hu hv,
Subset.trans (Set.seq_mono (Set.image_subset _ hut) hvss) husβ©
rcases this with β¨v, hv, hvsβ©
have : sequence v β traverse π l :=
mem_traverse _ _ <| hv.imp fun a s β¨hs, haβ© => IsOpen.mem_nhds hs ha
refine mem_of_superset this fun u hu β¦ ?_
have hu := (List.mem_traverse _ _).1 hu
have : List.Forallβ (fun a s => IsOpen s β§ a β s) u v := by
refine List.Forallβ.flip ?_
replace hv := hv.flip
#adaptation_note /-- nightly-2024-03-16: simp was
simp only [List.forallβ_and_left, flip] at hv β’ -/
simp only [List.forallβ_and_left, Function.flip_def] at hv β’
exact β¨hv.1, hu.flipβ©
refine mem_of_superset ?_ hvs
exact mem_traverse _ _ (this.imp fun a s β¨hs, haβ© => IsOpen.mem_nhds hs ha)
| [
" π as = traverse π as",
" pure β€ traverse π",
" pure l β€ traverse π l",
" pure [] β€ traverse π []",
" pure (a :: l) β€ traverse π (a :: l)",
" (Seq.seq (List.cons <$> pure a) fun x => pure l) β€ Seq.seq (List.cons <$> π a) fun x => traverse π l",
" β (a : List Ξ±), β s β traverse π a, βαΆ (y : Lis... | [] |
import Mathlib.Probability.Martingale.BorelCantelli
import Mathlib.Probability.ConditionalExpectation
import Mathlib.Probability.Independence.Basic
#align_import probability.borel_cantelli from "leanprover-community/mathlib"@"2f8347015b12b0864dfaf366ec4909eb70c78740"
open scoped MeasureTheory ProbabilityTheory ENNReal Topology
open MeasureTheory ProbabilityTheory MeasurableSpace TopologicalSpace
namespace ProbabilityTheory
variable {Ξ© : Type*} {m0 : MeasurableSpace Ξ©} {ΞΌ : Measure Ξ©} [IsProbabilityMeasure ΞΌ]
section BorelCantelli
variable {ΞΉ Ξ² : Type*} [LinearOrder ΞΉ] [mΞ² : MeasurableSpace Ξ²] [NormedAddCommGroup Ξ²]
[BorelSpace Ξ²] {f : ΞΉ β Ξ© β Ξ²} {i j : ΞΉ} {s : ΞΉ β Set Ξ©}
theorem iIndepFun.indep_comap_natural_of_lt (hf : β i, StronglyMeasurable (f i))
(hfi : iIndepFun (fun _ => mΞ²) f ΞΌ) (hij : i < j) :
Indep (MeasurableSpace.comap (f j) mΞ²) (Filtration.natural f hf i) ΞΌ := by
suffices Indep (β¨ k β ({j} : Set ΞΉ), MeasurableSpace.comap (f k) mΞ²)
(β¨ k β {k | k β€ i}, MeasurableSpace.comap (f k) mΞ²) ΞΌ by rwa [iSup_singleton] at this
exact indep_iSup_of_disjoint (fun k => (hf k).measurable.comap_le) hfi (by simpa)
set_option linter.uppercaseLean3 false in
#align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.iIndepFun.indep_comap_natural_of_lt
theorem iIndepFun.condexp_natural_ae_eq_of_lt [SecondCountableTopology Ξ²] [CompleteSpace Ξ²]
[NormedSpace β Ξ²] (hf : β i, StronglyMeasurable (f i)) (hfi : iIndepFun (fun _ => mΞ²) f ΞΌ)
(hij : i < j) : ΞΌ[f j|Filtration.natural f hf i] =α΅[ΞΌ] fun _ => ΞΌ[f j] :=
condexp_indep_eq (hf j).measurable.comap_le (Filtration.le _ _)
(comap_measurable <| f j).stronglyMeasurable (hfi.indep_comap_natural_of_lt hf hij)
set_option linter.uppercaseLean3 false in
#align probability_theory.Indep_fun.condexp_natural_ae_eq_of_lt ProbabilityTheory.iIndepFun.condexp_natural_ae_eq_of_lt
theorem iIndepSet.condexp_indicator_filtrationOfSet_ae_eq (hsm : β n, MeasurableSet (s n))
(hs : iIndepSet s ΞΌ) (hij : i < j) :
ΞΌ[(s j).indicator (fun _ => 1 : Ξ© β β)|filtrationOfSet hsm i] =α΅[ΞΌ]
fun _ => (ΞΌ (s j)).toReal := by
rw [Filtration.filtrationOfSet_eq_natural (Ξ² := β) hsm]
refine (iIndepFun.condexp_natural_ae_eq_of_lt _ hs.iIndepFun_indicator hij).trans ?_
simp only [integral_indicator_const _ (hsm _), Algebra.id.smul_eq_mul, mul_one]; rfl
set_option linter.uppercaseLean3 false in
#align probability_theory.Indep_set.condexp_indicator_filtration_of_set_ae_eq ProbabilityTheory.iIndepSet.condexp_indicator_filtrationOfSet_ae_eq
open Filter
| Mathlib/Probability/BorelCantelli.lean | 74 | 105 | theorem measure_limsup_eq_one {s : β β Set Ξ©} (hsm : β n, MeasurableSet (s n)) (hs : iIndepSet s ΞΌ)
(hs' : (β' n, ΞΌ (s n)) = β) : ΞΌ (limsup s atTop) = 1 := by |
rw [measure_congr (eventuallyEq_set.2 (ae_mem_limsup_atTop_iff ΞΌ <|
measurableSet_filtrationOfSet' hsm) : (limsup s atTop : Set Ξ©) =α΅[ΞΌ]
{Ο | Tendsto (fun n => β k β Finset.range n,
(ΞΌ[(s (k + 1)).indicator (1 : Ξ© β β)|filtrationOfSet hsm k]) Ο) atTop atTop})]
suffices {Ο | Tendsto (fun n => β k β Finset.range n,
(ΞΌ[(s (k + 1)).indicator (1 : Ξ© β β)|filtrationOfSet hsm k]) Ο) atTop atTop} =α΅[ΞΌ] Set.univ by
rw [measure_congr this, measure_univ]
have : βα΅ Ο βΞΌ, β n, (ΞΌ[(s (n + 1)).indicator (1 : Ξ© β β)|filtrationOfSet hsm n]) Ο = _ :=
ae_all_iff.2 fun n => hs.condexp_indicator_filtrationOfSet_ae_eq hsm n.lt_succ_self
filter_upwards [this] with Ο hΟ
refine eq_true (?_ : Tendsto _ _ _)
simp_rw [hΟ]
have htends : Tendsto (fun n => β k β Finset.range n, ΞΌ (s (k + 1))) atTop (π β) := by
rw [β ENNReal.tsum_add_one_eq_top hs' (measure_ne_top _ _)]
exact ENNReal.tendsto_nat_tsum _
rw [ENNReal.tendsto_nhds_top_iff_nnreal] at htends
refine tendsto_atTop_atTop_of_monotone' ?_ ?_
Β· refine monotone_nat_of_le_succ fun n => ?_
rw [β sub_nonneg, Finset.sum_range_succ_sub_sum]
exact ENNReal.toReal_nonneg
Β· rintro β¨B, hBβ©
refine not_eventually.2 (frequently_of_forall fun n => ?_) (htends B.toNNReal)
rw [mem_upperBounds] at hB
specialize hB (β k β Finset.range n, ΞΌ (s (k + 1))).toReal _
Β· refine β¨n, ?_β©
rw [ENNReal.toReal_sum]
exact fun _ _ => measure_ne_top _ _
Β· rw [not_lt, β ENNReal.toReal_le_toReal (ENNReal.sum_lt_top _).ne ENNReal.coe_ne_top]
Β· exact hB.trans (by simp)
Β· exact fun _ _ => measure_ne_top _ _
| [
" Indep (MeasurableSpace.comap (f j) mΞ²) (β(Filtration.natural f hf) i) ΞΌ",
" Indep (β¨ k β {j}, MeasurableSpace.comap (f k) mΞ²) (β¨ k β {k | k β€ i}, MeasurableSpace.comap (f k) mΞ²) ΞΌ",
" Disjoint {j} {k | k β€ i}",
" ΞΌ[(s j).indicator fun x => 1|β(filtrationOfSet hsm) i] =αΆ [ae ΞΌ] fun x => (ΞΌ (s j)).toReal",
"... | [
" Indep (MeasurableSpace.comap (f j) mΞ²) (β(Filtration.natural f hf) i) ΞΌ",
" Indep (β¨ k β {j}, MeasurableSpace.comap (f k) mΞ²) (β¨ k β {k | k β€ i}, MeasurableSpace.comap (f k) mΞ²) ΞΌ",
" Disjoint {j} {k | k β€ i}",
" ΞΌ[(s j).indicator fun x => 1|β(filtrationOfSet hsm) i] =αΆ [ae ΞΌ] fun x => (ΞΌ (s j)).toReal",
"... |
import Mathlib.Data.Set.Pairwise.Basic
import Mathlib.Order.Bounds.Basic
import Mathlib.Order.Directed
import Mathlib.Order.Hom.Set
#align_import order.antichain from "leanprover-community/mathlib"@"c227d107bbada5d0d9d20287e3282c0a7f1651a0"
open Function Set
section General
variable {Ξ± Ξ² : Type*} {r rβ rβ : Ξ± β Ξ± β Prop} {r' : Ξ² β Ξ² β Prop} {s t : Set Ξ±} {a b : Ξ±}
protected theorem Symmetric.compl (h : Symmetric r) : Symmetric rαΆ := fun _ _ hr hr' =>
hr <| h hr'
#align symmetric.compl Symmetric.compl
def IsAntichain (r : Ξ± β Ξ± β Prop) (s : Set Ξ±) : Prop :=
s.Pairwise rαΆ
#align is_antichain IsAntichain
namespace IsAntichain
protected theorem subset (hs : IsAntichain r s) (h : t β s) : IsAntichain r t :=
hs.mono h
#align is_antichain.subset IsAntichain.subset
theorem mono (hs : IsAntichain rβ s) (h : rβ β€ rβ) : IsAntichain rβ s :=
hs.mono' <| compl_le_compl h
#align is_antichain.mono IsAntichain.mono
theorem mono_on (hs : IsAntichain rβ s) (h : s.Pairwise fun β¦a bβ¦ => rβ a b β rβ a b) :
IsAntichain rβ s :=
hs.imp_on <| h.imp fun _ _ h hβ hβ => hβ <| h hβ
#align is_antichain.mono_on IsAntichain.mono_on
protected theorem eq (hs : IsAntichain r s) {a b : Ξ±} (ha : a β s) (hb : b β s) (h : r a b) :
a = b :=
Set.Pairwise.eq hs ha hb <| not_not_intro h
#align is_antichain.eq IsAntichain.eq
protected theorem eq' (hs : IsAntichain r s) {a b : Ξ±} (ha : a β s) (hb : b β s) (h : r b a) :
a = b :=
(hs.eq hb ha h).symm
#align is_antichain.eq' IsAntichain.eq'
protected theorem isAntisymm (h : IsAntichain r univ) : IsAntisymm Ξ± r :=
β¨fun _ _ ha _ => h.eq trivial trivial haβ©
#align is_antichain.is_antisymm IsAntichain.isAntisymm
protected theorem subsingleton [IsTrichotomous Ξ± r] (h : IsAntichain r s) : s.Subsingleton := by
rintro a ha b hb
obtain hab | hab | hab := trichotomous_of r a b
Β· exact h.eq ha hb hab
Β· exact hab
Β· exact h.eq' ha hb hab
#align is_antichain.subsingleton IsAntichain.subsingleton
protected theorem flip (hs : IsAntichain r s) : IsAntichain (flip r) s := fun _ ha _ hb h =>
hs hb ha h.symm
#align is_antichain.flip IsAntichain.flip
theorem swap (hs : IsAntichain r s) : IsAntichain (swap r) s :=
hs.flip
#align is_antichain.swap IsAntichain.swap
theorem image (hs : IsAntichain r s) (f : Ξ± β Ξ²) (h : β β¦a bβ¦, r' (f a) (f b) β r a b) :
IsAntichain r' (f '' s) := by
rintro _ β¨b, hb, rflβ© _ β¨c, hc, rflβ© hbc hr
exact hs hb hc (ne_of_apply_ne _ hbc) (h hr)
#align is_antichain.image IsAntichain.image
theorem preimage (hs : IsAntichain r s) {f : Ξ² β Ξ±} (hf : Injective f)
(h : β β¦a bβ¦, r' a b β r (f a) (f b)) : IsAntichain r' (f β»ΒΉ' s) := fun _ hb _ hc hbc hr =>
hs hb hc (hf.ne hbc) <| h hr
#align is_antichain.preimage IsAntichain.preimage
theorem _root_.isAntichain_insert :
IsAntichain r (insert a s) β IsAntichain r s β§ β β¦bβ¦, b β s β a β b β Β¬r a b β§ Β¬r b a :=
Set.pairwise_insert
#align is_antichain_insert isAntichain_insert
protected theorem insert (hs : IsAntichain r s) (hl : β β¦bβ¦, b β s β a β b β Β¬r b a)
(hr : β β¦bβ¦, b β s β a β b β Β¬r a b) : IsAntichain r (insert a s) :=
isAntichain_insert.2 β¨hs, fun _ hb hab => β¨hr hb hab, hl hb habβ©β©
#align is_antichain.insert IsAntichain.insert
theorem _root_.isAntichain_insert_of_symmetric (hr : Symmetric r) :
IsAntichain r (insert a s) β IsAntichain r s β§ β β¦bβ¦, b β s β a β b β Β¬r a b :=
pairwise_insert_of_symmetric hr.compl
#align is_antichain_insert_of_symmetric isAntichain_insert_of_symmetric
theorem insert_of_symmetric (hs : IsAntichain r s) (hr : Symmetric r)
(h : β β¦bβ¦, b β s β a β b β Β¬r a b) : IsAntichain r (insert a s) :=
(isAntichain_insert_of_symmetric hr).2 β¨hs, hβ©
#align is_antichain.insert_of_symmetric IsAntichain.insert_of_symmetric
| Mathlib/Order/Antichain.lean | 120 | 124 | theorem image_relEmbedding (hs : IsAntichain r s) (Ο : r βͺr r') : IsAntichain r' (Ο '' s) := by |
intro b hb b' hb' hβ hβ
rw [Set.mem_image] at hb hb'
obtain β¨β¨a, has, rflβ©, β¨a', has', rflβ©β© := hb, hb'
exact hs has has' (fun haa' => hβ (by rw [haa'])) (Ο.map_rel_iff.mp hβ)
| [
" s.Subsingleton",
" a = b",
" IsAntichain r' (f '' s)",
" False",
" IsAntichain r' (βΟ '' s)",
" Ο a = Ο a'"
] | [
" s.Subsingleton",
" a = b",
" IsAntichain r' (f '' s)",
" False"
] |
import Mathlib.RingTheory.AdjoinRoot
import Mathlib.FieldTheory.Minpoly.Field
import Mathlib.RingTheory.Polynomial.GaussLemma
#align_import field_theory.minpoly.is_integrally_closed from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
open scoped Classical Polynomial
open Polynomial Set Function minpoly
namespace minpoly
variable {R S : Type*} [CommRing R] [CommRing S] [IsDomain R] [Algebra R S]
section
variable (K L : Type*) [Field K] [Algebra R K] [IsFractionRing R K] [CommRing L] [Nontrivial L]
[Algebra R L] [Algebra S L] [Algebra K L] [IsScalarTower R K L] [IsScalarTower R S L]
variable [IsIntegrallyClosed R]
theorem isIntegrallyClosed_eq_field_fractions [IsDomain S] {s : S} (hs : IsIntegral R s) :
minpoly K (algebraMap S L s) = (minpoly R s).map (algebraMap R K) := by
refine (eq_of_irreducible_of_monic ?_ ?_ ?_).symm
Β· exact ((monic hs).irreducible_iff_irreducible_map_fraction_map).1 (irreducible hs)
Β· rw [aeval_map_algebraMap, aeval_algebraMap_apply, aeval, map_zero]
Β· exact (monic hs).map _
#align minpoly.is_integrally_closed_eq_field_fractions minpoly.isIntegrallyClosed_eq_field_fractions
| Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean | 61 | 64 | theorem isIntegrallyClosed_eq_field_fractions' [IsDomain S] [Algebra K S] [IsScalarTower R K S]
{s : S} (hs : IsIntegral R s) : minpoly K s = (minpoly R s).map (algebraMap R K) := by |
let L := FractionRing S
rw [β isIntegrallyClosed_eq_field_fractions K L hs, algebraMap_eq (IsFractionRing.injective S L)]
| [
" minpoly K ((algebraMap S L) s) = map (algebraMap R K) (minpoly R s)",
" Irreducible (map (algebraMap R K) (minpoly R s))",
" (Polynomial.aeval ((algebraMap S L) s)) (map (algebraMap R K) (minpoly R s)) = 0",
" (map (algebraMap R K) (minpoly R s)).Monic",
" minpoly K s = map (algebraMap R K) (minpoly R s)"... | [
" minpoly K ((algebraMap S L) s) = map (algebraMap R K) (minpoly R s)",
" Irreducible (map (algebraMap R K) (minpoly R s))",
" (Polynomial.aeval ((algebraMap S L) s)) (map (algebraMap R K) (minpoly R s)) = 0",
" (map (algebraMap R K) (minpoly R s)).Monic"
] |
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent
import Mathlib.Analysis.Calculus.FDeriv.Linear
import Mathlib.Analysis.Calculus.FDeriv.Comp
#align_import analysis.calculus.fderiv.equiv from "leanprover-community/mathlib"@"e3fb84046afd187b710170887195d50bada934ee"
open Filter Asymptotics ContinuousLinearMap Set Metric
open scoped Classical
open Topology NNReal Filter Asymptotics ENNReal
noncomputable section
section
variable {π : Type*} [NontriviallyNormedField π]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π E]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π F]
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π G]
variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace π G']
variable {f fβ fβ g : E β F}
variable {f' fβ' fβ' g' : E βL[π] F}
variable (e : E βL[π] F)
variable {x : E}
variable {s t : Set E}
variable {L Lβ Lβ : Filter E}
namespace ContinuousLinearEquiv
variable (iso : E βL[π] F)
@[fun_prop]
protected theorem hasStrictFDerivAt : HasStrictFDerivAt iso (iso : E βL[π] F) x :=
iso.toContinuousLinearMap.hasStrictFDerivAt
#align continuous_linear_equiv.has_strict_fderiv_at ContinuousLinearEquiv.hasStrictFDerivAt
@[fun_prop]
protected theorem hasFDerivWithinAt : HasFDerivWithinAt iso (iso : E βL[π] F) s x :=
iso.toContinuousLinearMap.hasFDerivWithinAt
#align continuous_linear_equiv.has_fderiv_within_at ContinuousLinearEquiv.hasFDerivWithinAt
@[fun_prop]
protected theorem hasFDerivAt : HasFDerivAt iso (iso : E βL[π] F) x :=
iso.toContinuousLinearMap.hasFDerivAtFilter
#align continuous_linear_equiv.has_fderiv_at ContinuousLinearEquiv.hasFDerivAt
@[fun_prop]
protected theorem differentiableAt : DifferentiableAt π iso x :=
iso.hasFDerivAt.differentiableAt
#align continuous_linear_equiv.differentiable_at ContinuousLinearEquiv.differentiableAt
@[fun_prop]
protected theorem differentiableWithinAt : DifferentiableWithinAt π iso s x :=
iso.differentiableAt.differentiableWithinAt
#align continuous_linear_equiv.differentiable_within_at ContinuousLinearEquiv.differentiableWithinAt
protected theorem fderiv : fderiv π iso x = iso :=
iso.hasFDerivAt.fderiv
#align continuous_linear_equiv.fderiv ContinuousLinearEquiv.fderiv
protected theorem fderivWithin (hxs : UniqueDiffWithinAt π s x) : fderivWithin π iso s x = iso :=
iso.toContinuousLinearMap.fderivWithin hxs
#align continuous_linear_equiv.fderiv_within ContinuousLinearEquiv.fderivWithin
@[fun_prop]
protected theorem differentiable : Differentiable π iso := fun _ => iso.differentiableAt
#align continuous_linear_equiv.differentiable ContinuousLinearEquiv.differentiable
@[fun_prop]
protected theorem differentiableOn : DifferentiableOn π iso s :=
iso.differentiable.differentiableOn
#align continuous_linear_equiv.differentiable_on ContinuousLinearEquiv.differentiableOn
theorem comp_differentiableWithinAt_iff {f : G β E} {s : Set G} {x : G} :
DifferentiableWithinAt π (iso β f) s x β DifferentiableWithinAt π f s x := by
refine
β¨fun H => ?_, fun H => iso.differentiable.differentiableAt.comp_differentiableWithinAt x Hβ©
have : DifferentiableWithinAt π (iso.symm β iso β f) s x :=
iso.symm.differentiable.differentiableAt.comp_differentiableWithinAt x H
rwa [β Function.comp.assoc iso.symm iso f, iso.symm_comp_self] at this
#align continuous_linear_equiv.comp_differentiable_within_at_iff ContinuousLinearEquiv.comp_differentiableWithinAt_iff
| Mathlib/Analysis/Calculus/FDeriv/Equiv.lean | 104 | 107 | theorem comp_differentiableAt_iff {f : G β E} {x : G} :
DifferentiableAt π (iso β f) x β DifferentiableAt π f x := by |
rw [β differentiableWithinAt_univ, β differentiableWithinAt_univ,
iso.comp_differentiableWithinAt_iff]
| [
" DifferentiableWithinAt π (βiso β f) s x β DifferentiableWithinAt π f s x",
" DifferentiableWithinAt π f s x",
" DifferentiableAt π (βiso β f) x β DifferentiableAt π f x"
] | [
" DifferentiableWithinAt π (βiso β f) s x β DifferentiableWithinAt π f s x",
" DifferentiableWithinAt π f s x"
] |
import Mathlib.Data.Finset.Lattice
#align_import combinatorics.set_family.compression.down from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s : Finset Ξ±} {a : Ξ±}
namespace Finset
def nonMemberSubfamily (a : Ξ±) (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) :=
π.filter fun s => a β s
#align finset.non_member_subfamily Finset.nonMemberSubfamily
def memberSubfamily (a : Ξ±) (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) :=
(π.filter fun s => a β s).image fun s => erase s a
#align finset.member_subfamily Finset.memberSubfamily
@[simp]
theorem mem_nonMemberSubfamily : s β π.nonMemberSubfamily a β s β π β§ a β s := by
simp [nonMemberSubfamily]
#align finset.mem_non_member_subfamily Finset.mem_nonMemberSubfamily
@[simp]
theorem mem_memberSubfamily : s β π.memberSubfamily a β insert a s β π β§ a β s := by
simp_rw [memberSubfamily, mem_image, mem_filter]
refine β¨?_, fun h => β¨insert a s, β¨h.1, by simpβ©, erase_insert h.2β©β©
rintro β¨s, β¨hs1, hs2β©, rflβ©
rw [insert_erase hs2]
exact β¨hs1, not_mem_erase _ _β©
#align finset.mem_member_subfamily Finset.mem_memberSubfamily
theorem nonMemberSubfamily_inter (a : Ξ±) (π β¬ : Finset (Finset Ξ±)) :
(π β© β¬).nonMemberSubfamily a = π.nonMemberSubfamily a β© β¬.nonMemberSubfamily a :=
filter_inter_distrib _ _ _
#align finset.non_member_subfamily_inter Finset.nonMemberSubfamily_inter
theorem memberSubfamily_inter (a : Ξ±) (π β¬ : Finset (Finset Ξ±)) :
(π β© β¬).memberSubfamily a = π.memberSubfamily a β© β¬.memberSubfamily a := by
unfold memberSubfamily
rw [filter_inter_distrib, image_inter_of_injOn _ _ ((erase_injOn' _).mono _)]
simp
#align finset.member_subfamily_inter Finset.memberSubfamily_inter
theorem nonMemberSubfamily_union (a : Ξ±) (π β¬ : Finset (Finset Ξ±)) :
(π βͺ β¬).nonMemberSubfamily a = π.nonMemberSubfamily a βͺ β¬.nonMemberSubfamily a :=
filter_union _ _ _
#align finset.non_member_subfamily_union Finset.nonMemberSubfamily_union
| Mathlib/Combinatorics/SetFamily/Compression/Down.lean | 86 | 88 | theorem memberSubfamily_union (a : Ξ±) (π β¬ : Finset (Finset Ξ±)) :
(π βͺ β¬).memberSubfamily a = π.memberSubfamily a βͺ β¬.memberSubfamily a := by |
simp_rw [memberSubfamily, filter_union, image_union]
| [
" s β nonMemberSubfamily a π β s β π β§ a β s",
" s β memberSubfamily a π β insert a s β π β§ a β s",
" (β a_1, (a_1 β π β§ a β a_1) β§ a_1.erase a = s) β insert a s β π β§ a β s",
" a β insert a s",
" (β a_1, (a_1 β π β§ a β a_1) β§ a_1.erase a = s) β insert a s β π β§ a β s",
" insert a (s.erase a) β π... | [
" s β nonMemberSubfamily a π β s β π β§ a β s",
" s β memberSubfamily a π β insert a s β π β§ a β s",
" (β a_1, (a_1 β π β§ a β a_1) β§ a_1.erase a = s) β insert a s β π β§ a β s",
" a β insert a s",
" (β a_1, (a_1 β π β§ a β a_1) β§ a_1.erase a = s) β insert a s β π β§ a β s",
" insert a (s.erase a) β π... |
import Mathlib.CategoryTheory.Category.Grpd
import Mathlib.CategoryTheory.Groupoid
import Mathlib.Topology.Category.TopCat.Basic
import Mathlib.Topology.Homotopy.Path
import Mathlib.Data.Set.Subsingleton
#align_import algebraic_topology.fundamental_groupoid.basic from "leanprover-community/mathlib"@"3d7987cda72abc473c7cdbbb075170e9ac620042"
open CategoryTheory
universe u v
variable {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y]
variable {xβ xβ : X}
noncomputable section
open unitInterval
namespace Path
namespace Homotopy
section
def reflTransSymmAux (x : I Γ I) : β :=
if (x.2 : β) β€ 1 / 2 then x.1 * 2 * x.2 else x.1 * (2 - 2 * x.2)
#align path.homotopy.refl_trans_symm_aux Path.Homotopy.reflTransSymmAux
@[continuity]
theorem continuous_reflTransSymmAux : Continuous reflTransSymmAux := by
refine continuous_if_le ?_ ?_ (Continuous.continuousOn ?_) (Continuous.continuousOn ?_) ?_
Β· continuity
Β· continuity
Β· continuity
Β· continuity
intro x hx
norm_num [hx, mul_assoc]
#align path.homotopy.continuous_refl_trans_symm_aux Path.Homotopy.continuous_reflTransSymmAux
theorem reflTransSymmAux_mem_I (x : I Γ I) : reflTransSymmAux x β I := by
dsimp only [reflTransSymmAux]
split_ifs
Β· constructor
Β· apply mul_nonneg
Β· apply mul_nonneg
Β· unit_interval
Β· norm_num
Β· unit_interval
Β· rw [mul_assoc]
apply mul_le_one
Β· unit_interval
Β· apply mul_nonneg
Β· norm_num
Β· unit_interval
Β· linarith
Β· constructor
Β· apply mul_nonneg
Β· unit_interval
linarith [unitInterval.nonneg x.2, unitInterval.le_one x.2]
Β· apply mul_le_one
Β· unit_interval
Β· linarith [unitInterval.nonneg x.2, unitInterval.le_one x.2]
Β· linarith [unitInterval.nonneg x.2, unitInterval.le_one x.2]
set_option linter.uppercaseLean3 false in
#align path.homotopy.refl_trans_symm_aux_mem_I Path.Homotopy.reflTransSymmAux_mem_I
def reflTransSymm (p : Path xβ xβ) : Homotopy (Path.refl xβ) (p.trans p.symm) where
toFun x := p β¨reflTransSymmAux x, reflTransSymmAux_mem_I xβ©
continuous_toFun := by continuity
map_zero_left := by simp [reflTransSymmAux]
map_one_left x := by
dsimp only [reflTransSymmAux, Path.coe_toContinuousMap, Path.trans]
change _ = ite _ _ _
split_ifs with h
Β· rw [Path.extend, Set.IccExtend_of_mem]
Β· norm_num
Β· rw [unitInterval.mul_pos_mem_iff zero_lt_two]
exact β¨unitInterval.nonneg x, hβ©
Β· rw [Path.symm, Path.extend, Set.IccExtend_of_mem]
Β· simp only [Set.Icc.coe_one, one_mul, coe_mk_mk, Function.comp_apply]
congr 1
ext
norm_num [sub_sub_eq_add_sub]
Β· rw [unitInterval.two_mul_sub_one_mem_iff]
exact β¨(not_le.1 h).le, unitInterval.le_one xβ©
prop' t x hx := by
simp only [Set.mem_singleton_iff, Set.mem_insert_iff] at hx
simp only [ContinuousMap.coe_mk, coe_toContinuousMap, Path.refl_apply]
cases hx with
| inl hx
| inr hx =>
set_option tactic.skipAssignedInstances false in
rw [hx]
norm_num [reflTransSymmAux]
#align path.homotopy.refl_trans_symm Path.Homotopy.reflTransSymm
def reflSymmTrans (p : Path xβ xβ) : Homotopy (Path.refl xβ) (p.symm.trans p) :=
(reflTransSymm p.symm).cast rfl <| congr_arg _ (Path.symm_symm _)
#align path.homotopy.refl_symm_trans Path.Homotopy.reflSymmTrans
end
section Assoc
def transAssocReparamAux (t : I) : β :=
if (t : β) β€ 1 / 4 then 2 * t else if (t : β) β€ 1 / 2 then t + 1 / 4 else 1 / 2 * (t + 1)
#align path.homotopy.trans_assoc_reparam_aux Path.Homotopy.transAssocReparamAux
@[continuity]
theorem continuous_transAssocReparamAux : Continuous transAssocReparamAux := by
refine continuous_if_le ?_ ?_ (Continuous.continuousOn ?_)
(continuous_if_le ?_ ?_
(Continuous.continuousOn ?_) (Continuous.continuousOn ?_) ?_).continuousOn
?_ <;>
[continuity; continuity; continuity; continuity; continuity; continuity; continuity; skip;
skip] <;>
Β· intro x hx
set_option tactic.skipAssignedInstances false in norm_num [hx]
#align path.homotopy.continuous_trans_assoc_reparam_aux Path.Homotopy.continuous_transAssocReparamAux
| Mathlib/AlgebraicTopology/FundamentalGroupoid/Basic.lean | 200 | 202 | theorem transAssocReparamAux_mem_I (t : I) : transAssocReparamAux t β I := by |
unfold transAssocReparamAux
split_ifs <;> constructor <;> linarith [unitInterval.le_one t, unitInterval.nonneg t]
| [
" Continuous reflTransSymmAux",
" Continuous fun x => βx.2",
" Continuous fun x => 1 / 2",
" Continuous fun x => βx.1 * 2 * βx.2",
" Continuous fun x => βx.1 * (2 - 2 * βx.2)",
" β (x : βI Γ βI), βx.2 = 1 / 2 β βx.1 * 2 * βx.2 = βx.1 * (2 - 2 * βx.2)",
" βx.1 * 2 * βx.2 = βx.1 * (2 - 2 * βx.2)",
" ref... | [
" Continuous reflTransSymmAux",
" Continuous fun x => βx.2",
" Continuous fun x => 1 / 2",
" Continuous fun x => βx.1 * 2 * βx.2",
" Continuous fun x => βx.1 * (2 - 2 * βx.2)",
" β (x : βI Γ βI), βx.2 = 1 / 2 β βx.1 * 2 * βx.2 = βx.1 * (2 - 2 * βx.2)",
" βx.1 * 2 * βx.2 = βx.1 * (2 - 2 * βx.2)",
" ref... |
import Mathlib.Order.Interval.Finset.Nat
import Mathlib.Data.PNat.Defs
#align_import data.pnat.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
open Finset Function PNat
namespace PNat
variable (a b : β+)
instance instLocallyFiniteOrder : LocallyFiniteOrder β+ := Subtype.instLocallyFiniteOrder _
theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : β) b).subtype fun n : β => 0 < n :=
rfl
#align pnat.Icc_eq_finset_subtype PNat.Icc_eq_finset_subtype
theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : β) b).subtype fun n : β => 0 < n :=
rfl
#align pnat.Ico_eq_finset_subtype PNat.Ico_eq_finset_subtype
theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : β) b).subtype fun n : β => 0 < n :=
rfl
#align pnat.Ioc_eq_finset_subtype PNat.Ioc_eq_finset_subtype
theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : β) b).subtype fun n : β => 0 < n :=
rfl
#align pnat.Ioo_eq_finset_subtype PNat.Ioo_eq_finset_subtype
theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : β) b).subtype fun n : β => 0 < n := rfl
#align pnat.uIcc_eq_finset_subtype PNat.uIcc_eq_finset_subtype
theorem map_subtype_embedding_Icc : (Icc a b).map (Embedding.subtype _) = Icc βa βb :=
Finset.map_subtype_embedding_Icc _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
#align pnat.map_subtype_embedding_Icc PNat.map_subtype_embedding_Icc
theorem map_subtype_embedding_Ico : (Ico a b).map (Embedding.subtype _) = Ico βa βb :=
Finset.map_subtype_embedding_Ico _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
#align pnat.map_subtype_embedding_Ico PNat.map_subtype_embedding_Ico
theorem map_subtype_embedding_Ioc : (Ioc a b).map (Embedding.subtype _) = Ioc βa βb :=
Finset.map_subtype_embedding_Ioc _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
#align pnat.map_subtype_embedding_Ioc PNat.map_subtype_embedding_Ioc
theorem map_subtype_embedding_Ioo : (Ioo a b).map (Embedding.subtype _) = Ioo βa βb :=
Finset.map_subtype_embedding_Ioo _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
#align pnat.map_subtype_embedding_Ioo PNat.map_subtype_embedding_Ioo
theorem map_subtype_embedding_uIcc : (uIcc a b).map (Embedding.subtype _) = uIcc βa βb :=
map_subtype_embedding_Icc _ _
#align pnat.map_subtype_embedding_uIcc PNat.map_subtype_embedding_uIcc
@[simp]
theorem card_Icc : (Icc a b).card = b + 1 - a := by
rw [β Nat.card_Icc]
-- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
-- https://github.com/leanprover-community/mathlib4/issues/5164
erw [β Finset.map_subtype_embedding_Icc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
rw [card_map]
#align pnat.card_Icc PNat.card_Icc
@[simp]
theorem card_Ico : (Ico a b).card = b - a := by
rw [β Nat.card_Ico]
-- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
-- https://github.com/leanprover-community/mathlib4/issues/5164
erw [β Finset.map_subtype_embedding_Ico _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
rw [card_map]
#align pnat.card_Ico PNat.card_Ico
@[simp]
theorem card_Ioc : (Ioc a b).card = b - a := by
rw [β Nat.card_Ioc]
-- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
-- https://github.com/leanprover-community/mathlib4/issues/5164
erw [β Finset.map_subtype_embedding_Ioc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
rw [card_map]
#align pnat.card_Ioc PNat.card_Ioc
@[simp]
theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
rw [β Nat.card_Ioo]
-- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
-- https://github.com/leanprover-community/mathlib4/issues/5164
erw [β Finset.map_subtype_embedding_Ioo _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
rw [card_map]
#align pnat.card_Ioo PNat.card_Ioo
@[simp]
theorem card_uIcc : (uIcc a b).card = (b - a : β€).natAbs + 1 := by
rw [β Nat.card_uIcc, β map_subtype_embedding_uIcc, card_map]
#align pnat.card_uIcc PNat.card_uIcc
-- Porting note: `simpNF` says `simp` can prove this
theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = b + 1 - a := by
rw [β card_Icc, Fintype.card_ofFinset]
#align pnat.card_fintype_Icc PNat.card_fintype_Icc
-- Porting note: `simpNF` says `simp` can prove this
| Mathlib/Data/PNat/Interval.lean | 113 | 114 | theorem card_fintype_Ico : Fintype.card (Set.Ico a b) = b - a := by |
rw [β card_Ico, Fintype.card_ofFinset]
| [
" (Icc a b).card = βb + 1 - βa",
" (Icc a b).card = (Icc βa βb).card",
" (Icc a b).card = (map (Embedding.subtype fun n => 0 < n) (Icc a b)).card",
" (Ico a b).card = βb - βa",
" (Ico a b).card = (Ico βa βb).card",
" (Ico a b).card = (map (Embedding.subtype fun n => 0 < n) (Ico a b)).card",
" (Ioc a b).... | [
" (Icc a b).card = βb + 1 - βa",
" (Icc a b).card = (Icc βa βb).card",
" (Icc a b).card = (map (Embedding.subtype fun n => 0 < n) (Icc a b)).card",
" (Ico a b).card = βb - βa",
" (Ico a b).card = (Ico βa βb).card",
" (Ico a b).card = (map (Embedding.subtype fun n => 0 < n) (Ico a b)).card",
" (Ioc a b).... |
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Algebra.Polynomial.BigOperators
import Mathlib.Algebra.Polynomial.Degree.Lemmas
import Mathlib.Algebra.Polynomial.Div
#align_import data.polynomial.ring_division from "leanprover-community/mathlib"@"8efcf8022aac8e01df8d302dcebdbc25d6a886c8"
noncomputable section
open Polynomial
open Finset
namespace Polynomial
universe u v w z
variable {R : Type u} {S : Type v} {T : Type w} {a b : R} {n : β}
section CommRing
variable [CommRing R]
| Mathlib/Algebra/Polynomial/RingDivision.lean | 427 | 436 | theorem le_rootMultiplicity_iff {p : R[X]} (p0 : p β 0) {a : R} {n : β} :
n β€ rootMultiplicity a p β (X - C a) ^ n β£ p := by |
classical
rw [rootMultiplicity_eq_nat_find_of_nonzero p0, @Nat.le_find_iff _ (_)]
simp_rw [Classical.not_not]
refine β¨fun h => ?_, fun h m hm => (pow_dvd_pow _ hm).trans hβ©
cases' n with n;
Β· rw [pow_zero]
apply one_dvd;
Β· exact h n n.lt_succ_self
| [
" n β€ rootMultiplicity a p β (X - C a) ^ n β£ p",
" (β m < n, ¬¬(X - C a) ^ (m + 1) β£ p) β (X - C a) ^ n β£ p",
" (β m < n, (X - C a) ^ (m + 1) β£ p) β (X - C a) ^ n β£ p",
" (X - C a) ^ n β£ p",
" (X - C a) ^ 0 β£ p",
" 1 β£ p",
" (X - C a) ^ (n + 1) β£ p"
] | [] |
import Mathlib.AlgebraicGeometry.Spec
import Mathlib.Algebra.Category.Ring.Constructions
import Mathlib.CategoryTheory.Elementwise
#align_import algebraic_geometry.Scheme from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c"
-- Explicit universe annotations were used in this file to improve perfomance #12737
set_option linter.uppercaseLean3 false
universe u
noncomputable section
open TopologicalSpace
open CategoryTheory
open TopCat
open Opposite
namespace AlgebraicGeometry
structure Scheme extends LocallyRingedSpace where
local_affine :
β x : toLocallyRingedSpace,
β (U : OpenNhds x) (R : CommRingCat),
Nonempty
(toLocallyRingedSpace.restrict U.openEmbedding β
Spec.toLocallyRingedSpace.obj (op R))
#align algebraic_geometry.Scheme AlgebraicGeometry.Scheme
namespace Scheme
-- @[nolint has_nonempty_instance] -- Porting note(#5171): linter not ported yet
def Hom (X Y : Scheme) : Type* :=
X.toLocallyRingedSpace βΆ Y.toLocallyRingedSpace
#align algebraic_geometry.Scheme.hom AlgebraicGeometry.Scheme.Hom
instance : Category Scheme :=
{ InducedCategory.category Scheme.toLocallyRingedSpace with Hom := Hom }
-- porting note (#10688): added to ease automation
@[continuity]
lemma Hom.continuous {X Y : Scheme} (f : X βΆ Y) : Continuous f.1.base := f.1.base.2
protected abbrev sheaf (X : Scheme) :=
X.toSheafedSpace.sheaf
#align algebraic_geometry.Scheme.sheaf AlgebraicGeometry.Scheme.sheaf
instance : CoeSort Scheme Type* where
coe X := X.carrier
@[simps!]
def forgetToLocallyRingedSpace : Scheme β₯€ LocallyRingedSpace :=
inducedFunctor _
-- deriving Full, Faithful -- Porting note: no delta derive handler, see https://github.com/leanprover-community/mathlib4/issues/5020
#align algebraic_geometry.Scheme.forget_to_LocallyRingedSpace AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace
@[simps!]
def fullyFaithfulForgetToLocallyRingedSpace :
forgetToLocallyRingedSpace.FullyFaithful :=
fullyFaithfulInducedFunctor _
instance : forgetToLocallyRingedSpace.Full :=
InducedCategory.full _
instance : forgetToLocallyRingedSpace.Faithful :=
InducedCategory.faithful _
@[simps!]
def forgetToTop : Scheme β₯€ TopCat :=
Scheme.forgetToLocallyRingedSpace β LocallyRingedSpace.forgetToTop
#align algebraic_geometry.Scheme.forget_to_Top AlgebraicGeometry.Scheme.forgetToTop
-- Porting note: Lean seems not able to find this coercion any more
instance hasCoeToTopCat : CoeOut Scheme TopCat where
coe X := X.carrier
-- Porting note: added this unification hint just in case
unif_hint forgetToTop_obj_eq_coe (X : Scheme) where β’
forgetToTop.obj X β (X : TopCat)
@[simp]
theorem id_val_base (X : Scheme) : (π X : _).1.base = π _ :=
rfl
#align algebraic_geometry.Scheme.id_val_base AlgebraicGeometry.Scheme.id_val_base
@[simp]
theorem id_app {X : Scheme} (U : (Opens X.carrier)α΅α΅) :
(π X : _).val.c.app U =
X.presheaf.map (eqToHom (by induction' U with U; cases U; rfl)) :=
PresheafedSpace.id_c_app X.toPresheafedSpace U
#align algebraic_geometry.Scheme.id_app AlgebraicGeometry.Scheme.id_app
@[reassoc]
theorem comp_val {X Y Z : Scheme} (f : X βΆ Y) (g : Y βΆ Z) : (f β« g).val = f.val β« g.val :=
rfl
#align algebraic_geometry.Scheme.comp_val AlgebraicGeometry.Scheme.comp_val
@[simp, reassoc] -- reassoc lemma does not need `simp`
theorem comp_coeBase {X Y Z : Scheme} (f : X βΆ Y) (g : Y βΆ Z) :
(f β« g).val.base = f.val.base β« g.val.base :=
rfl
#align algebraic_geometry.Scheme.comp_coe_base AlgebraicGeometry.Scheme.comp_coeBase
-- Porting note: removed elementwise attribute, as generated lemmas were trivial.
@[reassoc]
theorem comp_val_base {X Y Z : Scheme} (f : X βΆ Y) (g : Y βΆ Z) :
(f β« g).val.base = f.val.base β« g.val.base :=
rfl
#align algebraic_geometry.Scheme.comp_val_base AlgebraicGeometry.Scheme.comp_val_base
theorem comp_val_base_apply {X Y Z : Scheme} (f : X βΆ Y) (g : Y βΆ Z) (x : X) :
(f β« g).val.base x = g.val.base (f.val.base x) := by
simp
#align algebraic_geometry.Scheme.comp_val_base_apply AlgebraicGeometry.Scheme.comp_val_base_apply
@[simp, reassoc] -- reassoc lemma does not need `simp`
theorem comp_val_c_app {X Y Z : Scheme} (f : X βΆ Y) (g : Y βΆ Z) (U) :
(f β« g).val.c.app U = g.val.c.app U β« f.val.c.app _ :=
rfl
#align algebraic_geometry.Scheme.comp_val_c_app AlgebraicGeometry.Scheme.comp_val_c_app
| Mathlib/AlgebraicGeometry/Scheme.lean | 155 | 157 | theorem congr_app {X Y : Scheme} {f g : X βΆ Y} (e : f = g) (U) :
f.val.c.app U = g.val.c.app U β« X.presheaf.map (eqToHom (by subst e; rfl)) := by |
subst e; dsimp; simp
| [
" U = U",
" { unop := U } = { unop := U }",
" { unop := { carrier := carrierβ, is_open' := is_open'β } } =\n { unop := { carrier := carrierβ, is_open' := is_open'β } }",
" (f β« g).val.base x = g.val.base (f.val.base x)",
" (Opens.map g.val.base).op.obj U = (Opens.map f.val.base).op.obj U",
" (Opens.map... | [
" U = U",
" { unop := U } = { unop := U }",
" { unop := { carrier := carrierβ, is_open' := is_open'β } } =\n { unop := { carrier := carrierβ, is_open' := is_open'β } }",
" (f β« g).val.base x = g.val.base (f.val.base x)"
] |
import Mathlib.Algebra.Homology.Single
#align_import algebra.homology.augment from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
noncomputable section
open CategoryTheory Limits HomologicalComplex
universe v u
variable {V : Type u} [Category.{v} V]
namespace ChainComplex
@[simps]
def truncate [HasZeroMorphisms V] : ChainComplex V β β₯€ ChainComplex V β where
obj C :=
{ X := fun i => C.X (i + 1)
d := fun i j => C.d (i + 1) (j + 1)
shape := fun i j w => C.shape _ _ <| by simpa }
map f := { f := fun i => f.f (i + 1) }
#align chain_complex.truncate ChainComplex.truncate
def truncateTo [HasZeroObject V] [HasZeroMorphisms V] (C : ChainComplex V β) :
truncate.obj C βΆ (singleβ V).obj (C.X 0) :=
(toSingleβEquiv (truncate.obj C) (C.X 0)).symm β¨C.d 1 0, by aesopβ©
#align chain_complex.truncate_to ChainComplex.truncateTo
-- PROJECT when `V` is abelian (but not generally?)
-- `[β n, Exact (C.d (n+2) (n+1)) (C.d (n+1) n)] [Epi (C.d 1 0)]` iff `QuasiIso (C.truncate_to)`
variable [HasZeroMorphisms V]
def augment (C : ChainComplex V β) {X : V} (f : C.X 0 βΆ X) (w : C.d 1 0 β« f = 0) :
ChainComplex V β where
X | 0 => X
| i + 1 => C.X i
d | 1, 0 => f
| i + 1, j + 1 => C.d i j
| _, _ => 0
shape
| 1, 0, h => absurd rfl h
| i + 2, 0, _ => rfl
| 0, _, _ => rfl
| i + 1, j + 1, h => by
simp only; exact C.shape i j (Nat.succ_ne_succ.1 h)
d_comp_d'
| _, _, 0, rfl, rfl => w
| _, _, k + 1, rfl, rfl => C.d_comp_d _ _ _
#align chain_complex.augment ChainComplex.augment
@[simp]
theorem augment_X_zero (C : ChainComplex V β) {X : V} (f : C.X 0 βΆ X) (w : C.d 1 0 β« f = 0) :
(augment C f w).X 0 = X :=
rfl
set_option linter.uppercaseLean3 false in
#align chain_complex.augment_X_zero ChainComplex.augment_X_zero
@[simp]
theorem augment_X_succ (C : ChainComplex V β) {X : V} (f : C.X 0 βΆ X) (w : C.d 1 0 β« f = 0)
(i : β) : (augment C f w).X (i + 1) = C.X i :=
rfl
set_option linter.uppercaseLean3 false in
#align chain_complex.augment_X_succ ChainComplex.augment_X_succ
@[simp]
theorem augment_d_one_zero (C : ChainComplex V β) {X : V} (f : C.X 0 βΆ X) (w : C.d 1 0 β« f = 0) :
(augment C f w).d 1 0 = f :=
rfl
#align chain_complex.augment_d_one_zero ChainComplex.augment_d_one_zero
@[simp]
| Mathlib/Algebra/Homology/Augment.lean | 92 | 94 | theorem augment_d_succ_succ (C : ChainComplex V β) {X : V} (f : C.X 0 βΆ X) (w : C.d 1 0 β« f = 0)
(i j : β) : (augment C f w).d (i + 1) (j + 1) = C.d i j := by |
cases i <;> rfl
| [
" Β¬(ComplexShape.down β).Rel (i + 1) (j + 1)",
" (truncate.obj C).d 1 0 β« C.d 1 0 = 0",
" (fun x x_1 =>\n match x, x_1 with\n | 1, 0 => f\n | i.succ, j.succ => C.d i j\n | x, x_2 => 0)\n (i + 1) (j + 1) =\n 0",
" C.d i j = 0",
" (C.augment f w).d (i + 1) (j + 1) = C.d i j... | [
" Β¬(ComplexShape.down β).Rel (i + 1) (j + 1)",
" (truncate.obj C).d 1 0 β« C.d 1 0 = 0",
" (fun x x_1 =>\n match x, x_1 with\n | 1, 0 => f\n | i.succ, j.succ => C.d i j\n | x, x_2 => 0)\n (i + 1) (j + 1) =\n 0",
" C.d i j = 0"
] |
import Mathlib.Data.Int.GCD
import Mathlib.Tactic.NormNum
namespace Tactic
namespace NormNum
| Mathlib/Tactic/NormNum/GCD.lean | 22 | 28 | theorem int_gcd_helper' {d : β} {x y : β€} (a b : β€) (hβ : (d : β€) β£ x) (hβ : (d : β€) β£ y)
(hβ : x * a + y * b = d) : Int.gcd x y = d := by |
refine Nat.dvd_antisymm ?_ (Int.natCast_dvd_natCast.1 (Int.dvd_gcd hβ hβ))
rw [β Int.natCast_dvd_natCast, β hβ]
apply dvd_add
Β· exact Int.gcd_dvd_left.mul_right _
Β· exact Int.gcd_dvd_right.mul_right _
| [
" x.gcd y = d",
" x.gcd y β£ d",
" β(x.gcd y) β£ x * a + y * b",
" β(x.gcd y) β£ x * a",
" β(x.gcd y) β£ y * b"
] | [] |
import Mathlib.Algebra.EuclideanDomain.Instances
import Mathlib.RingTheory.Ideal.Colon
import Mathlib.RingTheory.UniqueFactorizationDomain
#align_import ring_theory.principal_ideal_domain from "leanprover-community/mathlib"@"6010cf523816335f7bae7f8584cb2edaace73940"
universe u v
variable {R : Type u} {M : Type v}
open Set Function
open Submodule
section
variable [Ring R] [AddCommGroup M] [Module R M]
instance bot_isPrincipal : (β₯ : Submodule R M).IsPrincipal :=
β¨β¨0, by simpβ©β©
#align bot_is_principal bot_isPrincipal
instance top_isPrincipal : (β€ : Submodule R R).IsPrincipal :=
β¨β¨1, Ideal.span_singleton_one.symmβ©β©
#align top_is_principal top_isPrincipal
variable (R)
class IsBezout : Prop where
isPrincipal_of_FG : β I : Ideal R, I.FG β I.IsPrincipal
#align is_bezout IsBezout
instance (priority := 100) IsBezout.of_isPrincipalIdealRing [IsPrincipalIdealRing R] : IsBezout R :=
β¨fun I _ => IsPrincipalIdealRing.principal Iβ©
#align is_bezout.of_is_principal_ideal_ring IsBezout.of_isPrincipalIdealRing
instance (priority := 100) DivisionRing.isPrincipalIdealRing (K : Type u) [DivisionRing K] :
IsPrincipalIdealRing K where
principal S := by
rcases Ideal.eq_bot_or_top S with (rfl | rfl)
Β· apply bot_isPrincipal
Β· apply top_isPrincipal
#align division_ring.is_principal_ideal_ring DivisionRing.isPrincipalIdealRing
end
namespace Submodule.IsPrincipal
variable [AddCommGroup M]
section Ring
variable [Ring R] [Module R M]
noncomputable def generator (S : Submodule R M) [S.IsPrincipal] : M :=
Classical.choose (principal S)
#align submodule.is_principal.generator Submodule.IsPrincipal.generator
theorem span_singleton_generator (S : Submodule R M) [S.IsPrincipal] : span R {generator S} = S :=
Eq.symm (Classical.choose_spec (principal S))
#align submodule.is_principal.span_singleton_generator Submodule.IsPrincipal.span_singleton_generator
@[simp]
theorem _root_.Ideal.span_singleton_generator (I : Ideal R) [I.IsPrincipal] :
Ideal.span ({generator I} : Set R) = I :=
Eq.symm (Classical.choose_spec (principal I))
#align ideal.span_singleton_generator Ideal.span_singleton_generator
@[simp]
theorem generator_mem (S : Submodule R M) [S.IsPrincipal] : generator S β S := by
conv_rhs => rw [β span_singleton_generator S]
exact subset_span (mem_singleton _)
#align submodule.is_principal.generator_mem Submodule.IsPrincipal.generator_mem
| Mathlib/RingTheory/PrincipalIdealDomain.lean | 109 | 111 | theorem mem_iff_eq_smul_generator (S : Submodule R M) [S.IsPrincipal] {x : M} :
x β S β β s : R, x = s β’ generator S := by |
simp_rw [@eq_comm _ x, β mem_span_singleton, span_singleton_generator]
| [
" β₯ = span R {0}",
" IsPrincipal S",
" IsPrincipal β₯",
" IsPrincipal β€",
" generator S β S",
"R : Type u\nM : Type v\ninstβΒ³ : AddCommGroup M\ninstβΒ² : Ring R\ninstβΒΉ : Module R M\nS : Submodule R M\ninstβ : S.IsPrincipal\n| S",
" generator S β span R {generator S}",
" x β S β β s, x = s β’ generator S... | [
" β₯ = span R {0}",
" IsPrincipal S",
" IsPrincipal β₯",
" IsPrincipal β€",
" generator S β S",
"R : Type u\nM : Type v\ninstβΒ³ : AddCommGroup M\ninstβΒ² : Ring R\ninstβΒΉ : Module R M\nS : Submodule R M\ninstβ : S.IsPrincipal\n| S",
" generator S β span R {generator S}"
] |
import Mathlib.Probability.Kernel.Composition
#align_import probability.kernel.invariance from "leanprover-community/mathlib"@"3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b"
open MeasureTheory
open scoped MeasureTheory ENNReal ProbabilityTheory
namespace ProbabilityTheory
variable {Ξ± Ξ² Ξ³ : Type*} {mΞ± : MeasurableSpace Ξ±} {mΞ² : MeasurableSpace Ξ²} {mΞ³ : MeasurableSpace Ξ³}
namespace kernel
@[simp]
theorem bind_add (ΞΌ Ξ½ : Measure Ξ±) (ΞΊ : kernel Ξ± Ξ²) : (ΞΌ + Ξ½).bind ΞΊ = ΞΌ.bind ΞΊ + Ξ½.bind ΞΊ := by
ext1 s hs
rw [Measure.bind_apply hs (kernel.measurable _), lintegral_add_measure, Measure.coe_add,
Pi.add_apply, Measure.bind_apply hs (kernel.measurable _),
Measure.bind_apply hs (kernel.measurable _)]
#align probability_theory.kernel.bind_add ProbabilityTheory.kernel.bind_add
@[simp]
theorem bind_smul (ΞΊ : kernel Ξ± Ξ²) (ΞΌ : Measure Ξ±) (r : ββ₯0β) : (r β’ ΞΌ).bind ΞΊ = r β’ ΞΌ.bind ΞΊ := by
ext1 s hs
rw [Measure.bind_apply hs (kernel.measurable _), lintegral_smul_measure, Measure.coe_smul,
Pi.smul_apply, Measure.bind_apply hs (kernel.measurable _), smul_eq_mul]
#align probability_theory.kernel.bind_smul ProbabilityTheory.kernel.bind_smul
| Mathlib/Probability/Kernel/Invariance.lean | 57 | 60 | theorem const_bind_eq_comp_const (ΞΊ : kernel Ξ± Ξ²) (ΞΌ : Measure Ξ±) :
const Ξ± (ΞΌ.bind ΞΊ) = ΞΊ ββ const Ξ± ΞΌ := by |
ext a s hs
simp_rw [comp_apply' _ _ _ hs, const_apply, Measure.bind_apply hs (kernel.measurable _)]
| [
" (ΞΌ + Ξ½).bind βΞΊ = ΞΌ.bind βΞΊ + Ξ½.bind βΞΊ",
" ((ΞΌ + Ξ½).bind βΞΊ) s = (ΞΌ.bind βΞΊ + Ξ½.bind βΞΊ) s",
" (r β’ ΞΌ).bind βΞΊ = r β’ ΞΌ.bind βΞΊ",
" ((r β’ ΞΌ).bind βΞΊ) s = (r β’ ΞΌ.bind βΞΊ) s",
" const Ξ± (ΞΌ.bind βΞΊ) = ΞΊ ββ const Ξ± ΞΌ",
" ((const Ξ± (ΞΌ.bind βΞΊ)) a) s = ((ΞΊ ββ const Ξ± ΞΌ) a) s"
] | [
" (ΞΌ + Ξ½).bind βΞΊ = ΞΌ.bind βΞΊ + Ξ½.bind βΞΊ",
" ((ΞΌ + Ξ½).bind βΞΊ) s = (ΞΌ.bind βΞΊ + Ξ½.bind βΞΊ) s",
" (r β’ ΞΌ).bind βΞΊ = r β’ ΞΌ.bind βΞΊ",
" ((r β’ ΞΌ).bind βΞΊ) s = (r β’ ΞΌ.bind βΞΊ) s"
] |
import Mathlib.MeasureTheory.Measure.Haar.Basic
import Mathlib.Analysis.InnerProductSpace.PiL2
#align_import measure_theory.measure.haar.of_basis from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d"
open Set TopologicalSpace MeasureTheory MeasureTheory.Measure FiniteDimensional
open scoped Pointwise
noncomputable section
variable {ΞΉ ΞΉ' E F : Type*}
section Fintype
variable [Fintype ΞΉ] [Fintype ΞΉ']
section AddCommGroup
variable [AddCommGroup E] [Module β E] [AddCommGroup F] [Module β F]
def parallelepiped (v : ΞΉ β E) : Set E :=
(fun t : ΞΉ β β => β i, t i β’ v i) '' Icc 0 1
#align parallelepiped parallelepiped
theorem mem_parallelepiped_iff (v : ΞΉ β E) (x : E) :
x β parallelepiped v β β t β Icc (0 : ΞΉ β β) 1, x = β i, t i β’ v i := by
simp [parallelepiped, eq_comm]
#align mem_parallelepiped_iff mem_parallelepiped_iff
| Mathlib/MeasureTheory/Measure/Haar/OfBasis.lean | 57 | 65 | theorem parallelepiped_basis_eq (b : Basis ΞΉ β E) :
parallelepiped b = {x | β i, b.repr x i β Set.Icc 0 1} := by |
classical
ext x
simp_rw [mem_parallelepiped_iff, mem_setOf_eq, b.ext_elem_iff, _root_.map_sum,
_root_.map_smul, Finset.sum_apply', Basis.repr_self, Finsupp.smul_single, smul_eq_mul,
mul_one, Finsupp.single_apply, Finset.sum_ite_eq', Finset.mem_univ, ite_true, mem_Icc,
Pi.le_def, Pi.zero_apply, Pi.one_apply, β forall_and]
aesop
| [
" x β parallelepiped v β β t β Icc 0 1, x = β i : ΞΉ, t i β’ v i",
" parallelepiped βb = {x | β (i : ΞΉ), (b.repr x) i β Icc 0 1}",
" x β parallelepiped βb β x β {x | β (i : ΞΉ), (b.repr x) i β Icc 0 1}",
" (β t, β (x_1 : ΞΉ), (0 β€ t x_1 β§ t x_1 β€ 1) β§ (b.repr x) x_1 = t x_1) β β (i : ΞΉ), 0 β€ (b.repr x) i β§ (b.rep... | [
" x β parallelepiped v β β t β Icc 0 1, x = β i : ΞΉ, t i β’ v i"
] |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.Fintype.Card
#align_import data.multiset.fintype from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d"
variable {Ξ± : Type*} [DecidableEq Ξ±] {m : Multiset Ξ±}
def Multiset.ToType (m : Multiset Ξ±) : Type _ := (x : Ξ±) Γ Fin (m.count x)
#align multiset.to_type Multiset.ToType
instance : CoeSort (Multiset Ξ±) (Type _) := β¨Multiset.ToTypeβ©
example : DecidableEq m := inferInstanceAs <| DecidableEq ((x : Ξ±) Γ Fin (m.count x))
-- Porting note: syntactic equality
#noalign multiset.coe_sort_eq
@[reducible, match_pattern]
def Multiset.mkToType (m : Multiset Ξ±) (x : Ξ±) (i : Fin (m.count x)) : m :=
β¨x, iβ©
#align multiset.mk_to_type Multiset.mkToType
instance instCoeSortMultisetType.instCoeOutToType : CoeOut m Ξ± :=
β¨fun x β¦ x.1β©
#align multiset.has_coe_to_sort.has_coe instCoeSortMultisetType.instCoeOutToTypeβ
-- Porting note: syntactic equality
#noalign multiset.fst_coe_eq_coe
-- Syntactic equality
#noalign multiset.coe_eq
-- @[simp] -- Porting note (#10685): dsimp can prove this
theorem Multiset.coe_mk {x : Ξ±} {i : Fin (m.count x)} : β(m.mkToType x i) = x :=
rfl
#align multiset.coe_mk Multiset.coe_mk
@[simp] lemma Multiset.coe_mem {x : m} : βx β m := Multiset.count_pos.mp (by have := x.2.2; omega)
#align multiset.coe_mem Multiset.coe_mem
@[simp]
protected theorem Multiset.forall_coe (p : m β Prop) :
(β x : m, p x) β β (x : Ξ±) (i : Fin (m.count x)), p β¨x, iβ© :=
Sigma.forall
#align multiset.forall_coe Multiset.forall_coe
@[simp]
protected theorem Multiset.exists_coe (p : m β Prop) :
(β x : m, p x) β β (x : Ξ±) (i : Fin (m.count x)), p β¨x, iβ© :=
Sigma.exists
#align multiset.exists_coe Multiset.exists_coe
instance : Fintype { p : Ξ± Γ β | p.2 < m.count p.1 } :=
Fintype.ofFinset
(m.toFinset.biUnion fun x β¦ (Finset.range (m.count x)).map β¨Prod.mk x, Prod.mk.inj_left xβ©)
(by
rintro β¨x, iβ©
simp only [Finset.mem_biUnion, Multiset.mem_toFinset, Finset.mem_map, Finset.mem_range,
Function.Embedding.coeFn_mk, Prod.mk.inj_iff, Set.mem_setOf_eq]
simp only [β and_assoc, exists_eq_right, and_iff_right_iff_imp]
exact fun h β¦ Multiset.count_pos.mp (by omega))
def Multiset.toEnumFinset (m : Multiset Ξ±) : Finset (Ξ± Γ β) :=
{ p : Ξ± Γ β | p.2 < m.count p.1 }.toFinset
#align multiset.to_enum_finset Multiset.toEnumFinset
@[simp]
theorem Multiset.mem_toEnumFinset (m : Multiset Ξ±) (p : Ξ± Γ β) :
p β m.toEnumFinset β p.2 < m.count p.1 :=
Set.mem_toFinset
#align multiset.mem_to_enum_finset Multiset.mem_toEnumFinset
theorem Multiset.mem_of_mem_toEnumFinset {p : Ξ± Γ β} (h : p β m.toEnumFinset) : p.1 β m :=
have := (m.mem_toEnumFinset p).mp h; Multiset.count_pos.mp (by omega)
#align multiset.mem_of_mem_to_enum_finset Multiset.mem_of_mem_toEnumFinset
@[mono]
| Mathlib/Data/Multiset/Fintype.lean | 122 | 126 | theorem Multiset.toEnumFinset_mono {mβ mβ : Multiset Ξ±} (h : mβ β€ mβ) :
mβ.toEnumFinset β mβ.toEnumFinset := by |
intro p
simp only [Multiset.mem_toEnumFinset]
exact gt_of_ge_of_gt (Multiset.le_iff_count.mp h p.1)
| [
" 0 < count x.fst m",
" β (x : Ξ± Γ β),\n (x β m.toFinset.biUnion fun x => Finset.map { toFun := Prod.mk x, inj' := β― } (Finset.range (Multiset.count x m))) β\n x β {p | p.2 < Multiset.count p.1 m}",
" ((x, i) β\n m.toFinset.biUnion fun x => Finset.map { toFun := Prod.mk x, inj' := β― } (Finset.range... | [
" 0 < count x.fst m",
" β (x : Ξ± Γ β),\n (x β m.toFinset.biUnion fun x => Finset.map { toFun := Prod.mk x, inj' := β― } (Finset.range (Multiset.count x m))) β\n x β {p | p.2 < Multiset.count p.1 m}",
" ((x, i) β\n m.toFinset.biUnion fun x => Finset.map { toFun := Prod.mk x, inj' := β― } (Finset.range... |
import Mathlib.Algebra.MvPolynomial.Supported
import Mathlib.RingTheory.WittVector.Truncated
#align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
noncomputable section
namespace WittVector
variable (p : β) [hp : Fact p.Prime]
variable {k : Type*} [CommRing k]
local notation "π" => WittVector p
-- Porting note: new notation
local notation "π" => MvPolynomial (Fin 2 Γ β) β€
open Finset MvPolynomial
def wittPolyProd (n : β) : π :=
rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β€ n) *
rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β€ n)
#align witt_vector.witt_poly_prod WittVector.wittPolyProd
theorem wittPolyProd_vars (n : β) : (wittPolyProd p n).vars β univ ΓΛ’ range (n + 1) := by
rw [wittPolyProd]
apply Subset.trans (vars_mul _ _)
refine union_subset ?_ ?_ <;>
Β· refine Subset.trans (vars_rename _ _) ?_
simp [wittPolynomial_vars, image_subset_iff]
#align witt_vector.witt_poly_prod_vars WittVector.wittPolyProd_vars
def wittPolyProdRemainder (n : β) : π :=
β i β range n, (p : π) ^ i * wittMul p i ^ p ^ (n - i)
#align witt_vector.witt_poly_prod_remainder WittVector.wittPolyProdRemainder
theorem wittPolyProdRemainder_vars (n : β) :
(wittPolyProdRemainder p n).vars β univ ΓΛ’ range n := by
rw [wittPolyProdRemainder]
refine Subset.trans (vars_sum_subset _ _) ?_
rw [biUnion_subset]
intro x hx
apply Subset.trans (vars_mul _ _)
refine union_subset ?_ ?_
Β· apply Subset.trans (vars_pow _ _)
have : (p : π) = C (p : β€) := by simp only [Int.cast_natCast, eq_intCast]
rw [this, vars_C]
apply empty_subset
Β· apply Subset.trans (vars_pow _ _)
apply Subset.trans (wittMul_vars _ _)
apply product_subset_product (Subset.refl _)
simp only [mem_range, range_subset] at hx β’
exact hx
#align witt_vector.witt_poly_prod_remainder_vars WittVector.wittPolyProdRemainder_vars
def remainder (n : β) : π :=
(β x β range (n + 1),
(rename (Prod.mk 0)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : β€) ^ x))) *
β x β range (n + 1),
(rename (Prod.mk 1)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : β€) ^ x))
#align witt_vector.remainder WittVector.remainder
theorem remainder_vars (n : β) : (remainder p n).vars β univ ΓΛ’ range (n + 1) := by
rw [remainder]
apply Subset.trans (vars_mul _ _)
refine union_subset ?_ ?_ <;>
Β· refine Subset.trans (vars_sum_subset _ _) ?_
rw [biUnion_subset]
intro x hx
rw [rename_monomial, vars_monomial, Finsupp.mapDomain_single]
Β· apply Subset.trans Finsupp.support_single_subset
simpa using mem_range.mp hx
Β· apply pow_ne_zero
exact mod_cast hp.out.ne_zero
#align witt_vector.remainder_vars WittVector.remainder_vars
def polyOfInterest (n : β) : π :=
wittMul p (n + 1) + (p : π) ^ (n + 1) * X (0, n + 1) * X (1, n + 1) -
X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β€ (n + 1)) -
X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β€ (n + 1))
#align witt_vector.poly_of_interest WittVector.polyOfInterest
theorem mul_polyOfInterest_aux1 (n : β) :
β i β range (n + 1), (p : π) ^ i * wittMul p i ^ p ^ (n - i) = wittPolyProd p n := by
simp only [wittPolyProd]
convert wittStructureInt_prop p (X (0 : Fin 2) * X 1) n using 1
Β· simp only [wittPolynomial, wittMul]
rw [AlgHom.map_sum]
congr 1 with i
congr 1
have hsupp : (Finsupp.single i (p ^ (n - i))).support = {i} := by
rw [Finsupp.support_eq_singleton]
simp only [and_true_iff, Finsupp.single_eq_same, eq_self_iff_true, Ne]
exact pow_ne_zero _ hp.out.ne_zero
simp only [bindβ_monomial, hsupp, Int.cast_natCast, prod_singleton, eq_intCast,
Finsupp.single_eq_same, C_pow, mul_eq_mul_left_iff, true_or_iff, eq_self_iff_true,
Int.cast_pow]
Β· simp only [map_mul, bindβ_X_right]
#align witt_vector.mul_poly_of_interest_aux1 WittVector.mul_polyOfInterest_aux1
theorem mul_polyOfInterest_aux2 (n : β) :
(p : π) ^ n * wittMul p n + wittPolyProdRemainder p n = wittPolyProd p n := by
convert mul_polyOfInterest_aux1 p n
rw [sum_range_succ, add_comm, Nat.sub_self, pow_zero, pow_one]
rfl
#align witt_vector.mul_poly_of_interest_aux2 WittVector.mul_polyOfInterest_aux2
| Mathlib/RingTheory/WittVector/MulCoeff.lean | 145 | 176 | theorem mul_polyOfInterest_aux3 (n : β) : wittPolyProd p (n + 1) =
-((p : π) ^ (n + 1) * X (0, n + 1)) * ((p : π) ^ (n + 1) * X (1, n + 1)) +
(p : π) ^ (n + 1) * X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β€ (n + 1)) +
(p : π) ^ (n + 1) * X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β€ (n + 1)) +
remainder p n := by |
-- a useful auxiliary fact
have mvpz : (p : π) ^ (n + 1) = MvPolynomial.C ((p : β€) ^ (n + 1)) := by norm_cast
-- Porting note: the original proof applies `sum_range_succ` through a non-`conv` rewrite,
-- but this does not work in Lean 4; the whole proof also times out very badly. The proof has been
-- nearly totally rewritten here and now finishes quite fast.
rw [wittPolyProd, wittPolynomial, AlgHom.map_sum, AlgHom.map_sum]
conv_lhs =>
arg 1
rw [sum_range_succ, β C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul,
rename_C, rename_X, β mvpz]
conv_lhs =>
arg 2
rw [sum_range_succ, β C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul,
rename_C, rename_X, β mvpz]
conv_rhs =>
enter [1, 1, 2, 2]
rw [sum_range_succ, β C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul,
rename_C, rename_X, β mvpz]
conv_rhs =>
enter [1, 2, 2]
rw [sum_range_succ, β C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul,
rename_C, rename_X, β mvpz]
simp only [add_mul, mul_add]
rw [add_comm _ (remainder p n)]
simp only [add_assoc]
apply congrArg (Add.add _)
ring
| [
" (wittPolyProd p n).vars β univ ΓΛ’ range (n + 1)",
" ((rename (Prod.mk 0)) (wittPolynomial p β€ n) * (rename (Prod.mk 1)) (wittPolynomial p β€ n)).vars β\n univ ΓΛ’ range (n + 1)",
" ((rename (Prod.mk 0)) (wittPolynomial p β€ n)).vars βͺ ((rename (Prod.mk 1)) (wittPolynomial p β€ n)).vars β\n univ ΓΛ’ range (n ... | [
" (wittPolyProd p n).vars β univ ΓΛ’ range (n + 1)",
" ((rename (Prod.mk 0)) (wittPolynomial p β€ n) * (rename (Prod.mk 1)) (wittPolynomial p β€ n)).vars β\n univ ΓΛ’ range (n + 1)",
" ((rename (Prod.mk 0)) (wittPolynomial p β€ n)).vars βͺ ((rename (Prod.mk 1)) (wittPolynomial p β€ n)).vars β\n univ ΓΛ’ range (n ... |
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 CompleteLattice
variable [CompleteLattice Ξ±] {s : Set ΞΉ} {t : Set ΞΉ'}
theorem PairwiseDisjoint.biUnion {s : Set ΞΉ'} {g : ΞΉ' β Set ΞΉ} {f : ΞΉ β Ξ±}
(hs : s.PairwiseDisjoint fun i' : ΞΉ' => β¨ i β g i', f i)
(hg : β i β s, (g i).PairwiseDisjoint f) : (β i β s, g i).PairwiseDisjoint f := by
rintro a ha b hb hab
simp_rw [Set.mem_iUnion] at ha hb
obtain β¨c, hc, haβ© := ha
obtain β¨d, hd, hbβ© := hb
obtain hcd | hcd := eq_or_ne (g c) (g d)
Β· exact hg d hd (hcd.subst ha) hb hab
-- Porting note: the elaborator couldn't figure out `f` here.
Β· exact (hs hc hd <| ne_of_apply_ne _ hcd).mono
(le_iSupβ (f := fun i (_ : i β g c) => f i) a ha)
(le_iSupβ (f := fun i (_ : i β g d) => f i) b hb)
#align set.pairwise_disjoint.bUnion Set.PairwiseDisjoint.biUnion
| Mathlib/Data/Set/Pairwise/Lattice.lean | 89 | 101 | theorem PairwiseDisjoint.prod_left {f : ΞΉ Γ ΞΉ' β Ξ±}
(hs : s.PairwiseDisjoint fun i => β¨ i' β t, f (i, i'))
(ht : t.PairwiseDisjoint fun i' => β¨ i β s, f (i, i')) :
(s ΓΛ’ t : Set (ΞΉ Γ ΞΉ')).PairwiseDisjoint f := by |
rintro β¨i, i'β© hi β¨j, j'β© hj h
rw [mem_prod] at hi hj
obtain rfl | hij := eq_or_ne i j
Β· refine (ht hi.2 hj.2 <| (Prod.mk.inj_left _).ne_iff.1 h).mono ?_ ?_
Β· convert le_iSupβ (Ξ± := Ξ±) i hi.1; rfl
Β· convert le_iSupβ (Ξ± := Ξ±) i hj.1; rfl
Β· refine (hs hi.1 hj.1 hij).mono ?_ ?_
Β· convert le_iSupβ (Ξ± := Ξ±) i' hi.2; rfl
Β· convert le_iSupβ (Ξ± := Ξ±) j' hj.2; rfl
| [
" (β i β s, g i).PairwiseDisjoint f",
" (Disjoint on f) a b",
" (s ΓΛ’ t).PairwiseDisjoint f",
" (Disjoint on f) (i, i') (j, j')",
" (Disjoint on f) (i, i') (i, j')",
" f (i, i') β€ (fun i' => β¨ i β s, f (i, i')) (i, i').2",
" f (i, i') = f (i, (i, i').2)",
" f (i, j') β€ (fun i' => β¨ i β s, f (i, i')) (... | [
" (β i β s, g i).PairwiseDisjoint f",
" (Disjoint on f) a b"
] |
import Mathlib.Algebra.CharP.ExpChar
import Mathlib.Algebra.GeomSum
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Equiv
import Mathlib.RingTheory.Polynomial.Content
import Mathlib.RingTheory.UniqueFactorizationDomain
#align_import ring_theory.polynomial.basic from "leanprover-community/mathlib"@"da420a8c6dd5bdfb85c4ced85c34388f633bc6ff"
noncomputable section
open Polynomial
open Finset
universe u v w
variable {R : Type u} {S : Type*}
namespace Polynomial
section Semiring
variable [Semiring R]
instance instCharP (p : β) [h : CharP R p] : CharP R[X] p :=
let β¨hβ© := h
β¨fun n => by rw [β map_natCast C, β C_0, C_inj, h]β©
instance instExpChar (p : β) [h : ExpChar R p] : ExpChar R[X] p := by
cases h; exacts [ExpChar.zero, ExpChar.prime βΉ_βΊ]
variable (R)
def degreeLE (n : WithBot β) : Submodule R R[X] :=
β¨
k : β, β¨
_ : βk > n, LinearMap.ker (lcoeff R k)
#align polynomial.degree_le Polynomial.degreeLE
def degreeLT (n : β) : Submodule R R[X] :=
β¨
k : β, β¨
(_ : k β₯ n), LinearMap.ker (lcoeff R k)
#align polynomial.degree_lt Polynomial.degreeLT
variable {R}
theorem mem_degreeLE {n : WithBot β} {f : R[X]} : f β degreeLE R n β degree f β€ n := by
simp only [degreeLE, Submodule.mem_iInf, degree_le_iff_coeff_zero, LinearMap.mem_ker]; rfl
#align polynomial.mem_degree_le Polynomial.mem_degreeLE
@[mono]
theorem degreeLE_mono {m n : WithBot β} (H : m β€ n) : degreeLE R m β€ degreeLE R n := fun _ hf =>
mem_degreeLE.2 (le_trans (mem_degreeLE.1 hf) H)
#align polynomial.degree_le_mono Polynomial.degreeLE_mono
theorem degreeLE_eq_span_X_pow [DecidableEq R] {n : β} :
degreeLE R n = Submodule.span R β((Finset.range (n + 1)).image fun n => (X : R[X]) ^ n) := by
apply le_antisymm
Β· intro p hp
replace hp := mem_degreeLE.1 hp
rw [β Polynomial.sum_monomial_eq p, Polynomial.sum]
refine Submodule.sum_mem _ fun k hk => ?_
have := WithBot.coe_le_coe.1 (Finset.sup_le_iff.1 hp k hk)
rw [β C_mul_X_pow_eq_monomial, C_mul']
refine
Submodule.smul_mem _ _
(Submodule.subset_span <|
Finset.mem_coe.2 <|
Finset.mem_image.2 β¨_, Finset.mem_range.2 (Nat.lt_succ_of_le this), rflβ©)
rw [Submodule.span_le, Finset.coe_image, Set.image_subset_iff]
intro k hk
apply mem_degreeLE.2
exact
(degree_X_pow_le _).trans (WithBot.coe_le_coe.2 <| Nat.le_of_lt_succ <| Finset.mem_range.1 hk)
set_option linter.uppercaseLean3 false in
#align polynomial.degree_le_eq_span_X_pow Polynomial.degreeLE_eq_span_X_pow
theorem mem_degreeLT {n : β} {f : R[X]} : f β degreeLT R n β degree f < n := by
rw [degreeLT, Submodule.mem_iInf]
conv_lhs => intro i; rw [Submodule.mem_iInf]
rw [degree, Finset.max_eq_sup_coe]
rw [Finset.sup_lt_iff ?_]
rotate_left
Β· apply WithBot.bot_lt_coe
conv_rhs =>
simp only [mem_support_iff]
intro b
rw [Nat.cast_withBot, WithBot.coe_lt_coe, lt_iff_not_le, Ne, not_imp_not]
rfl
#align polynomial.mem_degree_lt Polynomial.mem_degreeLT
@[mono]
theorem degreeLT_mono {m n : β} (H : m β€ n) : degreeLT R m β€ degreeLT R n := fun _ hf =>
mem_degreeLT.2 (lt_of_lt_of_le (mem_degreeLT.1 hf) <| WithBot.coe_le_coe.2 H)
#align polynomial.degree_lt_mono Polynomial.degreeLT_mono
| Mathlib/RingTheory/Polynomial/Basic.lean | 117 | 133 | theorem degreeLT_eq_span_X_pow [DecidableEq R] {n : β} :
degreeLT R n = Submodule.span R β((Finset.range n).image fun n => X ^ n : Finset R[X]) := by |
apply le_antisymm
Β· intro p hp
replace hp := mem_degreeLT.1 hp
rw [β Polynomial.sum_monomial_eq p, Polynomial.sum]
refine Submodule.sum_mem _ fun k hk => ?_
have := WithBot.coe_lt_coe.1 ((Finset.sup_lt_iff <| WithBot.bot_lt_coe n).1 hp k hk)
rw [β C_mul_X_pow_eq_monomial, C_mul']
refine
Submodule.smul_mem _ _
(Submodule.subset_span <|
Finset.mem_coe.2 <| Finset.mem_image.2 β¨_, Finset.mem_range.2 this, rflβ©)
rw [Submodule.span_le, Finset.coe_image, Set.image_subset_iff]
intro k hk
apply mem_degreeLT.2
exact lt_of_le_of_lt (degree_X_pow_le _) (WithBot.coe_lt_coe.2 <| Finset.mem_range.1 hk)
| [
" βn = 0 β p β£ n",
" ExpChar R[X] p",
" f β degreeLE R n β f.degree β€ n",
" (β (i : β), βi > n β (lcoeff R i) f = 0) β β (m : β), n < βm β f.coeff m = 0",
" degreeLE R βn = Submodule.span R β(image (fun n => X ^ n) (range (n + 1)))",
" degreeLE R βn β€ Submodule.span R β(image (fun n => X ^ n) (range (n + ... | [
" βn = 0 β p β£ n",
" ExpChar R[X] p",
" f β degreeLE R n β f.degree β€ n",
" (β (i : β), βi > n β (lcoeff R i) f = 0) β β (m : β), n < βm β f.coeff m = 0",
" degreeLE R βn = Submodule.span R β(image (fun n => X ^ n) (range (n + 1)))",
" degreeLE R βn β€ Submodule.span R β(image (fun n => X ^ n) (range (n + ... |
import Mathlib.Algebra.Group.Defs
#align_import group_theory.eckmann_hilton from "leanprover-community/mathlib"@"41cf0cc2f528dd40a8f2db167ea4fb37b8fde7f3"
universe u
namespace EckmannHilton
variable {X : Type u}
local notation a " <" m:51 "> " b => m a b
structure IsUnital (m : X β X β X) (e : X) extends Std.LawfulIdentity m e : Prop
#align eckmann_hilton.is_unital EckmannHilton.IsUnital
@[to_additive EckmannHilton.AddZeroClass.IsUnital]
theorem MulOneClass.isUnital [_G : MulOneClass X] : IsUnital (Β· * Β·) (1 : X) :=
IsUnital.mk { left_id := MulOneClass.one_mul,
right_id := MulOneClass.mul_one }
#align eckmann_hilton.mul_one_class.is_unital EckmannHilton.MulOneClass.isUnital
#align eckmann_hilton.add_zero_class.is_unital EckmannHilton.AddZeroClass.IsUnital
variable {mβ mβ : X β X β X} {eβ eβ : X}
variable (hβ : IsUnital mβ eβ) (hβ : IsUnital mβ eβ)
variable (distrib : β a b c d, ((a <mβ> b) <mβ> c <mβ> d) = (a <mβ> c) <mβ> b <mβ> d)
theorem one : eβ = eβ := by
simpa only [hβ.left_id, hβ.right_id, hβ.left_id, hβ.right_id] using distrib eβ eβ eβ eβ
#align eckmann_hilton.one EckmannHilton.one
| Mathlib/GroupTheory/EckmannHilton.lean | 64 | 69 | theorem mul : mβ = mβ := by |
funext a b
calc
mβ a b = mβ (mβ a eβ) (mβ eβ b) := by
{ simp only [one hβ hβ distrib, hβ.left_id, hβ.right_id, hβ.left_id, hβ.right_id] }
_ = mβ a b := by simp only [distrib, hβ.left_id, hβ.right_id, hβ.left_id, hβ.right_id]
| [
" eβ = eβ",
" mβ = mβ",
" mβ a b = mβ a b",
" mβ a b = mβ (mβ a eβ) (mβ eβ b)",
" mβ (mβ a eβ) (mβ eβ b) = mβ a b"
] | [
" eβ = eβ"
] |
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
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
#align option.mapβ_swap Option.mapβ_swap
theorem map_mapβ (f : Ξ± β Ξ² β Ξ³) (g : Ξ³ β Ξ΄) :
(mapβ f a b).map g = mapβ (fun a b => g (f a b)) a b := by cases a <;> cases b <;> rfl
#align option.map_mapβ Option.map_mapβ
theorem mapβ_map_left (f : Ξ³ β Ξ² β Ξ΄) (g : Ξ± β Ξ³) :
mapβ f (a.map g) b = mapβ (fun a b => f (g a) b) a b := by cases a <;> rfl
#align option.mapβ_map_left Option.mapβ_map_left
theorem mapβ_map_right (f : Ξ± β Ξ³ β Ξ΄) (g : Ξ² β Ξ³) :
mapβ f a (b.map g) = mapβ (fun a b => f a (g b)) a b := by cases b <;> rfl
#align option.mapβ_map_right Option.mapβ_map_right
@[simp]
theorem mapβ_curry (f : Ξ± Γ Ξ² β Ξ³) (a : Option Ξ±) (b : Option Ξ²) :
mapβ (curry f) a b = Option.map f (mapβ Prod.mk a b) := (map_mapβ _ _).symm
#align option.mapβ_curry Option.mapβ_curry
@[simp]
| Mathlib/Data/Option/NAry.lean | 109 | 110 | theorem map_uncurry (f : Ξ± β Ξ² β Ξ³) (x : Option (Ξ± Γ Ξ²)) :
x.map (uncurry f) = mapβ f (x.map Prod.fst) (x.map Prod.snd) := by | cases x <;> 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.Analysis.SpecialFunctions.Complex.Log
import Mathlib.RingTheory.RootsOfUnity.Basic
#align_import ring_theory.roots_of_unity.complex from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f"
namespace Complex
open Polynomial Real
open scoped Nat Real
| Mathlib/RingTheory/RootsOfUnity/Complex.lean | 33 | 50 | theorem isPrimitiveRoot_exp_of_coprime (i n : β) (h0 : n β 0) (hi : i.Coprime n) :
IsPrimitiveRoot (exp (2 * Ο * I * (i / n))) n := by |
rw [IsPrimitiveRoot.iff_def]
simp only [β exp_nat_mul, exp_eq_one_iff]
have hn0 : (n : β) β 0 := mod_cast h0
constructor
Β· use i
field_simp [hn0, mul_comm (i : β), mul_comm (n : β)]
Β· simp only [hn0, mul_right_comm _ _ βn, mul_left_inj' two_pi_I_ne_zero, Ne, not_false_iff,
mul_comm _ (i : β), β mul_assoc _ (i : β), exists_imp, field_simps]
norm_cast
rintro l k hk
conv_rhs at hk => rw [mul_comm, β mul_assoc]
have hz : 2 * βΟ * I β 0 := by simp [pi_pos.ne.symm, I_ne_zero]
field_simp [hz] at hk
norm_cast at hk
have : n β£ i * l := by rw [β Int.natCast_dvd_natCast, hk, mul_comm]; apply dvd_mul_left
exact hi.symm.dvd_of_dvd_mul_left this
| [
" IsPrimitiveRoot (cexp (2 * βΟ * I * (βi / βn))) n",
" cexp (2 * βΟ * I * (βi / βn)) ^ n = 1 β§ β (l : β), cexp (2 * βΟ * I * (βi / βn)) ^ l = 1 β n β£ l",
" (β n_1, βn * (2 * βΟ * I * (βi / βn)) = βn_1 * (2 * βΟ * I)) β§\n β (l : β), (β n_1, βl * (2 * βΟ * I * (βi / βn)) = βn_1 * (2 * βΟ * I)) β n β£ l",
" β... | [] |
import Mathlib.Topology.Order.LeftRightNhds
open Set Filter TopologicalSpace Topology Function
open OrderDual (toDual ofDual)
variable {Ξ± Ξ² Ξ³ : Type*}
section OrderTopology
variable [TopologicalSpace Ξ±] [TopologicalSpace Ξ²] [LinearOrder Ξ±] [LinearOrder Ξ²] [OrderTopology Ξ±]
[OrderTopology Ξ²]
theorem IsLUB.frequently_mem {a : Ξ±} {s : Set Ξ±} (ha : IsLUB s a) (hs : s.Nonempty) :
βαΆ x in π[β€] a, x β s := by
rcases hs with β¨a', ha'β©
intro h
rcases (ha.1 ha').eq_or_lt with (rfl | ha'a)
Β· exact h.self_of_nhdsWithin le_rfl ha'
Β· rcases (mem_nhdsWithin_Iic_iff_exists_Ioc_subset' ha'a).1 h with β¨b, hba, hbβ©
rcases ha.exists_between hba with β¨b', hb's, hb'β©
exact hb hb' hb's
#align is_lub.frequently_mem IsLUB.frequently_mem
theorem IsLUB.frequently_nhds_mem {a : Ξ±} {s : Set Ξ±} (ha : IsLUB s a) (hs : s.Nonempty) :
βαΆ x in π a, x β s :=
(ha.frequently_mem hs).filter_mono inf_le_left
#align is_lub.frequently_nhds_mem IsLUB.frequently_nhds_mem
theorem IsGLB.frequently_mem {a : Ξ±} {s : Set Ξ±} (ha : IsGLB s a) (hs : s.Nonempty) :
βαΆ x in π[β₯] a, x β s :=
IsLUB.frequently_mem (Ξ± := Ξ±α΅α΅) ha hs
#align is_glb.frequently_mem IsGLB.frequently_mem
theorem IsGLB.frequently_nhds_mem {a : Ξ±} {s : Set Ξ±} (ha : IsGLB s a) (hs : s.Nonempty) :
βαΆ x in π a, x β s :=
(ha.frequently_mem hs).filter_mono inf_le_left
#align is_glb.frequently_nhds_mem IsGLB.frequently_nhds_mem
theorem IsLUB.mem_closure {a : Ξ±} {s : Set Ξ±} (ha : IsLUB s a) (hs : s.Nonempty) : a β closure s :=
(ha.frequently_nhds_mem hs).mem_closure
#align is_lub.mem_closure IsLUB.mem_closure
theorem IsGLB.mem_closure {a : Ξ±} {s : Set Ξ±} (ha : IsGLB s a) (hs : s.Nonempty) : a β closure s :=
(ha.frequently_nhds_mem hs).mem_closure
#align is_glb.mem_closure IsGLB.mem_closure
theorem IsLUB.nhdsWithin_neBot {a : Ξ±} {s : Set Ξ±} (ha : IsLUB s a) (hs : s.Nonempty) :
NeBot (π[s] a) :=
mem_closure_iff_nhdsWithin_neBot.1 (ha.mem_closure hs)
#align is_lub.nhds_within_ne_bot IsLUB.nhdsWithin_neBot
theorem IsGLB.nhdsWithin_neBot : β {a : Ξ±} {s : Set Ξ±}, IsGLB s a β s.Nonempty β NeBot (π[s] a) :=
IsLUB.nhdsWithin_neBot (Ξ± := Ξ±α΅α΅)
#align is_glb.nhds_within_ne_bot IsGLB.nhdsWithin_neBot
theorem isLUB_of_mem_nhds {s : Set Ξ±} {a : Ξ±} {f : Filter Ξ±} (hsa : a β upperBounds s) (hsf : s β f)
[NeBot (f β π a)] : IsLUB s a :=
β¨hsa, fun b hb =>
not_lt.1 fun hba =>
have : s β© { a | b < a } β f β π a := inter_mem_inf hsf (IsOpen.mem_nhds (isOpen_lt' _) hba)
let β¨_x, β¨hxs, hxbβ©β© := Filter.nonempty_of_mem this
have : b < b := lt_of_lt_of_le hxb <| hb hxs
lt_irrefl b thisβ©
#align is_lub_of_mem_nhds isLUB_of_mem_nhds
| Mathlib/Topology/Order/IsLUB.lean | 77 | 80 | theorem isLUB_of_mem_closure {s : Set Ξ±} {a : Ξ±} (hsa : a β upperBounds s) (hsf : a β closure s) :
IsLUB s a := by |
rw [mem_closure_iff_clusterPt, ClusterPt, inf_comm] at hsf
exact isLUB_of_mem_nhds hsa (mem_principal_self s)
| [
" βαΆ (x : Ξ±) in π[β€] a, x β s",
" False",
" IsLUB s a"
] | [
" βαΆ (x : Ξ±) in π[β€] a, x β s",
" False"
] |
import Mathlib.Algebra.Homology.ShortComplex.ModuleCat
import Mathlib.RepresentationTheory.GroupCohomology.Basic
import Mathlib.RepresentationTheory.Invariants
universe v u
noncomputable section
open CategoryTheory Limits Representation
variable {k G : Type u} [CommRing k] [Group G] (A : Rep k G)
namespace groupCohomology
section IsCocycle
section
variable {G A : Type*} [Mul G] [AddCommGroup A] [SMul G A]
def IsOneCocycle (f : G β A) : Prop := β g h : G, f (g * h) = g β’ f h + f g
def IsTwoCocycle (f : G Γ G β A) : Prop :=
β g h j : G, f (g * h, j) + f (g, h) = g β’ (f (h, j)) + f (g, h * j)
end
section
variable {G A : Type*} [Monoid G] [AddCommGroup A] [MulAction G A]
| Mathlib/RepresentationTheory/GroupCohomology/LowDegree.lean | 401 | 403 | theorem map_one_of_isOneCocycle {f : G β A} (hf : IsOneCocycle f) :
f 1 = 0 := by |
simpa only [mul_one, one_smul, self_eq_add_right] using hf 1 1
| [
" f 1 = 0"
] | [] |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.FDeriv.Mul
import Mathlib.Analysis.Calculus.FDeriv.Add
#align_import analysis.calculus.deriv.mul from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
noncomputable section
open scoped Classical Topology Filter ENNReal
open Filter Asymptotics Set
open ContinuousLinearMap (smulRight smulRight_one_eq_iff)
variable {π : Type u} [NontriviallyNormedField π]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π G]
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
section Prod
section CLMCompApply
open ContinuousLinearMap
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π G] {c : π β F βL[π] G} {c' : F βL[π] G}
{d : π β E βL[π] F} {d' : E βL[π] F} {u : π β F} {u' : F}
theorem HasStrictDerivAt.clm_comp (hc : HasStrictDerivAt c c' x) (hd : HasStrictDerivAt d d' x) :
HasStrictDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x := by
have := (hc.hasStrictFDerivAt.clm_comp hd.hasStrictFDerivAt).hasStrictDerivAt
rwa [add_apply, comp_apply, comp_apply, smulRight_apply, smulRight_apply, one_apply, one_smul,
one_smul, add_comm] at this
#align has_strict_deriv_at.clm_comp HasStrictDerivAt.clm_comp
theorem HasDerivWithinAt.clm_comp (hc : HasDerivWithinAt c c' s x)
(hd : HasDerivWithinAt d d' s x) :
HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') s x := by
have := (hc.hasFDerivWithinAt.clm_comp hd.hasFDerivWithinAt).hasDerivWithinAt
rwa [add_apply, comp_apply, comp_apply, smulRight_apply, smulRight_apply, one_apply, one_smul,
one_smul, add_comm] at this
#align has_deriv_within_at.clm_comp HasDerivWithinAt.clm_comp
theorem HasDerivAt.clm_comp (hc : HasDerivAt c c' x) (hd : HasDerivAt d d' x) :
HasDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x := by
rw [β hasDerivWithinAt_univ] at *
exact hc.clm_comp hd
#align has_deriv_at.clm_comp HasDerivAt.clm_comp
theorem derivWithin_clm_comp (hc : DifferentiableWithinAt π c s x)
(hd : DifferentiableWithinAt π d s x) (hxs : UniqueDiffWithinAt π s x) :
derivWithin (fun y => (c y).comp (d y)) s x =
(derivWithin c s x).comp (d x) + (c x).comp (derivWithin d s x) :=
(hc.hasDerivWithinAt.clm_comp hd.hasDerivWithinAt).derivWithin hxs
#align deriv_within_clm_comp derivWithin_clm_comp
theorem deriv_clm_comp (hc : DifferentiableAt π c x) (hd : DifferentiableAt π d x) :
deriv (fun y => (c y).comp (d y)) x = (deriv c x).comp (d x) + (c x).comp (deriv d x) :=
(hc.hasDerivAt.clm_comp hd.hasDerivAt).deriv
#align deriv_clm_comp deriv_clm_comp
| Mathlib/Analysis/Calculus/Deriv/Mul.lean | 480 | 484 | theorem HasStrictDerivAt.clm_apply (hc : HasStrictDerivAt c c' x) (hu : HasStrictDerivAt u u' x) :
HasStrictDerivAt (fun y => (c y) (u y)) (c' (u x) + c x u') x := by |
have := (hc.hasStrictFDerivAt.clm_apply hu.hasStrictFDerivAt).hasStrictDerivAt
rwa [add_apply, comp_apply, flip_apply, smulRight_apply, smulRight_apply, one_apply, one_smul,
one_smul, add_comm] at this
| [
" HasStrictDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x",
" HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') s x",
" HasDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x",
" HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (... | [
" HasStrictDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x",
" HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') s x",
" HasDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x",
" HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (... |
import Mathlib.CategoryTheory.Limits.Shapes.SplitCoequalizer
import Mathlib.CategoryTheory.Limits.Preserves.Basic
#align_import category_theory.limits.preserves.shapes.equalizers from "leanprover-community/mathlib"@"4698e35ca56a0d4fa53aa5639c3364e0a77f4eba"
noncomputable section
universe w vβ vβ uβ uβ
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits
variable {C : Type uβ} [Category.{vβ} C]
variable {D : Type uβ} [Category.{vβ} D]
variable (G : C β₯€ D)
namespace CategoryTheory.Limits
section Equalizers
variable {X Y Z : C} {f g : X βΆ Y} {h : Z βΆ X} (w : h β« f = h β« g)
def isLimitMapConeForkEquiv :
IsLimit (G.mapCone (Fork.ofΞΉ h w)) β
IsLimit (Fork.ofΞΉ (G.map h) (by simp only [β G.map_comp, w]) : Fork (G.map f) (G.map g)) :=
(IsLimit.postcomposeHomEquiv (diagramIsoParallelPair _) _).symm.trans
(IsLimit.equivIsoLimit (Fork.ext (Iso.refl _) (by simp [Fork.ΞΉ])))
#align category_theory.limits.is_limit_map_cone_fork_equiv CategoryTheory.Limits.isLimitMapConeForkEquiv
def isLimitForkMapOfIsLimit [PreservesLimit (parallelPair f g) G] (l : IsLimit (Fork.ofΞΉ h w)) :
IsLimit (Fork.ofΞΉ (G.map h) (by simp only [β G.map_comp, w]) : Fork (G.map f) (G.map g)) :=
isLimitMapConeForkEquiv G w (PreservesLimit.preserves l)
#align category_theory.limits.is_limit_fork_map_of_is_limit CategoryTheory.Limits.isLimitForkMapOfIsLimit
def isLimitOfIsLimitForkMap [ReflectsLimit (parallelPair f g) G]
(l : IsLimit (Fork.ofΞΉ (G.map h) (by simp only [β G.map_comp, w]) : Fork (G.map f) (G.map g))) :
IsLimit (Fork.ofΞΉ h w) :=
ReflectsLimit.reflects ((isLimitMapConeForkEquiv G w).symm l)
#align category_theory.limits.is_limit_of_is_limit_fork_map CategoryTheory.Limits.isLimitOfIsLimitForkMap
variable (f g) [HasEqualizer f g]
def isLimitOfHasEqualizerOfPreservesLimit [PreservesLimit (parallelPair f g) G] :
IsLimit (Fork.ofΞΉ
(G.map (equalizer.ΞΉ f g)) (by simp only [β G.map_comp]; rw [equalizer.condition]) :
Fork (G.map f) (G.map g)) :=
isLimitForkMapOfIsLimit G _ (equalizerIsEqualizer f g)
#align category_theory.limits.is_limit_of_has_equalizer_of_preserves_limit CategoryTheory.Limits.isLimitOfHasEqualizerOfPreservesLimit
variable [HasEqualizer (G.map f) (G.map g)]
def PreservesEqualizer.ofIsoComparison [i : IsIso (equalizerComparison f g G)] :
PreservesLimit (parallelPair f g) G := by
apply preservesLimitOfPreservesLimitCone (equalizerIsEqualizer f g)
apply (isLimitMapConeForkEquiv _ _).symm _
refine @IsLimit.ofPointIso _ _ _ _ _ _ _ (limit.isLimit (parallelPair (G.map f) (G.map g))) ?_
apply i
#align category_theory.limits.preserves_equalizer.of_iso_comparison CategoryTheory.Limits.PreservesEqualizer.ofIsoComparison
variable [PreservesLimit (parallelPair f g) G]
def PreservesEqualizer.iso : G.obj (equalizer f g) β
equalizer (G.map f) (G.map g) :=
IsLimit.conePointUniqueUpToIso (isLimitOfHasEqualizerOfPreservesLimit G f g) (limit.isLimit _)
#align category_theory.limits.preserves_equalizer.iso CategoryTheory.Limits.PreservesEqualizer.iso
@[simp]
theorem PreservesEqualizer.iso_hom :
(PreservesEqualizer.iso G f g).hom = equalizerComparison f g G :=
rfl
#align category_theory.limits.preserves_equalizer.iso_hom CategoryTheory.Limits.PreservesEqualizer.iso_hom
@[simp]
| Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean | 104 | 108 | theorem PreservesEqualizer.iso_inv_ΞΉ :
(PreservesEqualizer.iso G f g).inv β« G.map (equalizer.ΞΉ f g) =
equalizer.ΞΉ (G.map f) (G.map g) := by |
rw [β Iso.cancel_iso_hom_left (PreservesEqualizer.iso G f g), β Category.assoc, Iso.hom_inv_id]
simp
| [
" G.map h β« G.map f = G.map h β« G.map g",
" (Iso.refl\n ((Cones.postcompose (diagramIsoParallelPair (parallelPair f g β G)).hom).obj\n (G.mapCone (Fork.ofΞΉ h w))).pt).hom β«\n (Fork.ofΞΉ (G.map h) β―).ΞΉ =\n Fork.ΞΉ ((Cones.postcompose (diagramIsoParallelPair (parallelPair f g β G)).hom).... | [
" G.map h β« G.map f = G.map h β« G.map g",
" (Iso.refl\n ((Cones.postcompose (diagramIsoParallelPair (parallelPair f g β G)).hom).obj\n (G.mapCone (Fork.ofΞΉ h w))).pt).hom β«\n (Fork.ofΞΉ (G.map h) β―).ΞΉ =\n Fork.ΞΉ ((Cones.postcompose (diagramIsoParallelPair (parallelPair f g β G)).hom).... |
import Batteries.Data.List.Lemmas
import Batteries.Tactic.Classical
import Mathlib.Tactic.TypeStar
import Mathlib.Mathport.Rename
#align_import data.list.tfae from "leanprover-community/mathlib"@"5a3e819569b0f12cbec59d740a2613018e7b8eec"
namespace List
def TFAE (l : List Prop) : Prop :=
β x β l, β y β l, x β y
#align list.tfae List.TFAE
theorem tfae_nil : TFAE [] :=
forall_mem_nil _
#align list.tfae_nil List.tfae_nil
@[simp]
theorem tfae_singleton (p) : TFAE [p] := by simp [TFAE, -eq_iff_iff]
#align list.tfae_singleton List.tfae_singleton
theorem tfae_cons_of_mem {a b} {l : List Prop} (h : b β l) : TFAE (a :: l) β (a β b) β§ TFAE l :=
β¨fun H => β¨H a (by simp) b (Mem.tail a h),
fun p hp q hq => H _ (Mem.tail a hp) _ (Mem.tail a hq)β©,
by
rintro β¨ab, Hβ© p (_ | β¨_, hpβ©) q (_ | β¨_, hqβ©)
Β· rfl
Β· exact ab.trans (H _ h _ hq)
Β· exact (ab.trans (H _ h _ hp)).symm
Β· exact H _ hp _ hqβ©
#align list.tfae_cons_of_mem List.tfae_cons_of_mem
theorem tfae_cons_cons {a b} {l : List Prop} : TFAE (a :: b :: l) β (a β b) β§ TFAE (b :: l) :=
tfae_cons_of_mem (Mem.head _)
#align list.tfae_cons_cons List.tfae_cons_cons
@[simp]
theorem tfae_cons_self {a} {l : List Prop} : TFAE (a :: a :: l) β TFAE (a :: l) := by
simp [tfae_cons_cons]
theorem tfae_of_forall (b : Prop) (l : List Prop) (h : β a β l, a β b) : TFAE l :=
fun _aβ hβ _aβ hβ => (h _ hβ).trans (h _ hβ).symm
#align list.tfae_of_forall List.tfae_of_forall
theorem tfae_of_cycle {a b} {l : List Prop} (h_chain : List.Chain (Β· β Β·) a (b :: l))
(h_last : getLastD l b β a) : TFAE (a :: b :: l) := by
induction l generalizing a b with
| nil => simp_all [tfae_cons_cons, iff_def]
| cons c l IH =>
simp only [tfae_cons_cons, getLastD_cons, tfae_singleton, and_true, chain_cons, Chain.nil] at *
rcases h_chain with β¨ab, β¨bc, chβ©β©
have := IH β¨bc, chβ© (ab β h_last)
exact β¨β¨ab, h_last β (this.2 c (.head _) _ (getLastD_mem_cons _ _)).1 β bcβ©, thisβ©
#align list.tfae_of_cycle List.tfae_of_cycle
theorem TFAE.out {l} (h : TFAE l) (nβ nβ) {a b} (hβ : List.get? l nβ = some a := by rfl)
(hβ : List.get? l nβ = some b := by rfl) : a β b :=
h _ (List.get?_mem hβ) _ (List.get?_mem hβ)
#align list.tfae.out List.TFAE.out
theorem forall_tfae {Ξ± : Type*} (l : List (Ξ± β Prop)) (H : β a : Ξ±, (l.map (fun p β¦ p a)).TFAE) :
(l.map (fun p β¦ β a, p a)).TFAE := by
simp only [TFAE, List.forall_mem_map_iff]
intros pβ hpβ pβ hpβ
exact forall_congr' fun a β¦ H a (pβ a) (mem_map_of_mem (fun p β¦ p a) hpβ)
(pβ a) (mem_map_of_mem (fun p β¦ p a) hpβ)
theorem exists_tfae {Ξ± : Type*} (l : List (Ξ± β Prop)) (H : β a : Ξ±, (l.map (fun p β¦ p a)).TFAE) :
(l.map (fun p β¦ β a, p a)).TFAE := by
simp only [TFAE, List.forall_mem_map_iff]
intros pβ hpβ pβ hpβ
exact exists_congr fun a β¦ H a (pβ a) (mem_map_of_mem (fun p β¦ p a) hpβ)
(pβ a) (mem_map_of_mem (fun p β¦ p a) hpβ)
| Mathlib/Data/List/TFAE.lean | 117 | 120 | theorem tfae_not_iff {l : List Prop} : TFAE (l.map Not) β TFAE l := by |
classical
simp only [TFAE, mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ,
Decidable.not_iff_not]
| [
" [p].TFAE",
" a β a :: l",
" (a β b) β§ l.TFAE β (a :: l).TFAE",
" a β a",
" a β q",
" p β a",
" p β q",
" (a :: a :: l).TFAE β (a :: l).TFAE",
" (a :: b :: l).TFAE",
" [a, b].TFAE",
" (a :: b :: c :: l).TFAE",
" (a β b) β§ (b β c) β§ (c :: l).TFAE",
" (map (fun p => β (a : Ξ±), p a) l).TFAE",
... | [
" [p].TFAE",
" a β a :: l",
" (a β b) β§ l.TFAE β (a :: l).TFAE",
" a β a",
" a β q",
" p β a",
" p β q",
" (a :: a :: l).TFAE β (a :: l).TFAE",
" (a :: b :: l).TFAE",
" [a, b].TFAE",
" (a :: b :: c :: l).TFAE",
" (a β b) β§ (b β c) β§ (c :: l).TFAE",
" (map (fun p => β (a : Ξ±), p a) l).TFAE",
... |
import Mathlib.Data.Finset.Sigma
import Mathlib.Data.Fintype.Card
#align_import data.finset.pi_induction from "leanprover-community/mathlib"@"f93c11933efbc3c2f0299e47b8ff83e9b539cbf6"
open Function
variable {ΞΉ : Type*} {Ξ± : ΞΉ β Type*} [Finite ΞΉ] [DecidableEq ΞΉ] [β i, DecidableEq (Ξ± i)]
namespace Finset
| Mathlib/Data/Finset/PiInduction.lean | 37 | 63 | theorem induction_on_pi_of_choice (r : β i, Ξ± i β Finset (Ξ± i) β Prop)
(H_ex : β (i) (s : Finset (Ξ± i)), s.Nonempty β β x β s, r i x (s.erase x))
{p : (β i, Finset (Ξ± i)) β Prop} (f : β i, Finset (Ξ± i)) (h0 : p fun _ β¦ β
)
(step :
β (g : β i, Finset (Ξ± i)) (i : ΞΉ) (x : Ξ± i),
r i x (g i) β p g β p (update g i (insert x (g i)))) :
p f := by |
cases nonempty_fintype ΞΉ
induction' hs : univ.sigma f using Finset.strongInductionOn with s ihs generalizing f; subst s
rcases eq_empty_or_nonempty (univ.sigma f) with he | hne
Β· convert h0 using 1
simpa [funext_iff] using he
Β· rcases sigma_nonempty.1 hne with β¨i, -, hiβ©
rcases H_ex i (f i) hi with β¨x, x_mem, hrβ©
set g := update f i ((f i).erase x) with hg
clear_value g
have hx' : x β g i := by
rw [hg, update_same]
apply not_mem_erase
rw [show f = update g i (insert x (g i)) by
rw [hg, update_idem, update_same, insert_erase x_mem, update_eq_self]] at hr ihs β’
clear hg
rw [update_same, erase_insert hx'] at hr
refine step _ _ _ hr (ihs (univ.sigma g) ?_ _ rfl)
rw [ssubset_iff_of_subset (sigma_mono (Subset.refl _) _)]
exacts [β¨β¨i, xβ©, mem_sigma.2 β¨mem_univ _, by simpβ©, by simp [hx']β©,
(@le_update_iff _ _ _ _ g g i _).2 β¨subset_insert _ _, fun _ _ β¦ le_rflβ©]
| [
" p f",
" f = fun x => β
",
" x β g i",
" x β (f i).erase x",
" f = update g i (insert x (g i))",
" p (update g i (insert x (g i)))",
" univ.sigma g β univ.sigma (update g i (insert x (g i)))",
" β (i_1 : ΞΉ), g i_1 β update g i (insert x (g i)) i_1",
" β¨i, xβ©.snd β update g i (insert x (g i)) β¨i, xβ©.... | [] |
import Mathlib.RingTheory.FinitePresentation
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Away.AdjoinRoot
import Mathlib.RingTheory.QuotientNilpotent
import Mathlib.RingTheory.TensorProduct.Basic
-- Porting note: added to make the syntax work below.
open scoped TensorProduct
universe u
namespace Algebra
section
variable (R : Type u) [CommSemiring R]
variable (A : Type u) [Semiring A] [Algebra R A]
@[mk_iff]
class FormallyUnramified : Prop where
comp_injective :
β β¦B : Type uβ¦ [CommRing B],
β [Algebra R B] (I : Ideal B) (_ : I ^ 2 = β₯),
Function.Injective ((Ideal.Quotient.mkβ R I).comp : (A ββ[R] B) β A ββ[R] B β§Έ I)
#align algebra.formally_unramified Algebra.FormallyUnramified
end
namespace FormallyUnramified
section
variable {R : Type u} [CommSemiring R]
variable {A : Type u} [Semiring A] [Algebra R A]
variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B)
theorem lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B]
[FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (gβ gβ : A ββ[R] B)
(h : (Ideal.Quotient.mkβ R I).comp gβ = (Ideal.Quotient.mkβ R I).comp gβ) : gβ = gβ := by
revert gβ gβ
change Function.Injective (Ideal.Quotient.mkβ R I).comp
revert _RB
apply Ideal.IsNilpotent.induction_on (R := B) I hI
Β· intro B _ I hI _; exact FormallyUnramified.comp_injective I hI
Β· intro B _ I J hIJ hβ hβ _ gβ gβ e
apply hβ
apply hβ
ext x
replace e := AlgHom.congr_fun e x
dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkβ_eq_mk] at e β’
rwa [Ideal.Quotient.eq, β map_sub, Ideal.mem_quotient_iff_mem hIJ, β Ideal.Quotient.eq]
#align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique
theorem ext [FormallyUnramified R A] (hI : IsNilpotent I) {gβ gβ : A ββ[R] B}
(H : β x, Ideal.Quotient.mk I (gβ x) = Ideal.Quotient.mk I (gβ x)) : gβ = gβ :=
FormallyUnramified.lift_unique I hI gβ gβ (AlgHom.ext H)
#align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext
theorem lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C]
(f : B β+* C) (hf : IsNilpotent <| RingHom.ker f) (gβ gβ : A ββ[R] B)
(h : f.comp βgβ = f.comp (gβ : A β+* B)) : gβ = gβ :=
FormallyUnramified.lift_unique _ hf _ _
(by
ext x
have := RingHom.congr_fun h x
simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkβ_eq_mk,
RingHom.mem_ker, map_sub, sub_eq_zero])
#align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom
theorem ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B β+* C)
(hf : IsNilpotent <| RingHom.ker f) (gβ gβ : A ββ[R] B) (h : β x, f (gβ x) = f (gβ x)) :
gβ = gβ :=
FormallyUnramified.lift_unique_of_ringHom f hf gβ gβ (RingHom.ext h)
#align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext'
theorem lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C]
[Algebra R C] (f : B ββ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B β+* C))
(gβ gβ : A ββ[R] B) (h : f.comp gβ = f.comp gβ) : gβ = gβ :=
FormallyUnramified.ext' _ hf gβ gβ (AlgHom.congr_fun h)
#align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique'
end
section Localization
variable {R S Rβ Sβ : Type u} [CommRing R] [CommRing S] [CommRing Rβ] [CommRing Sβ]
variable (M : Submonoid R)
variable [Algebra R S] [Algebra R Sβ] [Algebra S Sβ] [Algebra R Rβ] [Algebra Rβ Sβ]
variable [IsScalarTower R Rβ Sβ] [IsScalarTower R S Sβ]
variable [IsLocalization M Rβ] [IsLocalization (M.map (algebraMap R S)) Sβ]
-- Porting note: no longer supported
-- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on
| Mathlib/RingTheory/Unramified/Basic.lean | 201 | 207 | theorem of_isLocalization : FormallyUnramified R Rβ := by |
constructor
intro Q _ _ I _ fβ fβ _
apply AlgHom.coe_ringHom_injective
refine IsLocalization.ringHom_ext M ?_
ext
simp
| [
" gβ = gβ",
" β (gβ gβ : A ββ[R] B), (Ideal.Quotient.mkβ R I).comp gβ = (Ideal.Quotient.mkβ R I).comp gβ β gβ = gβ",
" Function.Injective (Ideal.Quotient.mkβ R I).comp",
" β [_RB : Algebra R B], Function.Injective (Ideal.Quotient.mkβ R I).comp",
" β β¦S : Type uβ¦ [inst : CommRing S] (I : Ideal S),\n I ^ 2... | [
" gβ = gβ",
" β (gβ gβ : A ββ[R] B), (Ideal.Quotient.mkβ R I).comp gβ = (Ideal.Quotient.mkβ R I).comp gβ β gβ = gβ",
" Function.Injective (Ideal.Quotient.mkβ R I).comp",
" β [_RB : Algebra R B], Function.Injective (Ideal.Quotient.mkβ R I).comp",
" β β¦S : Type uβ¦ [inst : CommRing S] (I : Ideal S),\n I ^ 2... |
import Mathlib.Algebra.PUnitInstances
import Mathlib.Tactic.Abel
import Mathlib.Tactic.Ring
import Mathlib.Order.Hom.Lattice
#align_import algebra.ring.boolean_ring from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open scoped symmDiff
variable {Ξ± Ξ² Ξ³ : Type*}
class BooleanRing (Ξ±) extends Ring Ξ± where
mul_self : β a : Ξ±, a * a = a
#align boolean_ring BooleanRing
section BooleanRing
variable [BooleanRing Ξ±] (a b : Ξ±)
instance : Std.IdempotentOp (Ξ± := Ξ±) (Β· * Β·) :=
β¨BooleanRing.mul_selfβ©
@[simp]
theorem mul_self : a * a = a :=
BooleanRing.mul_self _
#align mul_self mul_self
@[simp]
theorem add_self : a + a = 0 := by
have : a + a = a + a + (a + a) :=
calc
a + a = (a + a) * (a + a) := by rw [mul_self]
_ = a * a + a * a + (a * a + a * a) := by rw [add_mul, mul_add]
_ = a + a + (a + a) := by rw [mul_self]
rwa [self_eq_add_left] at this
#align add_self add_self
@[simp]
theorem neg_eq : -a = a :=
calc
-a = -a + 0 := by rw [add_zero]
_ = -a + -a + a := by rw [β neg_add_self, add_assoc]
_ = a := by rw [add_self, zero_add]
#align neg_eq neg_eq
theorem add_eq_zero' : a + b = 0 β a = b :=
calc
a + b = 0 β a = -b := add_eq_zero_iff_eq_neg
_ β a = b := by rw [neg_eq]
#align add_eq_zero' add_eq_zero'
@[simp]
theorem mul_add_mul : a * b + b * a = 0 := by
have : a + b = a + b + (a * b + b * a) :=
calc
a + b = (a + b) * (a + b) := by rw [mul_self]
_ = a * a + a * b + (b * a + b * b) := by rw [add_mul, mul_add, mul_add]
_ = a + a * b + (b * a + b) := by simp only [mul_self]
_ = a + b + (a * b + b * a) := by abel
rwa [self_eq_add_right] at this
#align mul_add_mul mul_add_mul
@[simp]
| Mathlib/Algebra/Ring/BooleanRing.lean | 101 | 101 | theorem sub_eq_add : a - b = a + b := by | rw [sub_eq_add_neg, add_right_inj, neg_eq]
| [
" a + a = 0",
" a + a = (a + a) * (a + a)",
" (a + a) * (a + a) = a * a + a * a + (a * a + a * a)",
" a * a + a * a + (a * a + a * a) = a + a + (a + a)",
" -a = -a + 0",
" -a + 0 = -a + -a + a",
" -a + -a + a = a",
" a = -b β a = b",
" a * b + b * a = 0",
" a + b = (a + b) * (a + b)",
" (a + b) ... | [
" a + a = 0",
" a + a = (a + a) * (a + a)",
" (a + a) * (a + a) = a * a + a * a + (a * a + a * a)",
" a * a + a * a + (a * a + a * a) = a + a + (a + a)",
" -a = -a + 0",
" -a + 0 = -a + -a + a",
" -a + -a + a = a",
" a = -b β a = b",
" a * b + b * a = 0",
" a + b = (a + b) * (a + b)",
" (a + b) ... |
import Mathlib.Order.Interval.Finset.Nat
#align_import data.fin.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
assert_not_exists MonoidWithZero
open Finset Fin Function
namespace Fin
variable (n : β)
instance instLocallyFiniteOrder : LocallyFiniteOrder (Fin n) :=
OrderIso.locallyFiniteOrder Fin.orderIsoSubtype
instance instLocallyFiniteOrderBot : LocallyFiniteOrderBot (Fin n) :=
OrderIso.locallyFiniteOrderBot Fin.orderIsoSubtype
instance instLocallyFiniteOrderTop : β n, LocallyFiniteOrderTop (Fin n)
| 0 => IsEmpty.toLocallyFiniteOrderTop
| _ + 1 => inferInstance
variable {n} (a b : Fin n)
theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : β) b).fin n :=
rfl
#align fin.Icc_eq_finset_subtype Fin.Icc_eq_finset_subtype
theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : β) b).fin n :=
rfl
#align fin.Ico_eq_finset_subtype Fin.Ico_eq_finset_subtype
theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : β) b).fin n :=
rfl
#align fin.Ioc_eq_finset_subtype Fin.Ioc_eq_finset_subtype
theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : β) b).fin n :=
rfl
#align fin.Ioo_eq_finset_subtype Fin.Ioo_eq_finset_subtype
theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : β) b).fin n := rfl
#align fin.uIcc_eq_finset_subtype Fin.uIcc_eq_finset_subtype
@[simp]
theorem map_valEmbedding_Icc : (Icc a b).map Fin.valEmbedding = Icc βa βb := by
simp [Icc_eq_finset_subtype, Finset.fin, Finset.map_map, Icc_filter_lt_of_lt_right]
#align fin.map_subtype_embedding_Icc Fin.map_valEmbedding_Icc
@[simp]
theorem map_valEmbedding_Ico : (Ico a b).map Fin.valEmbedding = Ico βa βb := by
simp [Ico_eq_finset_subtype, Finset.fin, Finset.map_map]
#align fin.map_subtype_embedding_Ico Fin.map_valEmbedding_Ico
@[simp]
theorem map_valEmbedding_Ioc : (Ioc a b).map Fin.valEmbedding = Ioc βa βb := by
simp [Ioc_eq_finset_subtype, Finset.fin, Finset.map_map, Ioc_filter_lt_of_lt_right]
#align fin.map_subtype_embedding_Ioc Fin.map_valEmbedding_Ioc
@[simp]
theorem map_valEmbedding_Ioo : (Ioo a b).map Fin.valEmbedding = Ioo βa βb := by
simp [Ioo_eq_finset_subtype, Finset.fin, Finset.map_map]
#align fin.map_subtype_embedding_Ioo Fin.map_valEmbedding_Ioo
@[simp]
theorem map_subtype_embedding_uIcc : (uIcc a b).map valEmbedding = uIcc βa βb :=
map_valEmbedding_Icc _ _
#align fin.map_subtype_embedding_uIcc Fin.map_subtype_embedding_uIcc
@[simp]
theorem card_Icc : (Icc a b).card = b + 1 - a := by
rw [β Nat.card_Icc, β map_valEmbedding_Icc, card_map]
#align fin.card_Icc Fin.card_Icc
@[simp]
theorem card_Ico : (Ico a b).card = b - a := by
rw [β Nat.card_Ico, β map_valEmbedding_Ico, card_map]
#align fin.card_Ico Fin.card_Ico
@[simp]
| Mathlib/Order/Interval/Finset/Fin.lean | 114 | 115 | theorem card_Ioc : (Ioc a b).card = b - a := by |
rw [β Nat.card_Ioc, β map_valEmbedding_Ioc, card_map]
| [
" map valEmbedding (Icc a b) = Icc βa βb",
" map valEmbedding (Ico a b) = Ico βa βb",
" map valEmbedding (Ioc a b) = Ioc βa βb",
" map valEmbedding (Ioo a b) = Ioo βa βb",
" (Icc a b).card = βb + 1 - βa",
" (Ico a b).card = βb - βa",
" (Ioc a b).card = βb - βa"
] | [
" map valEmbedding (Icc a b) = Icc βa βb",
" map valEmbedding (Ico a b) = Ico βa βb",
" map valEmbedding (Ioc a b) = Ioc βa βb",
" map valEmbedding (Ioo a b) = Ioo βa βb",
" (Icc a b).card = βb + 1 - βa",
" (Ico a b).card = βb - βa"
] |
import Mathlib.CategoryTheory.EqToHom
#align_import category_theory.sums.basic from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988"
namespace CategoryTheory
universe vβ uβ
-- morphism levels before object levels. See note [category_theory universes].
open Sum
section
variable (C : Type uβ) [Category.{vβ} C] (D : Type uβ) [Category.{vβ} D]
instance sum : Category.{vβ} (Sum C D) where
Hom X Y :=
match X, Y with
| inl X, inl Y => X βΆ Y
| inl _, inr _ => PEmpty
| inr _, inl _ => PEmpty
| inr X, inr Y => X βΆ Y
id X :=
match X with
| inl X => π X
| inr X => π X
comp {X Y Z} f g :=
match X, Y, Z, f, g with
| inl X, inl Y, inl Z, f, g => f β« g
| inr X, inr Y, inr Z, f, g => f β« g
assoc {W X Y Z} f g h :=
match X, Y, Z, W with
| inl X, inl Y, inl Z, inl W => Category.assoc f g h
| inr X, inr Y, inr Z, inr W => Category.assoc f g h
#align category_theory.sum CategoryTheory.sum
@[aesop norm -10 destruct (rule_sets := [CategoryTheory])]
| Mathlib/CategoryTheory/Sums/Basic.lean | 62 | 63 | theorem hom_inl_inr_false {X : C} {Y : D} (f : Sum.inl X βΆ Sum.inr Y) : False := by |
cases f
| [
" False"
] | [] |
import Mathlib.CategoryTheory.NatTrans
import Mathlib.CategoryTheory.Iso
#align_import category_theory.functor.category from "leanprover-community/mathlib"@"63721b2c3eba6c325ecf8ae8cca27155a4f6306f"
namespace CategoryTheory
-- declare the `v`'s first; see note [CategoryTheory universes].
universe vβ vβ vβ uβ uβ uβ
open NatTrans Category CategoryTheory.Functor
variable (C : Type uβ) [Category.{vβ} C] (D : Type uβ) [Category.{vβ} D]
attribute [local simp] vcomp_app
variable {C D} {E : Type uβ} [Category.{vβ} E]
variable {F G H I : C β₯€ D}
instance Functor.category : Category.{max uβ vβ} (C β₯€ D) where
Hom F G := NatTrans F G
id F := NatTrans.id F
comp Ξ± Ξ² := vcomp Ξ± Ξ²
#align category_theory.functor.category CategoryTheory.Functor.category
namespace NatTrans
-- Porting note: the behaviour of `ext` has changed here.
-- We need to provide a copy of the `NatTrans.ext` lemma,
-- written in terms of `F βΆ G` rather than `NatTrans F G`,
-- or `ext` will not retrieve it from the cache.
@[ext]
theorem ext' {Ξ± Ξ² : F βΆ G} (w : Ξ±.app = Ξ².app) : Ξ± = Ξ² := NatTrans.ext _ _ w
@[simp]
theorem vcomp_eq_comp (Ξ± : F βΆ G) (Ξ² : G βΆ H) : vcomp Ξ± Ξ² = Ξ± β« Ξ² := rfl
#align category_theory.nat_trans.vcomp_eq_comp CategoryTheory.NatTrans.vcomp_eq_comp
theorem vcomp_app' (Ξ± : F βΆ G) (Ξ² : G βΆ H) (X : C) : (Ξ± β« Ξ²).app X = Ξ±.app X β« Ξ².app X := rfl
#align category_theory.nat_trans.vcomp_app' CategoryTheory.NatTrans.vcomp_app'
theorem congr_app {Ξ± Ξ² : F βΆ G} (h : Ξ± = Ξ²) (X : C) : Ξ±.app X = Ξ².app X := by rw [h]
#align category_theory.nat_trans.congr_app CategoryTheory.NatTrans.congr_app
@[simp]
theorem id_app (F : C β₯€ D) (X : C) : (π F : F βΆ F).app X = π (F.obj X) := rfl
#align category_theory.nat_trans.id_app CategoryTheory.NatTrans.id_app
@[simp]
theorem comp_app {F G H : C β₯€ D} (Ξ± : F βΆ G) (Ξ² : G βΆ H) (X : C) :
(Ξ± β« Ξ²).app X = Ξ±.app X β« Ξ².app X := rfl
#align category_theory.nat_trans.comp_app CategoryTheory.NatTrans.comp_app
attribute [reassoc] comp_app
@[reassoc]
theorem app_naturality {F G : C β₯€ D β₯€ E} (T : F βΆ G) (X : C) {Y Z : D} (f : Y βΆ Z) :
(F.obj X).map f β« (T.app X).app Z = (T.app X).app Y β« (G.obj X).map f :=
(T.app X).naturality f
#align category_theory.nat_trans.app_naturality CategoryTheory.NatTrans.app_naturality
@[reassoc]
theorem naturality_app {F G : C β₯€ D β₯€ E} (T : F βΆ G) (Z : D) {X Y : C} (f : X βΆ Y) :
(F.map f).app Z β« (T.app Y).app Z = (T.app X).app Z β« (G.map f).app Z :=
congr_fun (congr_arg app (T.naturality f)) Z
#align category_theory.nat_trans.naturality_app CategoryTheory.NatTrans.naturality_app
theorem mono_of_mono_app (Ξ± : F βΆ G) [β X : C, Mono (Ξ±.app X)] : Mono Ξ± :=
β¨fun g h eq => by
ext X
rw [β cancel_mono (Ξ±.app X), β comp_app, eq, comp_app]β©
#align category_theory.nat_trans.mono_of_mono_app CategoryTheory.NatTrans.mono_of_mono_app
theorem epi_of_epi_app (Ξ± : F βΆ G) [β X : C, Epi (Ξ±.app X)] : Epi Ξ± :=
β¨fun g h eq => by
ext X
rw [β cancel_epi (Ξ±.app X), β comp_app, eq, comp_app]β©
#align category_theory.nat_trans.epi_of_epi_app CategoryTheory.NatTrans.epi_of_epi_app
@[simps]
def hcomp {H I : D β₯€ E} (Ξ± : F βΆ G) (Ξ² : H βΆ I) : F β H βΆ G β I where
app := fun X : C => Ξ².app (F.obj X) β« I.map (Ξ±.app X)
naturality X Y f := by
rw [Functor.comp_map, Functor.comp_map, β assoc, naturality, assoc, β map_comp I, naturality,
map_comp, assoc]
#align category_theory.nat_trans.hcomp CategoryTheory.NatTrans.hcomp
#align category_theory.nat_trans.hcomp_app CategoryTheory.NatTrans.hcomp_app
infixl:80 " β« " => hcomp
theorem hcomp_id_app {H : D β₯€ E} (Ξ± : F βΆ G) (X : C) : (Ξ± β« π H).app X = H.map (Ξ±.app X) := by
simp
#align category_theory.nat_trans.hcomp_id_app CategoryTheory.NatTrans.hcomp_id_app
| Mathlib/CategoryTheory/Functor/Category.lean | 125 | 125 | theorem id_hcomp_app {H : E β₯€ C} (Ξ± : F βΆ G) (X : E) : (π H β« Ξ±).app X = Ξ±.app _ := by | simp
| [
" Ξ±.app X = Ξ².app X",
" g = h",
" g.app X = h.app X",
" (F β H).map f β« (fun X => Ξ².app (F.obj X) β« I.map (Ξ±.app X)) Y =\n (fun X => Ξ².app (F.obj X) β« I.map (Ξ±.app X)) X β« (G β I).map f",
" (Ξ± β« π H).app X = H.map (Ξ±.app X)",
" (π H β« Ξ±).app X = Ξ±.app (H.obj X)"
] | [
" Ξ±.app X = Ξ².app X",
" g = h",
" g.app X = h.app X",
" (F β H).map f β« (fun X => Ξ².app (F.obj X) β« I.map (Ξ±.app X)) Y =\n (fun X => Ξ².app (F.obj X) β« I.map (Ξ±.app X)) X β« (G β I).map f",
" (Ξ± β« π H).app X = H.map (Ξ±.app X)"
] |
import Mathlib.Order.Interval.Finset.Fin
#align_import data.fintype.fin from "leanprover-community/mathlib"@"759575657f189ccb424b990164c8b1fa9f55cdfe"
open Finset
open Fintype
namespace Fin
variable {Ξ± Ξ² : Type*} {n : β}
theorem map_valEmbedding_univ : (Finset.univ : Finset (Fin n)).map Fin.valEmbedding = Iio n := by
ext
simp [orderIsoSubtype.symm.surjective.exists, OrderIso.symm]
#align fin.map_subtype_embedding_univ Fin.map_valEmbedding_univ
@[simp]
theorem Ioi_zero_eq_map : Ioi (0 : Fin n.succ) = univ.map (Fin.succEmb _) :=
coe_injective <| by ext; simp [pos_iff_ne_zero]
#align fin.Ioi_zero_eq_map Fin.Ioi_zero_eq_map
@[simp]
theorem Iio_last_eq_map : Iio (Fin.last n) = Finset.univ.map Fin.castSuccEmb :=
coe_injective <| by ext; simp [lt_def]
#align fin.Iio_last_eq_map Fin.Iio_last_eq_map
@[simp]
theorem Ioi_succ (i : Fin n) : Ioi i.succ = (Ioi i).map (Fin.succEmb _) := by
ext i
simp only [mem_filter, mem_Ioi, mem_map, mem_univ, true_and_iff, Function.Embedding.coeFn_mk,
exists_true_left]
constructor
Β· refine cases ?_ ?_ i
Β· rintro β¨β¨β©β©
Β· intro i hi
exact β¨i, succ_lt_succ_iff.mp hi, rflβ©
Β· rintro β¨i, hi, rflβ©
simpa
#align fin.Ioi_succ Fin.Ioi_succ
@[simp]
theorem Iio_castSucc (i : Fin n) : Iio (castSucc i) = (Iio i).map Fin.castSuccEmb := by
apply Finset.map_injective Fin.valEmbedding
rw [Finset.map_map, Fin.map_valEmbedding_Iio]
exact (Fin.map_valEmbedding_Iio i).symm
#align fin.Iio_cast_succ Fin.Iio_castSucc
| Mathlib/Data/Fintype/Fin.lean | 61 | 64 | theorem card_filter_univ_succ' (p : Fin (n + 1) β Prop) [DecidablePred p] :
(univ.filter p).card = ite (p 0) 1 0 + (univ.filter (p β Fin.succ)).card := by |
rw [Fin.univ_succ, filter_cons, card_disjUnion, filter_map, card_map]
split_ifs <;> simp
| [
" map valEmbedding univ = Iio n",
" aβ β map valEmbedding univ β aβ β Iio n",
" β(Ioi 0) = β(map (succEmb n) univ)",
" xβ β β(Ioi 0) β xβ β β(map (succEmb n) univ)",
" β(Iio (last n)) = β(map castSuccEmb univ)",
" xβ β β(Iio (last n)) β xβ β β(map castSuccEmb univ)",
" Ioi i.succ = map (succEmb n) (Ioi ... | [
" map valEmbedding univ = Iio n",
" aβ β map valEmbedding univ β aβ β Iio n",
" β(Ioi 0) = β(map (succEmb n) univ)",
" xβ β β(Ioi 0) β xβ β β(map (succEmb n) univ)",
" β(Iio (last n)) = β(map castSuccEmb univ)",
" xβ β β(Iio (last n)) β xβ β β(map castSuccEmb univ)",
" Ioi i.succ = map (succEmb n) (Ioi ... |
import Mathlib.Logic.Function.Basic
import Mathlib.Tactic.MkIffOfInductiveProp
#align_import data.sum.basic from "leanprover-community/mathlib"@"bd9851ca476957ea4549eb19b40e7b5ade9428cc"
universe u v w x
variable {Ξ± : Type u} {Ξ±' : Type w} {Ξ² : Type v} {Ξ²' : Type x} {Ξ³ Ξ΄ : Type*}
namespace Sum
#align sum.forall Sum.forall
#align sum.exists Sum.exists
theorem exists_sum {Ξ³ : Ξ± β Ξ² β Sort*} (p : (β ab, Ξ³ ab) β Prop) :
(β fab, p fab) β (β fa fb, p (Sum.rec fa fb)) := by
rw [β not_forall_not, forall_sum]
simp
theorem inl_injective : Function.Injective (inl : Ξ± β Sum Ξ± Ξ²) := fun _ _ β¦ inl.inj
#align sum.inl_injective Sum.inl_injective
theorem inr_injective : Function.Injective (inr : Ξ² β Sum Ξ± Ξ²) := fun _ _ β¦ inr.inj
#align sum.inr_injective Sum.inr_injective
theorem sum_rec_congr (P : Ξ± β Ξ² β Sort*) (f : β i, P (inl i)) (g : β i, P (inr i))
{x y : Ξ± β Ξ²} (h : x = y) :
@Sum.rec _ _ _ f g x = cast (congr_arg P h.symm) (@Sum.rec _ _ _ f g y) := by cases h; rfl
section get
#align sum.is_left Sum.isLeft
#align sum.is_right Sum.isRight
#align sum.get_left Sum.getLeft?
#align sum.get_right Sum.getRight?
variable {x y : Sum Ξ± Ξ²}
#align sum.get_left_eq_none_iff Sum.getLeft?_eq_none_iff
#align sum.get_right_eq_none_iff Sum.getRight?_eq_none_iff
| Mathlib/Data/Sum/Basic.lean | 54 | 55 | theorem eq_left_iff_getLeft_eq {a : Ξ±} : x = inl a β β h, x.getLeft h = a := by |
cases x <;> simp
| [
" (β fab, p fab) β β fa fb, p fun t => rec fa fb t",
" (Β¬β (fa : (val : Ξ±) β Ξ³ (inl val)) (fb : (val : Ξ²) β Ξ³ (inr val)), Β¬p fun t => rec fa fb t) β\n β fa fb, p fun t => rec fa fb t",
" rec f g x = cast β― (rec f g y)",
" rec f g x = cast β― (rec f g x)",
" x = inl a β β h, x.getLeft h = a",
" inl valβ ... | [
" (β fab, p fab) β β fa fb, p fun t => rec fa fb t",
" (Β¬β (fa : (val : Ξ±) β Ξ³ (inl val)) (fb : (val : Ξ²) β Ξ³ (inr val)), Β¬p fun t => rec fa fb t) β\n β fa fb, p fun t => rec fa fb t",
" rec f g x = cast β― (rec f g y)",
" rec f g x = cast β― (rec f g x)"
] |
import Mathlib.Analysis.NormedSpace.Exponential
import Mathlib.Analysis.Calculus.FDeriv.Analytic
import Mathlib.Topology.MetricSpace.CauSeqFilter
#align_import analysis.special_functions.exponential from "leanprover-community/mathlib"@"e1a18cad9cd462973d760af7de36b05776b8811c"
open Filter RCLike ContinuousMultilinearMap NormedField NormedSpace Asymptotics
open scoped Nat Topology ENNReal
section AnyFieldAnyAlgebra
variable {π πΈ : Type*} [NontriviallyNormedField π] [NormedRing πΈ] [NormedAlgebra π πΈ]
[CompleteSpace πΈ]
| Mathlib/Analysis/SpecialFunctions/Exponential.lean | 67 | 72 | theorem hasStrictFDerivAt_exp_zero_of_radius_pos (h : 0 < (expSeries π πΈ).radius) :
HasStrictFDerivAt (exp π) (1 : πΈ βL[π] πΈ) 0 := by |
convert (hasFPowerSeriesAt_exp_zero_of_radius_pos h).hasStrictFDerivAt
ext x
change x = expSeries π πΈ 1 fun _ => x
simp [expSeries_apply_eq, Nat.factorial]
| [
" HasStrictFDerivAt (exp π) 1 0",
" 1 = (continuousMultilinearCurryFin1 π πΈ πΈ) (expSeries π πΈ 1)",
" 1 x = ((continuousMultilinearCurryFin1 π πΈ πΈ) (expSeries π πΈ 1)) x",
" x = (expSeries π πΈ 1) fun x_1 => x"
] | [] |
import Mathlib.CategoryTheory.Limits.Shapes.Images
import Mathlib.CategoryTheory.Limits.Constructions.EpiMono
#align_import category_theory.limits.preserves.shapes.images from "leanprover-community/mathlib"@"fc78e3c190c72a109699385da6be2725e88df841"
noncomputable section
namespace CategoryTheory
namespace PreservesImage
open CategoryTheory
open CategoryTheory.Limits
universe uβ uβ vβ vβ
variable {A : Type uβ} {B : Type uβ} [Category.{vβ} A] [Category.{vβ} B]
variable [HasEqualizers A] [HasImages A]
variable [StrongEpiCategory B] [HasImages B]
variable (L : A β₯€ B)
variable [β {X Y Z : A} (f : X βΆ Z) (g : Y βΆ Z), PreservesLimit (cospan f g) L]
variable [β {X Y Z : A} (f : X βΆ Y) (g : X βΆ Z), PreservesColimit (span f g) L]
@[simps!]
def iso {X Y : A} (f : X βΆ Y) : image (L.map f) β
L.obj (image f) :=
let aux1 : StrongEpiMonoFactorisation (L.map f) :=
{ I := L.obj (Limits.image f)
m := L.map <| Limits.image.ΞΉ _
m_mono := preserves_mono_of_preservesLimit _ _
e := L.map <| factorThruImage _
e_strong_epi := @strongEpi_of_epi B _ _ _ _ _ (preserves_epi_of_preservesColimit L _)
fac := by rw [β L.map_comp, Limits.image.fac] }
IsImage.isoExt (Image.isImage (L.map f)) aux1.toMonoIsImage
#align category_theory.preserves_image.iso CategoryTheory.PreservesImage.iso
@[reassoc]
theorem factorThruImage_comp_hom {X Y : A} (f : X βΆ Y) :
factorThruImage (L.map f) β« (iso L f).hom = L.map (factorThruImage f) := by simp
#align category_theory.preserves_image.factor_thru_image_comp_hom CategoryTheory.PreservesImage.factorThruImage_comp_hom
@[reassoc]
theorem hom_comp_map_image_ΞΉ {X Y : A} (f : X βΆ Y) :
(iso L f).hom β« L.map (image.ΞΉ f) = image.ΞΉ (L.map f) := by rw [iso_hom, image.lift_fac]
#align category_theory.preserves_image.hom_comp_map_image_ΞΉ CategoryTheory.PreservesImage.hom_comp_map_image_ΞΉ
@[reassoc]
| Mathlib/CategoryTheory/Limits/Preserves/Shapes/Images.lean | 62 | 63 | theorem inv_comp_image_ΞΉ_map {X Y : A} (f : X βΆ Y) :
(iso L f).inv β« image.ΞΉ (L.map f) = L.map (image.ΞΉ f) := by | simp
| [
" L.map (factorThruImage f) β« L.map (image.ΞΉ f) = L.map f",
" factorThruImage (L.map f) β« (iso L f).hom = L.map (factorThruImage f)",
" (iso L f).hom β« L.map (image.ΞΉ f) = image.ΞΉ (L.map f)",
" (iso L f).inv β« image.ΞΉ (L.map f) = L.map (image.ΞΉ f)"
] | [
" L.map (factorThruImage f) β« L.map (image.ΞΉ f) = L.map f",
" factorThruImage (L.map f) β« (iso L f).hom = L.map (factorThruImage f)",
" (iso L f).hom β« L.map (image.ΞΉ f) = image.ΞΉ (L.map f)"
] |
import Mathlib.RingTheory.FiniteType
import Mathlib.RingTheory.Localization.AtPrime
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.RingTheory.RingHomProperties
import Mathlib.Data.Set.Subsingleton
#align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
open scoped Pointwise Classical
universe u
variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R)
variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R β+* S)
variable [Algebra R R'] [Algebra S S']
section Properties
section RingHom
variable (P : β {R S : Type u} [CommRing R] [CommRing S] (_ : R β+* S), Prop)
def RingHom.LocalizationPreserves :=
β β¦R S : Type uβ¦ [CommRing R] [CommRing S] (f : R β+* S) (M : Submonoid R) (R' S' : Type u)
[CommRing R'] [CommRing S'] [Algebra R R'] [Algebra S S'] [IsLocalization M R']
[IsLocalization (M.map f) S'],
P f β P (IsLocalization.map S' f (Submonoid.le_comap_map M) : R' β+* S')
#align ring_hom.localization_preserves RingHom.LocalizationPreserves
def RingHom.OfLocalizationFiniteSpan :=
β β¦R S : Type uβ¦ [CommRing R] [CommRing S] (f : R β+* S) (s : Finset R)
(_ : Ideal.span (s : Set R) = β€) (_ : β r : s, P (Localization.awayMap f r)), P f
#align ring_hom.of_localization_finite_span RingHom.OfLocalizationFiniteSpan
def RingHom.OfLocalizationSpan :=
β β¦R S : Type uβ¦ [CommRing R] [CommRing S] (f : R β+* S) (s : Set R) (_ : Ideal.span s = β€)
(_ : β r : s, P (Localization.awayMap f r)), P f
#align ring_hom.of_localization_span RingHom.OfLocalizationSpan
def RingHom.HoldsForLocalizationAway : Prop :=
β β¦R : Type uβ¦ (S : Type u) [CommRing R] [CommRing S] [Algebra R S] (r : R)
[IsLocalization.Away r S], P (algebraMap R S)
#align ring_hom.holds_for_localization_away RingHom.HoldsForLocalizationAway
def RingHom.OfLocalizationFiniteSpanTarget : Prop :=
β β¦R S : Type uβ¦ [CommRing R] [CommRing S] (f : R β+* S) (s : Finset S)
(_ : Ideal.span (s : Set S) = β€)
(_ : β r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f
#align ring_hom.of_localization_finite_span_target RingHom.OfLocalizationFiniteSpanTarget
def RingHom.OfLocalizationSpanTarget : Prop :=
β β¦R S : Type uβ¦ [CommRing R] [CommRing S] (f : R β+* S) (s : Set S) (_ : Ideal.span s = β€)
(_ : β r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f
#align ring_hom.of_localization_span_target RingHom.OfLocalizationSpanTarget
def RingHom.OfLocalizationPrime : Prop :=
β β¦R S : Type uβ¦ [CommRing R] [CommRing S] (f : R β+* S),
(β (J : Ideal S) (_ : J.IsPrime), P (Localization.localRingHom _ J f rfl)) β P f
#align ring_hom.of_localization_prime RingHom.OfLocalizationPrime
structure RingHom.PropertyIsLocal : Prop where
LocalizationPreserves : RingHom.LocalizationPreserves @P
OfLocalizationSpanTarget : RingHom.OfLocalizationSpanTarget @P
StableUnderComposition : RingHom.StableUnderComposition @P
HoldsForLocalizationAway : RingHom.HoldsForLocalizationAway @P
#align ring_hom.property_is_local RingHom.PropertyIsLocal
theorem RingHom.ofLocalizationSpan_iff_finite :
RingHom.OfLocalizationSpan @P β RingHom.OfLocalizationFiniteSpan @P := by
delta RingHom.OfLocalizationSpan RingHom.OfLocalizationFiniteSpan
apply forallβ
_congr
-- TODO: Using `refine` here breaks `resetI`.
intros
constructor
Β· intro h s; exact h s
Β· intro h s hs hs'
obtain β¨s', hβ, hββ© := (Ideal.span_eq_top_iff_finite s).mp hs
exact h s' hβ fun x => hs' β¨_, hβ x.propβ©
#align ring_hom.of_localization_span_iff_finite RingHom.ofLocalizationSpan_iff_finite
theorem RingHom.ofLocalizationSpanTarget_iff_finite :
RingHom.OfLocalizationSpanTarget @P β RingHom.OfLocalizationFiniteSpanTarget @P := by
delta RingHom.OfLocalizationSpanTarget RingHom.OfLocalizationFiniteSpanTarget
apply forallβ
_congr
-- TODO: Using `refine` here breaks `resetI`.
intros
constructor
Β· intro h s; exact h s
Β· intro h s hs hs'
obtain β¨s', hβ, hββ© := (Ideal.span_eq_top_iff_finite s).mp hs
exact h s' hβ fun x => hs' β¨_, hβ x.propβ©
#align ring_hom.of_localization_span_target_iff_finite RingHom.ofLocalizationSpanTarget_iff_finite
variable {P f R' S'}
| Mathlib/RingTheory/LocalProperties.lean | 181 | 189 | theorem RingHom.PropertyIsLocal.respectsIso (hP : RingHom.PropertyIsLocal @P) :
RingHom.RespectsIso @P := by |
apply hP.StableUnderComposition.respectsIso
introv
letI := e.toRingHom.toAlgebra
-- Porting note: was `apply_with hP.holds_for_localization_away { instances := ff }`
have : IsLocalization.Away (1 : R) S := by
apply IsLocalization.away_of_isUnit_of_bijective _ isUnit_one e.bijective
exact RingHom.PropertyIsLocal.HoldsForLocalizationAway hP S (1 : R)
| [
" OfLocalizationSpan P β OfLocalizationFiniteSpan P",
" (β β¦R S : Type uβ¦ [inst : CommRing R] [inst_1 : CommRing S] (f : R β+* S) (s : Set R),\n Ideal.span s = β€ β (β (r : βs), P (Localization.awayMap f βr)) β P f) β\n β β¦R S : Type uβ¦ [inst : CommRing R] [inst_1 : CommRing S] (f : R β+* S) (s : Finset R)... | [
" OfLocalizationSpan P β OfLocalizationFiniteSpan P",
" (β β¦R S : Type uβ¦ [inst : CommRing R] [inst_1 : CommRing S] (f : R β+* S) (s : Set R),\n Ideal.span s = β€ β (β (r : βs), P (Localization.awayMap f βr)) β P f) β\n β β¦R S : Type uβ¦ [inst : CommRing R] [inst_1 : CommRing S] (f : R β+* S) (s : Finset R)... |
import Mathlib.Data.Part
import Mathlib.Data.Rel
#align_import data.pfun from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432"
open Function
def PFun (Ξ± Ξ² : Type*) :=
Ξ± β Part Ξ²
#align pfun PFun
infixr:25 " β. " => PFun
namespace PFun
variable {Ξ± Ξ² Ξ³ Ξ΄ Ξ΅ ΞΉ : Type*}
instance inhabited : Inhabited (Ξ± β. Ξ²) :=
β¨fun _ => Part.noneβ©
#align pfun.inhabited PFun.inhabited
def Dom (f : Ξ± β. Ξ²) : Set Ξ± :=
{ a | (f a).Dom }
#align pfun.dom PFun.Dom
@[simp]
theorem mem_dom (f : Ξ± β. Ξ²) (x : Ξ±) : x β Dom f β β y, y β f x := by simp [Dom, Part.dom_iff_mem]
#align pfun.mem_dom PFun.mem_dom
@[simp]
theorem dom_mk (p : Ξ± β Prop) (f : β a, p a β Ξ²) : (PFun.Dom fun x => β¨p x, f xβ©) = { x | p x } :=
rfl
#align pfun.dom_mk PFun.dom_mk
theorem dom_eq (f : Ξ± β. Ξ²) : Dom f = { x | β y, y β f x } :=
Set.ext (mem_dom f)
#align pfun.dom_eq PFun.dom_eq
def fn (f : Ξ± β. Ξ²) (a : Ξ±) : Dom f a β Ξ² :=
(f a).get
#align pfun.fn PFun.fn
@[simp]
theorem fn_apply (f : Ξ± β. Ξ²) (a : Ξ±) : f.fn a = (f a).get :=
rfl
#align pfun.fn_apply PFun.fn_apply
def evalOpt (f : Ξ± β. Ξ²) [D : DecidablePred (Β· β Dom f)] (x : Ξ±) : Option Ξ² :=
@Part.toOption _ _ (D x)
#align pfun.eval_opt PFun.evalOpt
theorem ext' {f g : Ξ± β. Ξ²} (H1 : β a, a β Dom f β a β Dom g) (H2 : β a p q, f.fn a p = g.fn a q) :
f = g :=
funext fun a => Part.ext' (H1 a) (H2 a)
#align pfun.ext' PFun.ext'
theorem ext {f g : Ξ± β. Ξ²} (H : β a b, b β f a β b β g a) : f = g :=
funext fun a => Part.ext (H a)
#align pfun.ext PFun.ext
def asSubtype (f : Ξ± β. Ξ²) (s : f.Dom) : Ξ² :=
f.fn s s.2
#align pfun.as_subtype PFun.asSubtype
def equivSubtype : (Ξ± β. Ξ²) β Ξ£p : Ξ± β Prop, Subtype p β Ξ² :=
β¨fun f => β¨fun a => (f a).Dom, asSubtype fβ©, fun f x => β¨f.1 x, fun h => f.2 β¨x, hβ©β©, fun f =>
funext fun a => Part.eta _, fun β¨p, fβ© => by dsimp; congrβ©
#align pfun.equiv_subtype PFun.equivSubtype
theorem asSubtype_eq_of_mem {f : Ξ± β. Ξ²} {x : Ξ±} {y : Ξ²} (fxy : y β f x) (domx : x β f.Dom) :
f.asSubtype β¨x, domxβ© = y :=
Part.mem_unique (Part.get_mem _) fxy
#align pfun.as_subtype_eq_of_mem PFun.asSubtype_eq_of_mem
@[coe]
protected def lift (f : Ξ± β Ξ²) : Ξ± β. Ξ² := fun a => Part.some (f a)
#align pfun.lift PFun.lift
instance coe : Coe (Ξ± β Ξ²) (Ξ± β. Ξ²) :=
β¨PFun.liftβ©
#align pfun.has_coe PFun.coe
@[simp]
theorem coe_val (f : Ξ± β Ξ²) (a : Ξ±) : (f : Ξ± β. Ξ²) a = Part.some (f a) :=
rfl
#align pfun.coe_val PFun.coe_val
@[simp]
theorem dom_coe (f : Ξ± β Ξ²) : (f : Ξ± β. Ξ²).Dom = Set.univ :=
rfl
#align pfun.dom_coe PFun.dom_coe
theorem lift_injective : Injective (PFun.lift : (Ξ± β Ξ²) β Ξ± β. Ξ²) := fun _ _ h =>
funext fun a => Part.some_injective <| congr_fun h a
#align pfun.coe_injective PFun.lift_injective
def graph (f : Ξ± β. Ξ²) : Set (Ξ± Γ Ξ²) :=
{ p | p.2 β f p.1 }
#align pfun.graph PFun.graph
def graph' (f : Ξ± β. Ξ²) : Rel Ξ± Ξ² := fun x y => y β f x
#align pfun.graph' PFun.graph'
def ran (f : Ξ± β. Ξ²) : Set Ξ² :=
{ b | β a, b β f a }
#align pfun.ran PFun.ran
def restrict (f : Ξ± β. Ξ²) {p : Set Ξ±} (H : p β f.Dom) : Ξ± β. Ξ² := fun x =>
(f x).restrict (x β p) (@H x)
#align pfun.restrict PFun.restrict
@[simp]
theorem mem_restrict {f : Ξ± β. Ξ²} {s : Set Ξ±} (h : s β f.Dom) (a : Ξ±) (b : Ξ²) :
b β f.restrict h a β a β s β§ b β f a := by simp [restrict]
#align pfun.mem_restrict PFun.mem_restrict
def res (f : Ξ± β Ξ²) (s : Set Ξ±) : Ξ± β. Ξ² :=
(PFun.lift f).restrict s.subset_univ
#align pfun.res PFun.res
| Mathlib/Data/PFun.lean | 189 | 190 | theorem mem_res (f : Ξ± β Ξ²) (s : Set Ξ±) (a : Ξ±) (b : Ξ²) : b β res f s a β a β s β§ f a = b := by |
simp [res, @eq_comm _ b]
| [
" x β f.Dom β β y, y β f x",
" (fun f => β¨fun a => (f a).Dom, f.asSubtypeβ©) ((fun f x => { Dom := f.fst x, get := fun h => f.snd β¨x, hβ© }) β¨p, fβ©) =\n β¨p, fβ©",
" β¨fun a => p a, asSubtype fun x => { Dom := p x, get := fun h => f β¨x, hβ© }β© = β¨p, fβ©",
" b β f.restrict h a β a β s β§ b β f a",
" b β res f s a... | [
" x β f.Dom β β y, y β f x",
" (fun f => β¨fun a => (f a).Dom, f.asSubtypeβ©) ((fun f x => { Dom := f.fst x, get := fun h => f.snd β¨x, hβ© }) β¨p, fβ©) =\n β¨p, fβ©",
" β¨fun a => p a, asSubtype fun x => { Dom := p x, get := fun h => f β¨x, hβ© }β© = β¨p, fβ©",
" b β f.restrict h a β a β s β§ b β f a"
] |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.FDeriv.Comp
import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars
#align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
open scoped Classical
open Topology Filter ENNReal
open Filter Asymptotics Set
open ContinuousLinearMap (smulRight smulRight_one_eq_iff)
variable {π : Type u} [NontriviallyNormedField π]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
section CompositionVector
open ContinuousLinearMap
variable {l : F β E} {l' : F βL[π] E} {y : F}
variable (x)
theorem HasFDerivWithinAt.comp_hasDerivWithinAt {t : Set F} (hl : HasFDerivWithinAt l l' t (f x))
(hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) :
HasDerivWithinAt (l β f) (l' f') s x := by
simpa only [one_apply, one_smul, smulRight_apply, coe_comp', (Β· β Β·)] using
(hl.comp x hf.hasFDerivWithinAt hst).hasDerivWithinAt
#align has_fderiv_within_at.comp_has_deriv_within_at HasFDerivWithinAt.comp_hasDerivWithinAt
theorem HasFDerivWithinAt.comp_hasDerivWithinAt_of_eq {t : Set F}
(hl : HasFDerivWithinAt l l' t y)
(hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) (hy : y = f x) :
HasDerivWithinAt (l β f) (l' f') s x := by
rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf hst
theorem HasFDerivAt.comp_hasDerivWithinAt (hl : HasFDerivAt l l' (f x))
(hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (l β f) (l' f') s x :=
hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf (mapsTo_univ _ _)
#align has_fderiv_at.comp_has_deriv_within_at HasFDerivAt.comp_hasDerivWithinAt
theorem HasFDerivAt.comp_hasDerivWithinAt_of_eq (hl : HasFDerivAt l l' y)
(hf : HasDerivWithinAt f f' s x) (hy : y = f x) :
HasDerivWithinAt (l β f) (l' f') s x := by
rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf
theorem HasFDerivAt.comp_hasDerivAt (hl : HasFDerivAt l l' (f x)) (hf : HasDerivAt f f' x) :
HasDerivAt (l β f) (l' f') x :=
hasDerivWithinAt_univ.mp <| hl.comp_hasDerivWithinAt x hf.hasDerivWithinAt
#align has_fderiv_at.comp_has_deriv_at HasFDerivAt.comp_hasDerivAt
theorem HasFDerivAt.comp_hasDerivAt_of_eq
(hl : HasFDerivAt l l' y) (hf : HasDerivAt f f' x) (hy : y = f x) :
HasDerivAt (l β f) (l' f') x := by
rw [hy] at hl; exact hl.comp_hasDerivAt x hf
theorem HasStrictFDerivAt.comp_hasStrictDerivAt (hl : HasStrictFDerivAt l l' (f x))
(hf : HasStrictDerivAt f f' x) : HasStrictDerivAt (l β f) (l' f') x := by
simpa only [one_apply, one_smul, smulRight_apply, coe_comp', (Β· β Β·)] using
(hl.comp x hf.hasStrictFDerivAt).hasStrictDerivAt
#align has_strict_fderiv_at.comp_has_strict_deriv_at HasStrictFDerivAt.comp_hasStrictDerivAt
theorem HasStrictFDerivAt.comp_hasStrictDerivAt_of_eq (hl : HasStrictFDerivAt l l' y)
(hf : HasStrictDerivAt f f' x) (hy : y = f x) :
HasStrictDerivAt (l β f) (l' f') x := by
rw [hy] at hl; exact hl.comp_hasStrictDerivAt x hf
theorem fderivWithin.comp_derivWithin {t : Set F} (hl : DifferentiableWithinAt π l t (f x))
(hf : DifferentiableWithinAt π f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt π s x) :
derivWithin (l β f) s x = (fderivWithin π l t (f x) : F β E) (derivWithin f s x) :=
(hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf.hasDerivWithinAt hs).derivWithin hxs
#align fderiv_within.comp_deriv_within fderivWithin.comp_derivWithin
theorem fderivWithin.comp_derivWithin_of_eq {t : Set F} (hl : DifferentiableWithinAt π l t y)
(hf : DifferentiableWithinAt π f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt π s x)
(hy : y = f x) :
derivWithin (l β f) s x = (fderivWithin π l t (f x) : F β E) (derivWithin f s x) := by
rw [hy] at hl; exact fderivWithin.comp_derivWithin x hl hf hs hxs
theorem fderiv.comp_deriv (hl : DifferentiableAt π l (f x)) (hf : DifferentiableAt π f x) :
deriv (l β f) x = (fderiv π l (f x) : F β E) (deriv f x) :=
(hl.hasFDerivAt.comp_hasDerivAt x hf.hasDerivAt).deriv
#align fderiv.comp_deriv fderiv.comp_deriv
| Mathlib/Analysis/Calculus/Deriv/Comp.lean | 415 | 418 | theorem fderiv.comp_deriv_of_eq (hl : DifferentiableAt π l y) (hf : DifferentiableAt π f x)
(hy : y = f x) :
deriv (l β f) x = (fderiv π l (f x) : F β E) (deriv f x) := by |
rw [hy] at hl; exact fderiv.comp_deriv x hl hf
| [
" HasDerivWithinAt (l β f) (l' f') s x",
" HasDerivAt (l β f) (l' f') x",
" HasStrictDerivAt (l β f) (l' f') x",
" derivWithin (l β f) s x = (fderivWithin π l t (f x)) (derivWithin f s x)",
" deriv (l β f) x = (fderiv π l (f x)) (deriv f x)"
] | [
" HasDerivWithinAt (l β f) (l' f') s x",
" HasDerivAt (l β f) (l' f') x",
" HasStrictDerivAt (l β f) (l' f') x",
" derivWithin (l β f) s x = (fderivWithin π l t (f x)) (derivWithin f s x)"
] |
import Mathlib.RingTheory.Localization.Basic
#align_import ring_theory.localization.integer from "leanprover-community/mathlib"@"9556784a5b84697562e9c6acb40500d4a82e675a"
variable {R : Type*} [CommSemiring R] {M : Submonoid R} {S : Type*} [CommSemiring S]
variable [Algebra R S] {P : Type*} [CommSemiring P]
open Function
namespace IsLocalization
section
variable (R)
-- TODO: define a subalgebra of `IsInteger`s
def IsInteger (a : S) : Prop :=
a β (algebraMap R S).rangeS
#align is_localization.is_integer IsLocalization.IsInteger
end
theorem isInteger_zero : IsInteger R (0 : S) :=
Subsemiring.zero_mem _
#align is_localization.is_integer_zero IsLocalization.isInteger_zero
theorem isInteger_one : IsInteger R (1 : S) :=
Subsemiring.one_mem _
#align is_localization.is_integer_one IsLocalization.isInteger_one
theorem isInteger_add {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a + b) :=
Subsemiring.add_mem _ ha hb
#align is_localization.is_integer_add IsLocalization.isInteger_add
theorem isInteger_mul {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a * b) :=
Subsemiring.mul_mem _ ha hb
#align is_localization.is_integer_mul IsLocalization.isInteger_mul
theorem isInteger_smul {a : R} {b : S} (hb : IsInteger R b) : IsInteger R (a β’ b) := by
rcases hb with β¨b', hbβ©
use a * b'
rw [β hb, (algebraMap R S).map_mul, Algebra.smul_def]
#align is_localization.is_integer_smul IsLocalization.isInteger_smul
variable (M)
variable [IsLocalization M S]
theorem exists_integer_multiple' (a : S) : β b : M, IsInteger R (a * algebraMap R S b) :=
let β¨β¨Num, denomβ©, hβ© := IsLocalization.surj _ a
β¨denom, Set.mem_range.mpr β¨Num, h.symmβ©β©
#align is_localization.exists_integer_multiple' IsLocalization.exists_integer_multiple'
theorem exists_integer_multiple (a : S) : β b : M, IsInteger R ((b : R) β’ a) := by
simp_rw [Algebra.smul_def, mul_comm _ a]
apply exists_integer_multiple'
#align is_localization.exists_integer_multiple IsLocalization.exists_integer_multiple
| Mathlib/RingTheory/Localization/Integer.lean | 91 | 103 | theorem exist_integer_multiples {ΞΉ : Type*} (s : Finset ΞΉ) (f : ΞΉ β S) :
β b : M, β i β s, IsLocalization.IsInteger R ((b : R) β’ f i) := by |
haveI := Classical.propDecidable
refine β¨β i β s, (sec M (f i)).2, fun i hi => β¨?_, ?_β©β©
Β· exact (β j β s.erase i, (sec M (f j)).2) * (sec M (f i)).1
rw [RingHom.map_mul, sec_spec', β mul_assoc, β (algebraMap R S).map_mul, β Algebra.smul_def]
congr 2
refine _root_.trans ?_ (map_prod (Submonoid.subtype M) _ _).symm
rw [mul_comm,Submonoid.coe_finset_prod,
-- Porting note: explicitly supplied `f`
β Finset.prod_insert (f := fun i => ((sec M (f i)).snd : R)) (s.not_mem_erase i),
Finset.insert_erase hi]
rfl
| [
" IsInteger R (a β’ b)",
" (algebraMap R S) (a * b') = a β’ b",
" β b, IsInteger R (βb β’ a)",
" β b, IsInteger R (a * (algebraMap R S) βb)",
" β b, β i β s, IsInteger R (βb β’ f i)",
" R",
" (algebraMap R S) (β(β j β s.erase i, (sec M (f j)).2) * (sec M (f i)).1) = β(β i β s, (sec M (f i)).2) β’ f i",
" (... | [
" IsInteger R (a β’ b)",
" (algebraMap R S) (a * b') = a β’ b",
" β b, IsInteger R (βb β’ a)",
" β b, IsInteger R (a * (algebraMap R S) βb)"
] |
import Mathlib.CategoryTheory.Sites.Sheaf
import Mathlib.CategoryTheory.Sites.CoverLifting
import Mathlib.CategoryTheory.Adjunction.FullyFaithful
#align_import category_theory.sites.dense_subsite from "leanprover-community/mathlib"@"1d650c2e131f500f3c17f33b4d19d2ea15987f2c"
universe w v u
namespace CategoryTheory
variable {C : Type*} [Category C] {D : Type*} [Category D] {E : Type*} [Category E]
variable (J : GrothendieckTopology C) (K : GrothendieckTopology D)
variable {L : GrothendieckTopology E}
-- Porting note(#5171): removed `@[nolint has_nonempty_instance]`
structure Presieve.CoverByImageStructure (G : C β₯€ D) {V U : D} (f : V βΆ U) where
obj : C
lift : V βΆ G.obj obj
map : G.obj obj βΆ U
fac : lift β« map = f := by aesop_cat
#align category_theory.presieve.cover_by_image_structure CategoryTheory.Presieve.CoverByImageStructure
attribute [nolint docBlame] Presieve.CoverByImageStructure.obj Presieve.CoverByImageStructure.lift
Presieve.CoverByImageStructure.map Presieve.CoverByImageStructure.fac
attribute [reassoc (attr := simp)] Presieve.CoverByImageStructure.fac
def Presieve.coverByImage (G : C β₯€ D) (U : D) : Presieve U := fun _ f =>
Nonempty (Presieve.CoverByImageStructure G f)
#align category_theory.presieve.cover_by_image CategoryTheory.Presieve.coverByImage
def Sieve.coverByImage (G : C β₯€ D) (U : D) : Sieve U :=
β¨Presieve.coverByImage G U, fun β¨β¨Z, fβ, fβ, (e : _ = _)β©β© g =>
β¨β¨Z, g β« fβ, fβ, show (g β« fβ) β« fβ = g β« _ by rw [Category.assoc, β e]β©β©β©
#align category_theory.sieve.cover_by_image CategoryTheory.Sieve.coverByImage
theorem Presieve.in_coverByImage (G : C β₯€ D) {X : D} {Y : C} (f : G.obj Y βΆ X) :
Presieve.coverByImage G X f :=
β¨β¨Y, π _, f, by simpβ©β©
#align category_theory.presieve.in_cover_by_image CategoryTheory.Presieve.in_coverByImage
class Functor.IsCoverDense (G : C β₯€ D) (K : GrothendieckTopology D) : Prop where
is_cover : β U : D, Sieve.coverByImage G U β K U
#align category_theory.cover_dense CategoryTheory.Functor.IsCoverDense
lemma Functor.is_cover_of_isCoverDense (G : C β₯€ D) (K : GrothendieckTopology D)
[G.IsCoverDense K] (U : D) : Sieve.coverByImage G U β K U := by
apply Functor.IsCoverDense.is_cover
lemma Functor.isCoverDense_of_generate_singleton_functor_Ο_mem (G : C β₯€ D)
(K : GrothendieckTopology D)
(h : β B, β (X : C) (f : G.obj X βΆ B), Sieve.generate (Presieve.singleton f) β K B) :
G.IsCoverDense K where
is_cover B := by
obtain β¨X, f, hβ© := h B
refine K.superset_covering ?_ h
intro Y f β¨Z, g, _, h, wβ©
cases h
exact β¨β¨_, g, _, wβ©β©
attribute [nolint docBlame] CategoryTheory.Functor.IsCoverDense.is_cover
open Presieve Opposite
namespace Functor
namespace IsCoverDense
variable {K}
variable {A : Type*} [Category A] (G : C β₯€ D) [G.IsCoverDense K]
-- this is not marked with `@[ext]` because `H` can not be inferred from the type
| Mathlib/CategoryTheory/Sites/DenseSubsite.lean | 124 | 128 | theorem ext (β± : SheafOfTypes K) (X : D) {s t : β±.val.obj (op X)}
(h : β β¦Y : Cβ¦ (f : G.obj Y βΆ X), β±.val.map f.op s = β±.val.map f.op t) : s = t := by |
apply (β±.cond (Sieve.coverByImage G X) (G.is_cover_of_isCoverDense K X)).isSeparatedFor.ext
rintro Y _ β¨Z, fβ, fβ, β¨rflβ©β©
simp [h fβ]
| [
" (g β« fβ) β« fβ = g β« fβ",
" π (G.obj Y) β« f = f",
" Sieve.coverByImage G U β K.sieves U",
" Sieve.coverByImage G B β K.sieves B",
" Sieve.generate (Presieve.singleton f) β€ Sieve.coverByImage G B",
" (Sieve.coverByImage G B).arrows f",
" s = t",
" β β¦Y : Dβ¦ β¦f : Y βΆ Xβ¦, (Sieve.coverByImage G X).arrow... | [
" (g β« fβ) β« fβ = g β« fβ",
" π (G.obj Y) β« f = f",
" Sieve.coverByImage G U β K.sieves U",
" Sieve.coverByImage G B β K.sieves B",
" Sieve.generate (Presieve.singleton f) β€ Sieve.coverByImage G B",
" (Sieve.coverByImage G B).arrows f"
] |
import Mathlib.Algebra.Order.Group.Abs
import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax
#align_import algebra.order.group.min_max from "leanprover-community/mathlib"@"10b4e499f43088dd3bb7b5796184ad5216648ab1"
section
variable {Ξ± : Type*} [Group Ξ±] [LinearOrder Ξ±] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)]
-- TODO: This duplicates `oneLePart_div_leOnePart`
@[to_additive (attr := simp)]
theorem max_one_div_max_inv_one_eq_self (a : Ξ±) : max a 1 / max aβ»ΒΉ 1 = a := by
rcases le_total a 1 with (h | h) <;> simp [h]
#align max_one_div_max_inv_one_eq_self max_one_div_max_inv_one_eq_self
#align max_zero_sub_max_neg_zero_eq_self max_zero_sub_max_neg_zero_eq_self
alias max_zero_sub_eq_self := max_zero_sub_max_neg_zero_eq_self
#align max_zero_sub_eq_self max_zero_sub_eq_self
@[to_additive]
lemma max_inv_one (a : Ξ±) : max aβ»ΒΉ 1 = aβ»ΒΉ * max a 1 := by
rw [eq_inv_mul_iff_mul_eq, β eq_div_iff_mul_eq', max_one_div_max_inv_one_eq_self]
end
section LinearOrderedCommGroup
variable {Ξ± : Type*} [LinearOrderedCommGroup Ξ±] {a b c : Ξ±}
@[to_additive min_neg_neg]
theorem min_inv_inv' (a b : Ξ±) : min aβ»ΒΉ bβ»ΒΉ = (max a b)β»ΒΉ :=
Eq.symm <| (@Monotone.map_max Ξ± Ξ±α΅α΅ _ _ Inv.inv a b) fun _ _ =>
-- Porting note: Explicit `Ξ±` necessary to infer `CovariantClass` instance
(@inv_le_inv_iff Ξ± _ _ _).mpr
#align min_inv_inv' min_inv_inv'
#align min_neg_neg min_neg_neg
@[to_additive max_neg_neg]
theorem max_inv_inv' (a b : Ξ±) : max aβ»ΒΉ bβ»ΒΉ = (min a b)β»ΒΉ :=
Eq.symm <| (@Monotone.map_min Ξ± Ξ±α΅α΅ _ _ Inv.inv a b) fun _ _ =>
-- Porting note: Explicit `Ξ±` necessary to infer `CovariantClass` instance
(@inv_le_inv_iff Ξ± _ _ _).mpr
#align max_inv_inv' max_inv_inv'
#align max_neg_neg max_neg_neg
@[to_additive min_sub_sub_right]
theorem min_div_div_right' (a b c : Ξ±) : min (a / c) (b / c) = min a b / c := by
simpa only [div_eq_mul_inv] using min_mul_mul_right a b cβ»ΒΉ
#align min_div_div_right' min_div_div_right'
#align min_sub_sub_right min_sub_sub_right
@[to_additive max_sub_sub_right]
theorem max_div_div_right' (a b c : Ξ±) : max (a / c) (b / c) = max a b / c := by
simpa only [div_eq_mul_inv] using max_mul_mul_right a b cβ»ΒΉ
#align max_div_div_right' max_div_div_right'
#align max_sub_sub_right max_sub_sub_right
@[to_additive min_sub_sub_left]
| Mathlib/Algebra/Order/Group/MinMax.lean | 69 | 70 | theorem min_div_div_left' (a b c : Ξ±) : min (a / b) (a / c) = a / max b c := by |
simp only [div_eq_mul_inv, min_mul_mul_left, min_inv_inv']
| [
" max a 1 / max aβ»ΒΉ 1 = a",
" max aβ»ΒΉ 1 = aβ»ΒΉ * max a 1",
" min (a / c) (b / c) = min a b / c",
" max (a / c) (b / c) = max a b / c",
" min (a / b) (a / c) = a / max b c"
] | [
" max a 1 / max aβ»ΒΉ 1 = a",
" max aβ»ΒΉ 1 = aβ»ΒΉ * max a 1",
" min (a / c) (b / c) = min a b / c",
" max (a / c) (b / c) = max a b / c"
] |
import Mathlib.Algebra.Group.Prod
import Mathlib.Data.Set.Lattice
#align_import data.nat.pairing from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432"
assert_not_exists MonoidWithZero
open Prod Decidable Function
namespace Nat
-- Porting note: no pp_nodot
--@[pp_nodot]
def pair (a b : β) : β :=
if a < b then b * b + a else a * a + a + b
#align nat.mkpair Nat.pair
-- Porting note: no pp_nodot
--@[pp_nodot]
def unpair (n : β) : β Γ β :=
let s := sqrt n
if n - s * s < s then (n - s * s, s) else (s, n - s * s - s)
#align nat.unpair Nat.unpair
@[simp]
theorem pair_unpair (n : β) : pair (unpair n).1 (unpair n).2 = n := by
dsimp only [unpair]; let s := sqrt n
have sm : s * s + (n - s * s) = n := Nat.add_sub_cancel' (sqrt_le _)
split_ifs with h
Β· simp [pair, h, sm]
Β· have hl : n - s * s - s β€ s := Nat.sub_le_iff_le_add.2
(Nat.sub_le_iff_le_add'.2 <| by rw [β Nat.add_assoc]; apply sqrt_le_add)
simp [pair, hl.not_lt, Nat.add_assoc, Nat.add_sub_cancel' (le_of_not_gt h), sm]
#align nat.mkpair_unpair Nat.pair_unpair
theorem pair_unpair' {n a b} (H : unpair n = (a, b)) : pair a b = n := by
simpa [H] using pair_unpair n
#align nat.mkpair_unpair' Nat.pair_unpair'
@[simp]
theorem unpair_pair (a b : β) : unpair (pair a b) = (a, b) := by
dsimp only [pair]; split_ifs with h
Β· show unpair (b * b + a) = (a, b)
have be : sqrt (b * b + a) = b := sqrt_add_eq _ (le_trans (le_of_lt h) (Nat.le_add_left _ _))
simp [unpair, be, Nat.add_sub_cancel_left, h]
Β· show unpair (a * a + a + b) = (a, b)
have ae : sqrt (a * a + (a + b)) = a := by
rw [sqrt_add_eq]
exact Nat.add_le_add_left (le_of_not_gt h) _
simp [unpair, ae, Nat.not_lt_zero, Nat.add_assoc, Nat.add_sub_cancel_left]
#align nat.unpair_mkpair Nat.unpair_pair
@[simps (config := .asFn)]
def pairEquiv : β Γ β β β :=
β¨uncurry pair, unpair, fun β¨a, bβ© => unpair_pair a b, pair_unpairβ©
#align nat.mkpair_equiv Nat.pairEquiv
#align nat.mkpair_equiv_apply Nat.pairEquiv_apply
#align nat.mkpair_equiv_symm_apply Nat.pairEquiv_symm_apply
theorem surjective_unpair : Surjective unpair :=
pairEquiv.symm.surjective
#align nat.surjective_unpair Nat.surjective_unpair
@[simp]
theorem pair_eq_pair {a b c d : β} : pair a b = pair c d β a = c β§ b = d :=
pairEquiv.injective.eq_iff.trans (@Prod.ext_iff β β (a, b) (c, d))
#align nat.mkpair_eq_mkpair Nat.pair_eq_pair
| Mathlib/Data/Nat/Pairing.lean | 93 | 100 | theorem unpair_lt {n : β} (n1 : 1 β€ n) : (unpair n).1 < n := by |
let s := sqrt n
simp only [unpair, ge_iff_le, Nat.sub_le_iff_le_add]
by_cases h : n - s * s < s <;> simp [h]
Β· exact lt_of_lt_of_le h (sqrt_le_self _)
Β· simp at h
have s0 : 0 < s := sqrt_pos.2 n1
exact lt_of_le_of_lt h (Nat.sub_lt n1 (Nat.mul_pos s0 s0))
| [
" n.unpair.1.pair n.unpair.2 = n",
" (if n - n.sqrt * n.sqrt < n.sqrt then (n - n.sqrt * n.sqrt, n.sqrt)\n else (n.sqrt, n - n.sqrt * n.sqrt - n.sqrt)).1.pair\n (if n - n.sqrt * n.sqrt < n.sqrt then (n - n.sqrt * n.sqrt, n.sqrt)\n else (n.sqrt, n - n.sqrt * n.sqrt - n.sqrt)).2 =\n n",
" ... | [
" n.unpair.1.pair n.unpair.2 = n",
" (if n - n.sqrt * n.sqrt < n.sqrt then (n - n.sqrt * n.sqrt, n.sqrt)\n else (n.sqrt, n - n.sqrt * n.sqrt - n.sqrt)).1.pair\n (if n - n.sqrt * n.sqrt < n.sqrt then (n - n.sqrt * n.sqrt, n.sqrt)\n else (n.sqrt, n - n.sqrt * n.sqrt - n.sqrt)).2 =\n n",
" ... |
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan
import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine
#align_import geometry.euclidean.angle.unoriented.right_angle from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open scoped EuclideanGeometry
open scoped Real
open scoped RealInnerProductSpace
namespace InnerProductGeometry
variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace β V]
theorem norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two (x y : V) :
βx + yβ * βx + yβ = βxβ * βxβ + βyβ * βyβ β angle x y = Ο / 2 := by
rw [norm_add_sq_eq_norm_sq_add_norm_sq_iff_real_inner_eq_zero]
exact inner_eq_zero_iff_angle_eq_pi_div_two x y
#align inner_product_geometry.norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two InnerProductGeometry.norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two
theorem norm_add_sq_eq_norm_sq_add_norm_sq' (x y : V) (h : angle x y = Ο / 2) :
βx + yβ * βx + yβ = βxβ * βxβ + βyβ * βyβ :=
(norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two x y).2 h
#align inner_product_geometry.norm_add_sq_eq_norm_sq_add_norm_sq' InnerProductGeometry.norm_add_sq_eq_norm_sq_add_norm_sq'
| Mathlib/Geometry/Euclidean/Angle/Unoriented/RightAngle.lean | 56 | 59 | theorem norm_sub_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two (x y : V) :
βx - yβ * βx - yβ = βxβ * βxβ + βyβ * βyβ β angle x y = Ο / 2 := by |
rw [norm_sub_sq_eq_norm_sq_add_norm_sq_iff_real_inner_eq_zero]
exact inner_eq_zero_iff_angle_eq_pi_div_two x y
| [
" βx + yβ * βx + yβ = βxβ * βxβ + βyβ * βyβ β angle x y = Ο / 2",
" βͺx, yβ«_β = 0 β angle x y = Ο / 2",
" βx - yβ * βx - yβ = βxβ * βxβ + βyβ * βyβ β angle x y = Ο / 2"
] | [
" βx + yβ * βx + yβ = βxβ * βxβ + βyβ * βyβ β angle x y = Ο / 2",
" βͺx, yβ«_β = 0 β angle x y = Ο / 2"
] |
import Mathlib.Topology.Separation
#align_import topology.sober from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
open Set
variable {Ξ± Ξ² : Type*} [TopologicalSpace Ξ±] [TopologicalSpace Ξ²]
section genericPoint
def IsGenericPoint (x : Ξ±) (S : Set Ξ±) : Prop :=
closure ({x} : Set Ξ±) = S
#align is_generic_point IsGenericPoint
theorem isGenericPoint_def {x : Ξ±} {S : Set Ξ±} : IsGenericPoint x S β closure ({x} : Set Ξ±) = S :=
Iff.rfl
#align is_generic_point_def isGenericPoint_def
theorem IsGenericPoint.def {x : Ξ±} {S : Set Ξ±} (h : IsGenericPoint x S) :
closure ({x} : Set Ξ±) = S :=
h
#align is_generic_point.def IsGenericPoint.def
theorem isGenericPoint_closure {x : Ξ±} : IsGenericPoint x (closure ({x} : Set Ξ±)) :=
refl _
#align is_generic_point_closure isGenericPoint_closure
variable {x y : Ξ±} {S U Z : Set Ξ±}
theorem isGenericPoint_iff_specializes : IsGenericPoint x S β β y, x β€³ y β y β S := by
simp only [specializes_iff_mem_closure, IsGenericPoint, Set.ext_iff]
#align is_generic_point_iff_specializes isGenericPoint_iff_specializes
| Mathlib/Topology/Sober.lean | 107 | 111 | theorem isGenericPoint_iff_forall_closed (hS : IsClosed S) (hxS : x β S) :
IsGenericPoint x S β β Z : Set Ξ±, IsClosed Z β x β Z β S β Z := by |
have : closure {x} β S := closure_minimal (singleton_subset_iff.2 hxS) hS
simp_rw [IsGenericPoint, subset_antisymm_iff, this, true_and_iff, closure, subset_sInter_iff,
mem_setOf_eq, and_imp, singleton_subset_iff]
| [
" IsGenericPoint x S β β (y : Ξ±), x β€³ y β y β S",
" IsGenericPoint x S β β (Z : Set Ξ±), IsClosed Z β x β Z β S β Z"
] | [
" IsGenericPoint x S β β (y : Ξ±), x β€³ y β y β S"
] |
import Mathlib.Data.Nat.Factorial.Basic
import Mathlib.Order.Monotone.Basic
#align_import data.nat.choose.basic from "leanprover-community/mathlib"@"2f3994e1b117b1e1da49bcfb67334f33460c3ce4"
open Nat
namespace Nat
def choose : β β β β β
| _, 0 => 1
| 0, _ + 1 => 0
| n + 1, k + 1 => choose n k + choose n (k + 1)
#align nat.choose Nat.choose
@[simp]
theorem choose_zero_right (n : β) : choose n 0 = 1 := by cases n <;> rfl
#align nat.choose_zero_right Nat.choose_zero_right
@[simp]
theorem choose_zero_succ (k : β) : choose 0 (succ k) = 0 :=
rfl
#align nat.choose_zero_succ Nat.choose_zero_succ
theorem choose_succ_succ (n k : β) : choose (succ n) (succ k) = choose n k + choose n (succ k) :=
rfl
#align nat.choose_succ_succ Nat.choose_succ_succ
theorem choose_succ_succ' (n k : β) : choose (n + 1) (k + 1) = choose n k + choose n (k + 1) :=
rfl
theorem choose_eq_zero_of_lt : β {n k}, n < k β choose n k = 0
| _, 0, hk => absurd hk (Nat.not_lt_zero _)
| 0, k + 1, _ => choose_zero_succ _
| n + 1, k + 1, hk => by
have hnk : n < k := lt_of_succ_lt_succ hk
have hnk1 : n < k + 1 := lt_of_succ_lt hk
rw [choose_succ_succ, choose_eq_zero_of_lt hnk, choose_eq_zero_of_lt hnk1]
#align nat.choose_eq_zero_of_lt Nat.choose_eq_zero_of_lt
@[simp]
theorem choose_self (n : β) : choose n n = 1 := by
induction n <;> simp [*, choose, choose_eq_zero_of_lt (lt_succ_self _)]
#align nat.choose_self Nat.choose_self
@[simp]
theorem choose_succ_self (n : β) : choose n (succ n) = 0 :=
choose_eq_zero_of_lt (lt_succ_self _)
#align nat.choose_succ_self Nat.choose_succ_self
@[simp]
lemma choose_one_right (n : β) : choose n 1 = n := by induction n <;> simp [*, choose, Nat.add_comm]
#align nat.choose_one_right Nat.choose_one_right
-- The `n+1`-st triangle number is `n` more than the `n`-th triangle number
theorem triangle_succ (n : β) : (n + 1) * (n + 1 - 1) / 2 = n * (n - 1) / 2 + n := by
rw [β add_mul_div_left, Nat.mul_comm 2 n, β Nat.mul_add, Nat.add_sub_cancel, Nat.mul_comm]
cases n <;> rfl; apply zero_lt_succ
#align nat.triangle_succ Nat.triangle_succ
theorem choose_two_right (n : β) : choose n 2 = n * (n - 1) / 2 := by
induction' n with n ih
Β· simp
Β· rw [triangle_succ n, choose, ih]
simp [Nat.add_comm]
#align nat.choose_two_right Nat.choose_two_right
theorem choose_pos : β {n k}, k β€ n β 0 < choose n k
| 0, _, hk => by rw [Nat.eq_zero_of_le_zero hk]; decide
| n + 1, 0, _ => by simp
| n + 1, k + 1, hk => Nat.add_pos_left (choose_pos (le_of_succ_le_succ hk)) _
#align nat.choose_pos Nat.choose_pos
theorem choose_eq_zero_iff {n k : β} : n.choose k = 0 β n < k :=
β¨fun h => lt_of_not_ge (mt Nat.choose_pos h.symm.not_lt), Nat.choose_eq_zero_of_ltβ©
#align nat.choose_eq_zero_iff Nat.choose_eq_zero_iff
theorem succ_mul_choose_eq : β n k, succ n * choose n k = choose (succ n) (succ k) * succ k
| 0, 0 => by decide
| 0, k + 1 => by simp [choose]
| n + 1, 0 => by simp [choose, mul_succ, succ_eq_add_one, Nat.add_comm]
| n + 1, k + 1 => by
rw [choose_succ_succ (succ n) (succ k), Nat.add_mul, β succ_mul_choose_eq n, mul_succ, β
succ_mul_choose_eq n, Nat.add_right_comm, β Nat.mul_add, β choose_succ_succ, β succ_mul]
#align nat.succ_mul_choose_eq Nat.succ_mul_choose_eq
| Mathlib/Data/Nat/Choose/Basic.lean | 125 | 142 | theorem choose_mul_factorial_mul_factorial : β {n k}, k β€ n β choose n k * k ! * (n - k)! = n !
| 0, _, hk => by simp [Nat.eq_zero_of_le_zero hk]
| n + 1, 0, _ => by simp
| n + 1, succ k, hk => by
rcases lt_or_eq_of_le hk with hkβ | hkβ
Β· have h : choose n k * k.succ ! * (n - k)! = (k + 1) * n ! := by |
rw [β choose_mul_factorial_mul_factorial (le_of_succ_le_succ hk)]
simp [factorial_succ, Nat.mul_comm, Nat.mul_left_comm, Nat.mul_assoc]
have hβ : (n - k)! = (n - k) * (n - k.succ)! := by
rw [β succ_sub_succ, succ_sub (le_of_lt_succ hkβ), factorial_succ]
have hβ : choose n (succ k) * k.succ ! * ((n - k) * (n - k.succ)!) = (n - k) * n ! := by
rw [β choose_mul_factorial_mul_factorial (le_of_lt_succ hkβ)]
simp [factorial_succ, Nat.mul_comm, Nat.mul_left_comm, Nat.mul_assoc]
have hβ : k * n ! β€ n * n ! := Nat.mul_le_mul_right _ (le_of_succ_le_succ hk)
rw [choose_succ_succ, Nat.add_mul, Nat.add_mul, succ_sub_succ, h, hβ, hβ, Nat.add_mul,
Nat.mul_sub_right_distrib, factorial_succ, β Nat.add_sub_assoc hβ, Nat.add_assoc,
β Nat.add_mul, Nat.add_sub_cancel_left, Nat.add_comm]
Β· rw [hkβ]; simp [hkβ, Nat.mul_comm, choose, Nat.sub_self]
| [
" n.choose 0 = 1",
" choose 0 0 = 1",
" (nβ + 1).choose 0 = 1",
" (n + 1).choose (k + 1) = 0",
" n.choose n = 1",
" (nβ + 1).choose (nβ + 1) = 1",
" n.choose 1 = n",
" choose 0 1 = 0",
" (nβ + 1).choose 1 = nβ + 1",
" (n + 1) * (n + 1 - 1) / 2 = n * (n - 1) / 2 + n",
" n * (n + 1) / 2 = n * (n -... | [
" n.choose 0 = 1",
" choose 0 0 = 1",
" (nβ + 1).choose 0 = 1",
" (n + 1).choose (k + 1) = 0",
" n.choose n = 1",
" (nβ + 1).choose (nβ + 1) = 1",
" n.choose 1 = n",
" choose 0 1 = 0",
" (nβ + 1).choose 1 = nβ + 1",
" (n + 1) * (n + 1 - 1) / 2 = n * (n - 1) / 2 + n",
" n * (n + 1) / 2 = n * (n -... |
import Mathlib.Algebra.Polynomial.Eval
import Mathlib.RingTheory.Ideal.Quotient
#align_import linear_algebra.smodeq from "leanprover-community/mathlib"@"146d3d1fa59c091fedaad8a4afa09d6802886d24"
open Submodule
open Polynomial
variable {R : Type*} [Ring R]
variable {A : Type*} [CommRing A]
variable {M : Type*} [AddCommGroup M] [Module R M] (U Uβ Uβ : Submodule R M)
variable {x xβ xβ y yβ yβ z zβ zβ : M}
variable {N : Type*} [AddCommGroup N] [Module R N] (V Vβ Vβ : Submodule R N)
set_option backward.isDefEq.lazyWhnfCore false in -- See https://github.com/leanprover-community/mathlib4/issues/12534
def SModEq (x y : M) : Prop :=
(Submodule.Quotient.mk x : M β§Έ U) = Submodule.Quotient.mk y
#align smodeq SModEq
notation:50 x " β‘ " y " [SMOD " N "]" => SModEq N x y
variable {U Uβ Uβ}
set_option backward.isDefEq.lazyWhnfCore false in -- See https://github.com/leanprover-community/mathlib4/issues/12534
protected theorem SModEq.def :
x β‘ y [SMOD U] β (Submodule.Quotient.mk x : M β§Έ U) = Submodule.Quotient.mk y :=
Iff.rfl
#align smodeq.def SModEq.def
namespace SModEq
theorem sub_mem : x β‘ y [SMOD U] β x - y β U := by rw [SModEq.def, Submodule.Quotient.eq]
#align smodeq.sub_mem SModEq.sub_mem
@[simp]
theorem top : x β‘ y [SMOD (β€ : Submodule R M)] :=
(Submodule.Quotient.eq β€).2 mem_top
#align smodeq.top SModEq.top
@[simp]
| Mathlib/LinearAlgebra/SModEq.lean | 53 | 54 | theorem bot : x β‘ y [SMOD (β₯ : Submodule R M)] β x = y := by |
rw [SModEq.def, Submodule.Quotient.eq, mem_bot, sub_eq_zero]
| [
" x β‘ y [SMOD U] β x - y β U",
" x β‘ y [SMOD β₯] β x = y"
] | [
" x β‘ y [SMOD U] β x - y β U"
] |
import Mathlib.Algebra.Group.Basic
import Mathlib.Order.Basic
import Mathlib.Order.Monotone.Basic
#align_import algebra.covariant_and_contravariant from "leanprover-community/mathlib"@"2258b40dacd2942571c8ce136215350c702dc78f"
-- TODO: convert `ExistsMulOfLE`, `ExistsAddOfLE`?
-- TODO: relationship with `Con/AddCon`
-- TODO: include equivalence of `LeftCancelSemigroup` with
-- `Semigroup PartialOrder ContravariantClass Ξ± Ξ± (*) (β€)`?
-- TODO : use β, as per Eric's suggestion? See
-- https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/ordered.20stuff/near/236148738
-- for a discussion.
open Function
section Variants
variable {M N : Type*} (ΞΌ : M β N β N) (r : N β N β Prop)
variable (M N)
def Covariant : Prop :=
β (m) {nβ nβ}, r nβ nβ β r (ΞΌ m nβ) (ΞΌ m nβ)
#align covariant Covariant
def Contravariant : Prop :=
β (m) {nβ nβ}, r (ΞΌ m nβ) (ΞΌ m nβ) β r nβ nβ
#align contravariant Contravariant
class CovariantClass : Prop where
protected elim : Covariant M N ΞΌ r
#align covariant_class CovariantClass
class ContravariantClass : Prop where
protected elim : Contravariant M N ΞΌ r
#align contravariant_class ContravariantClass
theorem rel_iff_cov [CovariantClass M N ΞΌ r] [ContravariantClass M N ΞΌ r] (m : M) {a b : N} :
r (ΞΌ m a) (ΞΌ m b) β r a b :=
β¨ContravariantClass.elim _, CovariantClass.elim _β©
#align rel_iff_cov rel_iff_cov
section Covariant
variable {M N ΞΌ r} [CovariantClass M N ΞΌ r]
theorem act_rel_act_of_rel (m : M) {a b : N} (ab : r a b) : r (ΞΌ m a) (ΞΌ m b) :=
CovariantClass.elim _ ab
#align act_rel_act_of_rel act_rel_act_of_rel
@[to_additive]
theorem Group.covariant_iff_contravariant [Group N] :
Covariant N N (Β· * Β·) r β Contravariant N N (Β· * Β·) r := by
refine β¨fun h a b c bc β¦ ?_, fun h a b c bc β¦ ?_β©
Β· rw [β inv_mul_cancel_left a b, β inv_mul_cancel_left a c]
exact h aβ»ΒΉ bc
Β· rw [β inv_mul_cancel_left a b, β inv_mul_cancel_left a c] at bc
exact h aβ»ΒΉ bc
#align group.covariant_iff_contravariant Group.covariant_iff_contravariant
#align add_group.covariant_iff_contravariant AddGroup.covariant_iff_contravariant
@[to_additive]
instance (priority := 100) Group.covconv [Group N] [CovariantClass N N (Β· * Β·) r] :
ContravariantClass N N (Β· * Β·) r :=
β¨Group.covariant_iff_contravariant.mp CovariantClass.elimβ©
@[to_additive]
theorem Group.covariant_swap_iff_contravariant_swap [Group N] :
Covariant N N (swap (Β· * Β·)) r β Contravariant N N (swap (Β· * Β·)) r := by
refine β¨fun h a b c bc β¦ ?_, fun h a b c bc β¦ ?_β©
Β· rw [β mul_inv_cancel_right b a, β mul_inv_cancel_right c a]
exact h aβ»ΒΉ bc
Β· rw [β mul_inv_cancel_right b a, β mul_inv_cancel_right c a] at bc
exact h aβ»ΒΉ bc
#align group.covariant_swap_iff_contravariant_swap Group.covariant_swap_iff_contravariant_swap
#align add_group.covariant_swap_iff_contravariant_swap AddGroup.covariant_swap_iff_contravariant_swap
@[to_additive]
instance (priority := 100) Group.covconv_swap [Group N] [CovariantClass N N (swap (Β· * Β·)) r] :
ContravariantClass N N (swap (Β· * Β·)) r :=
β¨Group.covariant_swap_iff_contravariant_swap.mp CovariantClass.elimβ©
-- Lemma with 4 elements.
| Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean | 281 | 286 | theorem covariant_le_of_covariant_lt [PartialOrder N] :
Covariant M N ΞΌ (Β· < Β·) β Covariant M N ΞΌ (Β· β€ Β·) := by |
intro h a b c bc
rcases bc.eq_or_lt with (rfl | bc)
Β· exact le_rfl
Β· exact (h _ bc).le
| [
" Covariant N N (fun x x_1 => x * x_1) r β Contravariant N N (fun x x_1 => x * x_1) r",
" r b c",
" r (aβ»ΒΉ * (a * b)) (aβ»ΒΉ * (a * c))",
" r ((fun x x_1 => x * x_1) a b) ((fun x x_1 => x * x_1) a c)",
" Covariant N N (swap fun x x_1 => x * x_1) r β Contravariant N N (swap fun x x_1 => x * x_1) r",
" r (b *... | [
" Covariant N N (fun x x_1 => x * x_1) r β Contravariant N N (fun x x_1 => x * x_1) r",
" r b c",
" r (aβ»ΒΉ * (a * b)) (aβ»ΒΉ * (a * c))",
" r ((fun x x_1 => x * x_1) a b) ((fun x x_1 => x * x_1) a c)",
" Covariant N N (swap fun x x_1 => x * x_1) r β Contravariant N N (swap fun x x_1 => x * x_1) r",
" r (b *... |
import Mathlib.Topology.Constructions
#align_import topology.continuous_on from "leanprover-community/mathlib"@"d4f691b9e5f94cfc64639973f3544c95f8d5d494"
open Set Filter Function Topology Filter
variable {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*} {Ξ΄ : Type*}
variable [TopologicalSpace Ξ±]
@[simp]
theorem nhds_bind_nhdsWithin {a : Ξ±} {s : Set Ξ±} : ((π a).bind fun x => π[s] x) = π[s] a :=
bind_inf_principal.trans <| congr_argβ _ nhds_bind_nhds rfl
#align nhds_bind_nhds_within nhds_bind_nhdsWithin
@[simp]
theorem eventually_nhds_nhdsWithin {a : Ξ±} {s : Set Ξ±} {p : Ξ± β Prop} :
(βαΆ y in π a, βαΆ x in π[s] y, p x) β βαΆ x in π[s] a, p x :=
Filter.ext_iff.1 nhds_bind_nhdsWithin { x | p x }
#align eventually_nhds_nhds_within eventually_nhds_nhdsWithin
theorem eventually_nhdsWithin_iff {a : Ξ±} {s : Set Ξ±} {p : Ξ± β Prop} :
(βαΆ x in π[s] a, p x) β βαΆ x in π a, x β s β p x :=
eventually_inf_principal
#align eventually_nhds_within_iff eventually_nhdsWithin_iff
theorem frequently_nhdsWithin_iff {z : Ξ±} {s : Set Ξ±} {p : Ξ± β Prop} :
(βαΆ x in π[s] z, p x) β βαΆ x in π z, p x β§ x β s :=
frequently_inf_principal.trans <| by simp only [and_comm]
#align frequently_nhds_within_iff frequently_nhdsWithin_iff
| Mathlib/Topology/ContinuousOn.lean | 57 | 59 | theorem mem_closure_ne_iff_frequently_within {z : Ξ±} {s : Set Ξ±} :
z β closure (s \ {z}) β βαΆ x in π[β ] z, x β s := by |
simp [mem_closure_iff_frequently, frequently_nhdsWithin_iff]
| [
" (βαΆ (x : Ξ±) in π z, x β s β§ p x) β βαΆ (x : Ξ±) in π z, p x β§ x β s",
" z β closure (s \\ {z}) β βαΆ (x : Ξ±) in π[β ] z, x β s"
] | [
" (βαΆ (x : Ξ±) in π z, x β s β§ p x) β βαΆ (x : Ξ±) in π z, p x β§ x β s"
] |
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.Ray
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
open Convex Pointwise Set Metric
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
| Mathlib/Analysis/Convex/StrictConvexSpace.lean | 76 | 81 | theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by |
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
| [
" StrictConvex π (closedBall x r)",
" StrictConvex π (x +α΅₯ closedBall 0 r)"
] | [] |
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β©
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
theorem HasCountableSeparatingOn.mono {Ξ±} {pβ pβ : Set Ξ± β Prop} {tβ tβ : Set Ξ±}
[h : HasCountableSeparatingOn Ξ± pβ tβ] (hp : β s, pβ s β pβ s) (ht : tβ β tβ) :
HasCountableSeparatingOn Ξ± pβ tβ where
exists_countable_separating :=
let β¨S, hSc, hSp, hStβ© := h.1
β¨S, hSc, fun s hs β¦ hp s (hSp s hs), fun x hx y hy β¦ hSt x (ht hx) y (ht hy)β©
theorem HasCountableSeparatingOn.of_subtype {Ξ± : Type*} {p : Set Ξ± β Prop} {t : Set Ξ±}
{q : Set t β Prop} [h : HasCountableSeparatingOn t q univ]
(hpq : β U, q U β β V, p V β§ (β) β»ΒΉ' V = U) : HasCountableSeparatingOn Ξ± p t := by
rcases h.1 with β¨S, hSc, hSq, hSβ©
choose! V hpV hV using fun s hs β¦ hpq s (hSq s hs)
refine β¨β¨V '' S, hSc.image _, forall_mem_image.2 hpV, fun x hx y hy h β¦ ?_β©β©
refine congr_arg Subtype.val (hS β¨x, hxβ© trivial β¨y, hyβ© trivial fun U hU β¦ ?_)
rw [β hV U hU]
exact h _ (mem_image_of_mem _ hU)
theorem HasCountableSeparatingOn.subtype_iff {Ξ± : Type*} {p : Set Ξ± β Prop} {t : Set Ξ±} :
HasCountableSeparatingOn t (fun u β¦ β v, p v β§ (β) β»ΒΉ' v = u) univ β
HasCountableSeparatingOn Ξ± p t := by
constructor <;> intro h
Β· exact h.of_subtype $ fun s β¦ id
rcases h with β¨S, Sct, Sp, hSβ©
use {Subtype.val β»ΒΉ' s | s β S}, Sct.image _, ?_, ?_
Β· rintro u β¨t, tS, rflβ©
exact β¨t, Sp _ tS, rflβ©
rintro x - y - hxy
exact Subtype.val_injective $ hS _ (Subtype.coe_prop _) _ (Subtype.coe_prop _)
fun s hs β¦ hxy (Subtype.val β»ΒΉ' s) β¨s, hs, rflβ©
namespace Filter
variable {l : Filter Ξ±} [CountableInterFilter l] {f g : Ξ± β Ξ²}
| Mathlib/Order/Filter/CountableSeparatingOn.lean | 158 | 172 | theorem exists_subset_subsingleton_mem_of_forall_separating (p : Set Ξ± β Prop)
{s : Set Ξ±} [h : HasCountableSeparatingOn Ξ± p s] (hs : s β l)
(hl : β U, p U β U β l β¨ UαΆ β l) : β t, t β s β§ t.Subsingleton β§ t β l := by |
rcases h.1 with β¨S, hSc, hSp, hSβ©
refine β¨s β© ββ (S β© l.sets) β© β (U β S) (_ : UαΆ β l), UαΆ, ?_, ?_, ?_β©
Β· exact fun _ h β¦ h.1.1
Β· intro x hx y hy
simp only [mem_sInter, mem_inter_iff, mem_iInter, mem_compl_iff] at hx hy
refine hS x hx.1.1 y hy.1.1 (fun s hsS β¦ ?_)
cases hl s (hSp s hsS) with
| inl hsl => simp only [hx.1.2 s β¨hsS, hslβ©, hy.1.2 s β¨hsS, hslβ©]
| inr hsl => simp only [hx.2 s hsS hsl, hy.2 s hsS hsl]
Β· exact inter_mem
(inter_mem hs ((countable_sInter_mem (hSc.mono inter_subset_left)).2 fun _ h β¦ h.2))
((countable_bInter_mem hSc).2 fun U hU β¦ iInter_mem.2 id)
| [
" β 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",
" HasCountableSeparatingOn Ξ± p t",
" x = y",
" β¨x, hxβ© β U β β¨y, hyβ© β U",
" β¨x, hxβ© β Subtype.val β»ΒΉ' V U β β¨y, hyβ© β Subtype.val β»ΒΉ... | [
" β 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",
" HasCountableSeparatingOn Ξ± p t",
" x = y",
" β¨x, hxβ© β U β β¨y, hyβ© β U",
" β¨x, hxβ© β Subtype.val β»ΒΉ' V U β β¨y, hyβ© β Subtype.val β»ΒΉ... |
import Mathlib.Algebra.Lie.Submodule
#align_import algebra.lie.ideal_operations from "leanprover-community/mathlib"@"8983bec7cdf6cb2dd1f21315c8a34ab00d7b2f6d"
universe u v w wβ wβ
namespace LieSubmodule
variable {R : Type u} {L : Type v} {M : Type w} {Mβ : Type wβ}
variable [CommRing R] [LieRing L] [LieAlgebra R L]
variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
variable [AddCommGroup Mβ] [Module R Mβ] [LieRingModule L Mβ] [LieModule R L Mβ]
variable (N N' : LieSubmodule R L M) (I J : LieIdeal R L) (Nβ : LieSubmodule R L Mβ)
section LieIdealOperations
instance hasBracket : Bracket (LieIdeal R L) (LieSubmodule R L M) :=
β¨fun I N => lieSpan R L { m | β (x : I) (n : N), β
(x : L), (n : M)β = m }β©
#align lie_submodule.has_bracket LieSubmodule.hasBracket
theorem lieIdeal_oper_eq_span :
β
I, Nβ = lieSpan R L { m | β (x : I) (n : N), β
(x : L), (n : M)β = m } :=
rfl
#align lie_submodule.lie_ideal_oper_eq_span LieSubmodule.lieIdeal_oper_eq_span
theorem lieIdeal_oper_eq_linear_span :
(ββ
I, Nβ : Submodule R M) =
Submodule.span R { m | β (x : I) (n : N), β
(x : L), (n : M)β = m } := by
apply le_antisymm
Β· let s := { m : M | β (x : β₯I) (n : β₯N), β
(x : L), (n : M)β = m }
have aux : β (y : L), β m' β Submodule.span R s, β
y, m'β β Submodule.span R s := by
intro y m' hm'
refine Submodule.span_induction (R := R) (M := M) (s := s)
(p := fun m' β¦ β
y, m'β β Submodule.span R s) hm' ?_ ?_ ?_ ?_
Β· rintro m'' β¨x, n, hm''β©; rw [β hm'', leibniz_lie]
refine Submodule.add_mem _ ?_ ?_ <;> apply Submodule.subset_span
Β· use β¨β
y, βxβ, I.lie_mem x.propertyβ©, n
Β· use x, β¨β
y, βnβ, N.lie_mem n.propertyβ©
Β· simp only [lie_zero, Submodule.zero_mem]
Β· intro mβ mβ hmβ hmβ; rw [lie_add]; exact Submodule.add_mem _ hmβ hmβ
Β· intro t m'' hm''; rw [lie_smul]; exact Submodule.smul_mem _ t hm''
change _ β€ ({ Submodule.span R s with lie_mem := fun hm' => aux _ _ hm' } : LieSubmodule R L M)
rw [lieIdeal_oper_eq_span, lieSpan_le]
exact Submodule.subset_span
Β· rw [lieIdeal_oper_eq_span]; apply submodule_span_le_lieSpan
#align lie_submodule.lie_ideal_oper_eq_linear_span LieSubmodule.lieIdeal_oper_eq_linear_span
theorem lieIdeal_oper_eq_linear_span' :
(ββ
I, Nβ : Submodule R M) = Submodule.span R { m | β x β I, β n β N, β
x, nβ = m } := by
rw [lieIdeal_oper_eq_linear_span]
congr
ext m
constructor
Β· rintro β¨β¨x, hxβ©, β¨n, hnβ©, rflβ©
exact β¨x, hx, n, hn, rflβ©
Β· rintro β¨x, hx, n, hn, rflβ©
exact β¨β¨x, hxβ©, β¨n, hnβ©, rflβ©
#align lie_submodule.lie_ideal_oper_eq_linear_span' LieSubmodule.lieIdeal_oper_eq_linear_span'
| Mathlib/Algebra/Lie/IdealOperations.lean | 96 | 100 | theorem lie_le_iff : β
I, Nβ β€ N' β β x β I, β m β N, β
x, mβ β N' := by |
rw [lieIdeal_oper_eq_span, LieSubmodule.lieSpan_le]
refine β¨fun h x hx m hm => h β¨β¨x, hxβ©, β¨m, hmβ©, rflβ©, ?_β©
rintro h _ β¨β¨x, hxβ©, β¨m, hmβ©, rflβ©
exact h x hx m hm
| [
" ββ
I, Nβ = Submodule.span R {m | β x n, β
βx, βnβ = m}",
" ββ
I, Nβ β€ Submodule.span R {m | β x n, β
βx, βnβ = m}",
" β (y : L), β m' β Submodule.span R s, β
y, m'β β Submodule.span R s",
" β
y, m'β β Submodule.span R s",
" β x β s, (fun m' => β
y, m'β β Submodule.span R s) x",
" β
y, m''β β Submodule.span R s"... | [
" ββ
I, Nβ = Submodule.span R {m | β x n, β
βx, βnβ = m}",
" ββ
I, Nβ β€ Submodule.span R {m | β x n, β
βx, βnβ = m}",
" β (y : L), β m' β Submodule.span R s, β
y, m'β β Submodule.span R s",
" β
y, m'β β Submodule.span R s",
" β x β s, (fun m' => β
y, m'β β Submodule.span R s) x",
" β
y, m''β β Submodule.span R s"... |
import Mathlib.Data.Nat.Defs
import Mathlib.Order.Interval.Set.Basic
import Mathlib.Tactic.Monotonicity.Attr
#align_import data.nat.log from "leanprover-community/mathlib"@"3e00d81bdcbf77c8188bbd18f5524ddc3ed8cac6"
namespace Nat
--@[pp_nodot] porting note: unknown attribute
def log (b : β) : β β β
| n => if h : b β€ n β§ 1 < b then log b (n / b) + 1 else 0
decreasing_by
-- putting this in the def triggers the `unusedHavesSuffices` linter:
-- https://github.com/leanprover-community/batteries/issues/428
have : n / b < n := div_lt_self ((Nat.zero_lt_one.trans h.2).trans_le h.1) h.2
decreasing_trivial
#align nat.log Nat.log
@[simp]
theorem log_eq_zero_iff {b n : β} : log b n = 0 β n < b β¨ b β€ 1 := by
rw [log, dite_eq_right_iff]
simp only [Nat.add_eq_zero_iff, Nat.one_ne_zero, and_false, imp_false, not_and_or, not_le, not_lt]
#align nat.log_eq_zero_iff Nat.log_eq_zero_iff
theorem log_of_lt {b n : β} (hb : n < b) : log b n = 0 :=
log_eq_zero_iff.2 (Or.inl hb)
#align nat.log_of_lt Nat.log_of_lt
theorem log_of_left_le_one {b : β} (hb : b β€ 1) (n) : log b n = 0 :=
log_eq_zero_iff.2 (Or.inr hb)
#align nat.log_of_left_le_one Nat.log_of_left_le_one
@[simp]
theorem log_pos_iff {b n : β} : 0 < log b n β b β€ n β§ 1 < b := by
rw [Nat.pos_iff_ne_zero, Ne, log_eq_zero_iff, not_or, not_lt, not_le]
#align nat.log_pos_iff Nat.log_pos_iff
theorem log_pos {b n : β} (hb : 1 < b) (hbn : b β€ n) : 0 < log b n :=
log_pos_iff.2 β¨hbn, hbβ©
#align nat.log_pos Nat.log_pos
theorem log_of_one_lt_of_le {b n : β} (h : 1 < b) (hn : b β€ n) : log b n = log b (n / b) + 1 := by
rw [log]
exact if_pos β¨hn, hβ©
#align nat.log_of_one_lt_of_le Nat.log_of_one_lt_of_le
@[simp] lemma log_zero_left : β n, log 0 n = 0 := log_of_left_le_one $ Nat.zero_le _
#align nat.log_zero_left Nat.log_zero_left
@[simp]
theorem log_zero_right (b : β) : log b 0 = 0 :=
log_eq_zero_iff.2 (le_total 1 b)
#align nat.log_zero_right Nat.log_zero_right
@[simp]
theorem log_one_left : β n, log 1 n = 0 :=
log_of_left_le_one le_rfl
#align nat.log_one_left Nat.log_one_left
@[simp]
theorem log_one_right (b : β) : log b 1 = 0 :=
log_eq_zero_iff.2 (lt_or_le _ _)
#align nat.log_one_right Nat.log_one_right
theorem pow_le_iff_le_log {b : β} (hb : 1 < b) {x y : β} (hy : y β 0) :
b ^ x β€ y β x β€ log b y := by
induction' y using Nat.strong_induction_on with y ih generalizing x
cases x with
| zero => dsimp; omega
| succ x =>
rw [log]; split_ifs with h
Β· have b_pos : 0 < b := lt_of_succ_lt hb
rw [Nat.add_le_add_iff_right, β ih (y / b) (div_lt_self
(Nat.pos_iff_ne_zero.2 hy) hb) (Nat.div_pos h.1 b_pos).ne', le_div_iff_mul_le b_pos,
pow_succ', Nat.mul_comm]
Β· exact iff_of_false (fun hby => h β¨(le_self_pow x.succ_ne_zero _).trans hby, hbβ©)
(not_succ_le_zero _)
#align nat.pow_le_iff_le_log Nat.pow_le_iff_le_log
theorem lt_pow_iff_log_lt {b : β} (hb : 1 < b) {x y : β} (hy : y β 0) : y < b ^ x β log b y < x :=
lt_iff_lt_of_le_iff_le (pow_le_iff_le_log hb hy)
#align nat.lt_pow_iff_log_lt Nat.lt_pow_iff_log_lt
| Mathlib/Data/Nat/Log.lean | 108 | 111 | theorem pow_le_of_le_log {b x y : β} (hy : y β 0) (h : x β€ log b y) : b ^ x β€ y := by |
refine (le_or_lt b 1).elim (fun hb => ?_) fun hb => (pow_le_iff_le_log hb hy).2 h
rw [log_of_left_le_one hb, Nat.le_zero] at h
rwa [h, Nat.pow_zero, one_le_iff_ne_zero]
| [
" (invImage (fun x => x) instWellFoundedRelationOfSizeOf).1 (n / b) aβ",
" b.log n = 0 β n < b β¨ b β€ 1",
" (β (h : b β€ n β§ 1 < b), b.log (n / b) + 1 = 0) β n < b β¨ b β€ 1",
" 0 < b.log n β b β€ n β§ 1 < b",
" b.log n = b.log (n / b) + 1",
" (if h : b β€ n β§ 1 < b then b.log (n / b) + 1 else 0) = b.log (n / b)... | [
" (invImage (fun x => x) instWellFoundedRelationOfSizeOf).1 (n / b) aβ",
" b.log n = 0 β n < b β¨ b β€ 1",
" (β (h : b β€ n β§ 1 < b), b.log (n / b) + 1 = 0) β n < b β¨ b β€ 1",
" 0 < b.log n β b β€ n β§ 1 < b",
" b.log n = b.log (n / b) + 1",
" (if h : b β€ n β§ 1 < b then b.log (n / b) + 1 else 0) = b.log (n / b)... |
import Mathlib.Analysis.Normed.Group.InfiniteSum
import Mathlib.Topology.Instances.ENNReal
#align_import analysis.calculus.series from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Set Metric TopologicalSpace Function Filter
open scoped Topology NNReal
variable {Ξ± Ξ² F : Type*} [NormedAddCommGroup F] [CompleteSpace F] {u : Ξ± β β}
theorem tendstoUniformlyOn_tsum {f : Ξ± β Ξ² β F} (hu : Summable u) {s : Set Ξ²}
(hfu : β n x, x β s β βf n xβ β€ u n) :
TendstoUniformlyOn (fun t : Finset Ξ± => fun x => β n β t, f n x) (fun x => β' n, f n x) atTop
s := by
refine tendstoUniformlyOn_iff.2 fun Ξ΅ Ξ΅pos => ?_
filter_upwards [(tendsto_order.1 (tendsto_tsum_compl_atTop_zero u)).2 _ Ξ΅pos] with t ht x hx
have A : Summable fun n => βf n xβ :=
.of_nonneg_of_le (fun _ β¦ norm_nonneg _) (fun n => hfu n x hx) hu
rw [dist_eq_norm, β sum_add_tsum_subtype_compl A.of_norm t, add_sub_cancel_left]
apply lt_of_le_of_lt _ ht
apply (norm_tsum_le_tsum_norm (A.subtype _)).trans
exact tsum_le_tsum (fun n => hfu _ _ hx) (A.subtype _) (hu.subtype _)
#align tendsto_uniformly_on_tsum tendstoUniformlyOn_tsum
theorem tendstoUniformlyOn_tsum_nat {f : β β Ξ² β F} {u : β β β} (hu : Summable u) {s : Set Ξ²}
(hfu : β n x, x β s β βf n xβ β€ u n) :
TendstoUniformlyOn (fun N => fun x => β n β Finset.range N, f n x) (fun x => β' n, f n x) atTop
s :=
fun v hv => tendsto_finset_range.eventually (tendstoUniformlyOn_tsum hu hfu v hv)
#align tendsto_uniformly_on_tsum_nat tendstoUniformlyOn_tsum_nat
| Mathlib/Analysis/NormedSpace/FunctionSeries.lean | 53 | 56 | theorem tendstoUniformly_tsum {f : Ξ± β Ξ² β F} (hu : Summable u) (hfu : β n x, βf n xβ β€ u n) :
TendstoUniformly (fun t : Finset Ξ± => fun x => β n β t, f n x)
(fun x => β' n, f n x) atTop := by |
rw [β tendstoUniformlyOn_univ]; exact tendstoUniformlyOn_tsum hu fun n x _ => hfu n x
| [
" TendstoUniformlyOn (fun t x => β n β t, f n x) (fun x => β' (n : Ξ±), f n x) atTop s",
" βαΆ (n : Finset Ξ±) in atTop, β x β s, dist (β' (n : Ξ±), f n x) (β n β n, f n x) < Ξ΅",
" dist (β' (n : Ξ±), f n x) (β n β t, f n x) < Ξ΅",
" ββ' (x_1 : { x // x β t }), f (βx_1) xβ < Ξ΅",
" ββ' (x_1 : { x // x β t }), f (βx... | [
" TendstoUniformlyOn (fun t x => β n β t, f n x) (fun x => β' (n : Ξ±), f n x) atTop s",
" βαΆ (n : Finset Ξ±) in atTop, β x β s, dist (β' (n : Ξ±), f n x) (β n β n, f n x) < Ξ΅",
" dist (β' (n : Ξ±), f n x) (β n β t, f n x) < Ξ΅",
" ββ' (x_1 : { x // x β t }), f (βx_1) xβ < Ξ΅",
" ββ' (x_1 : { x // x β t }), f (βx... |
import Mathlib.Algebra.BigOperators.Module
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Order.Filter.ModEq
import Mathlib.Analysis.Asymptotics.Asymptotics
import Mathlib.Analysis.SpecificLimits.Basic
import Mathlib.Data.List.TFAE
import Mathlib.Analysis.NormedSpace.Basic
#align_import analysis.specific_limits.normed from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open scoped Classical
open Set Function Filter Finset Metric Asymptotics
open scoped Classical
open Topology Nat uniformity NNReal ENNReal
variable {Ξ± : Type*} {Ξ² : Type*} {ΞΉ : Type*}
theorem tendsto_norm_atTop_atTop : Tendsto (norm : β β β) atTop atTop :=
tendsto_abs_atTop_atTop
#align tendsto_norm_at_top_at_top tendsto_norm_atTop_atTop
theorem summable_of_absolute_convergence_real {f : β β β} :
(β r, Tendsto (fun n β¦ β i β range n, |f i|) atTop (π r)) β Summable f
| β¨r, hrβ© => by
refine .of_norm β¨r, (hasSum_iff_tendsto_nat_of_nonneg ?_ _).2 ?_β©
Β· exact fun i β¦ norm_nonneg _
Β· simpa only using hr
#align summable_of_absolute_convergence_real summable_of_absolute_convergence_real
theorem tendsto_norm_zero' {π : Type*} [NormedAddCommGroup π] :
Tendsto (norm : π β β) (π[β ] 0) (π[>] 0) :=
tendsto_norm_zero.inf <| tendsto_principal_principal.2 fun _ hx β¦ norm_pos_iff.2 hx
#align tendsto_norm_zero' tendsto_norm_zero'
theorem isLittleO_pow_pow_of_lt_left {rβ rβ : β} (hβ : 0 β€ rβ) (hβ : rβ < rβ) :
(fun n : β β¦ rβ ^ n) =o[atTop] fun n β¦ rβ ^ n :=
have H : 0 < rβ := hβ.trans_lt hβ
(isLittleO_of_tendsto fun _ hn β¦ False.elim <| H.ne' <| pow_eq_zero hn) <|
(tendsto_pow_atTop_nhds_zero_of_lt_one
(div_nonneg hβ (hβ.trans hβ.le)) ((div_lt_one H).2 hβ)).congr fun _ β¦ div_pow _ _ _
#align is_o_pow_pow_of_lt_left isLittleO_pow_pow_of_lt_left
theorem isBigO_pow_pow_of_le_left {rβ rβ : β} (hβ : 0 β€ rβ) (hβ : rβ β€ rβ) :
(fun n : β β¦ rβ ^ n) =O[atTop] fun n β¦ rβ ^ n :=
hβ.eq_or_lt.elim (fun h β¦ h βΈ isBigO_refl _ _) fun h β¦ (isLittleO_pow_pow_of_lt_left hβ h).isBigO
set_option linter.uppercaseLean3 false in
#align is_O_pow_pow_of_le_left isBigO_pow_pow_of_le_left
theorem isLittleO_pow_pow_of_abs_lt_left {rβ rβ : β} (h : |rβ| < |rβ|) :
(fun n : β β¦ rβ ^ n) =o[atTop] fun n β¦ rβ ^ n := by
refine (IsLittleO.of_norm_left ?_).of_norm_right
exact (isLittleO_pow_pow_of_lt_left (abs_nonneg rβ) h).congr (pow_abs rβ) (pow_abs rβ)
#align is_o_pow_pow_of_abs_lt_left isLittleO_pow_pow_of_abs_lt_left
open List in
| Mathlib/Analysis/SpecificLimits/Normed.lean | 132 | 189 | theorem TFAE_exists_lt_isLittleO_pow (f : β β β) (R : β) :
TFAE
[β a β Ioo (-R) R, f =o[atTop] (a ^ Β·), β a β Ioo 0 R, f =o[atTop] (a ^ Β·),
β a β Ioo (-R) R, f =O[atTop] (a ^ Β·), β a β Ioo 0 R, f =O[atTop] (a ^ Β·),
β a < R, β C : β, (0 < C β¨ 0 < R) β§ β n, |f n| β€ C * a ^ n,
β a β Ioo 0 R, β C > 0, β n, |f n| β€ C * a ^ n, β a < R, βαΆ n in atTop, |f n| β€ a ^ n,
β a β Ioo 0 R, βαΆ n in atTop, |f n| β€ a ^ n] := by |
have A : Ico 0 R β Ioo (-R) R :=
fun x hx β¦ β¨(neg_lt_zero.2 (hx.1.trans_lt hx.2)).trans_le hx.1, hx.2β©
have B : Ioo 0 R β Ioo (-R) R := Subset.trans Ioo_subset_Ico_self A
-- First we prove that 1-4 are equivalent using 2 β 3 β 4, 1 β 3, and 2 β 1
tfae_have 1 β 3
Β· exact fun β¨a, ha, Hβ© β¦ β¨a, ha, H.isBigOβ©
tfae_have 2 β 1
Β· exact fun β¨a, ha, Hβ© β¦ β¨a, B ha, Hβ©
tfae_have 3 β 2
Β· rintro β¨a, ha, Hβ©
rcases exists_between (abs_lt.2 ha) with β¨b, hab, hbRβ©
exact β¨b, β¨(abs_nonneg a).trans_lt hab, hbRβ©,
H.trans_isLittleO (isLittleO_pow_pow_of_abs_lt_left (hab.trans_le (le_abs_self b)))β©
tfae_have 2 β 4
Β· exact fun β¨a, ha, Hβ© β¦ β¨a, ha, H.isBigOβ©
tfae_have 4 β 3
Β· exact fun β¨a, ha, Hβ© β¦ β¨a, B ha, Hβ©
-- Add 5 and 6 using 4 β 6 β 5 β 3
tfae_have 4 β 6
Β· rintro β¨a, ha, Hβ©
rcases bound_of_isBigO_nat_atTop H with β¨C, hCβ, hCβ©
refine β¨a, ha, C, hCβ, fun n β¦ ?_β©
simpa only [Real.norm_eq_abs, abs_pow, abs_of_nonneg ha.1.le] using hC (pow_ne_zero n ha.1.ne')
tfae_have 6 β 5
Β· exact fun β¨a, ha, C, Hβ, Hβ© β¦ β¨a, ha.2, C, Or.inl Hβ, Hβ©
tfae_have 5 β 3
Β· rintro β¨a, ha, C, hβ, Hβ©
rcases sign_cases_of_C_mul_pow_nonneg fun n β¦ (abs_nonneg _).trans (H n) with (rfl | β¨hCβ, haββ©)
Β· obtain rfl : f = 0 := by
ext n
simpa using H n
simp only [lt_irrefl, false_or_iff] at hβ
exact β¨0, β¨neg_lt_zero.2 hβ, hββ©, isBigO_zero _ _β©
exact β¨a, A β¨haβ, haβ©,
isBigO_of_le' _ fun n β¦ (H n).trans <| mul_le_mul_of_nonneg_left (le_abs_self _) hCβ.leβ©
-- Add 7 and 8 using 2 β 8 β 7 β 3
tfae_have 2 β 8
Β· rintro β¨a, ha, Hβ©
refine β¨a, ha, (H.def zero_lt_one).mono fun n hn β¦ ?_β©
rwa [Real.norm_eq_abs, Real.norm_eq_abs, one_mul, abs_pow, abs_of_pos ha.1] at hn
tfae_have 8 β 7
Β· exact fun β¨a, ha, Hβ© β¦ β¨a, ha.2, Hβ©
tfae_have 7 β 3
Β· rintro β¨a, ha, Hβ©
have : 0 β€ a := nonneg_of_eventually_pow_nonneg (H.mono fun n β¦ (abs_nonneg _).trans)
refine β¨a, A β¨this, haβ©, IsBigO.of_bound 1 ?_β©
simpa only [Real.norm_eq_abs, one_mul, abs_pow, abs_of_nonneg this]
-- Porting note: used to work without explicitly having 6 β 7
tfae_have 6 β 7
Β· exact fun h β¦ tfae_8_to_7 <| tfae_2_to_8 <| tfae_3_to_2 <| tfae_5_to_3 <| tfae_6_to_5 h
tfae_finish
| [
" Summable f",
" β (i : β), 0 β€ βf iβ",
" Tendsto (fun n => β i β Finset.range n, βf iβ) atTop (π r)",
" (fun n => rβ ^ n) =o[atTop] fun n => rβ ^ n",
" (fun x => βrβ ^ xβ) =o[atTop] fun x => βrβ ^ xβ",
" [β a β Set.Ioo (-R) R, f =o[atTop] fun x => a ^ x, β a β Set.Ioo 0 R, f =o[atTop] fun x => a ^ x,\n ... | [
" Summable f",
" β (i : β), 0 β€ βf iβ",
" Tendsto (fun n => β i β Finset.range n, βf iβ) atTop (π r)",
" (fun n => rβ ^ n) =o[atTop] fun n => rβ ^ n",
" (fun x => βrβ ^ xβ) =o[atTop] fun x => βrβ ^ xβ"
] |
import Mathlib.MeasureTheory.Measure.Haar.Basic
import Mathlib.Analysis.InnerProductSpace.PiL2
#align_import measure_theory.measure.haar.of_basis from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d"
open Set TopologicalSpace MeasureTheory MeasureTheory.Measure FiniteDimensional
open scoped Pointwise
noncomputable section
variable {ΞΉ ΞΉ' E F : Type*}
section Fintype
variable [Fintype ΞΉ] [Fintype ΞΉ']
section AddCommGroup
variable [AddCommGroup E] [Module β E] [AddCommGroup F] [Module β F]
def parallelepiped (v : ΞΉ β E) : Set E :=
(fun t : ΞΉ β β => β i, t i β’ v i) '' Icc 0 1
#align parallelepiped parallelepiped
theorem mem_parallelepiped_iff (v : ΞΉ β E) (x : E) :
x β parallelepiped v β β t β Icc (0 : ΞΉ β β) 1, x = β i, t i β’ v i := by
simp [parallelepiped, eq_comm]
#align mem_parallelepiped_iff mem_parallelepiped_iff
theorem parallelepiped_basis_eq (b : Basis ΞΉ β E) :
parallelepiped b = {x | β i, b.repr x i β Set.Icc 0 1} := by
classical
ext x
simp_rw [mem_parallelepiped_iff, mem_setOf_eq, b.ext_elem_iff, _root_.map_sum,
_root_.map_smul, Finset.sum_apply', Basis.repr_self, Finsupp.smul_single, smul_eq_mul,
mul_one, Finsupp.single_apply, Finset.sum_ite_eq', Finset.mem_univ, ite_true, mem_Icc,
Pi.le_def, Pi.zero_apply, Pi.one_apply, β forall_and]
aesop
| Mathlib/MeasureTheory/Measure/Haar/OfBasis.lean | 67 | 71 | theorem image_parallelepiped (f : E ββ[β] F) (v : ΞΉ β E) :
f '' parallelepiped v = parallelepiped (f β v) := by |
simp only [parallelepiped, β image_comp]
congr 1 with t
simp only [Function.comp_apply, _root_.map_sum, LinearMap.map_smulββ, RingHom.id_apply]
| [
" x β parallelepiped v β β t β Icc 0 1, x = β i : ΞΉ, t i β’ v i",
" parallelepiped βb = {x | β (i : ΞΉ), (b.repr x) i β Icc 0 1}",
" x β parallelepiped βb β x β {x | β (i : ΞΉ), (b.repr x) i β Icc 0 1}",
" (β t, β (x_1 : ΞΉ), (0 β€ t x_1 β§ t x_1 β€ 1) β§ (b.repr x) x_1 = t x_1) β β (i : ΞΉ), 0 β€ (b.repr x) i β§ (b.rep... | [
" x β parallelepiped v β β t β Icc 0 1, x = β i : ΞΉ, t i β’ v i",
" parallelepiped βb = {x | β (i : ΞΉ), (b.repr x) i β Icc 0 1}",
" x β parallelepiped βb β x β {x | β (i : ΞΉ), (b.repr x) i β Icc 0 1}",
" (β t, β (x_1 : ΞΉ), (0 β€ t x_1 β§ t x_1 β€ 1) β§ (b.repr x) x_1 = t x_1) β β (i : ΞΉ), 0 β€ (b.repr x) i β§ (b.rep... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.