theorem col_strict {μ : YoungDiagram} (T : SemistandardYoungTableau μ) {i1 i2 j : ℕ} (hi : i1 < i2)
    (hcell : (i2, j) ∈ μ) : T i1 j < T i2 j


@[simp]
theorem diag_same : diag (stdBasisMatrix i i c) = Pi.single i c

{n : Type u_3}
{α : Type u_5}
[DecidableEq n]
[Semiring α]
(i : n)
(c : α)

(Matrix.stdBasisMatrix i i c).diag = Pi.single i c


theorem equivRealProd_apply_le' (z : ℂ) : ‖equivRealProd z‖ ≤ 1 * abs z

‖Complex.equivRealProd z‖ ≤ 1 * Complex.abs z


theorem preimage_comp_eq : preimage (g ∘ f) = preimage f ∘ preimage g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{g : β → γ}

Set.preimage (g ∘ f) = Set.preimage f ∘ Set.preimage g


/-- An algebra of sets is closed by finite unions. -/
theorem biUnion_mem {ι : Type*} (h𝒜 : IsSetAlgebra 𝒜) {s : ι → Set α} (S : Finset ι)
    (hs : ∀ i ∈ S, s i ∈ 𝒜) : ⋃ i ∈ S, s i ∈ 𝒜

{α : Type u_1}
{𝒜 : Set (Set α)}
{ι : Type u_2}
(h𝒜 : MeasureTheory.IsSetAlgebra 𝒜)
{s : ι → Set α}
(S : Finset ι)
(hs : ∀ i ∈ S, s i ∈ 𝒜)


/-- Rotating the first vector by the angle between the two vectors and swapping the vectors
results in an angle of 0. -/
@[simp]
theorem oangle_rotation_oangle_right (x y : V) : o.oangle y (o.rotation (o.oangle x y) x) = 0

[Fact (FiniteDimensional.finrank ℝ V = 2)]

o.oangle y ((o.rotation (o.oangle x y)) x) = 0


/-- An intermediate field contains the ring's 1. -/
protected theorem one_mem : (1 : L) ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)


/-- Every Yoneda-presheaf is a sheaf for the regular topology. -/
lemma isSheaf_yoneda_obj [Preregular C] (W : C)  :
    Presieve.IsSheaf (regularTopology C) (yoneda.obj W)

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Preregular C]
(W : C)

CategoryTheory.Presieve.IsSheaf (CategoryTheory.regularTopology C) (CategoryTheory.yoneda.obj W)


lemma factorizationLCMRight_pos :
    0 < factorizationLCMRight a b


/-- The data of a comonad on C consists of an endofunctor G together with natural transformations
ε : G ⟶ 𝟭 C and δ : G ⟶ G ⋙ G satisfying three equations:
- δ_X ≫ G δ_X = δ_X ≫ δ_(GX) (coassociativity)
- δ_X ≫ ε_(GX) = 1_X (left counit)
- δ_X ≫ G ε_X = 1_X (right counit)
-/
structure Comonad extends C ⥤ C where
  /-- The counit for the comonad. -/
  ε : toFunctor ⟶ 𝟭 _
  /-- The comultiplication for the comonad. -/
  δ : toFunctor ⟶ toFunctor ⋙ toFunctor
  coassoc : ∀ X, NatTrans.app δ _ ≫ toFunctor.map (δ.app X) = δ.app _ ≫ δ.app _ := by
    aesop_cat
  left_counit : ∀ X : C, δ.app X ≫ ε.app (toFunctor.obj X) = 𝟙 _ := by aesop_cat
  right_counit : ∀ X : C, δ.app X ≫ toFunctor.map (ε.app X) = 𝟙 _ := by aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(self : CategoryTheory.Comonad C)
(X : C)

CategoryTheory.CategoryStruct.comp (self.δ.app X) (self.ε.app (self.obj X)) =
  CategoryTheory.CategoryStruct.id (self.obj X)


theorem isLeft_left (h : LiftRel r s x (inl c)) : x.isLeft

{α : Type u}
{β : Type v}
{γ : Type u_1}
{δ : Type u_2}
{r : α → γ → Prop}
{s : β → δ → Prop}
{x : α ⊕ β}
{c : γ}
(h : Sum.LiftRel r s x (Sum.inl c))


@[simp]
theorem dist_self (x : α) : dist x x = 0

{α : Type u}
[PseudoMetricSpace α]
(x : α)


theorem toCotangent_eq {x y : I} : I.toCotangent x = I.toCotangent y ↔ (x - y : R) ∈ I ^ 2

{R : Type u}
[CommRing R]
(I : Ideal R)
{x y : ↥I}

I.toCotangent x = I.toCotangent y ↔ ↑x - ↑y ∈ I ^ 2


protected nonrec theorem SmoothOn.coordChange (hf : SmoothOn IM IB f s)
    (hg : SmoothOn IM 𝓘(𝕜, F) g s) (he : MapsTo f s e.baseSet) (he' : MapsTo f s e'.baseSet) :
    SmoothOn IM 𝓘(𝕜, F) (fun y ↦ e.coordChange e' (f y) (g y)) s

[TopologicalSpace (Bundle.TotalSpace F E)]

{e e' : Trivialization F Bundle.TotalSpace.proj}

SmoothOn IM 𝓘(𝕜, F) (fun y => e.coordChange e' (f y) (g y)) s


@[to_additive]
theorem AEMeasurable.mul_iff_right {G : Type*} [MeasurableSpace G] [MeasurableSpace α] [CommGroup G]
    [MeasurableMul₂ G] [MeasurableInv G] {μ : Measure α} {f g : α → G} (hf : AEMeasurable f μ) :
    AEMeasurable (f * g) μ ↔ AEMeasurable g μ

{α : Type u_1}
{G : Type u_2}
[MeasurableSpace G]
[MeasurableSpace α]
[AddCommGroup G]
[MeasurableAdd₂ G]
[MeasurableNeg G]
{μ : MeasureTheory.Measure α}
{f g : α → G}
(hf : AEMeasurable f μ)

AEMeasurable (f + g) μ ↔ AEMeasurable g μ


@[to_additive]
lemma orderOf_eq_card_powers : orderOf x = Fintype.card (powers x : Set G)

{G : Type u_1}
[LeftCancelMonoid G]
[Fintype G]
{x : G}

orderOf x = Fintype.card ↑↑(Submonoid.powers x)


theorem comap_neg_atTop : comap (Neg.neg : β → β) atTop = atBot

Filter.comap Neg.neg Filter.atTop = Filter.atBot


theorem arctan_inv_of_pos {x : ℝ} (h : 0 < x) : arctan x⁻¹ = π / 2 - arctan x

Real.arctan x⁻¹ = Real.pi / 2 - Real.arctan x


@[simp]
lemma range_liftBaseChange (l : M →ₗ[R] N) :
    LinearMap.range (l.liftBaseChange A) = Submodule.span A (LinearMap.range l)

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
(A : Type u_4)
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
[Module A N]
[IsScalarTower R A N]
(l : M →ₗ[R] N)

LinearMap.range (LinearMap.liftBaseChange A l) = Submodule.span A ↑(LinearMap.range l)


{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
(P : C → Prop)


theorem toNNReal_eq_zero_iff (x : ℝ≥0∞) : x.toNNReal = 0 ↔ x = 0 ∨ x = ∞


@[to_additive]
theorem smul_filter_le_smul_filter (hf : f₁ ≤ f₂) : a • f₁ ≤ a • f₂

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{f₁ f₂ : Filter β}
{a : α}
(hf : f₁ ≤ f₂)

a • f₁ ≤ a • f₂


lemma measurable_density (κ : Kernel α (γ × β)) (ν : Kernel α γ)
    {s : Set β} (hs : MeasurableSet s) :
    Measurable (fun (p : α × γ) ↦ density κ ν p.1 p.2 s)

(κ : ProbabilityTheory.Kernel α (γ × β))

Measurable fun p => κ.density ν p.1 p.2 s


@[to_additive]
theorem MonoidHom.comp_assoc {Q : Type*} [MulOneClass M] [MulOneClass N] [MulOneClass P]
    [MulOneClass Q] (f : M →* N) (g : N →* P) (h : P →* Q) :
    (h.comp g).comp f = h.comp (g.comp f)

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
{Q : Type u_10}
[MulOneClass M]
[MulOneClass N]
[MulOneClass P]
[MulOneClass Q]
(f : M →* N)
(g : N →* P)
(h : P →* Q)


/-- If a family is affinely independent, so is any subfamily given by
composition of an embedding into index type with the original
family. -/
theorem AffineIndependent.comp_embedding {ι2 : Type*} (f : ι2 ↪ ι) {p : ι → P}
    (ha : AffineIndependent k p) : AffineIndependent k (p ∘ f)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
{ι2 : Type u_5}
(f : ι2 ↪ ι)
{p : ι → P}
(ha : AffineIndependent k p)


theorem sdiff_le_sdiff_of_sup_le_sup_left (h : c ⊔ a ≤ c ⊔ b) : a \ c ≤ b \ c

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b c : α}
(h : c ⊔ a ≤ c ⊔ b)


@[simp]
protected theorem map_smul_nnreal (c : ℝ≥0) (μ : Measure α) (f : α → β) :
    (c • μ).map f = c • μ.map f

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
(c : NNReal)
(μ : MeasureTheory.Measure α)
(f : α → β)

MeasureTheory.Measure.map f (c • μ) = c • MeasureTheory.Measure.map f μ


theorem StrictMonoOn.exists_slope_lt_deriv_aux {x y : ℝ} {f : ℝ → ℝ} (hf : ContinuousOn f (Icc x y))
    (hxy : x < y) (hf'_mono : StrictMonoOn (deriv f) (Ioo x y)) (h : ∀ w ∈ Ioo x y, deriv f w ≠ 0) :
    ∃ a ∈ Ioo x y, (f y - f x) / (y - x) < deriv f a

(hf'_mono : StrictMonoOn (deriv f) (Set.Ioo x y))

∃ a ∈ Set.Ioo x y, (f y - f x) / (y - x) < deriv f a


@[to_additive (attr := simp)]
theorem closure_univ : closure (univ : Set G) = ⊤


@[simp]
theorem mk_pow (f : α → γ) (hf) (n : ℕ) :
    (mk f hf : α →ₘ[μ] γ) ^ n =
      mk (f ^ n) ((_root_.continuous_pow n).comp_aestronglyMeasurable hf)

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEEqFun.mk f hf ^ n = MeasureTheory.AEEqFun.mk (f ^ n) ⋯


lemma support_intCast (hn : n ≠ 0) : support (n : α → β) = univ

{α : Type u_1}
{β : Type u_2}
[AddGroupWithOne β]
[CharZero β]
{n : ℤ}
(hn : n ≠ 0)


theorem iInf_plift_down (f : ι → α) : ⨅ i, f (PLift.down i) = ⨅ i, f i

{α : Type u_1}
{ι : Sort u_5}
[InfSet α]
(f : ι → α)


@[simp, norm_cast]
theorem coe_comp (f : B →ₛₙₐ[ψ] C) (g : A →ₛₙₐ[φ] B) [MonoidHom.CompTriple φ ψ χ] :
    ⇑(f.comp g) = (⇑f) ∘ (⇑g)

{R : Type u}
{S : Type u₁}
{T : Type u_1}
[Monoid R]
[Monoid S]
[Monoid T]
{φ : R →* S}
{A : Type v}
{B : Type w}
{C : Type w₁}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction S B]
[NonUnitalNonAssocSemiring C]
[DistribMulAction T C]
{ψ : S →* T}
{χ : R →* T}
(f : B →ₛₙₐ[ψ] C)
(g : A →ₛₙₐ[φ] B)
[φ.CompTriple ψ χ]


theorem edist_def (f g : Lp E p μ) : edist f g = eLpNorm (⇑f - ⇑g) p μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
(f g : ↥(MeasureTheory.Lp E p μ))

edist f g = MeasureTheory.eLpNorm (↑↑f - ↑↑g) p μ


/-- Same as `lt_moveRight`, but for `Surreal` instead of `PGame` -/
theorem mk_lt_mk_moveRight {x : PGame} (o : Numeric x) (j) :
    Surreal.mk x o < Surreal.mk (x.moveRight j) (Numeric.moveRight o j)

{x : SetTheory.PGame}
(o : x.Numeric)
(j : x.RightMoves)

Surreal.mk x o < Surreal.mk (x.moveRight j) ⋯


@[simp]
theorem pairwiseDisjoint_singleton (i : ι) (f : ι → α) : PairwiseDisjoint {i} f

{α : Type u_1}
{ι : Type u_4}
[PartialOrder α]
[OrderBot α]
(i : ι)
(f : ι → α)


@[simp] theorem ofNat_num : (OfNat.ofNat n : Rat).num = OfNat.ofNat n


@[simp]
theorem coe_toOrderEmbedding (hf : RightOrdContinuous f) (h : Injective f) :
    ⇑(hf.toOrderEmbedding f h) = f

{α : Type u}
{β : Type v}
[SemilatticeInf α]
[SemilatticeInf β]
{f : α → β}
(hf : RightOrdContinuous f)
(h : Function.Injective f)

⇑(RightOrdContinuous.toOrderEmbedding f hf h) = f


@[deprecated map_smul (since := "2024-06-20")]
protected theorem map_smul (r : R) (x : A₁) : e (r • x) = r • e x

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)
(r : R)
(x : A₁)


/-- The product of two antitone functions is antitone. -/
@[to_additive add "The sum of two antitone functions is antitone."]
theorem Antitone.mul' [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (swap (· * ·)) (· ≤ ·)] (hf : Antitone f) (hg : Antitone g) :
    Antitone fun x => f x * g x

[CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]

[CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


theorem limsup_le_limsup {α : Type*} [ConditionallyCompleteLattice β] {f : Filter α} {u v : α → β}
    (h : u ≤ᶠ[f] v)
    (hu : f.IsCoboundedUnder (· ≤ ·) u := by isBoundedDefault)
    (hv : f.IsBoundedUnder (· ≤ ·) v := by isBoundedDefault) :
    limsup u f ≤ limsup v f

(hu : Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) f u := by isBoundedDefault)

(hv : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f v := by isBoundedDefault)


@[simp]
theorem Ioi_subset_Ioi_iff : Ioi b ⊆ Ioi a ↔ a ≤ b

{α : Type u_1}
[LinearOrder α]
{a b : α}


@[reassoc (attr := simp)]
theorem biproduct.ι_fromSubtype (j : Subtype p) :
    biproduct.ι (Subtype.restrict p f) j ≫ biproduct.fromSubtype f p = biproduct.ι f j

[CategoryTheory.Limits.HasBiproduct (Subtype.restrict p f)]

CategoryTheory.Limits.biproduct.ι (Subtype.restrict p f) j ≫ CategoryTheory.Limits.biproduct.fromSubtype f p =
  CategoryTheory.Limits.biproduct.ι f ↑j


/-- Sometimes, a group is defined as a quotient of a monoid by a congruence relation.
Usually, the inverse operation is defined as `Setoid.map f _` for some `f`.
This lemma allows to avoid code duplication in the definition of the inverse operation:
instead of proving both `∀ x y, c x y → c (f x) (f y)` (to define the operation)
and `∀ x, c (f x * x) 1` (to prove the group laws), one can only prove the latter. -/
@[to_additive "Sometimes, an additive group is defined as a quotient of a monoid
  by an additive congruence relation.
  Usually, the inverse operation is defined as `Setoid.map f _` for some `f`.
  This lemma allows to avoid code duplication in the definition of the inverse operation:
  instead of proving both `∀ x y, c x y → c (f x) (f y)` (to define the operation)
  and `∀ x, c (f x + x) 0` (to prove the group laws), one can only prove the latter."]
theorem map_of_mul_left_rel_one [Monoid M] (c : Con M)
    (f : M → M) (hf : ∀ x, c (f x * x) 1) {x y} (h : c x y) : c (f x) (f y)

{M : Type u_1}
[Monoid M]
(c : Con M)
(f : M → M)
(hf : ∀ (x : M), c (f x * x) 1)
{x y : M}
(h : c x y)


@[reassoc (attr := simp)]
lemma singleObjApplyIso_inv_single_map (j : J) {X Y : C} (f : X ⟶ Y) :
    (singleObjApplyIso j X).inv ≫ (single j).map f j = f ≫ (singleObjApplyIso j Y).inv

{J : Type u_1}
{C : Type u_2}
[CategoryTheory.Category.{u_3, u_2} C]
[CategoryTheory.Limits.HasInitial C]
[DecidableEq J]
(j : J)
{X Y : C}
(f : X ⟶ Y)

CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.singleObjApplyIso j X).inv
    ((CategoryTheory.GradedObject.single j).map f j) =
  CategoryTheory.CategoryStruct.comp f (CategoryTheory.GradedObject.singleObjApplyIso j Y).inv


theorem add_biSup {ι} {s : Set ι} (hs : s.Nonempty) {f : ι → ℝ≥0∞} :
    (a + ⨆ i ∈ s, f i) = ⨆ i ∈ s, a + f i

{a : ℝ≥0∞}
{ι : Type u_4}
{s : Set ι}
(hs : s.Nonempty)
{f : ι → ℝ≥0∞}


/-- `BoundedContinuousMapClass F α β` states that `F` is a type of bounded continuous maps.

You should also extend this typeclass when you extend `BoundedContinuousFunction`. -/
class BoundedContinuousMapClass (F : Type*) (α β : outParam Type*) [TopologicalSpace α]
    [PseudoMetricSpace β] [FunLike F α β] extends ContinuousMapClass F α β : Prop where
  map_bounded (f : F) : ∃ C, ∀ x y, dist (f x) (f y) ≤ C

[self : BoundedContinuousMapClass F α β]


/-- The cokernel of `f.op` is the opposite of `kernel f`. -/
@[simps!]
def cokernelOpOp : cokernel f.op ≅ Opposite.op (kernel f)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
{X Y : C}
(f : X ⟶ Y)

(CategoryTheory.cokernelOpOp f).inv =
  (CategoryTheory.Limits.kernel.lift f (CategoryTheory.Limits.cokernel.π f.op).unop ⋯).op


@[simp, mfld_simps]
theorem invFun_as_coe : e.invFun = e.symm

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)


@[simp]
theorem comap_principal {t : Set β} : comap m (𝓟 t) = 𝓟 (m ⁻¹' t)

{α : Type u}
{β : Type v}
{m : α → β}
{t : Set β}


@[simp]
theorem diff_self_inter {s t : Set α} : s \ (s ∩ t) = s \ t


@[simp]
theorem mem_map {b : β} : b ∈ s.map f ↔ ∃ a ∈ s, f a = b

{α : Type u_1}
{β : Type u_2}
{f : α ↪ β}
{s : Finset α}
{b : β}


theorem ediv_add_emod' (a b : Int) : a / b * b + a % b = a


@[simp] theorem getElem_concat_length : ∀ (l : List α) (a : α) (i) (_ : i = l.length) (w), (l ++ [a])[i]'w = a

{α : Type u_1}
(l : List α)
(a : α)
(i : Nat)

i = l.length → ∀ (w : i < (l ++ [a]).length), (l ++ [a])[i] = a


theorem iSup_iUnion (s : ι → Set α) (f : α → β) : ⨆ a ∈ ⋃ i, s i, f a = ⨆ (i) (a ∈ s i), f a

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
[CompleteLattice β]
(s : ι → Set α)
(f : α → β)

⨆ a ∈ ⋃ i, s i, f a = ⨆ i, ⨆ a ∈ s i, f a


lemma isOpen_iff :
    IsOpen s ↔ ∀ ⦃d : Set α⦄, d.Nonempty → DirectedOn (· ≤ ·) d → ∀ ⦃a : α⦄, IsLUB d a →
      a ∈ s → ∃ b ∈ d, Ici b ∩ d ⊆ s

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsScottHausdorff α]
{s : Set α}

IsOpen s ↔
  ∀ ⦃d : Set α⦄,
    d.Nonempty → DirectedOn (fun x x_1 => x ≤ x_1) d → ∀ ⦃a : α⦄, IsLUB d a → a ∈ s → ∃ b ∈ d, Set.Ici b ∩ d ⊆ s


@[to_additive (attr := simp, norm_cast) coe_le_zero]
theorem coe_le_one [LE α] : (a : WithBot α) ≤ 1 ↔ a ≤ 1

↑a ≤ 0 ↔ a ≤ 0


/-- `preimage_smul_setₛₗ` when both scalars act by unit -/
theorem preimage_smul_setₛₗ_of_units (hc : IsUnit c) (hc' : IsUnit (σ c)) :
    h ⁻¹' (σ c • t) = c • h ⁻¹' t

{R : Type u_1}
{S : Type u_2}
(M : Type u_3)
(N : Type u_6)
[Monoid R]
[Monoid S]
(σ : R → S)
[MulAction R M]
[MulAction S N]
{F : Type u_7}
(h : F)
[FunLike F M N]
[MulActionSemiHomClass F σ M N]
{c : R}
(t : Set N)
(hc : IsUnit c)
(hc' : IsUnit (σ c))


{K : Type u_3}
[DivisionMonoid K]
[HasDistribNeg K]
{a : K}


@[simp] theorem toFun_eq_coe (f : G →+c[a, b] H) : f.toFun = f

{G : Type u_1}
{H : Type u_2}
[Add G]
[Add H]
{a : G}
{b : H}
(f : AddConstMap G H a b)


{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b : α}


theorem TFAE [IsBezout R] [IsDomain R] :
    List.TFAE
    [IsNoetherianRing R, IsPrincipalIdealRing R, UniqueFactorizationMonoid R, WfDvdMonoid R]

{R : Type u}
[CommRing R]
[IsBezout R]
[IsDomain R]

[IsNoetherianRing R, IsPrincipalIdealRing R, UniqueFactorizationMonoid R, WfDvdMonoid R].TFAE


theorem Matrix.toBilin_basisFun : Matrix.toBilin (Pi.basisFun R₂ n) = Matrix.toBilin'

{R₂ : Type u_5}
[CommSemiring R₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]


theorem le_map_of_map_zero (x : ℝ) : f 0 + ⌊x⌋ ≤ f x


theorem IsNormal.inj {f} (H : IsNormal f) {a b} : f a = f b ↔ a = b

{f : Ordinal.{u_4} → Ordinal.{u_5}}
(H : Ordinal.IsNormal f)
{a b : Ordinal.{u_4}}


/-- Given two presheaves `F` and `G` on a category `C` with values in a category `A`,
this `presheafHom F G` is the presheaf of types which sends an object `X : C`
to the type of morphisms between the "restrictions" of `F` and `G` to the category `Over X`. -/
@[simps! obj]
def presheafHom : Cᵒᵖ ⥤ Type _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{A : Type u'}
[CategoryTheory.Category.{v', u'} A]
(F G : CategoryTheory.Functor Cᵒᵖ A)
(X : Cᵒᵖ)

(CategoryTheory.presheafHom F G).obj X =
  ((CategoryTheory.Over.forget (Opposite.unop X)).op.comp F ⟶ (CategoryTheory.Over.forget (Opposite.unop X)).op.comp G)


@[symm]
theorem symm ⦃f g : C(X, Y)⦄ (h : HomotopicRel f g S) : HomotopicRel g f S

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{S : Set X}
⦃f g : C(X, Y)⦄
(h : f.HomotopicRel g S)


theorem replaceF_cons_of_some {l : List α} (p) (h : p a = some a') :
    (a :: l).replaceF p = a' :: l

{α : Type u_1}
{a' a : α}
{l : List α}
(p : α → Option α)
(h : p a = some a')


@[simp] theorem sign_negSucc (x : Nat) : Int.sign (Int.negSucc x) = -1


@[to_additive (attr := simp)]
theorem prod_mul [Zero M] [CommMonoid N] {f : α →₀ M} {h₁ h₂ : α → M → N} :
    (f.prod fun a b => h₁ a b * h₂ a b) = f.prod h₁ * f.prod h₂

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[CommMonoid N]
{f : α →₀ M}
{h₁ h₂ : α → M → N}


theorem lt_or_equiv_or_gt {x y : PGame} (ox : Numeric x) (oy : Numeric y) :
    x < y ∨ (x ≈ y) ∨ y < x

{x y : SetTheory.PGame}
(ox : x.Numeric)
(oy : y.Numeric)


/-- The canonical increasing bijection between `Fin (c.length + 1)` and `c.boundaries` is
exactly `c.boundary`. -/
theorem orderEmbOfFin_boundaries :
    c.boundaries.orderEmbOfFin c.card_boundaries_eq_succ_length = c.boundary

c.boundaries.orderEmbOfFin ⋯ = c.boundary


theorem Separable.aeval_derivative_ne_zero [Nontrivial S] [Algebra R S] {p : R[X]}
    (h : p.Separable) {x : S} (hx : aeval x p = 0) :
    aeval x (derivative p) ≠ 0

{R : Type u}
[CommSemiring R]
{S : Type v}
[CommSemiring S]
[Nontrivial S]
[Algebra R S]
{p : R[X]}
(h : p.Separable)
{x : S}
(hx : (Polynomial.aeval x) p = 0)

(Polynomial.aeval x) (Polynomial.derivative p) ≠ 0


lemma eq_of_mem_uIcc_of_mem_uIcc (ha : a ∈ [[b, c]]) (hb : b ∈ [[a, c]]) : a = b

{α : Type u_1}
[DistribLattice α]
{a b c : α}
(ha : a ∈ Set.uIcc b c)
(hb : b ∈ Set.uIcc a c)


@[simp]
theorem toDual_min (a b : α) : toDual (min a b) = max (toDual a) (toDual b)

OrderDual.toDual (min a b) = max (OrderDual.toDual a) (OrderDual.toDual b)


/-- Any topological space is homotopy equivalent to itself.
-/
@[simps!]
def refl (X : Type u) [TopologicalSpace X] : X ≃ₕ X

(X : Type u)
[TopologicalSpace X]
(a : X)

↑(ContinuousMap.HomotopyEquiv.refl X).symm a = a


lemma MorphismProperty.LeftFraction.map_eq_iff
    {X Y : C} (φ ψ : W.LeftFraction X Y) :
    φ.map L (Localization.inverts _ _) = ψ.map L (Localization.inverts _ _) ↔
      LeftFractionRel φ ψ

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y : C}
(φ ψ : W.LeftFraction X Y)

φ.map L ⋯ = ψ.map L ⋯ ↔ CategoryTheory.MorphismProperty.LeftFractionRel φ ψ


@[simp, norm_cast]
lemma coe_withTopWithBot (f : LatticeHom α β) : ⇑f.withTopWithBot = Option.map (Option.map f)

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)

⇑f.withTopWithBot = Option.map (Option.map ⇑f)


theorem chain_le (s : Flag α) : IsChain (· ≤ ·) (s : Set α)


lemma mem_slitPlane_iff_not_le_zero {z : ℂ} : z ∈ slitPlane ↔ ¬z ≤ 0


@[simp] lemma locallyLinear_comap {G : SimpleGraph β} {e : α ≃ β} :
    (G.comap e).LocallyLinear ↔ G.LocallyLinear

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph β}
{e : α ≃ β}

(SimpleGraph.comap (⇑e) G).LocallyLinear ↔ G.LocallyLinear


@[simp]
theorem testBit_bit_succ (m b) : ∀ n, testBit (bit b n) (Nat.succ m) = testBit n m

(Int.bit b n).testBit m.succ = n.testBit m


@[simp]
theorem dropFun_id {α : TypeVec (n + 1)} : dropFun (@TypeVec.id _ α) = id


theorem card_eq_three {s : Multiset α} : card s = 3 ↔ ∃ x y z, s = {x, y, z}

Multiset.card s = 3 ↔ ∃ x y z, s = {x, y, z}


@[to_additive]
theorem orbit_eq_univ [IsPretransitive M α] (a : α) : orbit M a = Set.univ

(M : Type u)
[Monoid M]
{α : Type v}
[MulAction M α]
[MulAction.IsPretransitive M α]
(a : α)


theorem restr_trans (s : Set α) : (e.restr s).trans e' = (e.trans e').restr s

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : PartialEquiv α β)
(e' : PartialEquiv β γ)
(s : Set α)


theorem directedOn_range {f : ι → α} : Directed r f ↔ DirectedOn r (Set.range f)

{α : Type u}
{ι : Sort w}
{r : α → α → Prop}
{f : ι → α}


theorem enum_zero_le' {o : Ordinal} (h0 : 0 < o) (a : o.out.α) :
    @enum o.out.α (· < ·) _ 0 (by rwa [type_lt]) ≤ a

{o : Ordinal.{u_3}}
(h0 : 0 < o)
(a : (Quotient.out o).α)

Ordinal.enum (fun x x_1 => x < x_1) 0 ⋯ ≤ a


@[simp] theorem derivative_invOf {R} [CommRing R] (f : R⟦X⟧) [Invertible f] :
    d⁄dX R ⅟f = - ⅟f ^ 2 * d⁄dX R f

{R : Type u_1}
[CommRing R]
(f : PowerSeries R)
[Invertible f]

(PowerSeries.derivative R) ⅟f = -⅟f ^ 2 * (PowerSeries.derivative R) f


@[to_additive (attr := simp)]
lemma continuous_inv_iff : Continuous f⁻¹ ↔ Continuous f

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[InvolutiveNeg G]
[ContinuousNeg G]
[TopologicalSpace α]
{f : α → G}


@[simp]
theorem Basis.coe_algebraMapCoeffs : (b.algebraMapCoeffs A h : ι → M) = b

(h : Function.Bijective ⇑(algebraMap R A))


theorem Integrable.of_neg (hf : Integrable I l (-f) vol) : Integrable I l f vol

(hf : BoxIntegral.Integrable I l (-f) vol)


theorem omegaLimit_preimage_subset {α' : Type*} (ϕ : τ → α' → β) (s : Set α') (f : Filter τ)
    (g : α → α') : ω f (fun t x ↦ ϕ t (g x)) (g ⁻¹' s) ⊆ ω f ϕ s

{τ : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace β]
{α' : Type u_5}
(ϕ : τ → α' → β)
(s : Set α')
(f : Filter τ)
(g : α → α')

omegaLimit f (fun t x => ϕ t (g x)) (g ⁻¹' s) ⊆ omegaLimit f ϕ s


theorem mk_inj (A B : T) {f g : A ⟶ B} : Arrow.mk f = Arrow.mk g ↔ f = g

{T : Type u}
[CategoryTheory.Category.{v, u} T]
(A B : T)
{f g : A ⟶ B}

CategoryTheory.Arrow.mk f = CategoryTheory.Arrow.mk g ↔ f = g


@[to_additive (attr := simp)]
lemma monovaryOn_inv_right : MonovaryOn f g⁻¹ s ↔ AntivaryOn f g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedCommGroup α]
[OrderedCommGroup β]
{s : Set ι}
{f : ι → α}
{g : ι → β}


@[simp, norm_cast]
theorem coe_sInf (S : Set (StarSubalgebra R A)) : (↑(sInf S) : Set A) = ⋂ s ∈ S, ↑s

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
(S : Set (StarSubalgebra R A))


@[to_additive (attr := simp)]
theorem toWord_inj {x y : FreeGroup α} : toWord x = toWord y ↔ x = y

{α : Type u}
[DecidableEq α]
{x y : FreeAddGroup α}


/-- A dependent version of `Substructure.closure_induction`. -/
@[elab_as_elim]
theorem closure_induction' (s : Set M) {p : ∀ x, x ∈ closure L s → Prop}
    (Hs : ∀ (x) (h : x ∈ s), p x (subset_closure h))
    (Hfun : ∀ {n : ℕ} (f : L.Functions n), ClosedUnder f { x | ∃ hx, p x hx }) {x}
    (hx : x ∈ closure L s) : p x hx

{p : (x : M) → x ∈ (FirstOrder.Language.Substructure.closure L).toFun s → Prop}

(Hfun :
  ∀ {n : ℕ} (f : L.Functions n),
    FirstOrder.Language.ClosedUnder f {x | ∃ (hx : x ∈ (FirstOrder.Language.Substructure.closure L).toFun s), p x hx})


theorem bneEqOfEqEq {a b c d : Nat} (p : (a = b) = (c = d)) : (a != b) = (c != d)


@[simp] lemma isAcyclic_bot : IsAcyclic (⊥ : SimpleGraph V)


theorem isSeparating_iff_epi (𝒢 : Set C)
    [∀ A : C, HasCoproduct fun f : ΣG : 𝒢, (G : C) ⟶ A => (f.1 : C)] :
    IsSeparating 𝒢 ↔ ∀ A : C, Epi (Sigma.desc (@Sigma.snd 𝒢 fun G => (G : C) ⟶ A))

[∀ (A : C), CategoryTheory.Limits.HasCoproduct fun f => ↑f.fst]

CategoryTheory.IsSeparating 𝒢 ↔ ∀ (A : C), CategoryTheory.Epi (CategoryTheory.Limits.Sigma.desc Sigma.snd)


lemma trace_comp_toEnd_weightSpace_eq (χ : L → R) :
    LinearMap.trace R _ ∘ₗ (toEnd R L (weightSpace M χ)).toLinearMap =
    finrank R (weightSpace M χ) • χ

(R : Type u_1)
(L : Type u_2)
(M : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[IsDomain R]
[IsPrincipalIdealRing R]
[Module.Free R M]
[Module.Finite R M]
[LieAlgebra.IsNilpotent R L]
(χ : L → R)

⇑(LinearMap.trace R ↥↑(LieModule.weightSpace M χ) ∘ₗ ↑(LieModule.toEnd R L ↥↑(LieModule.weightSpace M χ))) =
  FiniteDimensional.finrank R ↥↑(LieModule.weightSpace M χ) • χ


protected theorem map {α β} [MeasurableSpace α] [MeasurableSpace β]
    {μ : Measure α} {pa qa : Set α → Prop}
    (H : InnerRegularWRT μ pa qa) {f : α → β} (hf : AEMeasurable f μ) {pb qb : Set β → Prop}
    (hAB : ∀ U, qb U → qa (f ⁻¹' U)) (hAB' : ∀ K, pa K → pb (f '' K))
    (hB₂ : ∀ U, qb U → MeasurableSet U) :
    InnerRegularWRT (map f μ) pb qb

(hAB : ∀ (U : Set β), qb U → qa (f ⁻¹' U))

(hAB' : ∀ (K : Set α), pa K → pb (f '' K))

(hB₂ : ∀ (U : Set β), qb U → MeasurableSet U)

(MeasureTheory.Measure.map f μ).InnerRegularWRT pb qb


theorem associated_of_factorization_eq (a b : α) (ha : a ≠ 0) (hb : b ≠ 0)
    (h : factorization a = factorization b) : Associated a b

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
[NormalizationMonoid α]
[DecidableEq α]
(a b : α)
(ha : a ≠ 0)
(hb : b ≠ 0)
(h : factorization a = factorization b)


@[simp, norm_cast]
theorem coe_toLinearMap (f : M →ₗ⁅R,L⁆ N) : ((f : M →ₗ[R] N) : M → N) = f

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[LieRingModule L M]
[LieRingModule L N]
(f : M →ₗ⁅R,L⁆ N)


theorem directed_comp {ι} {f : ι → β} {g : β → α} : Directed r (g ∘ f) ↔ Directed (g ⁻¹'o r) f

{α : Type u}
{β : Type v}
{r : α → α → Prop}
{ι : Sort u_1}
{f : ι → β}
{g : β → α}


theorem op_sSup (S : Set (Subring R)) : (sSup S).op = sSup (.unop ⁻¹' S)

{R : Type u_2}
[Ring R]
(S : Set (Subring R))


theorem map_const' (l : List α) (b : β) : map (fun _ => b) l = replicate l.length b

{α : Type u_1}
{β : Type u_2}
(l : List α)
(b : β)

List.map (fun x => b) l = List.replicate l.length b


@[simp]
theorem isReflection_conj_iff (w t : W) :
    cs.IsReflection (w * t * w⁻¹) ↔ cs.IsReflection t

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(w t : W)


@[to_additive] lemma IsMulFreimanHom.comp (hg : IsMulFreimanHom n B C g)
    (hf : IsMulFreimanHom n A B f) : IsMulFreimanHom n A C (g ∘ f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[AddCommMonoid α]
[AddCommMonoid β]
[AddCommMonoid γ]
{A : Set α}
{B : Set β}
{C : Set γ}
{f : α → β}
{g : β → γ}
{n : ℕ}
(hg : IsAddFreimanHom n B C g)
(hf : IsAddFreimanHom n A B f)


@[reassoc (attr := simp)]
theorem arrow_ι (j : J) : arrows j ≫ ι arrows j = head arrows

[CategoryTheory.Limits.HasWidePushout B objs arrows]

arrows j ≫ CategoryTheory.Limits.WidePushout.ι arrows j = CategoryTheory.Limits.WidePushout.head arrows


@[reassoc (attr := simp)]
theorem biproduct.lift_π {f : J → C} [HasBiproduct f] {P : C} (p : ∀ b, P ⟶ f b) (j : J) :
    biproduct.lift p ≫ biproduct.π f j = p j

CategoryTheory.Limits.biproduct.lift p ≫ CategoryTheory.Limits.biproduct.π f j = p j


{α : Type u_1}
{x y : Quiver.SingleObj α}


lemma starAlgHom_id {a : A} {φ : C(spectrum S a, S) →⋆ₐ[S] A} {f : C(S, R)}
    (h : SpectrumRestricts a f) (h_id : φ (.restrict (spectrum S a) <| .id S) = a) :
    h.starAlgHom φ (.restrict (spectrum R a) <| .id R) = a

(h_id : φ (ContinuousMap.restrict (spectrum S a) (ContinuousMap.id S)) = a)

(SpectrumRestricts.starAlgHom φ h) (ContinuousMap.restrict (spectrum R a) (ContinuousMap.id R)) = a


theorem PGame.fuzzy_iff_game_fuzzy {x y : PGame} : PGame.Fuzzy x y ↔ ⟦x⟧ ‖ ⟦y⟧

x.Fuzzy y ↔ SetTheory.Game.Fuzzy ⟦x⟧ ⟦y⟧


@[to_additive]
theorem prod_range_mul {f : ℕ → M} {k : ℕ} (h : HasProd (fun n ↦ f (n + k)) m) :
    HasProd f ((∏ i ∈ range k, f i) * m)

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
{m : M}
[ContinuousAdd M]
{f : ℕ → M}
{k : ℕ}
(h : HasSum (fun n => f (n + k)) m)

HasSum f (∑ i ∈ Finset.range k, f i + m)


@[simp]
theorem one_le (n : ℕ+) : (1 : ℕ+) ≤ n


/-- See `IsEmpty.exists_iff` for the `False` version. -/
@[simp] theorem exists_true_left (p : True → Prop) : (∃ x, p x) ↔ p True.intro


theorem isAlgebraic_int [Nontrivial R] (n : ℤ) : IsAlgebraic R (n : A)

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
[Nontrivial R]
(n : ℤ)


theorem Nonempty.ne_empty {s : Finset α} (h : s.Nonempty) : s ≠ ∅

{α : Type u_1}
{s : Finset α}
(h : s.Nonempty)


@[reassoc]
lemma RightHomologyData.rightHomologyIso_inv_naturality
    (h₁ : S₁.RightHomologyData) (h₂ : S₂.RightHomologyData) :
      h₁.homologyIso.inv ≫ homologyMap φ =
        rightHomologyMap' φ h₁ h₂ ≫ h₂.homologyIso.inv

CategoryTheory.CategoryStruct.comp h₁.homologyIso.inv (CategoryTheory.ShortComplex.homologyMap φ) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.rightHomologyMap' φ h₁ h₂) h₂.homologyIso.inv


/-- Every split epi whose section is epi is an iso. -/
theorem IsIso.of_epi_section {X Y : C} (f : X ⟶ Y) [hf : IsSplitEpi f] [hf' : Epi <| section_ f] :
    IsIso f

[hf' : CategoryTheory.Epi (CategoryTheory.section_ f)]


lemma eq_C_of_isEmpty [IsEmpty σ] (p : MvPolynomial σ R) :
    p = C (p.coeff 0)

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[IsEmpty σ]
(p : MvPolynomial σ R)

p = MvPolynomial.C (MvPolynomial.coeff 0 p)


theorem eventually_imp_distrib_left {f : Filter α} {p : Prop} {q : α → Prop} :
    (∀ᶠ x in f, p → q x) ↔ p → ∀ᶠ x in f, q x

{α : Type u}
{f : Filter α}
{p : Prop}
{q : α → Prop}

(∀ᶠ (x : α) in f, p → q x) ↔ p → ∀ᶠ (x : α) in f, q x


theorem singleton_eq (x : α) : ({x} : List α) = [x]


/-- The `p`-adic norm is nonnegative. -/
protected theorem nonneg (q : ℚ) : 0 ≤ padicNorm p q


@[to_additive]
theorem one_def : (1 : S) = ⟨1, S.one_mem⟩

{M : Type u_1}
[MulOneClass M]
(S : Submonoid M)


lemma neg (hxy : x ≡ y [SMOD U]) : - x ≡ - y [SMOD U]

{R : Type u_1}
[Ring R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{U : Submodule R M}
{x y : M}
(hxy : x ≡ y [SMOD U])


/-- If there is a nonzero vector and every other vector is a multiple of it,
then the module has dimension one. -/
theorem finrank_eq_one (v : M) (n : v ≠ 0) (h : ∀ w : M, ∃ c : R, c • v = w) : finrank R M = 1

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
[StrongRankCondition R]
(v : M)
(n : v ≠ 0)
(h : ∀ (w : M), ∃ c, c • v = w)


lemma zpow_add₀ (ha : a ≠ 0) (m n : ℤ) : a ^ (m + n) = a ^ m * a ^ n

{G₀ : Type u_3}
[GroupWithZero G₀]
{a : G₀}
(ha : a ≠ 0)
(m n : ℤ)


@[simp, norm_cast] lemma coe_zpow {α} [GroupWithZero α] [HasDistribNeg α] (a : SignType) (k : ℤ) :
    ↑(a ^ k) = (a : α) ^ k

{α : Type u_1}
[GroupWithZero α]
[HasDistribNeg α]
(a : SignType)
(k : ℤ)


@[symm]
theorem ManyOneEquiv.symm {α β} [Primcodable α] [Primcodable β] {p : α → Prop} {q : β → Prop} :
    ManyOneEquiv p q → ManyOneEquiv q p

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{p : α → Prop}
{q : β → Prop}


theorem Basis.opNNNorm_le {ι : Type*} [Fintype ι] (v : Basis ι 𝕜 E) {u : E →L[𝕜] F} (M : ℝ≥0)
    (hu : ∀ i, ‖u (v i)‖₊ ≤ M) : ‖u‖₊ ≤ Fintype.card ι • ‖v.equivFunL.toContinuousLinearMap‖₊ * M

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type w}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace 𝕜]
{ι : Type u_1}
[Fintype ι]
(v : Basis ι 𝕜 E)
{u : E →L[𝕜] F}
(M : ℝ≥0)
(hu : ∀ (i : ι), ‖u (v i)‖₊ ≤ M)

‖u‖₊ ≤ Fintype.card ι • ‖↑v.equivFunL‖₊ * M


@[ext]
theorem ext {S T : StarSubsemiring R} (h : ∀ x : R, x ∈ S ↔ x ∈ T) : S = T

{R : Type v}
[NonAssocSemiring R]
[StarRing R]
{S T : StarSubsemiring R}
(h : ∀ (x : R), x ∈ S ↔ x ∈ T)


@[simp]
theorem segment_same (x : E) : [x -[𝕜] x] = {x}

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(x : E)


@[simp]
theorem opAlgEquiv_tmul (a : Aᵐᵒᵖ) (b : Bᵐᵒᵖ) :
    opAlgEquiv R S A B (a ⊗ₜ[R] b) = op (a.unop ⊗ₜ b.unop)

(R : Type u_1)
(S : Type u_2)
(A : Type u_3)
(B : Type u_4)
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Semiring B]
[Algebra R S]
[Algebra R A]
[Algebra R B]
[Algebra S A]
[IsScalarTower R S A]
(a : Aᵐᵒᵖ)
(b : Bᵐᵒᵖ)

(Algebra.TensorProduct.opAlgEquiv R S A B) (a ⊗ₜ[R] b) = MulOpposite.op (MulOpposite.unop a ⊗ₜ[R] MulOpposite.unop b)


theorem eq_smul_self_of_isLocalExtrOn_real (hT : IsSelfAdjoint T) {x₀ : F}
    (hextr : IsLocalExtrOn T.reApplyInnerSelf (sphere (0 : F) ‖x₀‖) x₀) :
    T x₀ = T.rayleighQuotient x₀ • x₀

(hextr : IsLocalExtrOn T.reApplyInnerSelf (Metric.sphere 0 ‖x₀‖) x₀)


theorem EventuallyEq.eventually {l : Filter α} {f g : α → β} (h : f =ᶠ[l] g) :
    ∀ᶠ x in l, f x = g x

{α : Type u}
{β : Type v}
{l : Filter α}
{f g : α → β}
(h : f =ᶠ[l] g)


lemma IsCondKernelCDF.le_one (hf : IsCondKernelCDF f κ ν) (p : α × β) (x : ℝ) : f p x ≤ 1

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

(hf : ProbabilityTheory.IsCondKernelCDF f κ ν)


theorem isPrimePow_iff_factorization_eq_single {n : ℕ} :
    IsPrimePow n ↔ ∃ p k : ℕ, 0 < k ∧ n.factorization = Finsupp.single p k

IsPrimePow n ↔ ∃ p k, 0 < k ∧ n.factorization = Finsupp.single p k


theorem inverse'_inverse'
    {f : X →ₑ[φ] Y} {g : Y → X}
    {k₁ : Function.LeftInverse φ' φ} {k₂ : Function.RightInverse φ' φ}
    {h₁ : Function.LeftInverse g f} {h₂ : Function.RightInverse g f} :
    inverse' (inverse' f g k₂ h₁ h₂) f k₁ h₂ h₁ = f

{M : Type u_2}
{N : Type u_3}
{φ : M → N}
{X : Type u_5}
[SMul M X]
{Y : Type u_6}
[SMul N Y]
{φ' : N → M}
{f : X →ₑ[φ] Y}
{g : Y → X}
{k₁ : Function.LeftInverse φ' φ}
{k₂ : Function.RightInverse φ' φ}
{h₁ : Function.LeftInverse g ⇑f}
{h₂ : Function.RightInverse g ⇑f}

(f.inverse' g k₂ h₁ h₂).inverse' (⇑f) k₁ h₂ h₁ = f


theorem Ioc_subset_Ioc_iff (h₁ : a₁ < b₁) : Ioc a₁ b₁ ⊆ Ioc a₂ b₂ ↔ b₁ ≤ b₂ ∧ a₂ ≤ a₁

{α : Type u_1}
[LinearOrder α]
{a₁ a₂ b₁ b₂ : α}
(h₁ : a₁ < b₁)

Set.Ioc a₁ b₁ ⊆ Set.Ioc a₂ b₂ ↔ b₁ ≤ b₂ ∧ a₂ ≤ a₁


@[simp]
theorem toHom_inj {f g : M ↪[L] N} : f.toHom = g.toHom ↔ f = g

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
{f g : L.Embedding M N}


theorem IsCompact.exists_sInf_image_eq [ClosedIicTopology α] {s : Set β} (hs : IsCompact s)
    (ne_s : s.Nonempty) {f : β → α} (hf : ContinuousOn f s) : ∃ x ∈ s, sInf (f '' s) = f x

{α : Type u_2}
{β : Type u_3}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIicTopology α]
{s : Set β}
(hs : IsCompact s)
(ne_s : s.Nonempty)
{f : β → α}
(hf : ContinuousOn f s)


/-- The inclusion map from an open subset to the whole space, as a morphism in `TopCat`.
-/
@[simps (config := .asFn)]
def inclusion {X : TopCat.{u}} (U : Opens X) : (toTopCat X).obj U ⟶ X

{X : TopCat}
(U : TopologicalSpace.Opens ↑X)


/-- Factoring through the coimage is a strong epi-mono factorisation. -/
@[simps]
def coimageStrongEpiMonoFactorisation : StrongEpiMonoFactorisation f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P Q : C}
(f : P ⟶ Q)

(CategoryTheory.Abelian.coimageStrongEpiMonoFactorisation f).e = CategoryTheory.Abelian.coimage.π f


/-- Interpreting the legs of a cone as a structured arrow, interpreting this arrow as an arrow over
    the cone point, and finally forgetting the arrow is the same as just applying the functor the
    cone was over. -/
@[simps!]
def Cone.toStructuredArrowCompToUnderCompForget {F : J ⥤ C} (c : Cone F) :
    c.toStructuredArrow ⋙ StructuredArrow.toUnder _ _ ⋙ Under.forget _ ≅ F

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : CategoryTheory.Functor J C}
(c : CategoryTheory.Limits.Cone F)
(X : J)

c.toStructuredArrowCompToUnderCompForget.inv.app X = CategoryTheory.CategoryStruct.id (F.obj X)


theorem trace_eq_sum_automorphisms (x : L) [FiniteDimensional K L] [IsGalois K L] :
    algebraMap K L (Algebra.trace K L x) = ∑ σ : L ≃ₐ[K] L, σ x

{K : Type u_4}
{L : Type u_5}
[Field K]
[Field L]
[Algebra K L]
(x : L)
[FiniteDimensional K L]
[IsGalois K L]

(algebraMap K L) ((Algebra.trace K L) x) = ∑ σ : L ≃ₐ[K] L, σ x


@[to_additive (attr := simp)]
theorem inv_mul_eq_one {a : α} : ↑u⁻¹ * a = 1 ↔ ↑u = a

{α : Type u}
[Monoid α]
{u : αˣ}
{a : α}


theorem toRing_injective : Function.Injective (@toRing R)


@[continuity]
theorem Continuous.connectedComponentsLift_continuous (h : Continuous f) :
    Continuous h.connectedComponentsLift

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[TotallyDisconnectedSpace β]
{f : α → β}
(h : Continuous f)


theorem lifts_iff_set_range (p : S[X]) : p ∈ lifts f ↔ p ∈ Set.range (map f)

{R : Type u}
[Semiring R]
{S : Type v}
[Semiring S]
{f : R →+* S}
(p : S[X])

p ∈ Polynomial.lifts f ↔ p ∈ Set.range (Polynomial.map f)


theorem max_left_commutative : LeftCommutative (max : α → α → α)


@[simp]
lemma Isometry.fst_comp_inl (Q₁ : QuadraticMap R M₁ P) :
    (fst M₂ Q₁).comp (inl Q₁ (0 : QuadraticMap R M₂ P)) = .id _

{R : Type u_2}
{M₁ : Type u_3}
{M₂ : Type u_4}
{P : Type u_7}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid P]
[Module R M₁]
[Module R M₂]
[Module R P]
(Q₁ : QuadraticMap R M₁ P)

(QuadraticMap.Isometry.fst M₂ Q₁).comp (QuadraticMap.Isometry.inl Q₁ 0) = QuadraticMap.Isometry.id Q₁


theorem apply_add_of_supDegree_le (hD : D.Injective) {ap aq : A}
    (hp : p.supDegree D ≤ D ap) (hq : q.supDegree D ≤ D aq) :
    (p * q) (ap + aq) = p ap * q aq

[CovariantClass B B (fun x x_1 => x + x_1) fun x x_1 => x < x_1]

[CovariantClass B B (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1]

(hp : AddMonoidAlgebra.supDegree D p ≤ D ap)

(hq : AddMonoidAlgebra.supDegree D q ≤ D aq)


@[simp]
theorem coe_copy (f : A →⋆ₙ+* B) (f' : A → B) (h : f' = f) : ⇑(f.copy f' h) = f'

{A : Type u_1}
{B : Type u_2}
[NonUnitalNonAssocSemiring A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Star B]
(f : A →⋆ₙ+* B)
(f' : A → B)
(h : f' = ⇑f)


lemma injOn_of_subsingleton [Subsingleton α] (f : α → β) (s : Set α) : InjOn f s

{α : Type u_1}
{β : Type u_2}
[Subsingleton α]
(f : α → β)
(s : Set α)


theorem norm_apply_le_self_mul_norm_one [FunLike F A 𝕜] [AlgHomClass F 𝕜 A 𝕜] (f : F) (a : A) :
    ‖f a‖ ≤ ‖a‖ * ‖(1 : A)‖

{𝕜 : Type u_1}
{A : Type u_2}
{F : Type u_3}
[NormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
[FunLike F A 𝕜]
[AlgHomClass F 𝕜 A 𝕜]
(f : F)
(a : A)

‖f a‖ ≤ ‖a‖ * ‖1‖


@[simp] lemma subset_infClosure {s : Set α} : s ⊆ infClosure s

{α : Type u_2}
[SemilatticeInf α]
{s : Set α}


/-- **Fundamental theorem of calculus-2**, on the whole real line
When a function has a limit `m` at `-∞` and `n` at `+∞`, and its derivative is integrable, then the
integral of the derivative is `n - m`.

Note that such a function always has a limit at `-∞` and `+∞`,
see `tendsto_limUnder_of_hasDerivAt_of_integrableOn_Iic` and
`tendsto_limUnder_of_hasDerivAt_of_integrableOn_Ioi`. -/
theorem integral_of_hasDerivAt_of_tendsto [CompleteSpace E]
    (hderiv : ∀ x, HasDerivAt f (f' x) x) (hf' : Integrable f')
    (hbot : Tendsto f atBot (𝓝 m)) (htop : Tendsto f atTop (𝓝 n)) : ∫ x, f' x = n - m

(hderiv : ∀ (x : ℝ), HasDerivAt f (f' x) x)

(hf' : MeasureTheory.Integrable f' MeasureTheory.volume)

(hbot : Filter.Tendsto f Filter.atBot (𝓝 m))

(htop : Filter.Tendsto f Filter.atTop (𝓝 n))


/-- Iteration of a conservative system is a conservative system. -/
protected theorem iterate (hf : Conservative f μ) (n : ℕ) : Conservative f^[n] μ

{α : Type u_2}
[MeasurableSpace α]
{f : α → α}
{μ : MeasureTheory.Measure α}
(hf : MeasureTheory.Conservative f μ)
(n : ℕ)


/-- The reflection in `K` of an element of `Kᗮ` is its negation. -/
theorem reflection_mem_subspace_orthogonalComplement_eq_neg [HasOrthogonalProjection K] {v : E}
    (hv : v ∈ Kᗮ) : reflection K v = -v

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[HasOrthogonalProjection K]
{v : E}
(hv : v ∈ Kᗮ)


/-- Suppose a function to angles is continuous on a connected set and never takes the values `0`
or `π` on that set. Then the values of the function on that set all have the same sign. -/
theorem sign_eq_of_continuousOn {α : Type*} [TopologicalSpace α] {f : α → Angle} {s : Set α}
    {x y : α} (hc : IsConnected s) (hf : ContinuousOn f s) (hs : ∀ z ∈ s, f z ≠ 0 ∧ f z ≠ π)
    (hx : x ∈ s) (hy : y ∈ s) : (f y).sign = (f x).sign

{α : Type u_1}
[TopologicalSpace α]
{f : α → Real.Angle}
{s : Set α}
{x y : α}
(hc : IsConnected s)
(hf : ContinuousOn f s)
(hs : ∀ z ∈ s, f z ≠ 0 ∧ f z ≠ ↑π)
(hx : x ∈ s)
(hy : y ∈ s)


theorem pure_apply_of_ne (h : a' ≠ a) : pure a a' = 0


theorem prod_mem_prod {ι : Type*} {s : Finset ι} {I : ι → Ideal R} {x : ι → R} :
    (∀ i ∈ s, x i ∈ I i) → (∏ i ∈ s, x i) ∈ ∏ i ∈ s, I i

{R : Type u}
[CommSemiring R]
{ι : Type u_2}
{s : Finset ι}
{I : ι → Ideal R}
{x : ι → R}

(∀ i ∈ s, x i ∈ I i) → ∏ i ∈ s, x i ∈ ∏ i ∈ s, I i


@[simp]
theorem zeroIsoIsTerminal_inv {X : C} (t : IsTerminal X) : (zeroIsoIsTerminal t).inv = 0

(t : CategoryTheory.Limits.IsTerminal X)

(CategoryTheory.Limits.HasZeroObject.zeroIsoIsTerminal t).inv = 0


/-- The natural transformation `S.X₂ ⟶ S.opcycles` for all short complexes `S`. -/
@[simps]
noncomputable def pOpcyclesNatTrans :
    ShortComplex.π₂ ⟶ opcyclesFunctor C

(CategoryTheory.ShortComplex.pOpcyclesNatTrans C).app S = S.pOpcycles


{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(A : Matrix.SpecialLinearGroup n R)


theorem sum_split_boxes {M : Type*} [AddCommMonoid M] (I : Box ι) (i : ι) (x : ℝ) (f : Box ι → M) :
    (∑ J ∈ (split I i x).boxes, f J) =
      (I.splitLower i x).elim' 0 f + (I.splitUpper i x).elim' 0 f

{ι : Type u_1}
{M : Type u_3}
[AddCommMonoid M]
(I : BoxIntegral.Box ι)
(i : ι)
(x : ℝ)
(f : BoxIntegral.Box ι → M)

∑ J ∈ (BoxIntegral.Prepartition.split I i x).boxes, f J =
  Option.elim' 0 f (I.splitLower i x) + Option.elim' 0 f (I.splitUpper i x)


protected theorem one_lt_two_pow (h : n ≠ 0) : 1 < 2 ^ n


/-- It suffices to prove `[[x, y]] ⊆ s` for `x y ∈ s`, `x ≤ y`. -/
theorem ordConnected_iff : OrdConnected s ↔ ∀ x ∈ s, ∀ y ∈ s, x ≤ y → Icc x y ⊆ s

s.OrdConnected ↔ ∀ x ∈ s, ∀ y ∈ s, x ≤ y → Set.Icc x y ⊆ s


theorem SmoothOn.div₀ (hf : SmoothOn I' I f s) (hg : SmoothOn I' I g s) (h₀ : ∀ x ∈ s, g x ≠ 0) :
    SmoothOn I' I (f / g) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[GroupWithZero G]
[SmoothInv₀ I G]
[SmoothMul I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{s : Set M}
(hf : SmoothOn I' I f s)
(hg : SmoothOn I' I g s)
(h₀ : ∀ x ∈ s, g x ≠ 0)


/-- The trivial case if `X` is initial. -/
private lemma has_decomp_connected_components_aux_initial (X : C) (h : IsInitial X) :
    ∃ (ι : Type) (f : ι → C) (g : (i : ι) → (f i) ⟶ X) (_ : IsColimit (Cofan.mk X g)),
    (∀ i, IsConnected (f i)) ∧ Finite ι

{C : Type u₁}
[CategoryTheory.Category.{u₂, u₁} C]
(X : C)
(h : CategoryTheory.Limits.IsInitial X)

∃ ι f g x, (∀ (i : ι), CategoryTheory.PreGaloisCategory.IsConnected (f i)) ∧ Finite ι


theorem AntivaryOn.comp_monotoneOn_right (h : AntivaryOn f g s) (hg : MonotoneOn g' (g '' s)) :
    AntivaryOn f (g' ∘ g) s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Preorder α]
[LinearOrder β]
[Preorder γ]
{f : ι → α}
{g : ι → β}
{g' : β → γ}
{s : Set ι}
(h : AntivaryOn f g s)
(hg : MonotoneOn g' (g '' s))


theorem liftPropWithinAt_mono (mono : ∀ ⦃s x t⦄ ⦃f : H → H'⦄, t ⊆ s → P f s x → P f t x)
    (h : LiftPropWithinAt P g s x) (hts : t ⊆ s) : LiftPropWithinAt P g t x

(mono : ∀ ⦃s : Set H⦄ ⦃x : H⦄ ⦃t : Set H⦄ ⦃f : H → H'⦄, t ⊆ s → P f s x → P f t x)

(h : ChartedSpace.LiftPropWithinAt P g s x)


/-- The continuous homomorphism given by the diagonal embedding. -/
@[to_additive (attr := simps!) "The continuous homomorphism given by the diagonal embedding."]
def diag : ContinuousMonoidHom A (A × A)

(A : Type u_2)
[AddMonoid A]
[TopologicalSpace A]
(i : A)

(ContinuousAddMonoidHom.diag A) i =
  ((ContinuousAddMonoidHom.id A).toAddMonoidHom i, (ContinuousAddMonoidHom.id A).toAddMonoidHom i)


lemma IsAtom.le_iff_eq (ha : IsAtom a) (hb : b ≠ ⊥) : b ≤ a ↔ b = a

{α : Type u_2}
[PartialOrder α]
[OrderBot α]
{a b : α}
(ha : IsAtom a)
(hb : b ≠ ⊥)


/-- A functor `G : C ⥤ D` sends cocones over `F` to cocones over `F ⋙ G` functorially. -/
@[simps]
def functoriality : Cocone F ⥤ Cocone (F ⋙ G)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(F : J ⥤ C)
(G : C ⥤ D)

∀ {X Y : CategoryTheory.Limits.Cocone F} (f : X ⟶ Y),
  ((CategoryTheory.Limits.Cocones.functoriality F G).map f).hom = G.map f.hom


@[to_additive sub]
theorem ContinuousWithinAt.div' (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) :
    ContinuousWithinAt (fun x => f x / g x) s x

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Div G]
[ContinuousDiv G]
[TopologicalSpace α]
{f g : α → G}
{s : Set α}
{x : α}
(hf : ContinuousWithinAt f s x)
(hg : ContinuousWithinAt g s x)


theorem le_div_iff_of_nonzero {I J J' : FractionalIdeal R₁⁰ K} (hJ' : J' ≠ 0) :
    I ≤ J / J' ↔ ∀ x ∈ I, ∀ y ∈ J', x * y ∈ J

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[frac : IsFractionRing R₁ K]
[IsDomain R₁]
{I J J' : FractionalIdeal R₁⁰ K}
(hJ' : J' ≠ 0)


theorem subsingleton (h : IsAdjoinRoot S f) [Subsingleton R] : Subsingleton S

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRoot S f)
[Subsingleton R]


@[simp]
lemma shiftIso_zero_inv_app (a : M) (X : C) :
    (F.shiftIso 0 a a (zero_add a)).inv.app X =
      (shift F a).map ((shiftFunctorZero C M).inv.app X)

{C : Type u_1}
{A : Type u_2}
[CategoryTheory.Category.{u_6, u_1} C]
[CategoryTheory.Category.{u_5, u_2} A]
(F : C ⥤ A)
{M : Type u_3}
[AddMonoid M]
[CategoryTheory.HasShift C M]
[F.ShiftSequence M]
(a : M)
(X : C)

(F.shiftIso 0 a a ⋯).inv.app X = (F.shift a).map ((CategoryTheory.shiftFunctorZero C M).inv.app X)


@[simp]
theorem intrinsicFrontier_union_intrinsicInterior (s : Set P) :
    intrinsicFrontier 𝕜 s ∪ intrinsicInterior 𝕜 s = intrinsicClosure 𝕜 s

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_5}
[Ring 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
[TopologicalSpace P]
[AddTorsor V P]
(s : Set P)


@[to_additive (attr := simp)]
theorem div_right_inj : a / b = a / c ↔ b = c


theorem ext_iff {inst₁ inst₂ : NonAssocSemiring R} :
    inst₁ = inst₂ ↔
      (local_hAdd[R, inst₁] = local_hAdd[R, inst₂]) ∧
      (local_hMul[R, inst₁] = local_hMul[R, inst₂])

{R : Type u}
{inst₁ inst₂ : NonAssocSemiring R}

inst₁ = inst₂ ↔ HAdd.hAdd = HAdd.hAdd ∧ HMul.hMul = HMul.hMul


theorem not_mem_prime_iff_unit_in_stalk (r : Γ.obj (op X)) (x : X) :
    r ∉ (X.toΓSpecFun x).asIdeal ↔ IsUnit (X.presheaf.Γgerm x r)

(r : ↑(AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X)))

r ∉ (X.toΓSpecFun x).asIdeal ↔ IsUnit ((X.presheaf.Γgerm x) r)


/-- A rewrite lemma for `padicValRat p (q / r)` with conditions `q ≠ 0`, `r ≠ 0`. -/
protected theorem div {q r : ℚ} (hq : q ≠ 0) (hr : r ≠ 0) :
    padicValRat p (q / r) = padicValRat p q - padicValRat p r

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{q r : ℚ}
(hq : q ≠ 0)
(hr : r ≠ 0)


theorem Codisjoint.bihimp_inf_bihimp_le_left (h : Codisjoint a b) : a ⇔ c ⊓ b ⇔ c ≤ c

{α : Type u_2}
[BooleanAlgebra α]
{a b c : α}
(h : Codisjoint a b)


/-- An affine combination with `affineCombinationLineMapWeights` gives the result of
`line_map`. -/
@[simp]
theorem affineCombination_affineCombinationLineMapWeights [DecidableEq ι] (p : ι → P) {i j : ι}
    (hi : i ∈ s) (hj : j ∈ s) (c : k) :
    s.affineCombination k p (affineCombinationLineMapWeights i j c) =
      AffineMap.lineMap (p i) (p j) c

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
[DecidableEq ι]
(p : ι → P)
{i j : ι}
(hi : i ∈ s)
(hj : j ∈ s)
(c : k)

(Finset.affineCombination k s p) (Finset.affineCombinationLineMapWeights i j c) = (AffineMap.lineMap (p i) (p j)) c


protected theorem isClosed (a : A) : IsClosed (σ a)

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
(a : A)


/-- If `f : X → Y` is `K`-Lipschitz on `s`, then `μH[d] (f '' s) ≤ K ^ d * μH[d] s`. -/
theorem hausdorffMeasure_image_le (h : LipschitzOnWith K f s) {d : ℝ} (hd : 0 ≤ d) :
    μH[d] (f '' s) ≤ (K : ℝ≥0∞) ^ d * μH[d] s

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
[MeasurableSpace X]
[BorelSpace X]
[MeasurableSpace Y]
[BorelSpace Y]
{K : ℝ≥0}
{f : X → Y}
{s : Set X}
(h : LipschitzOnWith K f s)
{d : ℝ}
(hd : 0 ≤ d)


theorem lt_iff_lt_of_le_iff_le {β} [LinearOrder α] [LinearOrder β] {a b : α} {c d : β}
    (H : a ≤ b ↔ c ≤ d) : b < a ↔ d < c

{α : Type u_2}
{β : Type u_5}
[LinearOrder α]
[LinearOrder β]
{a b : α}
{c d : β}
(H : a ≤ b ↔ c ≤ d)


@[simp]
theorem coe_comp (g : PseudoEpimorphism β γ) (f : PseudoEpimorphism α β) :
    (g.comp f : α → γ) = g ∘ f

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
(g : PseudoEpimorphism β γ)
(f : PseudoEpimorphism α β)


@[fun_prop]
nonrec theorem HasStrictFDerivAt.add (hf : HasStrictFDerivAt f f' x)
    (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun y => f y + g y) (f' + g') x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{f' g' : E →L[𝕜] F}
{x : E}
(hf : HasStrictFDerivAt f f' x)
(hg : HasStrictFDerivAt g g' x)


/-- A fixed point of f is reached after the successor of the domains cardinality -/
theorem lfpApprox_ord_mem_fixedPoint (h_init : x ≤ f x) :
    lfpApprox f x (ord <| succ #α) ∈ fixedPoints f

{α : Type u}
[CompleteLattice α]
(f : α →o α)
(x : α)
(h_init : x ≤ f x)

OrdinalApprox.lfpApprox f x (Order.succ (Cardinal.mk α)).ord ∈ Function.fixedPoints ⇑f


@[to_additive]
theorem HasProd.one_le (h : ∀ i, 1 ≤ g i) (ha : HasProd g a) : 1 ≤ a

{ι : Type u_1}
{α : Type u_3}
[OrderedAddCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{g : ι → α}
{a : α}
(h : ∀ (i : ι), 0 ≤ g i)
(ha : HasSum g a)


@[to_additive]
lemma MonoidHom.tendsto_coe_cofinite_of_discrete [T2Space G] {H : Type*} [Group H] {f : H →* G}
    (hf : Function.Injective f) (hf' : DiscreteTopology f.range) :
    Tendsto f cofinite (cocompact _)

{G : Type u_1}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
[T2Space G]
{H : Type u_2}
[Group H]
{f : H →* G}
(hf : Function.Injective ⇑f)
(hf' : DiscreteTopology ↥f.range)

Filter.Tendsto (⇑f) Filter.cofinite (Filter.cocompact G)


@[simp]
theorem interior_Ico [NoMinOrder α] {a b : α} : interior (Ico a b) = Ioo a b

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMinOrder α]
{a b : α}


{R : Type u_2}
[Add R]
[Mul R]
(c : RingCon R)


protected lemma mul_comm (x y : ⨂[R] i, A i) : mul x y = mul y x

{ι : Type u_1}
{R : Type u_3}
{A : ι → Type u_4}
[CommSemiring R]
[(i : ι) → CommSemiring (A i)]
[(i : ι) → Algebra R (A i)]
(x y : ⨂[R] (i : ι), A i)

(PiTensorProduct.mul x) y = (PiTensorProduct.mul y) x


theorem Nat.succ_le_succ : LE.le n m → LE.le (succ n) (succ m)


@[simp]
lemma baseChange_top : (⊤ : LieSubmodule R L M).baseChange A = ⊤

(R : Type u_1)
(A : Type u_2)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[CommRing A]
[Algebra R A]


@[to_additive (attr := simp)]
theorem mk_mul (a b : G) : ((a * b : G) : Q) = a * b

{G : Type u}
[Group G]
(N : Subgroup G)
[nN : N.Normal]
(a b : G)


@[simp]
theorem mem_inf {S T : NonUnitalStarSubalgebra R A} {x : A} : x ∈ S ⊓ T ↔ x ∈ S ∧ x ∈ T

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
{S T : NonUnitalStarSubalgebra R A}
{x : A}


@[simp]
theorem untrop_zero [Top R] : untrop (0 : Tropical R) = ⊤


@[to_additive]
theorem mem_closure_inv {G : Type*} [Group G] (S : Set G) (x : G) :
    x ∈ Submonoid.closure S⁻¹ ↔ x⁻¹ ∈ Submonoid.closure S

{G : Type u_6}
[Group G]
(S : Set G)
(x : G)


theorem scaleRoots_eval₂_mul_of_commute {p : S[X]} (f : S →+* A) (a : A) (s : S)
    (hsa : Commute (f s) a) (hf : ∀ s₁ s₂, Commute (f s₁) (f s₂)) :
    eval₂ f (f s * a) (scaleRoots p s) = f s ^ p.natDegree * eval₂ f a p

(hf : ∀ (s₁ s₂ : S), Commute (f s₁) (f s₂))

Polynomial.eval₂ f (f s * a) (p.scaleRoots s) = f s ^ p.natDegree * Polynomial.eval₂ f a p


theorem encard_univ (α : Type*) :
    encard (univ : Set α) = PartENat.withTopEquiv (PartENat.card α)

Set.univ.encard = PartENat.withTopEquiv (PartENat.card α)


{B : Type u_1}
{W : Type u_3}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)


theorem IsWF.min_union (hs : s.IsWF) (hsn : s.Nonempty) (ht : t.IsWF) (htn : t.Nonempty) :
    (hs.union ht).min (union_nonempty.2 (Or.intro_left _ hsn)) =
      Min.min (hs.min hsn) (ht.min htn)

{α : Type u_2}
[LinearOrder α]
{s t : Set α}
(hs : s.IsWF)
(hsn : s.Nonempty)
(ht : t.IsWF)
(htn : t.Nonempty)


/-- Given a cone `c : Cone K` and a map `f : X ⟶ F.obj c.X`, we can construct a cone of structured
arrows over `X` with `f` as the cone point.
-/
@[simps]
def Cone.toStructuredArrowCone {K : J ⥤ C} (c : Cone K) (F : C ⥤ D) {X : D} (f : X ⟶ F.obj c.pt) :
    Cone ((F.mapCone c).toStructuredArrow ⋙ StructuredArrow.map f ⋙ StructuredArrow.pre _ K F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
{K : CategoryTheory.Functor J C}
(c : CategoryTheory.Limits.Cone K)
(F : CategoryTheory.Functor C D)
{X : D}
(f : X ⟶ F.obj c.pt)

(c.toStructuredArrowCone F f).pt = CategoryTheory.StructuredArrow.mk f


@[to_additive (attr := simp)]
theorem toProd_comp_inl : (toProd : M ∗ N →* M × N).comp inl = .inl _ _

{M : Type u_1}
{N : Type u_2}
[Monoid M]
[Monoid N]

Monoid.Coprod.toProd.comp Monoid.Coprod.inl = MonoidHom.inl M N


/-- Given a morphism of presheaves of commutative rings `φ : S ⟶ F.op ⋙ R`,
this is the type of relative `φ`-derivation of a presheaf of `R`-modules `M`. -/
@[ext]
structure Derivation where
  /-- the underlying additive map `R.obj X →+ M.obj X` of a derivation -/
  d {X : Dᵒᵖ} : R.obj X →+ M.obj X
  d_mul {X : Dᵒᵖ} (a b : R.obj X) : d (a * b) = a • d b + b • d a := by aesop_cat
  d_map {X Y : Dᵒᵖ} (f : X ⟶ Y) (x : R.obj X) :
    d (R.map f x) = M.map f (d x) := by aesop_cat
  d_app {X : Cᵒᵖ} (a : S.obj X) : d (φ.app X a) = 0 := by aesop_cat

{M : PresheafOfModules (R ⋙ CategoryTheory.forget₂ CommRingCat RingCat)}

self.d ((R.map f) x) = (M.map f) (self.d x)


theorem karoubi_hasFiniteBiproducts [HasFiniteBiproducts C] : HasFiniteBiproducts (Karoubi C)


lemma add_eq_union_left_of_le [DecidableEq α] {s t u : Multiset α} (h : t ≤ s) :
    u + s = u ∪ t ↔ u.Disjoint s ∧ s = t

{α : Type u_1}
[DecidableEq α]
{s t u : Multiset α}
(h : t ≤ s)


@[simp]
theorem recOn_nil {C H0 Hs} : @Vector3.recOn α (@C) 0 [] H0 @Hs = H0

{Hs : {n : ℕ} → (a : α) → (w : Vector3 α n) → C w → C (Vector3.cons a w)}


/-- If a linear map preserves the quadratic forms and is surjective, then the algebra
maps it induces between Clifford algebras is also surjective. -/
lemma map_surjective {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} (f : Q₁ →qᵢ Q₂)
    (hf : Function.Surjective f) : Function.Surjective (CliffordAlgebra.map f)

{R : Type u_1}
[CommRing R]
{M₁ : Type u_4}
{M₂ : Type u_5}
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
{Q₁ : QuadraticForm R M₁}
{Q₂ : QuadraticForm R M₂}
(f : Q₁ →qᵢ Q₂)
(hf : Function.Surjective ⇑f)


@[to_additive]
theorem con_mul_left_inv (x : FreeMonoid (G ⊕ H)) :
    coprodCon G H (ofList (x.toList.map (Sum.map Inv.inv Inv.inv)).reverse * x) 1

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
[AddGroup H]
(x : FreeAddMonoid (G ⊕ H))

(AddMonoid.coprodCon G H)
  (FreeAddMonoid.ofList (List.map (Sum.map Neg.neg Neg.neg) (FreeAddMonoid.toList x)).reverse + x) 0


@[simp]
theorem deriv.log (hf : DifferentiableAt ℝ f x) (hx : f x ≠ 0) :
    deriv (fun x => log (f x)) x = deriv f x / f x

{f : ℝ → ℝ}
{x : ℝ}
(hf : DifferentiableAt ℝ f x)
(hx : f x ≠ 0)

deriv (fun x => Real.log (f x)) x = deriv f x / f x


theorem IsExtrOn.on_subset (hf : IsExtrOn f t a) (h : s ⊆ t) : IsExtrOn f s a

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}
{t : Set α}
(hf : IsExtrOn f t a)
(h : s ⊆ t)


theorem Filter.EventuallyEq.comp_tendsto {α β γ : Type*} {l : Filter α} {f : α → β} {f' : α → β}
    (H : f =ᶠ[l] f') {g : γ → α} {lc : Filter γ} (hg : Tendsto g lc l) :
    f ∘ g =ᶠ[lc] f' ∘ g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{l : Filter α}
{f f' : α → β}
(H : f =ᶠ[l] f')
{g : γ → α}
{lc : Filter γ}
(hg : Filter.Tendsto g lc l)


protected theorem symm_mapsTo : MapsTo e.symm e.target e.source

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)


theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r)
    {y : E} (hy : (‖y‖₊ : ℝ≥0∞) < r) :
    fderiv 𝕜 f (x + y) = continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin y 1)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : FormalMultilinearSeries 𝕜 E F}
{r : ℝ≥0∞}
{f : E → F}
{x : E}
[CompleteSpace F]
(h : HasFPowerSeriesOnBall f p x r)
{y : E}
(hy : ↑‖y‖₊ < r)

fderiv 𝕜 f (x + y) = (continuousMultilinearCurryFin1 𝕜 E F) (p.changeOrigin y 1)


theorem lt_iterate_pos_iff {x : ℝ} {m : ℤ} {n : ℕ} (hn : 0 < n) :
    x + n * m < f^[n] x ↔ x + m < f x

(f : CircleDeg1Lift)
{x : ℝ}
{m : ℤ}
{n : ℕ}
(hn : 0 < n)


theorem snd_sSup [SupSet α] [SupSet β] (s : Set (α × β)) : (sSup s).snd = sSup (Prod.snd '' s)

{α : Type u_1}
{β : Type u_2}
[SupSet α]
[SupSet β]
(s : Set (α × β))


theorem edgeFinset_subset_edgeFinset : G₁.edgeFinset ⊆ G₂.edgeFinset ↔ G₁ ≤ G₂

{V : Type u_1}
{G₁ G₂ : SimpleGraph V}
[Fintype ↑G₁.edgeSet]
[Fintype ↑G₂.edgeSet]


/-- A slight reformulation of `IsLocalStructomorphWithinAt` when `f` is a partial homeomorph and
  the set we're considering is a superset of `f.source`. -/
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff' {G : StructureGroupoid H}
    [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H} (hs : f.source ⊆ s)
    (hx : x ∈ f.source ∪ sᶜ) :
    G.IsLocalStructomorphWithinAt (⇑f) s x ↔
      x ∈ s → ∃ e : PartialHomeomorph H H,
      e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) e.source ∧ x ∈ e.source

{H : Type u_1}
[TopologicalSpace H]
{G : StructureGroupoid H}
[ClosedUnderRestriction G]
(f : PartialHomeomorph H H)
{s : Set H}
{x : H}
(hs : f.source ⊆ s)
(hx : x ∈ f.source ∪ sᶜ)

G.IsLocalStructomorphWithinAt (↑f) s x ↔
  x ∈ s → ∃ e ∈ G, e.source ⊆ f.source ∧ Set.EqOn (↑f) (↑e) e.source ∧ x ∈ e.source


lemma IsUnit.mem_nonZeroDivisors {a : M} (ha : IsUnit a) : a ∈ M⁰

{M : Type u_2}
[MonoidWithZero M]
{a : M}
(ha : IsUnit a)


theorem mul_invOf_eq_iff_eq_mul_right : a * ⅟c = b ↔ a = b * c

{α : Type u}
[Monoid α]
{a b c : α}
[Invertible c]


theorem mem_of_mem_image_val (ha : a ∈ (γ : Set α)) : ⟨a, image_val_subset ha⟩ ∈ γ

{α : Type u}
{β : Set α}
{γ : Set ↑β}
{a : α}
(ha : a ∈ ↑γ)


@[to_additive]
theorem ediam_mul_le (x y : Set E) : EMetric.diam (x * y) ≤ EMetric.diam x + EMetric.diam y

{E : Type u_1}
[SeminormedCommGroup E]
(x y : Set E)


theorem map_iInf_eq {f : ι → Filter α} {m : α → β} (hf : Directed (· ≥ ·) f) [Nonempty ι] :
    map m (iInf f) = ⨅ i, map m (f i)

(hf : Directed (fun x x_1 => x ≥ x_1) f)

Filter.map m (iInf f) = ⨅ i, Filter.map m (f i)


theorem ext {x y : ExceptT ε m α} (h : x.run = y.run) : x = y

{ε : Type u_1}
{m : Type u_1 → Type u_2}
{α : Type u_1}
{x y : ExceptT ε m α}
(h : x.run = y.run)


theorem IsBoundedUnder.bddAbove_range [Preorder β] [IsDirected β (· ≤ ·)] {f : ℕ → β}
    (hf : IsBoundedUnder (· ≤ ·) atTop f) : BddAbove (range f)

(hf : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) Filter.atTop f)


lemma Equivalence.reflexive {r : β → β → Prop} (h : Equivalence r) : Reflexive r

{β : Sort v}
{r : β → β → Prop}
(h : Equivalence r)


@[trans]
theorem ManyOneReducible.trans {α β γ} [Primcodable α] [Primcodable β] [Primcodable γ]
    {p : α → Prop} {q : β → Prop} {r : γ → Prop} : p ≤₀ q → q ≤₀ r → p ≤₀ r

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
{p : α → Prop}
{q : β → Prop}
{r : γ → Prop}

p ≤₀ q → q ≤₀ r → p ≤₀ r


theorem cokernel.π_unop :
    (cokernel.π g.unop).op =
      (cokernelUnopOp g).hom ≫ kernel.ι g ≫ eqToHom (Opposite.op_unop _).symm

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
{A B : Cᵒᵖ}
(g : A ⟶ B)

(CategoryTheory.Limits.cokernel.π g.unop).op =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.cokernelUnopOp g).hom
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.kernel.ι g) (CategoryTheory.eqToHom ⋯))


/-- Two simplices are equal if and only if they have the same points. -/
theorem ext_iff {n : ℕ} (s1 s2 : Simplex k P n) : s1 = s2 ↔ ∀ i, s1.points i = s2.points i

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{n : ℕ}
(s1 s2 : Affine.Simplex k P n)

s1 = s2 ↔ ∀ (i : Fin (n + 1)), s1.points i = s2.points i


/-- Assemble an `I`-indexed family of functors into a functor between the pi types.
-/
@[simps]
def pi (F : ∀ i, C i ⥤ D i) : (∀ i, C i) ⥤ ∀ i, D i

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

[(i : I) → CategoryTheory.Category.{v₂, u₂} (D i)]

(F : (i : I) → CategoryTheory.Functor (C i) (D i))

∀ {X Y : (i : I) → C i} (α : X ⟶ Y) (i : I), (CategoryTheory.Functor.pi F).map α i = (F i).map (α i)


theorem arcsin_mem_Icc (x : ℝ) : arcsin x ∈ Icc (-(π / 2)) (π / 2)

Real.arcsin x ∈ Set.Icc (-(π / 2)) (π / 2)


@[measurability, fun_prop]
lemma _root_.EReal.measurable_exp : Measurable exp


theorem sub_apply : (D1 - D2) a = D1 a - D2 a

{R : Type u_1}
[CommRing R]
{A : Type u_2}
[CommRing A]
[Algebra R A]
{M : Type u_3}
[AddCommGroup M]
[Module A M]
[Module R M]
{D1 D2 : Derivation R A M}
(a : A)


@[to_additive (attr := simp)]
theorem coe_snd : ⇑(snd M N) = Prod.snd

{M : Type u_5}
{N : Type u_6}
[MulOneClass M]
[MulOneClass N]


@[simp]
lemma preΨ_four : W.preΨ 4 = W.preΨ₄

{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)


theorem ite_subset_union (s s' : Finset α) (P : Prop) [Decidable P] : ite P s s' ⊆ s ∪ s'

{α : Type u_1}
[DecidableEq α]
(s s' : Finset α)
(P : Prop)
[Decidable P]


theorem inner_single_right (i : ι) (a : G i) (f : lp G 2) : ⟪f, lp.single 2 i a⟫ = ⟪f i, a⟫

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{G : ι → Type u_4}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
(i : ι)
(a : G i)
(f : ↥(lp G 2))


@[simp] theorem surjOn_empty_iff : SurjOn f ∅ t ↔ t = ∅

{α : Type u_1}
{β : Type u_2}
{t : Set β}
{f : α → β}


@[deprecated DifferentiableOn.sub_iff_left (since := "2024-07-11")]
theorem differentiableOn_sub_const_iff (c : F) :
    DifferentiableOn 𝕜 (fun y => f y - c) s ↔ DifferentiableOn 𝕜 f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(c : F)


/-- A helper function used in defining the Čech conerve adjunction. -/
@[simps]
def equivalenceLeftToRight (F : Arrow C) (X : CosimplicialObject.Augmented C)
    (G : F.augmentedCechConerve ⟶ X) : F ⟶ Augmented.toArrow.obj X

[∀ (n : ℕ) (f : CategoryTheory.Arrow C), CategoryTheory.Limits.HasWidePushout f.left (fun x => f.right) fun x => f.hom]

(X : CategoryTheory.CosimplicialObject.Augmented C)

(CategoryTheory.CosimplicialObject.equivalenceLeftToRight F X G).left = G.left


/-- `2` is not a factor of an odd natural number. -/
lemma Odd.ne_two_of_dvd_nat {m n : ℕ} (hn : Odd n) (hm : m ∣ n) : m ≠ 2


/-- If `f` is surjective, then `Nat.card β ≤ Nat.card α`. We must also assume
  `Nat.card α = 0 → Nat.card β = 0` since `Nat.card` is defined to be `0` for infinite types. -/
theorem card_le_of_surjective' {f : α → β} (hf : Function.Surjective f)
    (h : Nat.card α = 0 → Nat.card β = 0) : Nat.card β ≤ Nat.card α

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(hf : Function.Surjective f)
(h : Nat.card α = 0 → Nat.card β = 0)


theorem neg [AddGroup β] [TopologicalAddGroup β] {f : α → β} (hfm : AEStronglyMeasurable' m f μ) :
    AEStronglyMeasurable' m (-f) μ

(hfm : MeasureTheory.AEStronglyMeasurable' m f μ)

MeasureTheory.AEStronglyMeasurable' m (-f) μ


protected theorem smooth (s : Cₛ^∞⟮I; F, V⟯) :
    Smooth I (I.prod 𝓘(𝕜, F)) fun x => TotalSpace.mk' F x (s x : V x)

[TopologicalSpace (Bundle.TotalSpace F V)]

Smooth I (I.prod 𝓘(𝕜, F)) fun x => Bundle.TotalSpace.mk' F x (s x)


/-- The existence of a right adjoint of `f`. -/
class IsLeftAdjoint (left : a ⟶ b) : Prop where mk' ::
  nonempty : Nonempty (RightAdjoint left)

[self : CategoryTheory.Bicategory.IsLeftAdjoint left]


@[simp]
lemma map_zero (hf : Measurable f) : Kernel.map (0 : Kernel α β) f hf = 0

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
{f : β → γ}
(hf : Measurable f)


theorem cont_normedSpace_to_withSeminorms (E) [SeminormedAddCommGroup E] [NormedSpace 𝕝 E]
    [TopologicalSpace F] {q : ι → Seminorm 𝕝₂ F} (hq : WithSeminorms q)
    (f : E →ₛₗ[τ₁₂] F) (hf : ∀ i : ι, ∃ C : ℝ≥0, (q i).comp f ≤ C • normSeminorm 𝕝 E) :
    Continuous f

{τ₁₂ : 𝕝 →+* 𝕝₂}

(hf : ∀ (i : ι), ∃ C, (q i).comp f ≤ C • normSeminorm 𝕝 E)


theorem isAntichain_and_least_iff : IsAntichain (· ≤ ·) s ∧ IsLeast s a ↔ s = {a}

{α : Type u_1}
{s : Set α}
{a : α}
[Preorder α]

IsAntichain (fun x x_1 => x ≤ x_1) s ∧ IsLeast s a ↔ s = {a}


theorem HasDerivAt.hasFDerivAt_equiv {f : 𝕜 → 𝕜} {f' x : 𝕜} (hf : HasDerivAt f f' x)
    (hf' : f' ≠ 0) :
    HasFDerivAt f (ContinuousLinearEquiv.unitsEquivAut 𝕜 (Units.mk0 f' hf') : 𝕜 →L[𝕜] 𝕜) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{f : 𝕜 → 𝕜}
{f' x : 𝕜}
(hf : HasDerivAt f f' x)
(hf' : f' ≠ 0)

HasFDerivAt f (↑((ContinuousLinearEquiv.unitsEquivAut 𝕜) (Units.mk0 f' hf'))) x


theorem of.zero_exact_aux [∀ i (k : G i), Decidable (k ≠ 0)] [Nonempty ι] [IsDirected ι (· ≤ ·)]
    {x : DirectSum ι G} (H : (Submodule.Quotient.mk x : DirectLimit G f) = (0 : DirectLimit G f)) :
    ∃ j,
      (∀ k ∈ x.support, k ≤ j) ∧
        DirectSum.toModule R ι (G j) (fun i => totalize G f i j) x = (0 : G j)

[DirectedSystem G fun i j h => ⇑(f i j h)]

[(i : ι) → (k : G i) → Decidable (k ≠ 0)]

∃ j,
  (∀ k ∈ DFinsupp.support x, k ≤ j) ∧ (DirectSum.toModule R ι (G j) fun i => Module.DirectLimit.totalize G f i j) x = 0


@[simp]
theorem subtypeDomain_smul [Monoid γ] [∀ i, AddMonoid (β i)] [∀ i, DistribMulAction γ (β i)]
    {p : ι → Prop} [DecidablePred p] (r : γ) (f : Π₀ i, β i) :
    (r • f).subtypeDomain p = r • f.subtypeDomain p

{ι : Type u}
{γ : Type w}
{β : ι → Type v}
[Monoid γ]
[(i : ι) → AddMonoid (β i)]
[(i : ι) → DistribMulAction γ (β i)]
{p : ι → Prop}
[DecidablePred p]
(r : γ)
(f : Π₀ (i : ι), β i)

DFinsupp.subtypeDomain p (r • f) = r • DFinsupp.subtypeDomain p f


theorem powerlt_le {a b c : Cardinal.{u}} : a ^< b ≤ c ↔ ∀ x < b, a ^ x ≤ c


theorem setIntegral_re_add_im {f : X → 𝕜} {i : Set X} (hf : IntegrableOn f i μ) :
    ((∫ x in i, RCLike.re (f x) ∂μ : ℝ) : 𝕜) + (∫ x in i, RCLike.im (f x) ∂μ : ℝ) * RCLike.I =
      ∫ x in i, f x ∂μ

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{𝕜 : Type u_5}
[RCLike 𝕜]
{f : X → 𝕜}
{i : Set X}
(hf : MeasureTheory.IntegrableOn f i μ)

↑(∫ (x : X) in i, RCLike.re (f x) ∂μ) + ↑(∫ (x : X) in i, RCLike.im (f x) ∂μ) * RCLike.I = ∫ (x : X) in i, f x ∂μ


theorem mem_support_swap_mul_imp_mem_support_ne {x y : α} (hy : y ∈ support (swap x (f x) * f)) :
    y ∈ support f ∧ y ≠ x

(hy : y ∈ (Equiv.swap x (f x) * f).support)


/-- **Hahn-Banach theorem**: if `N : E → ℝ` is a sublinear map, `f` is a linear map
defined on a subspace of `E`, and `f x ≤ N x` for all `x` in the domain of `f`,
then `f` can be extended to the whole space to a linear map `g` such that `g x ≤ N x`
for all `x`. -/
theorem exists_extension_of_le_sublinear (f : E →ₗ.[ℝ] ℝ) (N : E → ℝ)
    (N_hom : ∀ c : ℝ, 0 < c → ∀ x, N (c • x) = c * N x) (N_add : ∀ x y, N (x + y) ≤ N x + N y)
    (hf : ∀ x : f.domain, f x ≤ N x) :
    ∃ g : E →ₗ[ℝ] ℝ, (∀ x : f.domain, g x = f x) ∧ ∀ x, g x ≤ N x

(N_hom : ∀ (c : ℝ), 0 < c → ∀ (x : E), N (c • x) = c * N x)

(N_add : ∀ (x y : E), N (x + y) ≤ N x + N y)

∃ g, (∀ (x : ↥f.domain), g ↑x = ↑f x) ∧ ∀ (x : E), g x ≤ N x


theorem submodule_injective :
    Function.Injective (Projectivization.submodule : ℙ K V → Submodule K V)

{K : Type u_1}
{V : Type u_2}
[DivisionRing K]
[AddCommGroup V]
[Module K V]


/-- The lower integral of a function over `AddCircle T` is equal to the lower integral over an
interval (t, t + T] in `ℝ` of its lift to `ℝ`. -/
protected theorem lintegral_preimage (t : ℝ) (f : AddCircle T → ℝ≥0∞) :
    (∫⁻ a in Ioc t (t + T), f a) = ∫⁻ b : AddCircle T, f b

(T : ℝ)
[hT : Fact (0 < T)]
(t : ℝ)
(f : AddCircle T → ℝ≥0∞)

∫⁻ (a : ℝ) in Set.Ioc t (t + T), f ↑a = ∫⁻ (b : AddCircle T), f b


/-- If `L` is a finite extension of `K = Frac(A)`,
then `L` has a basis over `A` consisting of integral elements. -/
theorem FiniteDimensional.exists_is_basis_integral :
    ∃ (s : Finset L) (b : Basis s K L), ∀ x, IsIntegral A (b x)

(A : Type u_2)
(K : Type u_3)
[CommRing A]
[Field K]
[IsDomain A]
[Algebra A K]
[IsFractionRing A K]
(L : Type u_4)
[Field L]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[FiniteDimensional K L]

∃ s b, ∀ (x : { x // x ∈ s }), IsIntegral A (b x)


/-- There are distinct ordinals smaller than the successor of the domains cardinals with
  equal value -/
theorem exists_gfpApprox_eq_gfpApprox : ∃ a < ord <| succ #α, ∃ b < ord <| succ #α,
    a ≠ b ∧ gfpApprox f x a = gfpApprox f x b

{α : Type u}
[CompleteLattice α]
(f : α →o α)
(x : α)

∃ a < (Order.succ (Cardinal.mk α)).ord,
  ∃ b < (Order.succ (Cardinal.mk α)).ord, a ≠ b ∧ OrdinalApprox.gfpApprox f x a = OrdinalApprox.gfpApprox f x b


theorem liftPropWithinAt_of_liftPropAt (mono : ∀ ⦃s x t⦄ ⦃f : H → H'⦄, t ⊆ s → P f s x → P f t x)
    (h : LiftPropAt P g x) : LiftPropWithinAt P g s x

(mono : ∀ ⦃s : Set H⦄ ⦃x : H⦄ ⦃t : Set H⦄ ⦃f : H → H'⦄, t ⊆ s → P f s x → P f t x)


theorem Surjective.prodMap (hf : Surjective f) (hg : Surjective g) : Surjective (map f g)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{f : α → γ}
{g : β → δ}
(hf : Function.Surjective f)
(hg : Function.Surjective g)


@[to_additive]
theorem relindex_le_of_le_right (hKL : K ≤ L) (hHL : H.relindex L ≠ 0) :
    H.relindex K ≤ H.relindex L

{G : Type u_1}
[AddGroup G]
{H K L : AddSubgroup G}
(hKL : K ≤ L)
(hHL : H.relindex L ≠ 0)


theorem LipschitzOnWith.coordinate [PseudoMetricSpace α] (f : α → ℓ^∞(ι)) (s : Set α) (K : ℝ≥0) :
    LipschitzOnWith K f s ↔ ∀ i : ι, LipschitzOnWith K (fun a : α ↦ f a i) s

{α : Type u_1}
{ι : Type u_3}
[PseudoMetricSpace α]
(f : α → ↥(lp (fun i => ℝ) ⊤))
(s : Set α)
(K : ℝ≥0)

LipschitzOnWith K f s ↔ ∀ (i : ι), LipschitzOnWith K (fun a => ↑(f a) i) s


@[simp]
theorem quotQuotToQuotSupₐ_toRingHom :
    ((quotQuotToQuotSupₐ R I J) : _ ⧸ map (Ideal.Quotient.mkₐ R I) J →+* _) =
      quotQuotToQuotSup I J

(R : Type u)
{A : Type u_1}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(I J : Ideal A)

↑(DoubleQuot.quotQuotToQuotSupₐ R I J) = DoubleQuot.quotQuotToQuotSup I J


/-- The equivalence between `BddLat` and itself induced by `OrderDual` both ways. -/
@[simps functor inverse]
def dualEquiv : BddLat ≌ BddLat


lemma cfc_comp (g f : R → R) (a : A) (ha : p a := by cfc_tac)
    (hg : ContinuousOn g (f '' spectrum R a) := by cfc_cont_tac)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) :
    cfc (g ∘ f) a = cfc g (cfc f a)


theorem leftInverse_expMapCircle_arg : LeftInverse expMapCircle (arg ∘ (↑))

Function.LeftInverse (⇑expMapCircle) (Complex.arg ∘ Subtype.val)


theorem rpow_mul {x : ℝ} (hx : 0 ≤ x) (y z : ℝ) : x ^ (y * z) = (x ^ y) ^ z


@[simp]
lemma image_subtype_val_Ioc {s : Set α} [OrdConnected s] (x y : s) :
    Subtype.val '' Ioc x y = Ioc x.1 y

{α : Type u_1}
[Preorder α]
{s : Set α}
[s.OrdConnected]
(x y : ↑s)

Subtype.val '' Set.Ioc x y = Set.Ioc ↑x ↑y


@[to_additive (attr := simp)]
theorem mul_leftInvEquiv_symm (x : S) : (x : M) * (S.leftInvEquiv hS).symm x = 1

{M : Type u_1}
[CommMonoid M]
(S : Submonoid M)
(hS : S ≤ IsUnit.submonoid M)
(x : ↥S)


/-- The left fraction from `X` to `Y` given by a morphism `f : X ⟶ Y`. -/
@[simps]
def ofHom (f : X ⟶ Y) [W.ContainsIdentities] :
    W.LeftFraction X Y

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(W : CategoryTheory.MorphismProperty C)
{X Y : C}
(f : X ⟶ Y)
[W.ContainsIdentities]

(CategoryTheory.MorphismProperty.LeftFraction.ofHom W f).f = f


/-- Conjugating `ClosureOperators` on `α` and on `β` by a fixed isomorphism
`e : α ≃o β` gives an equivalence `ClosureOperator α ≃ ClosureOperator β`. -/
@[simps apply symm_apply]
def OrderIso.equivClosureOperator {α β} [Preorder α] [Preorder β] (e : α ≃o β) :
    ClosureOperator α ≃ ClosureOperator β

{α : Type u_4}
{β : Type u_5}
[Preorder α]
[Preorder β]
(e : α ≃o β)
(c : ClosureOperator β)

e.equivClosureOperator.symm c = c.conjBy e.symm


theorem adjoin_algebra_injective :
    Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K)

(n : ℕ+)
(A : Type u)
(K : Type w)
[CommRing A]
[Field K]
[Algebra A K]

Function.Injective ⇑(algebraMap (CyclotomicRing n A K) (CyclotomicField n K))


/-- If a function `f` with a densely ordered codomain is strictly monotone on a right neighborhood
of `a` and the image of this neighborhood under `f` is a right neighborhood of `f a`, then `f` is
continuous at `a` from the right. -/
theorem StrictMonoOn.continuousWithinAt_right_of_image_mem_nhdsWithin [DenselyOrdered β] {f : α → β}
    {s : Set α} {a : α} (h_mono : StrictMonoOn f s) (hs : s ∈ 𝓝[≥] a) (hfs : f '' s ∈ 𝓝[≥] f a) :
    ContinuousWithinAt f (Ici a) a

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[LinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
[DenselyOrdered β]
{f : α → β}
{s : Set α}
{a : α}
(h_mono : StrictMonoOn f s)
(hs : s ∈ 𝓝[≥] a)
(hfs : f '' s ∈ 𝓝[≥] f a)


theorem neg_of_mul_pos_right [PosMulMono α] [MulPosMono α] (h : 0 < a * b) (ha : a ≤ 0) : b < 0

{α : Type u_1}
{a b : α}
[MulZeroClass α]
[LinearOrder α]
[PosMulMono α]
[MulPosMono α]
(h : 0 < a * b)
(ha : a ≤ 0)


@[aesop safe apply (rule_sets := [SetLike])]
theorem self_mem (x : A) : x ∈ elementalStarAlgebra R x

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[TopologicalSpace A]
[Semiring A]
[StarRing A]
[TopologicalSemiring A]
[ContinuousStar A]
[Algebra R A]
[StarModule R A]
(x : A)


theorem boundedBy_le (s : Set α) : boundedBy m s ≤ m s

{α : Type u_1}
{m : Set α → ℝ≥0∞}
(s : Set α)

(MeasureTheory.OuterMeasure.boundedBy m) s ≤ m s


theorem eq_sum_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    map φ P =
      ⟨φ P.a, φ P.a * -(x + y + z), φ P.a * (x * y + x * z + y * z), φ P.a * -(x * y * z)⟩

(h3 : (Cubic.map φ P).roots = {x, y, z})


@[to_additive]
theorem div_card_le : (s / t).card ≤ s.card * t.card

{α : Type u_2}
[DecidableEq α]
[Sub α]
{s t : Finset α}


@[simp] theorem infinitePos_neg {x : ℝ*} : InfinitePos (-x) ↔ InfiniteNeg x


theorem mem_lowerBounds_image2_of_mem_lowerBounds_of_mem_lowerBounds (ha : a ∈ upperBounds s)
    (hb : b ∈ lowerBounds t) : f a b ∈ lowerBounds (image2 f s t)

{f : α → β → γ}

(h₀ : ∀ (b : β), Antitone (Function.swap f b))


lemma realPart_surjective : Function.Surjective (realPart (A := A))

{A : Type u_1}
[AddCommGroup A]
[Module ℂ A]
[StarAddMonoid A]
[StarModule ℂ A]


theorem mem_left {b : Board} (x : ℤ × ℤ) : x ∈ left b ↔ x ∈ b ∧ (x.1, x.2 - 1) ∈ b

{b : SetTheory.PGame.Domineering.Board}
(x : ℤ × ℤ)

x ∈ SetTheory.PGame.Domineering.left b ↔ x ∈ b ∧ (x.1, x.2 - 1) ∈ b


@[simp]
theorem preimage_const_mul_Icc (a b : α) {c : α} (h : 0 < c) :
    (c * ·) ⁻¹' Icc a b = Icc (a / c) (b / c)

{α : Type u_1}
[LinearOrderedField α]
(a b : α)
{c : α}
(h : 0 < c)

(fun x => c * x) ⁻¹' Set.Icc a b = Set.Icc (a / c) (b / c)


@[simp]
theorem map_rel (φ : M ≃[L] N) {n : ℕ} (r : L.Relations n) (x : Fin n → M) :
    RelMap r (φ ∘ x) ↔ RelMap r x

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(φ : L.Equiv M N)
{n : ℕ}
(r : L.Relations n)
(x : Fin n → M)

FirstOrder.Language.Structure.RelMap r (⇑φ ∘ x) ↔ FirstOrder.Language.Structure.RelMap r x


/-- A version of `Equiv.mulLeft a b⁻¹` that is defeq to `a / b`. -/
@[to_additive (attr := simps) " A version of `Equiv.addLeft a (-b)` that is defeq to `a - b`. "]
protected def divLeft (a : G) : G ≃ G


@[simp, norm_cast]
theorem coe_neg (z1 : ℤ_[p]) : ((-z1 : ℤ_[p]) : ℚ_[p]) = -z1

{p : ℕ}
[Fact (Nat.Prime p)]
(z1 : ℤ_[p])


theorem opNorm_eq_of_bounds {M : ℝ} (M_nonneg : 0 ≤ M) (h_above : ∀ x, ‖f x‖ ≤ M * ‖x‖)
    (h_below : ∀ N ≥ 0, (∀ x, ‖f x‖ ≤ N * ‖x‖) → M ≤ N) : ‖f‖ = M

(h_below : ∀ N ≥ 0, (∀ (x : V₁), ‖f x‖ ≤ N * ‖x‖) → M ≤ N)


@[to_additive (attr := simp)] lemma unop_inv [Inv α] (x : αᵐᵒᵖ) : unop x⁻¹ = (unop x)⁻¹

AddOpposite.unop (-x) = -AddOpposite.unop x


theorem hasDerivAt_iff_isLittleO :
    HasDerivAt f f' x ↔ (fun x' : 𝕜 => f x' - f x - (x' - x) • f') =o[𝓝 x] fun x' => x' - x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}

HasDerivAt f f' x ↔ (fun x' => f x' - f x - (x' - x) • f') =o[𝓝 x] fun x' => x' - x


@[to_additive]
theorem ofList_map (f : α → β) (xs : List α) : ofList (xs.map f) = map f (ofList xs)

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(xs : List α)

FreeMonoid.ofList (List.map f xs) = (FreeMonoid.map f) (FreeMonoid.ofList xs)


@[reassoc (attr := simp)]
lemma _root_.CategoryTheory.Iso.inv_hom_id_triangle_hom₂ {A B : Triangle C} (e : A ≅ B) :
    e.inv.hom₂ ≫ e.hom.hom₂ = 𝟙 _

{A B : CategoryTheory.Pretriangulated.Triangle C}


/-- **Fermat's Theorem**: the derivative of a function at a local extremum equals zero. -/
theorem IsLocalExtr.fderiv_eq_zero (h : IsLocalExtr f a) : fderiv ℝ f a = 0

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{a : E}
(h : IsLocalExtr f a)


theorem Antiperiodic.const_inv_smul [AddMonoid α] [Neg β] [Group γ] [DistribMulAction γ α]
    (h : Antiperiodic f c) (a : γ) : Antiperiodic (fun x => f (a⁻¹ • x)) (a • c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{c : α}
[AddMonoid α]
[Neg β]
[Group γ]
[DistribMulAction γ α]
(h : Function.Antiperiodic f c)
(a : γ)

Function.Antiperiodic (fun x => f (a⁻¹ • x)) (a • c)


lemma rank_le_card : rank R L M ≤ Fintype.card ιₘ

(R : Type u_1)
(L : Type u_3)
(M : Type u_4)
{ιₘ : Type u_6}
[CommRing R]
[Nontrivial R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[Module.Free R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[Module.Finite R M]
[Module.Free R M]
[Fintype ιₘ]
(bₘ : Basis ιₘ R M)


@[simp] lemma preimage_subtype_val_Ioc (a b : {x // p x}) : (↑) ⁻¹' (Ioc a.1 b) = Ioc a b

{α : Type u_1}
[Preorder α]
{p : α → Prop}
(a b : { x // p x })

Subtype.val ⁻¹' Set.Ioc ↑a ↑b = Set.Ioc a b


/-- The counit of the constructed pointwise right Kan extension when
`HasPointwiseRightKanExtension L F` holds. -/
@[simps]
noncomputable def pointwiseRightKanExtensionCounit :
    L ⋙ pointwiseRightKanExtension L F ⟶ F

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Category.{u_6, u_3} H]
(L : CategoryTheory.Functor C D)
(F : CategoryTheory.Functor C H)
[L.HasPointwiseRightKanExtension F]
(X : C)

(L.pointwiseRightKanExtensionCounit F).app X =
  CategoryTheory.Limits.limit.π ((CategoryTheory.StructuredArrow.proj (L.obj X) L).comp F)
    (CategoryTheory.StructuredArrow.mk (CategoryTheory.CategoryStruct.id (L.obj X)))


@[simp]
theorem neg_apply [∀ i j, Neg (α i j)] (M : DMatrix m n α) (i j) : (-M) i j = -M i j

{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[(i : m) → (j : n) → Neg (α i j)]
(M : DMatrix m n α)
(i : m)
(j : n)


theorem lift_of {i} (x : G i) : lift L ι G f g Hg (of L ι G f i x) = g i x

[DirectedSystem G fun i j h => ⇑(f i j h)]

(Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (g i) x)

(FirstOrder.Language.DirectLimit.lift L ι G f g Hg) ((FirstOrder.Language.DirectLimit.of L ι G f i) x) = (g i) x


@[to_additive]
theorem card_inv_le : s⁻¹.card ≤ s.card

{α : Type u_2}
[DecidableEq α]
[Inv α]
{s : Finset α}


@[simp]
theorem imageToKernel_comp_mono {D : V} (h : C ⟶ D) [Mono h] (w) :
    imageToKernel f (g ≫ h) w =
      imageToKernel f g ((cancel_mono h).mp (by simpa using w : (f ≫ g) ≫ h = 0 ≫ h)) ≫
        (Subobject.isoOfEq _ _ (kernelSubobject_comp_mono g h)).inv

imageToKernel f (g ≫ h) w =
  imageToKernel f g ⋯ ≫
    ((CategoryTheory.Limits.kernelSubobject (g ≫ h)).isoOfEq (CategoryTheory.Limits.kernelSubobject g) ⋯).inv


theorem one_hadamard : (1 : Matrix n n α) ⊙ M = diagonal fun i => M i i

{α : Type u_1}
{n : Type u_5}
[DecidableEq n]
[MulZeroOneClass α]
(M : Matrix n n α)

Matrix.hadamard 1 M = Matrix.diagonal fun i => M i i


theorem ne_zero_of_coeff_ne_zero {x : HahnSeries Γ R} {g : Γ} (h : x.coeff g ≠ 0) : x ≠ 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{x : HahnSeries Γ R}
{g : Γ}
(h : x.coeff g ≠ 0)


/-- We can clear the denominators of a finite indexed family of fractions. -/
theorem exist_integer_multiples_of_finite {ι : Type*} [Finite ι] (g : ι → M') :
    ∃ b : S, ∀ i, IsInteger f ((b : R) • g i)

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{M' : Type u_3}
[AddCommMonoid M']
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
{ι : Type u_4}
[Finite ι]
(g : ι → M')

∃ b, ∀ (i : ι), IsLocalizedModule.IsInteger f (↑b • g i)


theorem Kernel.measure_zero_or_one_of_measurableSet_limsup (h_le : ∀ n, s n ≤ m0)
    (h_indep : iIndep s κ μα)
    (hf : ∀ t, p t → tᶜ ∈ f) (hns : Directed (· ≤ ·) ns) (hnsp : ∀ a, p (ns a))
    (hns_univ : ∀ n, ∃ a, n ∈ ns a) {t : Set Ω} (ht_tail : MeasurableSet[limsup s f] t) :
    ∀ᵐ a ∂μα, κ a t = 0 ∨ κ a t = 1

{α : Type u_1}
{Ω : Type u_2}
{ι : Type u_3}
{_mα : MeasurableSpace α}
{s : ι → MeasurableSpace Ω}
{m0 : MeasurableSpace Ω}
{κ : ProbabilityTheory.Kernel α Ω}
{μα : MeasureTheory.Measure α}
[ProbabilityTheory.IsMarkovKernel κ]

∀ {α_1 : Type u_4} {p : Set ι → Prop} {f : Filter ι} {ns : α_1 → Set ι},
  (∀ (n : ι), s n ≤ m0) →
    ProbabilityTheory.Kernel.iIndep s κ μα →
      (∀ (t : Set ι), p t → tᶜ ∈ f) →
        Directed (fun x x_1 => x ≤ x_1) ns →
          (∀ (a : α_1), p (ns a)) →
            (∀ (n : ι), ∃ a, n ∈ ns a) → ∀ {t : Set Ω}, MeasurableSet t → ∀ᵐ (a : α) ∂μα, (κ a) t = 0 ∨ (κ a) t = 1


lemma densityProcess_le_one (hκν : fst κ ≤ ν) (n : ℕ) (a : α) (x : γ) (s : Set β) :
    densityProcess κ ν n a x s ≤ 1

{κ : ProbabilityTheory.Kernel α (γ × β)}


theorem differentiableAt_Λ {s : ℂ} (hs : s ≠ 0 ∨ P.f₀ = 0) (hs' : s ≠ P.k ∨ P.g₀ = 0) :
    DifferentiableAt ℂ P.Λ s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(P : WeakFEPair E)
{s : ℂ}
(hs : s ≠ 0 ∨ P.f₀ = 0)
(hs' : s ≠ ↑P.k ∨ P.g₀ = 0)


theorem sqLe_add_mixed {c d x y z w : ℕ} (xy : SqLe x c y d) (zw : SqLe z c w d) :
    c * (x * z) ≤ d * (y * w)

{c d x y z w : ℕ}
(xy : Zsqrtd.SqLe x c y d)
(zw : Zsqrtd.SqLe z c w d)


@[simp]
theorem fromEdgeSet_sdiff (s t : Set (Sym2 V)) :
    fromEdgeSet (s \ t) = fromEdgeSet s \ fromEdgeSet t

SimpleGraph.fromEdgeSet (s \ t) = SimpleGraph.fromEdgeSet s \ SimpleGraph.fromEdgeSet t


theorem lt_top_of_mul_ne_top_left (h : a * b ≠ ∞) (hb : b ≠ 0) : a < ∞

{a b : ℝ≥0∞}
(h : a * b ≠ ⊤)
(hb : b ≠ 0)


theorem eq_of_left_mem_center {g h : M} (H : IsConj g h) (Hg : g ∈ Set.center M) : g = h

{M : Type u_2}
[Monoid M]
{g h : M}
(H : IsConj g h)
(Hg : g ∈ Set.center M)


theorem toUniformSpace_eq :
    toUniformSpace = @TopologicalAddGroup.toUniformSpace R _ v.subgroups_basis.topology _

(R : Type u)
[Ring R]
(Γ₀ : Type v)
[LinearOrderedCommGroupWithZero Γ₀]
[_i : Valued R Γ₀]

Valued.toUniformSpace = TopologicalAddGroup.toUniformSpace R


@[simp]
theorem natDegree_natCast (n : ℕ) : natDegree (n : R[X]) = 0


theorem setAverage_eq (f : α → E) (s : Set α) :
    ⨍ x in s, f x ∂μ = (μ s).toReal⁻¹ • ∫ x in s, f x ∂μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(μ : MeasureTheory.Measure α)
(f : α → E)
(s : Set α)

⨍ (x : α) in s, f x ∂μ = (μ s).toReal⁻¹ • ∫ (x : α) in s, f x ∂μ


/--
In an additive monoid with multiplication, every square is a sum of squares. By definition, a square
in `R` is a term `x : R` such that `x = y * y` for some `y : R` and in Mathlib this is known as
`IsSquare R` (see Mathlib.Algebra.Group.Even).
-/
theorem SquaresInSumSq [AddMonoid R] {x : R} (px : IsSquare x) : x ∈ SumSqIn R

{R : Type u_1}
[Mul R]
[AddMonoid R]
{x : R}
(px : IsSquare x)


@[simp]
theorem orderOf_neg_one [Nontrivial R] : orderOf (-1 : R) = if ringChar R = 2 then 1 else 2

orderOf (-1) = if ringChar R = 2 then 1 else 2


theorem StrictMono.mul_const_of_neg [ExistsAddOfLE α] [MulPosStrictMono α]
    [CovariantClass α α (swap (· + ·)) (· < ·)] [ContravariantClass α α (swap (· + ·)) (· < ·)]
    (hf : StrictMono f) (ha : a < 0) : StrictAnti fun x => f x * a

[CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1]

[ContravariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1]


theorem C_mul' : MvPolynomial.C a * p = a • p

{R : Type u}
{σ : Type u_1}
{a : R}
[CommSemiring R]
{p : MvPolynomial σ R}


theorem MonotoneOn.integrableOn_of_measure_ne_top (hmono : MonotoneOn f s) {a b : X}
    (ha : IsLeast s a) (hb : IsGreatest s b) (hs : μ s ≠ ∞) (h's : MeasurableSet s) :
    IntegrableOn f s μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[TopologicalSpace X]
[NormedAddCommGroup E]
{f : X → E}
{μ : MeasureTheory.Measure X}
{s : Set X}
[BorelSpace X]
[ConditionallyCompleteLinearOrder X]
[ConditionallyCompleteLinearOrder E]
[OrderTopology X]
[OrderTopology E]
[SecondCountableTopology E]
(hmono : MonotoneOn f s)
{a b : X}
(ha : IsLeast s a)
(hb : IsGreatest s b)
(hs : μ s ≠ ⊤)
(h's : MeasurableSet s)


theorem IsInvariant.isFwInvariant [Preorder τ] [Zero τ] {ϕ : τ → α → α} {s : Set α}
    (h : IsInvariant ϕ s) : IsFwInvariant ϕ s

{τ : Type u_1}
{α : Type u_2}
[Preorder τ]
[Zero τ]
{ϕ : τ → α → α}
{s : Set α}
(h : IsInvariant ϕ s)


@[to_additive coe_prod]
theorem coe_prod (s : Subsemigroup M) (t : Subsemigroup N) :
    (s.prod t : Set (M × N)) = (s : Set M) ×ˢ (t : Set N)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(s : Subsemigroup M)
(t : Subsemigroup N)


theorem comp_assoc : (r ∘r p) ∘r q = r ∘r p ∘r q

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{r : α → β → Prop}
{p : β → γ → Prop}
{q : γ → δ → Prop}

Relation.Comp (Relation.Comp r p) q = Relation.Comp r (Relation.Comp p q)


/-- Transfer `IsBigO` over a `PartialHomeomorph`. -/
theorem isBigO_congr (e : PartialHomeomorph α β) {b : β} (hb : b ∈ e.target) {f : β → E}
    {g : β → F} : f =O[𝓝 b] g ↔ (f ∘ e) =O[𝓝 (e.symm b)] (g ∘ e)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{E : Type u_3}
[Norm E]
{F : Type u_4}
[Norm F]
(e : PartialHomeomorph α β)
{b : β}
(hb : b ∈ e.target)
{f : β → E}
{g : β → F}

f =O[𝓝 b] g ↔ (f ∘ ↑e) =O[𝓝 (↑e.symm b)] (g ∘ ↑e)


@[simp]
theorem quotient_map_out {C D : HomotopyCategory V c} (f : C ⟶ D) : (quotient V c).map f.out = f

{ι : Type u_2}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomotopyCategory V c}
(f : C ⟶ D)

(HomotopyCategory.quotient V c).map (Quot.out f) = f


theorem transitive_join (ht : Transitive r) (h : ∀ a b c, r a b → r a c → Join r b c) :
    Transitive (Join r)

(h : ∀ (a b c : α), r a b → r a c → Relation.Join r b c)


@[to_additive (attr := simp) sub_mem_addCentralizer]
lemma div_mem_centralizer (ha : a ∈ centralizer S) (hb : b ∈ centralizer S) :
    a / b ∈ centralizer S

{M : Type u_1}
{S : Set M}
[AddGroup M]
{a b : M}
(ha : a ∈ S.addCentralizer)
(hb : b ∈ S.addCentralizer)


@[to_additive (attr := simp)]
theorem toEquiv_mulLeft (g : G) : (mulLeft g).toEquiv = Equiv.mulLeft g

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul G]
(g : G)

(MeasurableEquiv.mulLeft g).toEquiv = Equiv.mulLeft g


lemma hasSum_int_evenKernel (a : ℝ) {t : ℝ} (ht : 0 < t) :
    HasSum (fun n : ℤ ↦ rexp (-π * (n + a) ^ 2 * t)) (evenKernel a t)

HasSum (fun n => rexp (-π * (↑n + a) ^ 2 * t)) (HurwitzZeta.evenKernel (↑a) t)


/-- A linear isometric equivalence preserves the inner product. -/
@[simp]
theorem LinearIsometryEquiv.inner_map_map (f : E ≃ₗᵢ[𝕜] E') (x y : E) : ⟪f x, f y⟫ = ⟪x, y⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{E' : Type u_7}
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E']
(f : E ≃ₗᵢ[𝕜] E')
(x y : E)


/-- If a function `f` is continuous on a convex set `D ⊆ ℝ`, is differentiable on its interior,
and `f'` is antitone on the interior, then `f` is concave on `D`. -/
theorem AntitoneOn.concaveOn_of_deriv {D : Set ℝ} (hD : Convex ℝ D) {f : ℝ → ℝ}
    (hf : ContinuousOn f D) (hf' : DifferentiableOn ℝ f (interior D))
    (h_anti : AntitoneOn (deriv f) (interior D)) : ConcaveOn ℝ D f


lemma root_apply_coroot {α : Weight K H L} (hα : α.IsNonZero) :
    α (coroot α) = 2

{K : Type u_2}
{L : Type u_3}
[LieRing L]
[Field K]
[LieAlgebra K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
[LieAlgebra.IsKilling K L]
[CharZero K]
{α : LieModule.Weight K (↥H) L}
(hα : α.IsNonZero)


/-- The sum of two upper semicontinuous functions is upper semicontinuous. Formulated with an
explicit continuity assumption on addition, for application to `EReal`. The unprimed version of
the lemma uses `[ContinuousAdd]`. -/
theorem UpperSemicontinuous.add' {f g : α → γ} (hf : UpperSemicontinuous f)
    (hg : UpperSemicontinuous g)
    (hcont : ∀ x, ContinuousAt (fun p : γ × γ => p.1 + p.2) (f x, g x)) :
    UpperSemicontinuous fun z => f z + g z

(hcont : ∀ (x : α), ContinuousAt (fun p => p.1 + p.2) (f x, g x))


theorem continuous_toCircle : Continuous (@toCircle T)


@[simp]
theorem piRing_symm_apply (f : ι → M) (g : ι → R) : (piRing R M ι S).symm f g = ∑ i, g i • f i

{R : Type u}
{M : Type v}
{ι : Type x}
[Semiring R]
(S : Type u_4)
[Fintype ι]
[DecidableEq ι]
[Semiring S]
[AddCommMonoid M]
[Module R M]
[Module S M]
[SMulCommClass R S M]
(f : ι → M)
(g : ι → R)

((LinearEquiv.piRing R M ι S).symm f) g = ∑ i : ι, g i • f i


@[continuity]
theorem Continuous.matrix_det [Fintype n] [DecidableEq n] [CommRing R] [TopologicalRing R]
    {A : X → Matrix n n R} (hA : Continuous A) : Continuous fun x => (A x).det

{X : Type u_1}
{n : Type u_5}
{R : Type u_8}
[TopologicalSpace X]
[TopologicalSpace R]
[Fintype n]
[DecidableEq n]
[CommRing R]
[TopologicalRing R]
{A : X → Matrix n n R}
(hA : Continuous A)


/-- The anti-equivalence between simplicial objects and cosimplicial objects. -/
@[simps!]
def simplicialCosimplicialEquiv : (SimplicialObject C)ᵒᵖ ≌ CosimplicialObject Cᵒᵖ

(C : Type u)
[CategoryTheory.Category.{v, u} C]

∀ {X Y : (SimplexCategoryᵒᵖ ⥤ C)ᵒᵖ} (η : X ⟶ Y) (X_1 : SimplexCategory),
  ((CategoryTheory.simplicialCosimplicialEquiv C).functor.map η).app X_1 = (η.unop.app (Opposite.op X_1)).op


@[to_additive add_self_zsmul]
lemma mul_zpow_self (a : G) (n : ℤ) : a ^ n * a = a ^ (n + 1)

{G : Type u_3}
[AddGroup G]
(a : G)
(n : ℤ)


theorem IsSeparatedMap.comp_left {f : X → Y} (sep : IsSeparatedMap f) {g : Y → A}
    (inj : g.Injective) : IsSeparatedMap (g ∘ f)

{X : Type u_1}
{Y : Sort u_2}
{A : Type u_3}
[TopologicalSpace X]
{f : X → Y}
(sep : IsSeparatedMap f)
{g : Y → A}
(inj : Function.Injective g)


theorem nnnorm_approxOn_le [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f) {s : Set E}
    {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] (x : β) (n : ℕ) :
    ‖approxOn f hf s y₀ h₀ n x - f x‖₊ ≤ ‖f x - y₀‖₊

{β : Type u_2}
{E : Type u_4}
[MeasurableSpace β]
[MeasurableSpace E]
[NormedAddCommGroup E]
[OpensMeasurableSpace E]
{f : β → E}
(hf : Measurable f)
{s : Set E}
{y₀ : E}
(h₀ : y₀ ∈ s)
[TopologicalSpace.SeparableSpace ↑s]
(x : β)
(n : ℕ)

‖↑(MeasureTheory.SimpleFunc.approxOn f hf s y₀ h₀ n) x - f x‖₊ ≤ ‖f x - y₀‖₊


/-- Oh, monads are just monoids in the category of endofunctors (equivalence of categories). -/
@[simps]
def monadMonEquiv : Monad C ≌ Mon_ (C ⥤ C)

∀ (x : CategoryTheory.Monad C) (x_1 : C),
  ((CategoryTheory.Monad.monadMonEquiv C).unitIso.hom.app x).app x_1 =
    CategoryTheory.CategoryStruct.id (((CategoryTheory.Functor.id (CategoryTheory.Monad C)).obj x).obj x_1)


@[simp]
theorem symmDiff_symmDiff_cancel_right : b ∆ a ∆ a = b

{α : Type u_2}
[GeneralizedBooleanAlgebra α]
(a b : α)


/-- Symmetric statement to `Set.image_image2_distrib_right`. -/
theorem image_image2_right_comm {f : α → β' → γ} {g : β → β'} {f' : α → β → δ} {g' : δ → γ}
    (h_right_comm : ∀ a b, f a (g b) = g' (f' a b)) :
    image2 f s (t.image g) = (image2 f' s t).image g'

{f : α → β' → γ}

{f' : α → β → δ}

(h_right_comm : ∀ (a : α) (b : β), f a (g b) = g' (f' a b))

Set.image2 f s (g '' t) = g' '' Set.image2 f' s t


@[simp]
theorem lowerClosure_eq_bot_iff : lowerClosure s = ⊥ ↔ s = ∅


theorem isPrimitive_iff_isUnit_of_C_dvd {p : R[X]} : p.IsPrimitive ↔ ∀ r : R, C r ∣ p → IsUnit r

{R : Type u_1}
[CommSemiring R]
{p : Polynomial R}

p.IsPrimitive ↔ ∀ (r : R), Polynomial.C r ∣ p → IsUnit r


theorem sqrt : @Primrec' 1 fun v => v.head.sqrt


theorem strictAnti_iff_map_neg : StrictAnti (f : α → β) ↔ ∀ a, 0 < a → f a < 0

[CovariantClass β β (fun x x_1 => x + x_1) fun x x_1 => x < x_1]

StrictAnti ⇑f ↔ ∀ (a : α), 0 < a → f a < 0


@[simp]
theorem floorRing_ceil_eq : @FloorRing.ceil = @Int.ceil


/-- If the codomain is Hausdorff, preimages of compact sets are compact under a cocompact
continuous map. -/
theorem isCompact_preimage [T2Space β] (f : CocompactMap α β) ⦃s : Set β⦄ (hs : IsCompact s) :
    IsCompact (f ⁻¹' s)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[T2Space β]
(f : CocompactMap α β)
⦃s : Set β⦄
(hs : IsCompact s)


protected theorem mdifferentiableAt {x : M} (hx : x ∈ e.source) : MDifferentiableAt I I' e x

(he : PartialHomeomorph.MDifferentiable I I' e)


@[simp 1100]
theorem prevD_comp_right (f : ∀ i j, C.X i ⟶ D.X j) (g : D ⟶ E) (j : ι) :
    (prevD j fun i j => f i j ≫ g.f j) = prevD j f ≫ g.f j

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D E : HomologicalComplex V c}
(f : (i j : ι) → C.X i ⟶ D.X j)
(g : D ⟶ E)
(j : ι)

((prevD j) fun i j => f i j ≫ g.f j) = (prevD j) f ≫ g.f j


lemma ShortExact.ab_exact_iff_function_exact :
    S.Exact ↔ Function.Exact S.f S.g


@[to_additive]
theorem IsCompact.closedBall_mul (hs : IsCompact s) (hδ : 0 ≤ δ) (x : E) :
    closedBall x δ * s = x • cthickening δ s

{E : Type u_1}
[SeminormedCommGroup E]
{δ : ℝ}
{s : Set E}
(hs : IsCompact s)
(hδ : 0 ≤ δ)
(x : E)

Metric.closedBall x δ * s = x • Metric.cthickening δ s


@[to_additive]
theorem mk'_mul_cancel_left (x) (y : S) : f.mk' ((y : M) * x) y = f.toMap x

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
(x : M)
(y : ↥S)


@[reassoc (attr := simp)]
theorem whiskerLeft_naturality_comp (f : a' ⟶ G.obj a) (g : a ⟶ b) (h : b ⟶ c) :
    f ◁ (θ.naturality (g ≫ h)).hom ≫ f ◁ θ.app a ◁ H.mapComp g h =
      f ◁ G.mapComp g h ▷ θ.app c ≫
        f ◁ (α_ _ _ _).hom ≫
          f ◁ G.map g ◁ (θ.naturality h).hom ≫
            f ◁ (α_ _ _ _).inv ≫ f ◁ (θ.naturality g).hom ▷ H.map h ≫ f ◁ (α_ _ _ _).hom

(θ : CategoryTheory.StrongOplaxNatTrans G H)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (θ.naturality (CategoryTheory.CategoryStruct.comp g h)).hom)
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerLeft (θ.app a) (H.mapComp g h))) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerRight (G.mapComp g h) (θ.app c)))
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.associator (G.map g) (G.map h) (θ.app c)).hom)
      (CategoryTheory.CategoryStruct.comp
        (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerLeft (G.map g) (θ.naturality h).hom))
        (CategoryTheory.CategoryStruct.comp
          (CategoryTheory.Bicategory.whiskerLeft f
            (CategoryTheory.Bicategory.associator (G.map g) (θ.app b) (H.map h)).inv)
          (CategoryTheory.CategoryStruct.comp
            (CategoryTheory.Bicategory.whiskerLeft f
              (CategoryTheory.Bicategory.whiskerRight (θ.naturality g).hom (H.map h)))
            (CategoryTheory.Bicategory.whiskerLeft f
              (CategoryTheory.Bicategory.associator (θ.app a) (H.map g) (H.map h)).hom)))))


@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0

{R : Type u_1}
[CommRing R]
(S : Submonoid R)
{P : Type u_2}
[CommRing P]
[Algebra R P]
{x : P}


theorem mk_mem_nonZeroDivisors_associates : Associates.mk a ∈ (Associates M₀)⁰ ↔ a ∈ M₀⁰

{M₀ : Type u_2}
[CommMonoidWithZero M₀]
{a : M₀}


lemma zmultiplesHom_apply (x : β) (n : ℤ) : zmultiplesHom β x n = n • x

(β : Type u_4)
[AddGroup β]
(x : β)
(n : ℤ)


@[simp]
theorem sub_one_covBy (z : ℤ) : z - 1 ⋖ z


theorem mk'_surjective (z : S) : ∃ (x : _) (y : M), mk' S x y = z

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(z : S)


theorem integral_nonneg {f : α → ℝ} (hf : 0 ≤ f) : 0 ≤ ∫ a, f a ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
(hf : 0 ≤ f)


lemma _root_.Finset.exists_not_mem (s : Finset α) : ∃ a, a ∉ s

{α : Type u}
[Infinite α]
(s : Finset α)