/-- If `f` is a continuous multilinear map in finitely many variables on `E` and `m` is an element
of `∀ i, E i` such that one of the `m i` has norm `0`, then `f m` has norm `0`.

Note that we cannot drop the continuity assumption because `f (m : Unit → E) = f (m ())`,
where the domain has zero norm and the codomain has a nonzero norm
does not satisfy this condition. -/
lemma norm_map_coord_zero (hf : Continuous f) {m : ∀ i, E i} {i : ι} (hi : ‖m i‖ = 0) :
    ‖f m‖ = 0

[(i : ι) → SeminormedAddCommGroup (E i)]


theorem or_eq_of_eq {a b : Prop} (h : a = b) : (a ∨ b) = a


lemma regularityReduced_edges_card_aux [Nonempty α] (hε : 0 < ε) (hP : P.IsEquipartition)
    (hPε : P.IsUniform G (ε/8)) (hP' : 4 / ε ≤ P.parts.card) :
    2 * (G.edgeFinset.card - (G.regularityReduced P (ε/8) (ε/4)).edgeFinset.card : ℝ)
      < 2 * ε * (card α ^ 2 : ℕ)

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{G : SimpleGraph α}
[DecidableRel G.Adj]
{P : Finpartition Finset.univ}
{ε : ℝ}
[Nonempty α]
(hε : 0 < ε)
(hP : P.IsEquipartition)
(hPε : P.IsUniform G (ε / 8))
(hP' : 4 / ε ≤ ↑P.parts.card)

2 * (↑G.edgeFinset.card - ↑(SimpleGraph.regularityReduced P G (ε / 8) (ε / 4)).edgeFinset.card) <
  2 * ε * ↑(Fintype.card α ^ 2)


nonrec theorem SmoothOn.smul {f : M → 𝕜} {g : M → V} (hf : SmoothOn I 𝓘(𝕜) f s)
    (hg : SmoothOn I 𝓘(𝕜, V) g s) : SmoothOn I 𝓘(𝕜, V) (fun p => f p • g p) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
{V : Type u_18}
[NormedAddCommGroup V]
[NormedSpace 𝕜 V]
{f : M → 𝕜}
{g : M → V}
(hf : SmoothOn I 𝓘(𝕜, 𝕜) f s)
(hg : SmoothOn I 𝓘(𝕜, V) g s)


theorem triangle_bimod {X Y Z : Mon_ C} (M : Bimod X Y) (N : Bimod Y Z) :
    (associatorBimod M (regular Y) N).hom ≫ whiskerLeft M (leftUnitorBimod N).hom =
      whiskerRight (rightUnitorBimod M).hom N

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁} (CategoryTheory.MonoidalCategory.tensorLeft X)]

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁}
      (CategoryTheory.MonoidalCategory.tensorRight X)]

(M.associatorBimod (Bimod.regular Y) N).hom ≫ M.whiskerLeft N.leftUnitorBimod.hom =
  Bimod.whiskerRight M.rightUnitorBimod.hom N


/-- A left homology map data for a morphism of short complexes in the opposite category
induces a right homology map data in the original category. -/
@[simps]
def LeftHomologyMapData.unop {S₁ S₂ : ShortComplex Cᵒᵖ} {φ : S₁ ⟶ S₂}
    {h₁ : S₁.LeftHomologyData} {h₂ : S₂.LeftHomologyData}
    (ψ : LeftHomologyMapData φ h₁ h₂) : RightHomologyMapData (unopMap φ) h₂.unop h₁.unop

{S₁ S₂ : CategoryTheory.ShortComplex Cᵒᵖ}

(ψ : CategoryTheory.ShortComplex.LeftHomologyMapData φ h₁ h₂)


/-- If all multiplications cancel on the left then every element is left-regular. -/
@[to_additive "If all additions cancel on the left then every element is add-left-regular."]
theorem IsLeftRegular.all [Mul R] [IsLeftCancelMul R] (g : R) : IsLeftRegular g

{R : Type u_1}
[Add R]
[IsLeftCancelAdd R]
(g : R)


/-- By definition, the edistance on `Closeds α` is given by the Hausdorff edistance -/
theorem Closeds.edist_eq {s t : Closeds α} : edist s t = hausdorffEdist (s : Set α) t

{α : Type u}
[EMetricSpace α]
{s t : TopologicalSpace.Closeds α}

edist s t = EMetric.hausdorffEdist ↑s ↑t


theorem mkDerivationₗ_X (f : σ → A) (i : σ) : mkDerivationₗ R f (X i) = f i

{σ : Type u_1}
{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[Module (MvPolynomial σ R) A]
(f : σ → A)
(i : σ)

(MvPolynomial.mkDerivationₗ R f) (MvPolynomial.X i) = f i


@[simps id comp]
instance Pseudofunctor.categoryStruct : CategoryStruct (Pseudofunctor B C)

(B : Type u₁)
[CategoryTheory.Bicategory B]
(C : Type u₂)
[CategoryTheory.Bicategory C]
(F : CategoryTheory.Pseudofunctor B C)

CategoryTheory.CategoryStruct.id F = CategoryTheory.StrongOplaxNatTrans.id F.toOplax


theorem setIntegral_nonneg_of_ae (hf : 0 ≤ᵐ[μ] f) : 0 ≤ ∫ x in s, f x ∂μ

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{f : X → ℝ}
{s : Set X}
(hf : 0 ≤ᵐ[μ] f)


/-- Conjugating a linear map by a linear equiv does not change its determinant. -/
@[simp]
theorem det_conj {N : Type*} [AddCommGroup N] [Module A N] (f : M →ₗ[A] M) (e : M ≃ₗ[A] N) :
    LinearMap.det ((e : M →ₗ[A] N) ∘ₗ f ∘ₗ (e.symm : N →ₗ[A] M)) = LinearMap.det f

{M : Type u_2}
[AddCommGroup M]
{A : Type u_5}
[CommRing A]
[Module A M]
{N : Type u_7}
[AddCommGroup N]
[Module A N]
(f : M →ₗ[A] M)
(e : M ≃ₗ[A] N)

LinearMap.det (↑e ∘ₗ f ∘ₗ ↑e.symm) = LinearMap.det f


@[to_additive]
theorem unop_inf (S₁ S₂ : Submonoid Mᵐᵒᵖ) : (S₁ ⊓ S₂).unop = S₁.unop ⊓ S₂.unop

{M : Type u_2}
[AddZeroClass M]
(S₁ S₂ : AddSubmonoid Mᵃᵒᵖ)


theorem as_sum_range (p : R[X]) : p = ∑ i ∈ range (p.natDegree + 1), monomial i (coeff p i)

p = ∑ i ∈ Finset.range (p.natDegree + 1), (Polynomial.monomial i) (p.coeff i)


@[simp]
lemma linearIsometryEquiv_coe_apply (u : unitary (H →L[𝕜] H)) :
    linearIsometryEquiv u = (u : H →L[𝕜] H)

{𝕜 : Type u_1}
[RCLike 𝕜]
{H : Type u_5}
[NormedAddCommGroup H]
[InnerProductSpace 𝕜 H]
[CompleteSpace H]
(u : ↥(unitary (H →L[𝕜] H)))

↑{ toLinearEquiv := (unitary.linearIsometryEquiv u).toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ } = ↑u


theorem sizeOf_lt_sizeOf_of_mem [SizeOf α] {x : α} {l : List α} (hx : x ∈ l) :
    SizeOf.sizeOf x < SizeOf.sizeOf l

{α : Type u}
[SizeOf α]
{x : α}
{l : List α}
(hx : x ∈ l)


/-- The last element of a `Vector`, given that the vector is at least one element. -/
theorem last_def {v : Vector α (n + 1)} : v.last = v.get (Fin.last n)

{n : ℕ}
{α : Type u_1}
{v : Mathlib.Vector α (n + 1)}


@[simp]
theorem right_lt_sup : b < a ⊔ b ↔ ¬a ≤ b

{α : Type u}
[SemilatticeSup α]
{a b : α}


@[to_additive (attr := simp)]
lemma locallyLipschitz_inv_iff : LocallyLipschitz f⁻¹ ↔ LocallyLipschitz f

{α : Type u_5}
{E : Type u_6}
[SeminormedAddCommGroup E]
[PseudoEMetricSpace α]
{f : α → E}

LocallyLipschitz (-f) ↔ LocallyLipschitz f


theorem IndepFun.ae_eq {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
    {f' : Ω → β} {g' : Ω → β'} (hfg : IndepFun f g κ μ)
    (hf : ∀ᵐ a ∂μ, f =ᵐ[κ a] f') (hg : ∀ᵐ a ∂μ, g =ᵐ[κ a] g') :
    IndepFun f' g' κ μ

(hfg : ProbabilityTheory.Kernel.IndepFun f g κ μ)

ProbabilityTheory.Kernel.IndepFun f' g' κ μ


@[simp] theorem and_false (p : Prop) : (p ∧ False) = False


/-- Helper function for constructing morphisms between coequalizer cotridents.
-/
@[simps]
def Cotrident.mkHom [Nonempty J] {s t : Cotrident f} (k : s.pt ⟶ t.pt)
    (w : s.π ≫ k = t.π := by aesop_cat) : s ⟶ t

{s t : CategoryTheory.Limits.Cotrident f}

(w : CategoryTheory.CategoryStruct.comp s.π k = t.π := by aesop_cat)

(CategoryTheory.Limits.Cotrident.mkHom k w).hom = k


@[simp, norm_cast]
theorem cast_zero : ((0 : ℤ) : R) = 0


@[simp]
theorem quotEquivOfEq_mk {R : Type*} [CommRing R] {I J : Ideal R} (h : I = J) (x : R) :
    quotEquivOfEq h (Ideal.Quotient.mk I x) = Ideal.Quotient.mk J x

{R : Type u_1}
[CommRing R]
{I J : Ideal R}
(h : I = J)
(x : R)

(Ideal.quotEquivOfEq h) ((Ideal.Quotient.mk I) x) = (Ideal.Quotient.mk J) x


{α : Type u_1}
{P : Set α → Prop}
{m : (s : Set α) → P s → ℝ≥0∞}
(P0 : P ∅)
(m0 : m ∅ P0 = 0)


theorem one_leftUnitor {M : Mon_ C} :
    ((λ_ (𝟙_ C)).inv ≫ (𝟙 (𝟙_ C) ⊗ M.one)) ≫ (λ_ M.X).hom = M.one

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{M : Mon_ C}


lemma ModuleCat.enoughInjectives : EnoughInjectives (ModuleCat.{max v u} R)


theorem measurable_spanningSetsIndex (μ : Measure α) [SigmaFinite μ] :
    Measurable (spanningSetsIndex μ)

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]


private theorem restrictNonposSeq_disjoint : Pairwise (Disjoint on restrictNonposSeq s i)

{α : Type u_1}
[MeasurableSpace α]
{s : MeasureTheory.SignedMeasure α}
{i : Set α}

Pairwise (Disjoint on MeasureTheory.SignedMeasure.restrictNonposSeq s i)


@[simp]
theorem symm_dual_comp (g : InfTopHom βᵒᵈ γᵒᵈ) (f : InfTopHom αᵒᵈ βᵒᵈ) :
    SupBotHom.dual.symm (g.comp f) =
      (SupBotHom.dual.symm g).comp (SupBotHom.dual.symm f)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Sup α]
[Bot α]
[Sup β]
[Bot β]
[Sup γ]
[Bot γ]
(g : InfTopHom βᵒᵈ γᵒᵈ)
(f : InfTopHom αᵒᵈ βᵒᵈ)


@[simp, norm_cast]
theorem coe_pimage : (s.pimage f : Set β) = f.image s

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α →. β}
[(x : α) → Decidable (f x).Dom]
{s : Finset α}


theorem mk_factors_self (f : X ⟶ Y) [Mono f] : (mk f).Factors f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
(f : X ⟶ Y)
[CategoryTheory.Mono f]


theorem dist_dist_dist_le (x y x' y' : α) : dist (dist x y) (dist x' y') ≤ dist x x' + dist y y'

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


/-- The map `coe_fn : (r ≃r s) → (α → β)` is injective. Lean fails to parse
`function.injective (fun e : r ≃r s ↦ (e : α → β))`, so we use a trick to say the same. -/
theorem coe_fn_injective : Injective fun f : r ≃r s => (f : α → β)

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}


@[simps]
instance left (X Y : C) [MonoidalCoherence X Y] :
    MonoidalCoherence (𝟙_ C ⊗ X) Y

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
(X Y : C)
[CategoryTheory.MonoidalCoherence X Y]


theorem sUnion_union (S T : Set (Set α)) : ⋃₀(S ∪ T) = ⋃₀S ∪ ⋃₀T

⋃₀ (S ∪ T) = ⋃₀ S ∪ ⋃₀ T


theorem eq_properDivisors_of_subset_of_sum_eq_sum {s : Finset ℕ} (hsub : s ⊆ n.properDivisors) :
    ((∑ x ∈ s, x) = ∑ x ∈ n.properDivisors, x) → s = n.properDivisors

{n : ℕ}
{s : Finset ℕ}
(hsub : s ⊆ n.properDivisors)

∑ x ∈ s, x = ∑ x ∈ n.properDivisors, x → s = n.properDivisors


/-- Core data defining a locally trivial bundle with fiber `F` over a topological
space `B`. Note that "bundle" is used in its mathematical sense. This is the (computer science)
bundled version, i.e., all the relevant data is contained in the following structure. A family of
local trivializations is indexed by a type `ι`, on open subsets `baseSet i` for each `i : ι`.
Trivialization changes from `i` to `j` are given by continuous maps `coordChange i j` from
`baseSet i ∩ baseSet j` to the set of homeomorphisms of `F`, but we express them as maps
`B → F → F` and require continuity on `(baseSet i ∩ baseSet j) × F` to avoid the topology on the
space of continuous maps on `F`. -/
-- Porting note(#5171): was @[nolint has_nonempty_instance]
structure FiberBundleCore (ι : Type*) (B : Type*) [TopologicalSpace B] (F : Type*)
    [TopologicalSpace F] where
  baseSet : ι → Set B
  isOpen_baseSet : ∀ i, IsOpen (baseSet i)
  indexAt : B → ι
  mem_baseSet_at : ∀ x, x ∈ baseSet (indexAt x)
  coordChange : ι → ι → B → F → F
  coordChange_self : ∀ i, ∀ x ∈ baseSet i, ∀ v, coordChange i i x v = v
  continuousOn_coordChange : ∀ i j,
    ContinuousOn (fun p : B × F => coordChange i j p.1 p.2) ((baseSet i ∩ baseSet j) ×ˢ univ)
  coordChange_comp : ∀ i j k, ∀ x ∈ baseSet i ∩ baseSet j ∩ baseSet k, ∀ v,
    (coordChange j k x) (coordChange i j x v) = coordChange i k x v

{ι : Type u_5}
{B : Type u_6}
[TopologicalSpace B]
{F : Type u_7}
[TopologicalSpace F]
(self : FiberBundleCore ι B F)
(i j k : ι)
(x : B)

x ∈ self.baseSet i ∩ self.baseSet j ∩ self.baseSet k →
  ∀ (v : F), self.coordChange j k x (self.coordChange i j x v) = self.coordChange i k x v


theorem toWeakDualBCNN_continuous : Continuous fun μ : ProbabilityMeasure Ω => μ.toWeakDualBCNN

{Ω : Type u_1}
[MeasurableSpace Ω]
[TopologicalSpace Ω]
[OpensMeasurableSpace Ω]


lemma countable_countableGeneratingSet [MeasurableSpace α] [h : CountablyGenerated α] :
    Set.Countable (countableGeneratingSet α)

[h : MeasurableSpace.CountablyGenerated α]


@[to_additive]
theorem IsUnit.Submonoid.coe_inv [Monoid M] (x : IsUnit.submonoid M) :
    ↑x⁻¹ = (↑x.prop.unit⁻¹ : M)

{M : Type u_1}
[Monoid M]
(x : ↥(IsUnit.submonoid M))


theorem derivBFamily_lt_ord {o : Ordinal} {f : ∀ a < o, Ordinal → Ordinal} {c} (hc : IsRegular c)
    (hι : o.card < c) (hc' : c ≠ ℵ₀) (hf : ∀ (i hi), ∀ b < c.ord, f i hi b < c.ord) {a} :
    a < c.ord → derivBFamily.{u, u} o f a < c.ord

{f : (a : Ordinal.{u}) → a < o → Ordinal.{u} → Ordinal.{u}}

(hf : ∀ (i : Ordinal.{u}) (hi : i < o), ∀ b < c.ord, f i hi b < c.ord)


theorem iUnion_plift_up (f : PLift ι → Set α) : ⋃ i, f (PLift.up i) = ⋃ i, f i

{α : Type u_1}
{ι : Sort u_4}
(f : PLift ι → Set α)


@[to_additive (attr := simp)]
theorem card_singleton_mul : ({a} * t).card = t.card

{α : Type u_2}
[Add α]
[IsLeftCancelAdd α]
[DecidableEq α]
(t : Finset α)
(a : α)


@[simp, norm_cast]
lemma cast_min : ↑(min a b) = (min a b : R)

{R : Type u_1}
[LinearOrderedRing R]
{a b : ℤ}


@[to_additive]
theorem smul_mem_smul_set : b ∈ s → a • b ∈ a • s

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{s : Set β}
{a : α}
{b : β}


theorem ker_apply_mk_out {f : α → β} (a : α) : f (haveI := Setoid.ker f; ⟦a⟧.out) = f a

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


theorem _root_.isSelfAdjoint_iff [Star R] {x : R} : IsSelfAdjoint x ↔ star x = x


theorem start_v (a b : ℕ+) : (start a b).v = ⟨a, b⟩


@[simp] lemma ofNat_eq_coe (n : ℕ) [n.AtLeastTwo] (m : α) :
    no_index (OfNat.ofNat n) = (m : WithTop α) ↔ OfNat.ofNat n = m

{α : Type u}
[AddMonoidWithOne α]
(n : ℕ)
[n.AtLeastTwo]
(m : α)


@[simp]
theorem dist_le_zero {x y : γ} : dist x y ≤ 0 ↔ x = y


@[to_additive]
theorem iff_mulOpposite :
    UniqueMul (B.map ⟨_, op_injective⟩) (A.map ⟨_, op_injective⟩) (op b0) (op a0) ↔
      UniqueMul A B a0 b0

{G : Type u_1}
[Mul G]
{A B : Finset G}
{a0 b0 : G}

UniqueMul (Finset.map { toFun := MulOpposite.op, inj' := ⋯ } B) (Finset.map { toFun := MulOpposite.op, inj' := ⋯ } A)
    (MulOpposite.op b0) (MulOpposite.op a0) ↔
  UniqueMul A B a0 b0


/-- If `g : ℝ → ℝ` is periodic with period `T > 0` and `0 < ∫ x in 0..T, g x`, then
`t ↦ ∫ x in 0..t, g x` tends to `∞` as `t` tends to `∞`. -/
theorem tendsto_atTop_intervalIntegral_of_pos (h₀ : 0 < ∫ x in (0)..T, g x) (hT : 0 < T) :
    Tendsto (fun t => ∫ x in (0)..t, g x) atTop atTop

(h_int : ∀ (t₁ t₂ : ℝ), IntervalIntegrable g MeasureTheory.volume t₁ t₂)

Filter.Tendsto (fun t => ∫ (x : ℝ) in 0 ..t, g x) Filter.atTop Filter.atTop


theorem coeff_zero_of_lt_valuation {n D : ℤ} {f : LaurentSeries K}
    (H : Valued.v f ≤ Multiplicative.ofAdd (-D)) : n < D → f.coeff n = 0

(H : Valued.v f ≤ ↑(Multiplicative.ofAdd (-D)))


theorem image_union (s t : Set α) : f.image (s ∪ t) = f.image s ∪ f.image t

{α : Type u_1}
{β : Type u_2}
(f : α →. β)
(s t : Set α)


/-- The identity map preserves multiplication. -/
@[to_additive "The identity map preserves addition"]
theorem id : IsMulHom (id : α → α)


theorem gc_comap_kernMap (m : α → β) : GaloisConnection (comap m) (kernMap m)

GaloisConnection (Filter.comap m) (Filter.kernMap m)


@[simp] lemma zero_mem_box : (0 : α) ∈ box n ↔ n = 0

{α : Type u_1}
[OrderedRing α]
[LocallyFiniteOrder α]
[DecidableEq α]
{n : ℕ}


/-- If the measure is sigma-finite, all strongly measurable functions are
  `FinStronglyMeasurable`. -/
@[aesop 5% apply (rule_sets := [Measurable])]
protected theorem finStronglyMeasurable [TopologicalSpace β] [Zero β] {m0 : MeasurableSpace α}
    (hf : StronglyMeasurable f) (μ : Measure α) [SigmaFinite μ] : FinStronglyMeasurable f μ

(hf : MeasureTheory.StronglyMeasurable f)


/-- Convolution of the zero measure with a measure μ returns the zero measure. -/
@[to_additive (attr := simp) conv_zero]
theorem mconv_zero (μ : Measure M) : (0 : Measure M) ∗ μ = (0 : Measure M)

{M : Type u_1}
[AddMonoid M]
[MeasurableSpace M]
(μ : MeasureTheory.Measure M)


lemma LSeries.term_smul (f : ℕ → ℂ) (c s : ℂ) : term (c • f) s = c • term f s

LSeries.term (c • f) s = c • LSeries.term f s


theorem map_iInf_le {f : ι → Filter α} {m : α → β} : map m (iInf f) ≤ ⨅ i, map m (f i)

{α : Type u}
{β : Type v}
{ι : Sort x}
{f : ι → Filter α}
{m : α → β}

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


/-- A category is `MonoidalLinear R` if tensoring is `R`-linear in both factors.
-/
class MonoidalLinear [MonoidalPreadditive C] : Prop where
  whiskerLeft_smul : ∀ (X : C) {Y Z : C} (r : R) (f : Y ⟶ Z) , X ◁ (r • f) = r • (X ◁ f) := by
    aesop_cat
  smul_whiskerRight : ∀ (r : R) {Y Z : C} (f : Y ⟶ Z) (X : C), (r • f) ▷ X = r • (f ▷ X) := by
    aesop_cat

[self : CategoryTheory.MonoidalLinear R C]

CategoryTheory.MonoidalCategory.whiskerRight (r • f) X = r • CategoryTheory.MonoidalCategory.whiskerRight f X


/-- The adjoint triangle theorem: Suppose `U : B ⥤ C` has a left adjoint `F` such that each counit
`ε_X : FUX ⟶ X` is a regular epimorphism. Then if a category `A` has coequalizers of reflexive
pairs, then a functor `R : A ⥤ B` has a left adjoint if the composite `R ⋙ U` does.

Note the converse is true (with weaker assumptions), by `Adjunction.comp`.
See https://ncatlab.org/nlab/show/adjoint+triangle+theorem
-/
lemma adjointTriangleLift {U : B ⥤ C} {F : C ⥤ B} (R : A ⥤ B) (adj₁ : F ⊣ U)
    [∀ X : B, RegularEpi (adj₁.counit.app X)] [HasReflexiveCoequalizers A]
    [(R ⋙ U).IsRightAdjoint ] : R.IsRightAdjoint

[(X : B) → CategoryTheory.RegularEpi (adj₁.counit.app X)]


theorem mem_erase_of_ne {a b : α} {s : Multiset α} (ab : a ≠ b) : a ∈ s.erase b ↔ a ∈ s

{α : Type u_1}
[DecidableEq α]
{a b : α}
{s : Multiset α}
(ab : a ≠ b)


lemma dvd_of_mem_primeFactors (hp : p ∈ n.primeFactors) : p ∣ n


/-- Abbreviation for `mulSingle_eq_of_ne h.symm`, for ease of use by `simp`. -/
@[to_additive (attr := simp)
  "Abbreviation for `single_eq_of_ne h.symm`, for ease of use by `simp`."]
theorem mulSingle_eq_of_ne' {i i' : I} (h : i ≠ i') (x : f i) : mulSingle i x i' = 1

{I : Type u}
{f : I → Type v₁}
[DecidableEq I]
[(i : I) → One (f i)]
{i i' : I}
(h : i ≠ i')
(x : f i)


lemma IsCompact.exists_mapClusterPt {ι : Type*} (hs : IsCompact s) {f : Filter ι} [NeBot f]
    {u : ι → X} (hf : Filter.map u f ≤ 𝓟 s) :
    ∃ x ∈ s, MapClusterPt x f u

{X : Type u}
[TopologicalSpace X]
{s : Set X}
{ι : Type u_2}
(hs : IsCompact s)
{f : Filter ι}
[f.NeBot]
{u : ι → X}
(hf : Filter.map u f ≤ 𝓟 s)


/--
We say that `P : MorphismProperty Scheme` is local at the target if
1. `P` respects isomorphisms.
2. `P` holds for `f ∣_ U` for an open cover `U` of `Y` if and only if `P` holds for `f`.
Also see `IsLocalAtTarget.mk'` for a convenient constructor.
-/
class IsLocalAtTarget (P : MorphismProperty Scheme) : Prop where
  /-- `P` respects isomorphisms. -/
  respectsIso : P.RespectsIso := by infer_instance
  /-- `P` holds for `f ∣_ U` for an open cover `U` of `Y` if and only if `P` holds for `f`.  -/
  iff_of_openCover' :
    ∀ {X Y : Scheme.{u}} (f : X ⟶ Y) (𝒰 : Scheme.OpenCover.{u} Y),
      P f ↔ ∀ i, P (𝒰.pullbackHom f i)

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

[self : AlgebraicGeometry.IsLocalAtTarget P]


theorem copy_eq (S : NonUnitalSubsemiring R) (s : Set R) (hs : s = ↑S) : S.copy s hs = S

{R : Type u}
[NonUnitalNonAssocSemiring R]
(S : NonUnitalSubsemiring R)
(s : Set R)
(hs : s = ↑S)


theorem add_mul_left_right_iff {x y z : R} : IsCoprime x (y + x * z) ↔ IsCoprime x y


theorem of_finrank_eq_succ {n : ℕ} (hn : finrank K V = n.succ) :
    FiniteDimensional K V

(hn : FiniteDimensional.finrank K V = n.succ)


@[to_additive (attr := measurability)]
protected theorem const_smul {𝕜} [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β]
    (hf : AEStronglyMeasurable f μ) (c : 𝕜) : AEStronglyMeasurable (c • f) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (c • f) μ


theorem orderTop_of_ne {x : HahnSeries Γ R} (hx : x ≠ 0) :
    orderTop x = x.isWF_support.min (support_nonempty_iff.2 hx)

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{x : HahnSeries Γ R}
(hx : x ≠ 0)


theorem IsCompact.isLeast_sInf [ClosedIicTopology α] {s : Set α} (hs : IsCompact s)
    (ne_s : s.Nonempty) : IsLeast s (sInf s)

{α : Type u_2}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[ClosedIicTopology α]
{s : Set α}
(hs : IsCompact s)
(ne_s : s.Nonempty)


theorem lhopital_zero_atTop_on_Ioi (hdf : DifferentiableOn ℝ f (Ioi a))
    (hg' : ∀ x ∈ Ioi a, (deriv g) x ≠ 0) (hftop : Tendsto f atTop (𝓝 0))
    (hgtop : Tendsto g atTop (𝓝 0)) (hdiv : Tendsto (fun x => (deriv f) x / (deriv g) x) atTop l) :
    Tendsto (fun x => f x / g x) atTop l

(hdf : DifferentiableOn ℝ f (Set.Ioi a))

(hftop : Filter.Tendsto f Filter.atTop (𝓝 0))

(hgtop : Filter.Tendsto g Filter.atTop (𝓝 0))

(hdiv : Filter.Tendsto (fun x => deriv f x / deriv g x) Filter.atTop l)

Filter.Tendsto (fun x => f x / g x) Filter.atTop l


theorem biprod.map_lift_mapBiprod (f : W ⟶ X) (g : W ⟶ Y) :
    F.map (biprod.lift f g) ≫ (F.mapBiprod X Y).hom = biprod.lift (F.map f) (F.map g)

[CategoryTheory.Limits.PreservesBinaryBiproduct X Y F]

F.map (CategoryTheory.Limits.biprod.lift f g) ≫ (F.mapBiprod X Y).hom =
  CategoryTheory.Limits.biprod.lift (F.map f) (F.map g)


/-- If ∠ABC = π, then (dist A C) = (dist A B) + (dist B C). -/
theorem dist_eq_add_dist_of_angle_eq_pi {p1 p2 p3 : P} (h : ∠ p1 p2 p3 = π) :
    dist p1 p3 = dist p1 p2 + dist p3 p2

(h : EuclideanGeometry.angle p1 p2 p3 = π)


@[to_additive (attr := simp)]
theorem swap_mul [Mul M] [Mul N] (p q : M × N) : (p * q).swap = p.swap * q.swap

{M : Type u_5}
{N : Type u_6}
[Add M]
[Add N]
(p q : M × N)


protected theorem mem (h : IsGenericPoint x S) : x ∈ S

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{S : Set α}
(h : IsGenericPoint x S)


@[simp]
theorem normalizeIsoApp_tensor (X Y : F C) (n : N C) :
    normalizeIsoApp C (X ⊗ Y) n =
      (α_ _ _ _).symm ≪≫ whiskerRightIso (normalizeIsoApp C X n) Y ≪≫ normalizeIsoApp _ _ _

(X Y : CategoryTheory.FreeMonoidalCategory C)

(n : (CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C)

CategoryTheory.FreeMonoidalCategory.normalizeIsoApp C (CategoryTheory.MonoidalCategory.tensorObj X Y) n =
  (CategoryTheory.MonoidalCategory.associator (CategoryTheory.FreeMonoidalCategory.inclusion.obj { as := n.as }) X
        Y).symm ≪≫
    CategoryTheory.MonoidalCategory.whiskerRightIso (CategoryTheory.FreeMonoidalCategory.normalizeIsoApp C X n) Y ≪≫
      CategoryTheory.FreeMonoidalCategory.normalizeIsoApp C Y { as := X.normalizeObj n.as }


theorem Exists₂.imp {p q : ∀ a, β a → Prop} (h : ∀ a b, p a b → q a b) :
    (∃ a b, p a b) → ∃ a b, q a b

(h : ∀ (a : α) (b : β a), p a b → q a b)


theorem UniqueFactorizationMonoid.of_exists_unique_irreducible_factors [CancelCommMonoidWithZero α]
    (eif : ∀ a : α, a ≠ 0 → ∃ f : Multiset α, (∀ b ∈ f, Irreducible b) ∧ f.prod ~ᵤ a)
    (uif :
      ∀ f g : Multiset α,
        (∀ x ∈ f, Irreducible x) →
          (∀ x ∈ g, Irreducible x) → f.prod ~ᵤ g.prod → Multiset.Rel Associated f g) :
    UniqueFactorizationMonoid α

(eif : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Irreducible b) ∧ f.prod ~ᵤ a)

(uif :
  ∀ (f g : Multiset α),
    (∀ x ∈ f, Irreducible x) → (∀ x ∈ g, Irreducible x) → f.prod ~ᵤ g.prod → Multiset.Rel Associated f g)


theorem UniqueDiffOn.inter (hs : UniqueDiffOn 𝕜 s) (ht : IsOpen t) : UniqueDiffOn 𝕜 (s ∩ t)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s t : Set E}
(hs : UniqueDiffOn 𝕜 s)
(ht : IsOpen t)


lemma Finset.range_zero' {n : ℕ} (pn : NormNum.IsNat n 0) :
    Finset.range n = {}

{n : ℕ}
(pn : Mathlib.Meta.NormNum.IsNat n 0)


/-- Arithmetic progressions of length three are preserved under `2`-Freiman homomorphisms. -/
@[to_additive
"Arithmetic progressions of length three are preserved under `2`-Freiman homomorphisms."]
lemma ThreeGPFree.of_image (hf : IsMulFreimanHom 2 s t f) (hf' : s.InjOn f) (hAs : A ⊆ s)
    (hA : ThreeGPFree (f '' A)) : ThreeGPFree A

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{s A : Set α}
{t : Set β}
{f : α → β}
(hf : IsAddFreimanHom 2 s t f)
(hf' : Set.InjOn f s)
(hAs : A ⊆ s)
(hA : ThreeAPFree (f '' A))


theorem setToSimpleFunc_indicator (T : Set α → F →L[ℝ] F') (hT_empty : T ∅ = 0)
    {m : MeasurableSpace α} {s : Set α} (hs : MeasurableSet s) (x : F) :
    SimpleFunc.setToSimpleFunc T
        (SimpleFunc.piecewise s hs (SimpleFunc.const α x) (SimpleFunc.const α 0)) =
      T s x

{α : Type u_1}
{F : Type u_3}
{F' : Type u_4}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[NormedAddCommGroup F']
[NormedSpace ℝ F']
(T : Set α → F →L[ℝ] F')
(hT_empty : T ∅ = 0)
{m : MeasurableSpace α}
{s : Set α}
(hs : MeasurableSet s)
(x : F)

MeasureTheory.SimpleFunc.setToSimpleFunc T
    (MeasureTheory.SimpleFunc.piecewise s hs (MeasureTheory.SimpleFunc.const α x)
      (MeasureTheory.SimpleFunc.const α 0)) =
  (T s) x


@[continuity, fun_prop]
theorem continuous_im : Continuous (im : K → ℝ)


protected theorem IsInfix.sublist : l₁ <:+: l₂ → l₁ <+ l₂

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <:+: l₂ → l₁ <+ l₂


/-- If `k` is algebraically closed, `K / k` is a field extension, `L / k` is an intermediate field
which is algebraic, then `L` is equal to `k`. A corollary of
`IsAlgClosed.algebraMap_surjective_of_isAlgebraic`. -/
theorem IntermediateField.eq_bot_of_isAlgClosed_of_isAlgebraic {k K : Type*} [Field k] [Field K]
    [IsAlgClosed k] [Algebra k K] (L : IntermediateField k K) [Algebra.IsAlgebraic k L] :
    L = ⊥

{k : Type u_1}
{K : Type u_2}
[Field k]
[Field K]
[IsAlgClosed k]
[Algebra k K]
(L : IntermediateField k K)
[Algebra.IsAlgebraic k ↥L]


@[simp, norm_cast]
theorem cast_zpow (q : ℚ) (n : ℤ) : ((q ^ n : ℚ) : α) = (q : α) ^ n

{α : Type u_3}
[DivisionRing α]
[CharZero α]
(q : ℚ)
(n : ℤ)


theorem specializes_of_nhdsWithin (h₁ : 𝓝[s] x ≤ 𝓝[s] y) (h₂ : x ∈ s) : x ⤳ y

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
{s : Set X}
(h₁ : 𝓝[s] x ≤ 𝓝[s] y)
(h₂ : x ∈ s)


theorem _root_.Filter.HasBasis.vitaliFamily {ι : Sort*} {p : ι → Prop} {s : ι → Set α} {x : α}
    (h : (𝓝 x).HasBasis p s) : (v.filterAt x).HasBasis p (fun i ↦ {t ∈ v.setsAt x | t ⊆ s i})

{α : Type u_1}
[MetricSpace α]
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(v : VitaliFamily μ)
{ι : Sort u_2}
{p : ι → Prop}
{s : ι → Set α}
{x : α}
(h : (𝓝 x).HasBasis p s)

(v.filterAt x).HasBasis p fun i => {t | t ∈ v.setsAt x ∧ t ⊆ s i}


theorem edist_of_re_eq {z w : ℂ} (h : z.re = w.re) : edist z w = edist z.im w.im


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

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{P : C(X, Y) → Prop}
⦃f g : C(X, Y)⦄
(h : f.HomotopicWith g P)


lemma NNReal.ball_zero_eq_Ico' (c : ℝ≥0) :
    Metric.ball (0 : ℝ≥0) c.toReal = Set.Ico 0 c


@[to_additive]
theorem set_smul_subset_iff : a • A ⊆ B ↔ A ⊆ a⁻¹ • B

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{A B : Set β}
{a : α}

a • A ⊆ B ↔ A ⊆ a⁻¹ • B


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

[self : CategoryTheory.Bicategory.IsRightAdjoint right]


theorem differentiableWithinAt_arcsin_Iic {x : ℝ} :
    DifferentiableWithinAt ℝ arcsin (Iic x) x ↔ x ≠ 1

DifferentiableWithinAt ℝ Real.arcsin (Set.Iic x) x ↔ x ≠ 1


@[simp]
lemma cfcₙ_const_zero : cfcₙ (fun _ : R ↦ 0) a = 0


lemma natDegree_preΨ_le (n : ℤ) : (W.preΨ n).natDegree ≤
    (n.natAbs ^ 2 - if Even n then 4 else 1) / 2

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(n : ℤ)


theorem eq_zero_of_basicOpen_eq_bot {X : Scheme} [hX : IsReduced X] {U : X.Opens}
    (s : Γ(X, U)) (hs : X.basicOpen s = ⊥) : s = 0

{X : AlgebraicGeometry.Scheme}
[hX : AlgebraicGeometry.IsReduced X]
{U : X.Opens}
(s : ↑(X.presheaf.obj (Opposite.op U)))
(hs : X.basicOpen s = ⊥)


@[simp]
theorem num_zero : (0 : NumDenSameDeg 𝒜 x).num = 0

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[AddCommMonoid ι]
[DecidableEq ι]
[CommRing R]
[CommRing A]
[Algebra R A]
{𝒜 : ι → Submodule R A}
[GradedAlgebra 𝒜]
(x : Submonoid A)

HomogeneousLocalization.NumDenSameDeg.num 0 = 0


@[simp]
theorem mul_integral_comp_add_mul :
    (c * ∫ x in a..b, f (d + c * x)) = ∫ x in d + c * a..d + c * b, f x

c * ∫ (x : ℝ) in a..b, f (d + c * x) = ∫ (x : ℝ) in d + c * a..d + c * b, f x


/-- An iterated biproduct is a biproduct over a sigma type. -/
@[simps]
def biproductBiproductIso {ι} (f : ι → Type*) (g : (i : ι) → (f i) → C)
    [∀ i, HasBiproduct (g i)] [HasBiproduct fun i => ⨁ g i] :
    (⨁ fun i => ⨁ g i) ≅ (⨁ fun p : Σ i, f i => g p.1 p.2)

[∀ (i : ι), CategoryTheory.Limits.HasBiproduct (g i)]

[CategoryTheory.Limits.HasBiproduct fun i => ⨁ g i]

(CategoryTheory.Limits.biproductBiproductIso f g).inv =
  CategoryTheory.Limits.biproduct.lift fun i =>
    CategoryTheory.Limits.biproduct.lift fun x => CategoryTheory.Limits.biproduct.π (fun p => g p.fst p.snd) ⟨i, x⟩


@[simp]
theorem abs_det_adjustToOrientation [Nonempty ι] (e : Basis ι R M)
    (x : Orientation R M ι) (v : ι → M) : |(e.adjustToOrientation x).det v| = |e.det v|

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_3}
[Fintype ι]
[DecidableEq ι]
[Nonempty ι]
(e : Basis ι R M)
(x : Orientation R M ι)
(v : ι → M)


lemma mul_conjTranspose_mul_self_eq_zero (A : Matrix m n R) (B : Matrix p n R) :
    B * (Aᴴ * A) = 0 ↔ B * Aᴴ = 0

{m : Type u_1}
{n : Type u_2}
{p : Type u_3}
{R : Type u_4}
[Fintype m]
[Fintype n]
[PartialOrder R]
[NonUnitalRing R]
[StarRing R]
[StarOrderedRing R]
[NoZeroDivisors R]
(A : Matrix m n R)
(B : Matrix p n R)

B * (A.conjTranspose * A) = 0 ↔ B * A.conjTranspose = 0


@[simp]
theorem fst_prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : (fst R B C).comp (prod f g) = f

{R : Type u}
[Monoid R]
{A : Type v}
{B : Type w}
{C : Type w₁}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[NonUnitalNonAssocSemiring C]
[DistribMulAction R B]
[DistribMulAction R C]
(f : A →ₙₐ[R] B)
(g : A →ₙₐ[R] C)

(NonUnitalAlgHom.fst R B C).comp (f.prod g) = f


@[simp] lemma addLeft_add : Equiv.addLeft (a + b) = Equiv.addLeft a * Equiv.addLeft b


lemma traceForm_apply_eq_zero_of_mem_lcs_of_mem_center {x y : L}
    (hx : x ∈ lowerCentralSeries R L L 1) (hy : y ∈ LieAlgebra.center R L) :
    traceForm R L M x y = 0

(hx : x ∈ LieModule.lowerCentralSeries R L L 1)


@[to_additive (attr := simp)]
theorem swap_comp_swap : (swap M N).comp (swap N M) = .id _

(M : Type u_1)
(N : Type u_2)
[MulOneClass M]
[MulOneClass N]

(Monoid.Coprod.swap M N).comp (Monoid.Coprod.swap N M) = MonoidHom.id (Monoid.Coprod N M)


@[to_additive (attr := simp)]
lemma symm_mk_mul [Mul M] (a b : Mᵈᵐᵃ) : mk.symm (a * b) = mk.symm b * mk.symm a

DomMulAct.mk.symm (a * b) = DomMulAct.mk.symm b * DomMulAct.mk.symm a


@[simp]
theorem realize_restrictVarLeft [DecidableEq α] {γ : Type*} {t : L.Term (α ⊕ γ)} {s : Set α}
    (h : ↑t.varFinsetLeft ⊆ s) {v : α → M} {xs : γ → M} :
    (t.restrictVarLeft (Set.inclusion h)).realize (Sum.elim (v ∘ (↑)) xs) =
      t.realize (Sum.elim v xs)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
[DecidableEq α]
{γ : Type u_4}
{t : L.Term (α ⊕ γ)}
{s : Set α}
(h : ↑t.varFinsetLeft ⊆ s)
{v : α → M}
{xs : γ → M}

FirstOrder.Language.Term.realize (Sum.elim (v ∘ Subtype.val) xs) (t.restrictVarLeft (Set.inclusion h)) =
  FirstOrder.Language.Term.realize (Sum.elim v xs) t


theorem xn_modEq_x4n_add (n j) : xn a1 (4 * n + j) ≡ xn a1 j [MOD xn a1 n]

Pell.xn a1 (4 * n + j) ≡ Pell.xn a1 j [MOD Pell.xn a1 n]


@[to_additive (attr := simp, norm_cast)]
theorem coe_div (s t : Finset α) : (↑(s / t) : Set α) = ↑s / ↑t

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


theorem inv_eq_of_aeval_divX_ne_zero {x : L} {p : K[X]} (aeval_ne : aeval x (divX p) ≠ 0) :
    x⁻¹ = aeval x (divX p) / (aeval x p - algebraMap _ _ (p.coeff 0))

(aeval_ne : (Polynomial.aeval x) p.divX ≠ 0)

x⁻¹ = (Polynomial.aeval x) p.divX / ((Polynomial.aeval x) p - (algebraMap K L) (p.coeff 0))


theorem integral_finset_sum {ι} (s : Finset ι) {f : ι → α → G} (hf : ∀ i ∈ s, Integrable (f i) μ) :
    ∫ a, ∑ i ∈ s, f i a ∂μ = ∑ i ∈ s, ∫ a, f i a ∂μ

(hf : ∀ i ∈ s, MeasureTheory.Integrable (f i) μ)

∫ (a : α), ∑ i ∈ s, f i a ∂μ = ∑ i ∈ s, ∫ (a : α), f i a ∂μ


theorem coeff_add_of_disjoint (x y : 𝕎 R) (h : ∀ n, x.coeff n = 0 ∨ y.coeff n = 0) :
    (x + y).coeff n = x.coeff n + y.coeff n

(h : ∀ (n : ℕ), x.coeff n = 0 ∨ y.coeff n = 0)


theorem norm_iteratedFDerivWithin_smul_le {f : E → 𝕜'} {g : E → F} {N : ℕ∞}
    (hf : ContDiffOn 𝕜 N f s) (hg : ContDiffOn 𝕜 N g s) (hs : UniqueDiffOn 𝕜 s) {x : E} (hx : x ∈ s)
    {n : ℕ} (hn : (n : ℕ∞) ≤ N) : ‖iteratedFDerivWithin 𝕜 n (fun y => f y • g y) s x‖ ≤
      ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * ‖iteratedFDerivWithin 𝕜 i f s x‖ *
        ‖iteratedFDerivWithin 𝕜 (n - i) g s x‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{𝕜' : Type u_2}
[NormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{f : E → 𝕜'}
{g : E → F}
{N : ℕ∞}
(hf : ContDiffOn 𝕜 N f s)
(hg : ContDiffOn 𝕜 N g s)
(hs : UniqueDiffOn 𝕜 s)
{x : E}
(hx : x ∈ s)
{n : ℕ}
(hn : ↑n ≤ N)

‖iteratedFDerivWithin 𝕜 n (fun y => f y • g y) s x‖ ≤
  ∑ i ∈ Finset.range (n + 1), ↑(n.choose i) * ‖iteratedFDerivWithin 𝕜 i f s x‖ * ‖iteratedFDerivWithin 𝕜 (n - i) g s x‖


/-- A functor is said to preserve connectedness if whenever `X : C` is connected,
also `F.obj X` is connected. -/
class PreservesIsConnected {C : Type u₁} [Category.{u₂, u₁} C] {D : Type v₁}
    [Category.{v₂, v₁} D] (F : C ⥤ D) : Prop where
  /-- `F.obj X` is connected if `X` is connected. -/
  preserves : ∀ {X : C} [IsConnected X], IsConnected (F.obj X)

[self : CategoryTheory.PreGaloisCategory.PreservesIsConnected F]


/-- A function `f` from a measurable space to any type is called *simple*,
if every preimage `f ⁻¹' {x}` is measurable, and the range is finite. This structure bundles
a function with these properties. -/
structure SimpleFunc.{u, v} (α : Type u) [MeasurableSpace α] (β : Type v) where
  toFun : α → β
  measurableSet_fiber' : ∀ x, MeasurableSet (toFun ⁻¹' {x})
  finite_range' : (Set.range toFun).Finite

{α : Type u}
[MeasurableSpace α]
{β : Type v}
(self : MeasureTheory.SimpleFunc α β)


theorem δ_comp_δ'' {n} {i : Fin (n + 3)} {j : Fin (n + 2)} (H : i ≤ Fin.castSucc j) :
    δ (i.castLT (Nat.lt_of_le_of_lt (Fin.le_iff_val_le_val.mp H) j.is_lt)) ≫ δ j.succ =
      δ j ≫ δ i

{n : ℕ}
{i : Fin (n + 3)}
{j : Fin (n + 2)}
(H : i ≤ j.castSucc)

SimplexCategory.δ (i.castLT ⋯) ≫ SimplexCategory.δ j.succ = SimplexCategory.δ j ≫ SimplexCategory.δ i


/-- Coercion from `C(X, Y)` with compact-open topology to `X → Y` with pointwise convergence
topology is a continuous map.

Porting note: merged `continuous_coe` with `continuous_coe'` removing unneeded assumptions. -/
theorem continuous_coe : Continuous ((⇑) : C(X, Y) → (X → Y))

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]


@[to_additive]
theorem Multipliable.multipliable_compl_iff {s : Set β} (hf : Multipliable (f ∘ (↑) : s → α)) :
    Multipliable (f ∘ (↑) : ↑sᶜ → α) ↔ Multipliable f

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
{f : β → α}
{s : Set β}
(hf : Summable (f ∘ Subtype.val))


theorem foldr'_ι (f : M →ₗ[R] CliffordAlgebra Q × N →ₗ[R] N)
    (hf : ∀ m x fx, f m (ι Q m * x, f m (x, fx)) = Q m • fx) (n m) :
    foldr' Q f hf n (ι Q m) = f m (1, n)

(hf : ∀ (m : M) (x : CliffordAlgebra Q) (fx : N), (f m) ((CliffordAlgebra.ι Q) m * x, (f m) (x, fx)) = Q m • fx)

(CliffordAlgebra.foldr' Q f hf n) ((CliffordAlgebra.ι Q) m) = (f m) (1, n)


@[to_additive card_le_one_iff_eq_bot]
theorem card_le_one_iff_eq_bot : card S ≤ 1 ↔ S = ⊥

{M : Type u_1}
[AddMonoid M]
{S : AddSubmonoid M}
[Fintype ↥S]


@[simp]
theorem mapMatrix_symm (f : α ≃+ β) : f.mapMatrix.symm = (f.symm.mapMatrix : Matrix m n β ≃+ _)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{β : Type w}
[Add α]
[Add β]
(f : α ≃+ β)


theorem toInt_ne (x y : BitVec n) : x.toInt ≠ y.toInt ↔ x ≠ y


theorem exists_mul_self (x : ℤ) : (∃ n, n * n = x) ↔ sqrt x * sqrt x = x

(∃ n, n * n = x) ↔ Int.sqrt x * Int.sqrt x = x


theorem drop_left' {l₁ l₂ : List α} {n} (h : length l₁ = n) : drop n (l₁ ++ l₂) = l₂

{α : Type u_1}
{l₁ l₂ : List α}
{n : Nat}
(h : l₁.length = n)


@[simp]
lemma map_mul_right_cobounded {a : α} (ha : a ≠ 0) :
    map (· * a) (cobounded α) = cobounded α

{α : Type u_1}
[NormedDivisionRing α]
{a : α}
(ha : a ≠ 0)

Filter.map (fun x => x * a) (Bornology.cobounded α) = Bornology.cobounded α


theorem firstDiff_le_longestPrefix {s : Set (∀ n, E n)} (hs : IsClosed s) {x y : ∀ n, E n}
    (hx : x ∉ s) (hy : y ∈ s) : firstDiff x y ≤ longestPrefix x s

{E : ℕ → Type u_1}
[(n : ℕ) → TopologicalSpace (E n)]
[∀ (n : ℕ), DiscreteTopology (E n)]
{s : Set ((n : ℕ) → E n)}
(hs : IsClosed s)
{x y : (n : ℕ) → E n}
(hx : x ∉ s)
(hy : y ∈ s)

PiNat.firstDiff x y ≤ PiNat.longestPrefix x s


theorem count_nth_succ {n : ℕ} (hn : ∀ hf : (setOf p).Finite, n < hf.toFinset.card) :
    count p (nth p n + 1) = n + 1

(hn : ∀ (hf : (setOf p).Finite), n < hf.toFinset.card)


/-- Note that this is not quite as useful as it looks because the measure takes values in `ℝ≥0∞`.
Thus the subtraction appearing is the truncated subtraction of `ℝ≥0∞`, rather than the
better-behaved subtraction of `ℝ`. -/
theorem prob_compl_eq_one_sub (hs : MeasurableSet s) : μ sᶜ = 1 - μ s

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[MeasureTheory.IsProbabilityMeasure μ]
(hs : MeasurableSet s)


theorem not_inr_lt_inl [LT α] [LT β] {a : α} {b : β} : ¬toLex (inr b) < toLex (inl a)

{α : Type u_1}
{β : Type u_2}
[LT α]
[LT β]
{a : α}
{b : β}


/-- The scalar multiplication of two `C^n` functions is `C^n`. -/
theorem ContDiff.smul {f : E → 𝕜} {g : E → F} (hf : ContDiff 𝕜 n f) (hg : ContDiff 𝕜 n g) :
    ContDiff 𝕜 n fun x => f x • g x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{f : E → 𝕜}
{g : E → F}
(hf : ContDiff 𝕜 n f)
(hg : ContDiff 𝕜 n g)


@[simp] theorem push_data (arr : Array α) (a : α) : (arr.push a).data = arr.data ++ [a]


theorem nonneg_normed (x : E) : 0 ≤ f.normed μ x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
[MeasurableSpace E]
{c : E}
(f : ContDiffBump c)
{μ : MeasureTheory.Measure E}
(x : E)


/-- Given a cocone `c` over `F`, we can interpret the legs of `c` as costructured arrows
    `F.obj - ⟶ c.pt`. -/
@[simps]
def Cocone.toCostructuredArrow {F : J ⥤ C} (c : Cocone F) : J ⥤ CostructuredArrow F c.pt

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

c.toCostructuredArrow.obj j = CategoryTheory.CostructuredArrow.mk (c.ι.app j)


theorem toMeasureOfZeroLE_toSignedMeasure (hs : 0 ≤[Set.univ] s) :
    (s.toMeasureOfZeroLE Set.univ MeasurableSet.univ hs).toSignedMeasure = s

(hs : MeasureTheory.VectorMeasure.restrict 0 Set.univ ≤ MeasureTheory.VectorMeasure.restrict s Set.univ)

(s.toMeasureOfZeroLE Set.univ ⋯ hs).toSignedMeasure = s


/-- If `f` is locally integrable, `‖f(-x)‖ = ‖f(x)‖`, and `f =O[atTop] g`, for some
`g` integrable at `atTop`, then `f` is integrable. -/
theorem LocallyIntegrable.integrable_of_isBigO_atTop_of_norm_isNegInvariant
    [IsMeasurablyGenerated (atTop (α := α))] [MeasurableNeg α] [μ.IsNegInvariant]
    (hf : LocallyIntegrable f μ) (hsymm : norm ∘ f =ᵐ[μ] norm ∘ f ∘ Neg.neg) (ho : f =O[atTop] g)
    (hg : IntegrableAtFilter g atTop μ) : Integrable f μ

(hf : MeasureTheory.LocallyIntegrable f μ)

(hg : MeasureTheory.IntegrableAtFilter g Filter.atTop μ)


@[to_additive]
theorem continuousWithinAt_inv {s : Set G} {x : G} : ContinuousWithinAt Inv.inv s x

{G : Type w}
[TopologicalSpace G]
[Neg G]
[ContinuousNeg G]
{s : Set G}
{x : G}


theorem joinM_map_map {α β : Type u} (f : α → β) (a : m (m α)) :
    joinM (Functor.map f <$> a) = f <$> joinM a

{m : Type u → Type u}
[Monad m]
[LawfulMonad m]
{α β : Type u}
(f : α → β)
(a : m (m α))


lemma isSemisimple_ad_of_mem_isCartanSubalgebra {x : L} (hx : x ∈ H) :
    (ad K L x).IsSemisimple

{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]
[PerfectField K]
{x : L}
(hx : x ∈ H)


theorem iteratedFDerivWithin_eventually_congr_set' (y : E) (h : s =ᶠ[𝓝[{y}ᶜ] x] t) (n : ℕ) :
    iteratedFDerivWithin 𝕜 n f s =ᶠ[𝓝 x] iteratedFDerivWithin 𝕜 n f t

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s t : Set E}
{f : E → F}
{x : E}
(y : E)
(h : s =ᶠ[𝓝[{y}ᶜ] x] t)
(n : ℕ)


/-- In a monoid with zero, if zero equals one, then zero is the only element. -/
theorem eq_zero_of_zero_eq_one (h : (0 : M₀) = 1) (a : M₀) : a = 0

{M₀ : Type u_2}
[MulZeroOneClass M₀]
(h : 0 = 1)
(a : M₀)


theorem nhdsWithin_source_inter {x} (hx : x ∈ e.source) (s : Set X) : 𝓝[e.source ∩ s] x = 𝓝[s] x

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{x : X}
(hx : x ∈ e.source)
(s : Set X)


@[simp]
lemma polyCharpolyAux_coeff_eval [Module.Finite R M] [Module.Free R M] (x : L) (i : ℕ) :
    MvPolynomial.eval (b.repr x) ((polyCharpolyAux φ b bₘ).coeff i) = (φ x).charpoly.coeff i

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
{ι : Type u_5}
{ιM : Type u_7}
[CommRing R]
[AddCommGroup L]
[Module R L]
[AddCommGroup M]
[Module R M]
(φ : L →ₗ[R] Module.End R M)
[Fintype ι]
[Fintype ιM]
[DecidableEq ι]
[DecidableEq ιM]
(b : Basis ι R L)
(bₘ : Basis ιM R M)
[Module.Finite R M]
[Module.Free R M]
(x : L)
(i : ℕ)

(MvPolynomial.eval ⇑(b.repr x)) ((φ.polyCharpolyAux b bₘ).coeff i) = (LinearMap.charpoly (φ x)).coeff i


theorem eLpNorm_one_le_of_le' {r : ℝ} (hfint : Integrable f μ) (hfint' : 0 ≤ ∫ x, f x ∂μ)
    (hf : ∀ᵐ ω ∂μ, f ω ≤ r) : eLpNorm f 1 μ ≤ 2 * μ Set.univ * ENNReal.ofReal r

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
{r : ℝ}
(hfint : MeasureTheory.Integrable f μ)
(hfint' : 0 ≤ ∫ (x : α), f x ∂μ)
(hf : ∀ᵐ (ω : α) ∂μ, f ω ≤ r)

MeasureTheory.eLpNorm f 1 μ ≤ 2 * μ Set.univ * ENNReal.ofReal r


@[simp]
theorem map_adjoin_singleton (e : A →ₐ[R] B) (x : A) :
    (adjoin R {x}).map e = adjoin R {e x}

{R : Type uR}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(e : A →ₐ[R] B)
(x : A)

Subalgebra.map e (Algebra.adjoin R {x}) = Algebra.adjoin R {e x}


theorem exists_measure_pos_of_not_measure_iUnion_null [Countable ι] {s : ι → Set α}
    (hs : μ (⋃ n, s n) ≠ 0) : ∃ n, 0 < μ (s n)

{α : Type u_1}
{ι : Sort u_5}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[Countable ι]
{s : ι → Set α}
(hs : μ (⋃ n, s n) ≠ 0)


@[nontriviality]
theorem isLittleO_of_subsingleton [Subsingleton E'] : f' =o[l] g'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{f' : α → E'}
{g' : α → F'}
{l : Filter α}
[Subsingleton E']


@[mono]
theorem map_mono : Monotone (map f)

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
{f : L →ₗ⁅R⁆ L'}


@[to_additive]
theorem Antitone.inv (hf : Antitone f) : Monotone fun x => (f 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 prod_mono_left : s₁ ≤ s₂ → s₁ ×ˢ t ≤ s₂ ×ˢ t

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s₁ s₂ : UpperSet α}
{t : UpperSet β}

s₁ ≤ s₂ → s₁ ×ˢ t ≤ s₂ ×ˢ t


theorem _root_.biSup_sigma (s : Set ι) (t : ∀ i, Set (α i)) (f : Sigma α → β) :
    ⨆ ij ∈ s.sigma t, f ij = ⨆ (i ∈ s) (j ∈ t i), f ⟨i, j⟩

{ι : Type u_1}
{α : ι → Type u_3}
{β : Type u_5}
[CompleteLattice β]
(s : Set ι)
(t : (i : ι) → Set (α i))
(f : Sigma α → β)

⨆ ij ∈ s.sigma t, f ij = ⨆ i ∈ s, ⨆ j ∈ t i, f ⟨i, j⟩


theorem nmul_assoc : ∀ a b c, a ⨳ b ⨳ c = a ⨳ (b ⨳ c)


@[simp]
protected theorem coe_mk (hsp : ⊤ ≤ (span 𝕜 (Set.range v)).topologicalClosure) :
    ⇑(HilbertBasis.mk hv hsp) = v

(hsp : ⊤ ≤ (Submodule.span 𝕜 (Set.range v)).topologicalClosure)

(fun i => (HilbertBasis.mk hv hsp).repr.symm (lp.single 2 i 1)) = v


/-- If a locally integrable function has zero integral on all compact sets in a sigma-compact space,
then it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_setIntegral_isCompact_eq_zero'
    [SigmaCompactSpace β] [R1Space β] {μ : Measure β} {f : β → E} (hf : LocallyIntegrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0

(hf : MeasureTheory.LocallyIntegrable f μ)

(h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0)


theorem true_imp_iff (α : Prop) : (True → α) ↔ α

True → α ↔ α


@[simp]
theorem incl_apply (m : N) : N.incl m = m

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(N : LieSubmodule R L M)
(m : ↥N)


protected theorem Reachable.pos_dist_of_ne (h : G.Reachable u v) (hne : u ≠ v) :
    0 < G.dist u v

{V : Type u_1}
{G : SimpleGraph V}
{u v : V}
(h : G.Reachable u v)
(hne : u ≠ v)


@[simp]
theorem pointReflection_symm (x : P₁) : (pointReflection k x).symm = pointReflection k x

(k : Type u_1)
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(x : P₁)

(AffineEquiv.pointReflection k x).symm = AffineEquiv.pointReflection k x


/-- A group is commutative if the quotient by the center is cyclic.
  Also see `commGroup_of_cycle_center_quotient` for the `CommGroup` instance. -/
@[to_additive
      "A group is commutative if the quotient by the center is cyclic.
      Also see `addCommGroup_of_cycle_center_quotient` for the `AddCommGroup` instance."]
theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf : f.ker ≤ center G)
    (a b : G) : a * b = b * a

{G : Type u_1}
{H : Type u_2}
[Group G]
[Group H]
[IsCyclic H]
(f : G →* H)
(hf : f.ker ≤ Subgroup.center G)
(a b : G)


theorem inf_mem_infs : a ∈ s → b ∈ t → a ⊓ b ∈ s ⊼ t

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
{s t : Finset α}
{a b : α}


/-- When every element of a set `s` is bounded by an element of a set `t`, and conversely, then
`s` and `t` have the same infimum. This holds even when the sets may be empty or unbounded. -/
theorem csInf_eq_csInf_of_forall_exists_le {s t : Set α}
    (hs : ∀ x ∈ s, ∃ y ∈ t, y ≤ x) (ht : ∀ y ∈ t, ∃ x ∈ s, x ≤ y) :
    sInf s = sInf t

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
{s t : Set α}
(hs : ∀ x ∈ s, ∃ y ∈ t, y ≤ x)
(ht : ∀ y ∈ t, ∃ x ∈ s, x ≤ y)


@[simp]
theorem ihom_obj_ρ_def (A B : Rep k G) : ((ihom A).obj B).ρ = ((Rep.ihom A).obj B).ρ

{k G : Type u}
[CommRing k]
[Group G]
(A B : Rep k G)

((CategoryTheory.ihom A).obj B).ρ = (A.ihom.obj B).ρ


theorem dvd_mul_of_dvd_right (h : a ∣ b) (c : α) : a ∣ c * b

{α : Type u_1}
[CommSemigroup α]
{a b : α}
(h : a ∣ b)
(c : α)


@[simp] theorem val_rev_zero [NeZero n] : ((rev 0 : Fin n) : ℕ) = n.pred


theorem IsMinFilter.filter_mono (h : IsMinFilter f l a) (hl : l' ≤ l) : IsMinFilter f l' a

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{l : Filter α}
{a : α}
{l' : Filter α}
(h : IsMinFilter f l a)
(hl : l' ≤ l)


@[simp] lemma intCast_mul_left (h : SemiconjBy a x y) (n : ℤ) : SemiconjBy (n * a) x y

{α : Type u_3}
[Ring α]
{a x y : α}
(h : SemiconjBy a x y)
(n : ℤ)


@[simp]
lemma re_eq_neg_abs {z : ℂ} : z.re = -abs z ↔ z ≤ 0


@[simp]
theorem curry_apply (f : C(X × Y, Z)) (a : X) (b : Y) : f.curry a b = f (a, b)

{X : Type u_2}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(f : C(X × Y, Z))
(a : X)
(b : Y)


@[to_additive]
theorem smul_finset_subset_smul {s : Finset α} : a ∈ s → a • t ⊆ s • t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[SMul α β]
{t : Finset β}
{a : α}
{s : Finset α}


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

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


protected theorem disjoint_sup_left : Disjoint (s.sup f) a ↔ ∀ ⦃i⦄, i ∈ s → Disjoint (f i) a

{α : Type u_2}
{ι : Type u_5}
[DistribLattice α]
[OrderBot α]
{s : Finset ι}
{f : ι → α}
{a : α}

Disjoint (s.sup f) a ↔ ∀ ⦃i : ι⦄, i ∈ s → Disjoint (f i) a


theorem contMDiff_proj : ContMDiff (IB.prod 𝓘(𝕜, F)) IB n (π F E)

[TopologicalSpace (Bundle.TotalSpace F E)]

ContMDiff (IB.prod 𝓘(𝕜, F)) IB n Bundle.TotalSpace.proj


@[simp]
theorem aequiv_trans {U : Type*} [CommRing U] [Algebra R U] (h : IsAdjoinRoot S f)
    (h' : IsAdjoinRoot T f) (h'' : IsAdjoinRoot U f) :
    (h.aequiv h').trans (h'.aequiv h'') = h.aequiv h''

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{f : R[X]}
{T : Type u_1}
[CommRing T]
[Algebra R T]
{U : Type u_2}
[CommRing U]
[Algebra R U]
(h : IsAdjoinRoot S f)
(h' : IsAdjoinRoot T f)
(h'' : IsAdjoinRoot U f)


@[continuity, fun_prop]
protected theorem Continuous.max (hf : Continuous f) (hg : Continuous g) :
    Continuous fun b => max (f b) (g b)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{f g : β → α}
[TopologicalSpace β]
(hf : Continuous f)
(hg : Continuous g)


lemma isoOfHom_unop  {X Y : Cᵒᵖ} (w : X ⟶ Y) (hw : W.op w) :
    (isoOfHom L.op W.op w hw).unop = (isoOfHom L W w.unop hw)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
(L : C ⥤ D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
{X Y : Cᵒᵖ}
(w : X ⟶ Y)
(hw : W.op w)

(CategoryTheory.Localization.isoOfHom L.op W.op w hw).unop = CategoryTheory.Localization.isoOfHom L W w.unop hw


/-- `cyclotomic n ℤ` is the minimal polynomial of a primitive `n`-th root of unity `μ`. -/
theorem cyclotomic_eq_minpoly {n : ℕ} {K : Type*} [Field K] {μ : K} (h : IsPrimitiveRoot μ n)
    (hpos : 0 < n) [CharZero K] : cyclotomic n ℤ = minpoly ℤ μ

{n : ℕ}
{K : Type u_2}
[Field K]
{μ : K}
(h : IsPrimitiveRoot μ n)
(hpos : 0 < n)
[CharZero K]


/-- For nonzero `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
@[simp]
theorem factorization_mul {a b : α} (ha : a ≠ 0) (hb : b ≠ 0) :
    factorization (a * b) = factorization a + factorization b

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


@[to_additive] lemma commute_inv_coe : Commute ↑a⁻¹ (a : α)


@[simp]
theorem mem_sUnion {x y : ZFSet.{u}} : y ∈ ⋃₀ x ↔ ∃ z ∈ x, y ∈ z

y ∈ ⋃₀ x ↔ ∃ z ∈ x, y ∈ z


@[simp]
theorem disjoint_sUnion_right {s : Set α} {S : Set (Set α)} :
    Disjoint s (⋃₀S) ↔ ∀ t ∈ S, Disjoint s t

{α : Type u_1}
{s : Set α}
{S : Set (Set α)}

Disjoint s (⋃₀ S) ↔ ∀ t ∈ S, Disjoint s t


@[simp]
theorem sInter_eq_univ {S : Set (Set α)} : ⋂₀ S = univ ↔ ∀ s ∈ S, s = univ


theorem coind_bijective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Bijective f) :
    Bijective (coind f h)

{α : Sort u_4}
{β : Sort u_5}
{f : α → β}
{p : β → Prop}
(h : ∀ (a : α), p (f a))
(hf : Function.Bijective f)


/-- Build an isomorphism in the category `Grp` from a `MulEquiv` between `Group`s. -/
@[to_additive (attr := simps)]
def MulEquiv.toGrpIso {X Y : Grp} (e : X ≃* Y) : X ≅ Y


@[simp]
lemma opcyclesMap_sub : opcyclesMap (φ - φ') = opcyclesMap φ - opcyclesMap φ'

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
(φ φ' : S₁ ⟶ S₂)
[S₁.HasRightHomology]
[S₂.HasRightHomology]

CategoryTheory.ShortComplex.opcyclesMap (φ - φ') =
  CategoryTheory.ShortComplex.opcyclesMap φ - CategoryTheory.ShortComplex.opcyclesMap φ'


theorem enoughInjectives_iff (F : C ≌ D) : EnoughInjectives C ↔ EnoughInjectives D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u_1}
[CategoryTheory.Category.{u_2, u_1} D]
(F : C ≌ D)

CategoryTheory.EnoughInjectives C ↔ CategoryTheory.EnoughInjectives D


theorem mono' (h : ∀ (a) (_ : a ∈ s) (b) (_ : b ∈ s), r' a b → r a b) :
    s.WellFoundedOn r → s.WellFoundedOn r'

{α : Type u_2}
{r r' : α → α → Prop}
{s : Set α}
(h : ∀ a ∈ s, ∀ b ∈ s, r' a b → r a b)


theorem max_const (hf : LipschitzWith Kf f) (a : ℝ) : LipschitzWith Kf fun x => max (f x) a

{α : Type u}
[PseudoEMetricSpace α]
{f : α → ℝ}
{Kf : ℝ≥0}
(hf : LipschitzWith Kf f)
(a : ℝ)


@[simp] lemma coeff_ofNat_mul {a k : ℕ} [Nat.AtLeastTwo a] :
  coeff ((no_index (OfNat.ofNat a) : R[X]) * p) k = OfNat.ofNat a * coeff p k

{R : Type u}
[Semiring R]
{p : R[X]}
{a k : ℕ}
[a.AtLeastTwo]

(OfNat.ofNat a * p).coeff k = OfNat.ofNat a * p.coeff k


@[to_additive (attr := simp)]
theorem inv_singleton (a : α) : ({a} : Set α)⁻¹ = {a⁻¹}

{α : Type u_2}
[InvolutiveNeg α]
(a : α)


theorem dvd_mod_iff {a b c : R} (h : c ∣ b) : c ∣ a % b ↔ c ∣ a

{R : Type u}
[EuclideanDomain R]
{a b c : R}
(h : c ∣ b)


@[simp]
theorem derivative_intCast {n : ℤ} : derivative (n : R[X]) = 0


/-- All nondegenerate quadratic forms on the complex numbers are equivalent. -/
theorem complex_equivalent {M : Type*} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
    (Q₁ Q₂ : QuadraticForm ℂ M) (hQ₁ : (associated (R := ℂ) Q₁).SeparatingLeft)
    (hQ₂ : (associated (R := ℂ) Q₂).SeparatingLeft) : Equivalent Q₁ Q₂

(hQ₁ : LinearMap.SeparatingLeft (QuadraticMap.associated Q₁))

(hQ₂ : LinearMap.SeparatingLeft (QuadraticMap.associated Q₂))


/-- An equiv between topological spaces respecting openness is a homeomorphism. -/
@[simps toEquiv]
def toHomeomorph (e : X ≃ Y) (he : ∀ s, IsOpen (e ⁻¹' s) ↔ IsOpen s) : X ≃ₜ Y

(he : ∀ (s : Set Y), IsOpen (⇑e ⁻¹' s) ↔ IsOpen s)


theorem mul_inv_le_of_le_mul (hab : a ≤ b * c) : a * c⁻¹ ≤ b

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a b c : α}
(hab : a ≤ b * c)


/-- A complex differentiable function `f : ℂ → E` is continuously differentiable at every point. -/
protected theorem _root_.Differentiable.contDiff {f : ℂ → E} (hf : Differentiable ℂ f) {n : ℕ∞} :
    ContDiff ℂ n f

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[CompleteSpace E]
{f : ℂ → E}
(hf : Differentiable ℂ f)
{n : ℕ∞}


@[to_additive]
theorem ker_eq_bot_of_mono [Mono f] : f.ker = ⊥

{A B : CommGrp}
(f : A ⟶ B)
[CategoryTheory.Mono f]


lemma exact_and_epi_g_iff_of_iso (e : S₁ ≅ S₂) :
    S₁.Exact ∧ Epi S₁.g ↔ S₂.Exact ∧ Epi S₂.g

S₁.Exact ∧ CategoryTheory.Epi S₁.g ↔ S₂.Exact ∧ CategoryTheory.Epi S₂.g


theorem mem_sInf {S : Set (StarSubalgebra R A)} {x : A} : x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p

{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)}
{x : A}


theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x)
    (hne : f x ≠ g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f g : G → E}
{s : Set G}
{x : G}
{n : ℕ∞}
(hf : ContDiffWithinAt ℝ n f s x)
(hg : ContDiffWithinAt ℝ n g s x)
(hne : f x ≠ g x)


@[simp] lemma coe_star [StarRing R] [ContinuousStar R] (f : C(X, R)₀) : ⇑(star f) = star ⇑f

{X : Type u_1}
{R : Type u_2}
[Zero X]
[TopologicalSpace X]
[TopologicalSpace R]
[CommSemiring R]
[TopologicalSemiring R]
[StarRing R]
[ContinuousStar R]
(f : ContinuousMapZero X R)


@[to_additive]
lemma mulIndicator_iUnion_apply (h1 : (⊥ : M) = 1) (s : ι → Set α) (f : α → M) (x : α) :
    mulIndicator (⋃ i, s i) f x = ⨆ i, mulIndicator (s i) f x

{ι : Sort u_1}
{α : Type u_2}
{M : Type u_4}
[CompleteLattice M]
[One M]
(h1 : ⊥ = 1)
(s : ι → Set α)
(f : α → M)
(x : α)

(⋃ i, s i).mulIndicator f x = ⨆ i, (s i).mulIndicator f x


/-- The composition of equivalences of first-order languages. -/
@[simps, trans]
protected def trans (e : L ≃ᴸ L') (e' : L' ≃ᴸ L'') : L ≃ᴸ L''

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
{L'' : FirstOrder.Language}
(e : L ≃ᴸ L')
(e' : L' ≃ᴸ L'')

(e.trans e').toLHom = e'.toLHom.comp e.toLHom


/-- If `n` is a squarefree natural number, then `-1` is a square modulo `n` if and only if
`n` has no divisor `q` that is `≡ 3 mod 4`. -/
theorem ZMod.isSquare_neg_one_iff' {n : ℕ} (hn : Squarefree n) :
    IsSquare (-1 : ZMod n) ↔ ∀ {q : ℕ}, q ∣ n → q % 4 ≠ 3

IsSquare (-1) ↔ ∀ {q : ℕ}, q ∣ n → q % 4 ≠ 3


/-- Auxiliary definition for `functorCategoryEquivalence`. -/
@[simps]
def inverse : (SingleObj G ⥤ V) ⥤ Action V G

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}

∀ {X Y : CategoryTheory.SingleObj ↑G ⥤ V} (f : X ⟶ Y),
  (Action.FunctorCategoryEquivalence.inverse.map f).hom = f.app PUnit.unit


protected theorem ext_iff {a b : ℍ} : a = b ↔ (a : ℂ) = b


lemma presheafHom_isSheafFor  :
    Presieve.IsSheafFor (presheafHom F G) S.arrows

(hG :
  ⦃Y : C⦄ →
    (f : Y ⟶ X) → CategoryTheory.Limits.IsLimit (G.mapCone (CategoryTheory.Sieve.pullback f S).arrows.cocone.op))

CategoryTheory.Presieve.IsSheafFor (CategoryTheory.presheafHom F G) S.arrows


theorem wittPolynomial_vars_subset (n : ℕ) : (wittPolynomial p R n).vars ⊆ range (n + 1)

(p : ℕ)
(R : Type u_1)
[CommRing R]
[hp : NeZero p]
(n : ℕ)


lemma sections_ext (F : Sheaf J (Type _)) {x y : F.1.sections}
    (h : ∀ (i : I), x.1 (Opposite.op (Y i)) = y.1 (Opposite.op (Y i))) :
    x = y

{J : CategoryTheory.GrothendieckTopology C}

(h : ∀ (i : I), ↑x (Opposite.op (Y i)) = ↑y (Opposite.op (Y i)))


theorem isClopen_range_inr : IsClopen (range (Sum.inr : Y → X ⊕ Y))

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]


theorem comap_comap {T : Type*} [Semiring T] {I : Ideal T} (f : R →+* S) (g : S →+* T) :
    (I.comap g).comap f = I.comap (g.comp f)

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
{T : Type u_3}
[Semiring T]
{I : Ideal T}
(f : R →+* S)
(g : S →+* T)

Ideal.comap f (Ideal.comap g I) = Ideal.comap (g.comp f) I


/-- The sine of the angle between two vectors is 0 if and only if the angle is 0 or π. -/
theorem sin_eq_zero_iff_angle_eq_zero_or_angle_eq_pi :
    sin (angle x y) = 0 ↔ angle x y = 0 ∨ angle x y = π

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}

Real.sin (InnerProductGeometry.angle x y) = 0 ↔ InnerProductGeometry.angle x y = 0 ∨ InnerProductGeometry.angle x y = π


theorem natDegree_eq_zero_iff_degree_le_zero : p.natDegree = 0 ↔ p.degree ≤ 0


@[elab_as_elim]
protected theorem inductionOn {C : DirectLimit G f → Prop} (z : DirectLimit G f)
    (ih : ∀ i x, C (of L ι G f i x)) : C z

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

{C : FirstOrder.Language.DirectLimit G f → Prop}

(z : FirstOrder.Language.DirectLimit G f)

(ih : ∀ (i : ι) (x : G i), C ((FirstOrder.Language.DirectLimit.of L ι G f i) x))


/-- The image of the normalizer is equal to the normalizer of the image of a bijective
  function. -/
@[to_additive
      "The image of the normalizer is equal to the normalizer of the image of a bijective
        function."]
theorem map_normalizer_eq_of_bijective (H : Subgroup G) {f : G →* N} (hf : Function.Bijective f) :
    H.normalizer.map f = (H.map f).normalizer

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(H : Subgroup G)
{f : G →* N}
(hf : Function.Bijective ⇑f)

Subgroup.map f H.normalizer = (Subgroup.map f H).normalizer


/-- If `f` is continuous multilinear, then `f (Σ_{j₁ ∈ A₁} g₁ j₁, ..., Σ_{jₙ ∈ Aₙ} gₙ jₙ)` is the
sum of `f (g₁ (r 1), ..., gₙ (r n))` where `r` ranges over all functions with `r 1 ∈ A₁`, ...,
`r n ∈ Aₙ`. This follows from multilinearity by expanding successively with respect to each
coordinate. -/
theorem map_sum_finset [DecidableEq ι] :
    (f fun i => ∑ j ∈ A i, g i j) = ∑ r ∈ piFinset A, f fun i => g i (r i)

{R : Type u}
{ι : Type v}
{M₁ : ι → Type w₁}
{M₂ : Type w₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]
(f : ContinuousMultilinearMap R M₁ M₂)
{α : ι → Type u_1}
[Fintype ι]
(g : (i : ι) → α i → M₁ i)
(A : (i : ι) → Finset (α i))
[DecidableEq ι]

(f fun i => ∑ j ∈ A i, g i j) = ∑ r ∈ Fintype.piFinset A, f fun i => g i (r i)


@[simp]
protected theorem add_right_inj (i j k : Int) : (i + k = j + k) ↔ i = j


@[simp]
theorem Inv_divided_by_X_pow_order_rightInv {f : k⟦X⟧} (hf : f ≠ 0) :
    divided_by_X_pow_order hf * Inv_divided_by_X_pow_order hf = 1

{k : Type u_2}
[Field k]
{f : PowerSeries k}
(hf : f ≠ 0)

PowerSeries.divided_by_X_pow_order hf * PowerSeries.Inv_divided_by_X_pow_order hf = 1


theorem AddMonoid.fg_iff_mul_fg : AddMonoid.FG N ↔ Monoid.FG (Multiplicative N)


theorem embedding_inl [Zero M] : Embedding (inl : R → tsze R M)

{R : Type u_3}
{M : Type u_4}
[TopologicalSpace R]
[TopologicalSpace M]
[Zero M]


@[simp]
theorem get_tails : ∀ (n : ℕ) (s : Stream' α), get (tails s) n = drop n (tail s)


/-- Any increasing map `f` from `Fin k` to a finset of cardinality `k` has to coincide with
the increasing bijection `orderEmbOfFin s h`. -/
theorem orderEmbOfFin_unique {s : Finset α} {k : ℕ} (h : s.card = k) {f : Fin k → α}
    (hfs : ∀ x, f x ∈ s) (hmono : StrictMono f) : f = s.orderEmbOfFin h

{α : Type u_1}
[LinearOrder α]
{s : Finset α}
{k : ℕ}
(h : s.card = k)
{f : Fin k → α}
(hfs : ∀ (x : Fin k), f x ∈ s)
(hmono : StrictMono f)


theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f pos}

Set.range f = {f SignType.zero, f SignType.neg, f SignType.pos}


theorem sameRay_neg_smul_right_iff_of_ne {v : M} {r : R} (hv : v ≠ 0) (hr : r ≠ 0) :
    SameRay R (-v) (r • v) ↔ r < 0

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{v : M}
{r : R}
(hv : v ≠ 0)
(hr : r ≠ 0)


@[simp]
theorem setToFun_zero (hT : DominatedFinMeasAdditive μ T C) : setToFun μ T hT (0 : α → E) = 0

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)


/-- An antitone sequence `f : ℕ → ℝ≥0` has a finite limit. -/
theorem tendsto_of_antitone {f : ℕ → ℝ≥0} (h_ant : Antitone f) :
    ∃ r : ℝ≥0, Tendsto f atTop (𝓝 r)

∃ r, Filter.Tendsto f Filter.atTop (𝓝 r)


theorem ContDiffWithinAt.rpow (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x)
    (h : f x ≠ 0) : ContDiffWithinAt ℝ n (fun x => f x ^ g x) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f g : E → ℝ}
{x : E}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffWithinAt ℝ n f s x)
(hg : ContDiffWithinAt ℝ n g s x)
(h : f x ≠ 0)


@[simp]
theorem domDomCongr_eq_zero_iff (σ : ι ≃ ι') (f : M [⋀^ι]→ₗ[R] N) :
    f.domDomCongr σ = 0 ↔ f = 0

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
{ι' : Type u_8}
(σ : ι ≃ ι')
(f : M [⋀^ι]→ₗ[R] N)

AlternatingMap.domDomCongr σ f = 0 ↔ f = 0


@[simp]
theorem productMap_apply_tmul (a : A) (b : B) : productMap f g (a ⊗ₜ b) = f a * g b

{R : Type uR}
{S : Type uS}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Semiring B]
[CommSemiring S]
[Algebra R A]
[Algebra R B]
[Algebra R S]
(f : A →ₐ[R] S)
(g : B →ₐ[R] S)
(a : A)
(b : B)

(Algebra.TensorProduct.productMap f g) (a ⊗ₜ[R] b) = f a * g b


protected theorem ne_zero {x : R} (hx : x ≠ 0) : abv x ≠ 0

{R : Type u_5}
{S : Type u_6}
[Semiring R]
[OrderedSemiring S]
(abv : AbsoluteValue R S)
{x : R}
(hx : x ≠ 0)


@[to_additive]
lemma orderOf_pow_of_dvd {x : G} {n : ℕ} (hn : n ≠ 0) (dvd : n ∣ orderOf x) :
    orderOf (x ^ n) = orderOf x / n

{G : Type u_1}
[Monoid G]
{x : G}
{n : ℕ}
(hn : n ≠ 0)
(dvd : n ∣ orderOf x)


theorem continuousOn_tan_Ioo : ContinuousOn tan (Ioo (-(π / 2)) (π / 2))

ContinuousOn Real.tan (Set.Ioo (-(Real.pi / 2)) (Real.pi / 2))


theorem suffixLevenshtein_minimum_le_levenshtein_cons (xs : List α) (y ys) :
    (suffixLevenshtein C xs ys).1.minimum ≤ levenshtein C xs (y :: ys)

(↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))


theorem card_embedding_eq_of_unique {α β : Type*} [Unique α] [Fintype β] [Fintype (α ↪ β)] :
    ‖α ↪ β‖ = ‖β‖

{α : Type u_1}
{β : Type u_2}
[Unique α]
[Fintype β]
[Fintype (α ↪ β)]

‖α ↪ β‖ = ‖β‖


theorem IsBounded.isBoundedUnder {q : β → β → Prop} {u : α → β}
    (hu : ∀ a₀ a₁, r a₀ a₁ → q (u a₀) (u a₁)) : f.IsBounded r → f.IsBoundedUnder q u

(hu : ∀ (a₀ a₁ : α), r a₀ a₁ → q (u a₀) (u a₁))

Filter.IsBounded r f → Filter.IsBoundedUnder q f u


theorem not_isUniform_zero : ¬G.IsUniform (0 : 𝕜) s t

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
{G : SimpleGraph α}
[DecidableRel G.Adj]
{s t : Finset α}


theorem bounded_singleton {r : α → α → Prop} [IsWellOrder α r] (hr : (type r).IsLimit) (x) :
    Bounded r {x}

{α : Type u_1}
{r : α → α → Prop}
[IsWellOrder α r]
(hr : (Ordinal.type r).IsLimit)
(x : α)


theorem mk (h : ∀ ⦃s : Set α⦄, MeasurableSet s → ν s = 0 → μ s = 0) : μ ≪ ν


@[reassoc (attr := simp)]
theorem Pi.reindex_hom_π (b : β) : (Pi.reindex ε f).hom ≫ Pi.π f (ε b) = Pi.π (f ∘ ε) b

[CategoryTheory.Limits.HasProduct (f ∘ ⇑ε)]

(CategoryTheory.Limits.Pi.reindex ε f).hom ≫ CategoryTheory.Limits.Pi.π f (ε b) = CategoryTheory.Limits.Pi.π (f ∘ ⇑ε) b


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

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

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


@[simp]
lemma prodEquiv_apply_fst (x : (forget C).obj (X₁ ⨯ X₂)) :
    (prodEquiv X₁ X₂ x).fst = (Limits.prod.fst : X₁ ⨯ X₂ ⟶ X₁) x

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.pair X₁ X₂) (CategoryTheory.forget C)]

(x : (CategoryTheory.forget C).obj (X₁ ⨯ X₂))

((CategoryTheory.Limits.Concrete.prodEquiv X₁ X₂) x).1 = CategoryTheory.Limits.prod.fst x


theorem IsMin.not_supIrred (ha : IsMin a) : ¬SupIrred a

{α : Type u_2}
[SemilatticeSup α]
{a : α}
(ha : IsMin a)


@[to_additive (attr := simp)]
theorem mulIndicator_range_comp {ι : Sort*} (f : ι → α) (g : α → M) :
    mulIndicator (range f) g ∘ f = g ∘ f

{α : Type u_1}
{M : Type u_4}
[One M]
{ι : Sort u_6}
(f : ι → α)
(g : α → M)

(Set.range f).mulIndicator g ∘ f = g ∘ f


@[simp]
theorem enumFrom_map_snd : ∀ (n) (l : List α), map Prod.snd (enumFrom n l) = l

List.map Prod.snd (List.enumFrom n l) = l


theorem vecAlt0_vecAppend (v : Fin n → α) :
    vecAlt0 rfl (vecAppend rfl v v) = v ∘ (fun n ↦ n + n)

Matrix.vecAlt0 ⋯ (Matrix.vecAppend ⋯ v v) = v ∘ fun n_1 => n_1 + n_1


@[simp] theorem two_ne_top : (2 : ℝ≥0∞) ≠ ∞


@[simp]
theorem trans_apply (e : α ≃o β) (e' : β ≃o γ) (x : α) : e.trans e' x = e' (e x)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[LE α]
[LE β]
[LE γ]
(e : α ≃o β)
(e' : β ≃o γ)
(x : α)


theorem inversion_eq_lineMap (c : P) (R : ℝ) (x : P) :
    inversion c R x = lineMap c x ((R / dist x c) ^ 2)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(c : P)
(R : ℝ)
(x : P)

EuclideanGeometry.inversion c R x = (AffineMap.lineMap c x) ((R / dist x c) ^ 2)


@[simp]
theorem X_mul_divX_add (p : R[X]) : X * divX p + C (p.coeff 0) = p

Polynomial.X * p.divX + Polynomial.C (p.coeff 0) = p


theorem intValuation_eq_of_coe (P : K[X]) :
    (Polynomial.idealX K).intValuation P = (idealX K).intValuation (P : K⟦X⟧)

(Polynomial.idealX K).intValuation P = (PowerSeries.idealX K).intValuation ↑P


theorem ofNat_sub_dichotomy {a b : Nat} :
    b ≤ a ∧ ((a - b : Nat) : Int) = a - b ∨ a < b ∧ ((a - b : Nat) : Int) = 0

b ≤ a ∧ ↑(a - b) = ↑a - ↑b ∨ a < b ∧ ↑(a - b) = 0


@[to_additive] lemma antivary_inv : Antivary f⁻¹ g⁻¹ ↔ Antivary f g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommGroup β]
{f : ι → α}
{g : ι → β}


@[simp]
theorem derivedSeriesOfIdeal_succ (k : ℕ) :
    derivedSeriesOfIdeal R L (k + 1) I =
      ⁅derivedSeriesOfIdeal R L k I, derivedSeriesOfIdeal R L k I⁆

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)
(k : ℕ)

LieAlgebra.derivedSeriesOfIdeal R L (k + 1) I =
  ⁅LieAlgebra.derivedSeriesOfIdeal R L k I, LieAlgebra.derivedSeriesOfIdeal R L k I⁆


lemma one_add_smoothingFn_le_two {x : ℝ} (hx : exp 1 ≤ x) : 1 + ε x ≤ 2

1 + AkraBazziRecurrence.smoothingFn x ≤ 2


theorem eq_empty_or_nonempty (u : ZFSet) : u = ∅ ∨ u.Nonempty


/-- The auxiliary function `convs'Aux` returns the same value for a sequence and the
corresponding squashed sequence at the squashed position. -/
theorem succ_succ_nth_conv'Aux_eq_succ_nth_conv'Aux_squashSeq :
    convs'Aux s (n + 2) = convs'Aux (squashSeq s n) (n + 1)

{K : Type u_1}
{n : ℕ}
{s : Stream'.Seq (GenContFract.Pair K)}
[DivisionRing K]

GenContFract.convs'Aux s (n + 2) = GenContFract.convs'Aux (GenContFract.squashSeq s n) (n + 1)


lemma ceilDiv_le_iff_le_mul (ha : 0 < a) : b ⌈/⌉ a ≤ c ↔ b ≤ a * c

{α : Type u_2}
[OrderedSemiring α]
[CeilDiv α α]
{a b c : α}
(ha : 0 < a)


/-- For a fixed function `x₀ : {a // p a} → β` defined on a subtype of `α`,
the subtype of functions `x : α → β` that agree with `x₀` on the subtype `{a // p a}`
is naturally equivalent to the type of functions `{a // ¬ p a} → β`. -/
@[simps]
def subtypePreimage : { x : α → β // x ∘ Subtype.val = x₀ } ≃ ({ a // ¬p a } → β)

{α : Sort u_1}
{β : Sort u_2}
(p : α → Prop)
[DecidablePred p]
(x₀ : { a // p a } → β)
(x : { a // ¬p a } → β)
(a : α)

↑((Equiv.subtypePreimage p x₀).symm x) a = if h : p a then x₀ ⟨a, h⟩ else x ⟨a, h⟩


theorem dropSlice_eq (xs : List α) (n m : ℕ) : dropSlice n m xs = xs.take n ++ xs.drop (n + m)

List.dropSlice n m xs = List.take n xs ++ List.drop (n + m) xs


theorem beqFalseOfEqFalse {a b : Nat} (p : (a = b) = False) : (a == b) = false


/-- A family `𝓕 : ι → X → α` is equicontinuous at `x₀` within `S` iff the function
`swap 𝓕 : X → ι → α` is continuous at `x₀` within `S`
*when `ι → α` is equipped with the topology of uniform convergence*. This is very useful for
developping the equicontinuity API, but it should not be used directly for other purposes. -/
theorem equicontinuousWithinAt_iff_continuousWithinAt {F : ι → X → α} {S : Set X} {x₀ : X} :
    EquicontinuousWithinAt F S x₀ ↔
    ContinuousWithinAt (ofFun ∘ Function.swap F : X → ι →ᵤ α) S x₀

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{F : ι → X → α}
{S : Set X}
{x₀ : X}

EquicontinuousWithinAt F S x₀ ↔ ContinuousWithinAt (⇑UniformFun.ofFun ∘ Function.swap F) S x₀


theorem subset_zeroLocus_vanishingIdeal (t : Set (PrimeSpectrum R)) :
    t ⊆ zeroLocus (vanishingIdeal t)

{R : Type u}
[CommSemiring R]
(t : Set (PrimeSpectrum R))

t ⊆ PrimeSpectrum.zeroLocus ↑(PrimeSpectrum.vanishingIdeal t)


theorem blockDiagonal'_submatrix_eq_blockDiagonal (M : o → Matrix m n α) :
    (blockDiagonal' M).submatrix (Prod.toSigma ∘ Prod.swap) (Prod.toSigma ∘ Prod.swap) =
      blockDiagonal M

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[DecidableEq o]
[Zero α]
(M : o → Matrix m n α)

(Matrix.blockDiagonal' M).submatrix (Prod.toSigma ∘ Prod.swap) (Prod.toSigma ∘ Prod.swap) = Matrix.blockDiagonal M


/-- The second projection of a product is a ⋆-algebra homomorphism. -/
@[simps!]
def snd : A × B →⋆ₐ[R] B

(R : Type u_1)
(A : Type u_2)
(B : Type u_3)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Star A]
[Semiring B]
[Algebra R B]
[Star B]
(self : A × B)


theorem card_subtype_diag [Fintype α] : card { a : Sym2 α // a.IsDiag } = card α

{α : Type u_1}
[DecidableEq α]
[Fintype α]

Fintype.card { a // a.IsDiag } = Fintype.card α


theorem isLittleO_iff_nat_mul_le' : f' =o[l] g ↔ ∀ n : ℕ, ∀ᶠ x in l, ↑n * ‖f' x‖ ≤ ‖g x‖

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{g : α → F}
{f' : α → E'}
{l : Filter α}

f' =o[l] g ↔ ∀ (n : ℕ), ∀ᶠ (x : α) in l, ↑n * ‖f' x‖ ≤ ‖g x‖


/-- An implication of predicates `Z → Z'` induces a functor between full subcategories. -/
@[simps]
def FullSubcategory.map (h : ∀ ⦃X⦄, Z X → Z' X) : FullSubcategory Z ⥤ FullSubcategory Z'

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
{Z Z' : C → Prop}
(h : ∀ ⦃X : C⦄, Z X → Z' X)
(X : CategoryTheory.FullSubcategory Z)

((CategoryTheory.FullSubcategory.map h).obj X).obj = X.obj


theorem toMultiset_apply (f : α →₀ ℕ) : toMultiset f = f.sum fun a n => n • {a}

Finsupp.toMultiset f = f.sum fun a n => n • {a}


@[simp] theorem getLsb_zeroExtend (m : Nat) (x : BitVec n) (i : Nat) :
    getLsb (zeroExtend m x) i = (decide (i < m) && getLsb x i)

{n : Nat}
(m : Nat)
(x : BitVec n)
(i : Nat)

(BitVec.zeroExtend m x).getLsb i = (decide (i < m) && x.getLsb i)


lemma W_of_isIso {X Y : C} (f : X ⟶ Y) [IsIso f] : W P f

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(P : C → Prop)
{X Y : C}
(f : X ⟶ Y)
[CategoryTheory.IsIso f]


/-- Auxiliary lemma for `setIntegral_density`. -/
lemma setIntegral_density_of_measurableSet (hκν : fst κ ≤ ν)
    [IsFiniteKernel ν] (n : ℕ) (a : α) {s : Set β} (hs : MeasurableSet s) {A : Set γ}
    (hA : MeasurableSet[countableFiltration γ n] A) :
    ∫ x in A, density κ ν a x s ∂(ν a) = (κ a (A ×ˢ s)).toReal

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

∫ (x : γ) in A, κ.density ν a x s ∂ν a = ((κ a) (A ×ˢ s)).toReal


lemma Module.support_subset_of_injective (hf : Function.Injective f) :
    Module.support R M ⊆ Module.support R N

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{N : Type u_3}
[AddCommGroup N]
[Module R N]
(f : M →ₗ[R] N)
(hf : Function.Injective ⇑f)


@[simp]
theorem toBlocks_fromBlocks₂₁ (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α)
    (D : Matrix o m α) : (fromBlocks A B C D).toBlocks₂₁ = C

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
(A : Matrix n l α)
(B : Matrix n m α)
(C : Matrix o l α)
(D : Matrix o m α)

(Matrix.fromBlocks A B C D).toBlocks₂₁ = C


/-- See `add_tsub_add_eq_tsub_left` for the equality. -/
theorem add_tsub_add_le_tsub_left : a + b - (a + c) ≤ b - c

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


/-- For two points on the same vertical line, the distance is equal to the distance between the
logarithms of their imaginary parts. -/
nonrec theorem dist_of_re_eq (h : z.re = w.re) : dist z w = dist (log z.im) (log w.im)

dist z w = dist (Real.log z.im) (Real.log w.im)


theorem pow : Nat.Primrec (unpaired (· ^ ·))

Nat.Primrec (Nat.unpaired fun x x_1 => x ^ x_1)


@[simp] lemma shatters_univ [Fintype α] : 𝒜.Shatters univ ↔ 𝒜 = univ

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
[Fintype α]

𝒜.Shatters Finset.univ ↔ 𝒜 = Finset.univ


@[aesop safe apply]
lemma differentiableAt_one_sub_smoothingFn {x : ℝ} (hx : 1 < x) :
    DifferentiableAt ℝ (fun z => 1 - ε z) x

DifferentiableAt ℝ (fun z => 1 - AkraBazziRecurrence.smoothingFn z) x


/-- `Functor.hom` is the hom-pairing, sending `(X, Y)` to `X ⟶ Y`, contravariant in `X` and
covariant in `Y`. -/
@[simps]
def hom : Cᵒᵖ × C ⥤ Type v

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

∀ {X Y : Cᵒᵖ × C} (f : X ⟶ Y) (h : Opposite.unop X.1 ⟶ X.2), (CategoryTheory.Functor.hom C).map f h = f.1.unop ≫ h ≫ f.2


@[simp low]
theorem if_true_left [h : Decidable p] :
    ite p True q ↔ ¬p → q


theorem sub_apply {x : α} : (f - g) x = f x - g x

{α : Type u}
[TopologicalSpace α]
{R : Type u_2}
[PseudoMetricSpace R]
[Sub R]
[BoundedSub R]
[ContinuousSub R]
(f g : BoundedContinuousFunction α R)
{x : α}


@[simp]
theorem coassoc_apply (a : A) :
    TensorProduct.assoc R A A A (comul.rTensor A (comul a)) = comul.lTensor A (comul a)

{R : Type u}
{A : Type v}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[Coalgebra R A]
(a : A)

(TensorProduct.assoc R A A A) ((LinearMap.rTensor A Coalgebra.comul) (Coalgebra.comul a)) =
  (LinearMap.lTensor A Coalgebra.comul) (Coalgebra.comul a)


/-- The canonical isomorphism `(F ⋙ G).mapTriangle ≅ F.mapTriangle ⋙ G.mapTriangle`. -/
@[simps!]
def mapTriangleCompIso : (F ⋙ G).mapTriangle ≅ F.mapTriangle ⋙ G.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

((F.mapTriangleCompIso G).inv.app X).hom₁ = CategoryTheory.CategoryStruct.id (G.obj (F.obj X.obj₁))


/-- The powerset functor. `Set` as a functor. -/
@[simps]
def fintypeToFinBoolAlgOp : FintypeCat ⥤ FinBoolAlgᵒᵖ

fintypeToFinBoolAlgOp.map f =
  Quiver.Hom.op
    (let __src := { toFun := ⇑(CompleteLatticeHom.setPreimage f), map_sup' := ⋯, map_inf' := ⋯ };
    { toFun := ⇑(CompleteLatticeHom.setPreimage f), map_sup' := ⋯, map_inf' := ⋯, map_top' := ⋯, map_bot' := ⋯ })


theorem sup_bind {f g : Filter α} {h : α → Filter β} : bind (f ⊔ g) h = bind f h ⊔ bind g h

{α : Type u}
{β : Type v}
{f g : Filter α}
{h : α → Filter β}


/-- Given `r` larger than the measure of a set `A`, there exists an open superset of `A` with
measure less than `r`. -/
theorem _root_.Set.exists_isOpen_lt_of_lt [OuterRegular μ] (A : Set α) (r : ℝ≥0∞) (hr : μ A < r) :
    ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U < r

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[μ.OuterRegular]
(A : Set α)
(r : ℝ≥0∞)
(hr : μ A < r)


theorem rightCosetEquivalence_equiv_snd (g : G) :
    RightCosetEquivalence H g ((hHT.equiv g).snd : G)

{G : Type u_1}
[Group G]
{H : Subgroup G}
{T : Set G}
(hHT : Subgroup.IsComplement (↑H) T)
(g : G)

RightCosetEquivalence (↑H) g ↑(hHT.equiv g).2


theorem zero_ne_mul_self : 0 ≠ a * a ↔ a ≠ 0

{M₀ : Type u_1}
[MulZeroClass M₀]
[NoZeroDivisors M₀]
{a : M₀}


/-- To show that two subobjects are equal, it suffices to exhibit an isomorphism commuting with
    the arrows. -/
theorem mk_eq_of_comm {B A : C} {X : Subobject B} (f : A ⟶ B) [Mono f] (i : A ≅ (X : C))
    (w : i.hom ≫ X.arrow = f) : mk f = X

(i : A ≅ CategoryTheory.Subobject.underlying.obj X)

(w : CategoryTheory.CategoryStruct.comp i.hom X.arrow = f)


/-- This left homology map data expresses compatibilities of the left homology data
constructed by `LeftHomologyData.ofEpiOfIsIsoOfMono` -/
@[simps]
def ofEpiOfIsIsoOfMono (φ : S₁ ⟶ S₂) (h : LeftHomologyData S₁)
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] :
    LeftHomologyMapData φ h (LeftHomologyData.ofEpiOfIsIsoOfMono φ h)

(CategoryTheory.ShortComplex.LeftHomologyMapData.ofEpiOfIsIsoOfMono φ h).φK = CategoryTheory.CategoryStruct.id h.K


theorem vector_length {n} : Computable (@Vector.length α n)


/-- Given a point in the affine span from which all the points are
equidistant, that distance is the circumradius. -/
theorem eq_circumradius_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
    (hp : p ∈ affineSpan ℝ (Set.range s.points)) {r : ℝ} (hr : ∀ i, dist (s.points i) p = r) :
    r = s.circumradius

(hr : ∀ (i : Fin (n + 1)), dist (s.points i) p = r)


theorem sym_sublist_sym_cons {a : α} : xs.sym n <+ (a :: xs).sym n

{α : Type u_1}
{xs : List α}
{n : ℕ}
{a : α}

(List.sym n xs).Sublist (List.sym n (a :: xs))


@[simp]
lemma RingEquiv_coe_eq {X Y : Type _} [Semiring X] [Semiring Y] (e : X ≃+* Y) :
    (@DFunLike.coe (SemiRingCat.of X ⟶ SemiRingCat.of Y) _ (fun _ => (forget SemiRingCat).obj _)
      ConcreteCategory.instFunLike (e : X →+* Y) : X → Y) = ↑e

{X Y : Type u_1}
[Semiring X]
[Semiring Y]
(e : X ≃+* Y)


theorem oscillation_eq_zero [TopologicalSpace E] {f : E → F} {x : E} (hf : ContinuousAt f x) :
    oscillation f x = 0

{E : Type u}
{F : Type v}
[PseudoEMetricSpace F]
[TopologicalSpace E]
{f : E → F}
{x : E}
(hf : ContinuousAt f x)


theorem sub_eq_of_add_eq {a b c : Ordinal} (h : a + b = c) : c - a = b


theorem integralNormalization_coeff {f : R[X]} {i : ℕ} :
    (integralNormalization f).coeff i =
      if f.degree = i then 1 else coeff f i * f.leadingCoeff ^ (f.natDegree - 1 - i)

{R : Type u}
[Semiring R]
{f : R[X]}
{i : ℕ}

f.integralNormalization.coeff i = if f.degree = ↑i then 1 else f.coeff i * f.leadingCoeff ^ (f.natDegree - 1 - i)


/-- A lawful `Control.Monad` gives a category theory `Monad` on the category of types.
-/
@[simps!]
def ofTypeMonad : Monad (Type u)

(m : Type u → Type u)
[Monad m]
[LawfulMonad m]
{α : Type u}
(a : m (m α))

(CategoryTheory.ofTypeMonad m).μ.app α a = joinM a


@[simp] theorem mod_zero (a : Nat) : a % 0 = a


theorem indicatorConstLp_coeFn : ⇑(indicatorConstLp p hs hμs c) =ᵐ[μ] s.indicator fun _ => c

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{s : Set α}
{hs : MeasurableSet s}
{hμs : μ s ≠ ⊤}
{c : E}

↑↑(MeasureTheory.indicatorConstLp p hs hμs c) =ᵐ[μ] s.indicator fun x => c


theorem mem_smul_pointwise_iff_exists (m : M) (r : R) (S : Subsemiring R) :
    r ∈ m • S ↔ ∃ s : R, s ∈ S ∧ m • s = r

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[Semiring R]
[MulSemiringAction M R]
(m : M)
(r : R)
(S : Subsemiring R)


@[simp]
theorem sameCycle_subtypePerm {h} {x y : { x // p x }} :
    (f.subtypePerm h).SameCycle x y ↔ f.SameCycle x y

{α : Type u_2}
{f : Equiv.Perm α}
{p : α → Prop}
{h : ∀ (x : α), p x ↔ p (f x)}
{x y : { x // p x }}

(f.subtypePerm h).SameCycle x y ↔ f.SameCycle ↑x ↑y


@[simp]
theorem cos_two_pi : cos (2 * π) = 1


@[simp]
theorem coe_zero : ↑(0 : { P : M // IsLprojection X P }) = (0 : M)

{X : Type u_1}
[NormedAddCommGroup X]
{M : Type u_2}
[Ring M]
[Module M X]


@[to_additive (attr := simp)]
theorem MulHom.comp_id [Mul M] [Mul N] (f : M →ₙ* N) : f.comp (MulHom.id M) = f

{M : Type u_4}
{N : Type u_5}
[Add M]
[Add N]
(f : AddHom M N)


@[simp]
theorem mk'_eq_div {r} (s : nonZeroDivisors A) : mk' K r s = algebraMap A K r / algebraMap A K s

{A : Type u_4}
[CommRing A]
[IsDomain A]
{K : Type u_5}
[Field K]
[Algebra A K]
[IsFractionRing A K]
{r : A}
(s : ↥(nonZeroDivisors A))

IsLocalization.mk' K r s = (algebraMap A K) r / (algebraMap A K) ↑s


lemma map_nsmul_piAntidiag_univ [Fintype ι] (m : ℕ) {n : ℕ} (hn : n ≠ 0) :
    (piAntidiag (univ : Finset ι) m).map
        ⟨(n • ·), fun f g h ↦ funext fun i ↦ mul_right_injective₀ hn (congr_fun h i)⟩ =
      (piAntidiag univ (n * m)).filter fun f : ι → ℕ ↦ ∀ i, n ∣ f i

{ι : Type u_1}
[DecidableEq ι]
[Fintype ι]
(m : ℕ)
{n : ℕ}
(hn : n ≠ 0)

Finset.map { toFun := fun x => n • x, inj' := ⋯ } (Finset.univ.piAntidiag m) =
  Finset.filter (fun f => ∀ (i : ι), n ∣ f i) (Finset.univ.piAntidiag (n * m))


lemma le_comap_iSup (f : LatticeHom α β) (L : ι → Sublattice β) :
    ⨆ i, (L i).comap f ≤ (⨆ i, L i).comap f

{ι : Sort u_1}
{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)
(L : ι → Sublattice β)

⨆ i, Sublattice.comap f (L i) ≤ Sublattice.comap f (⨆ i, L i)


/-- `p → p → q ↔ p → q` -/
theorem le_himp_iff_left : a ≤ a ⇨ b ↔ a ≤ b

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


@[simp]
theorem sup_N : (F ⊔ F').N = F.N ⊔ F'.N

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
(F F' : I.Filtration M)


@[to_additive]
theorem mk_le_mk : mk a₁ a₂ ≤ mk b₁ b₂ ↔ ↑b₂ * a₁ ≤ a₂ * b₁

{α : Type u_1}
[OrderedCancelCommMonoid α]
{s : Submonoid α}
{a₁ b₁ : α}
{a₂ b₂ : ↥s}

Localization.mk a₁ a₂ ≤ Localization.mk b₁ b₂ ↔ ↑b₂ * a₁ ≤ ↑a₂ * b₁


theorem denseRange_coeSimpleFuncNonnegToLpNonneg [hp : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) :
    DenseRange (coeSimpleFuncNonnegToLpNonneg p μ G)

{α : Type u_1}
[MeasurableSpace α]
(p : ℝ≥0∞)
(μ : MeasureTheory.Measure α)
(G : Type u_7)
[NormedLatticeAddCommGroup G]
[hp : Fact (1 ≤ p)]
(hp_ne_top : p ≠ ⊤)

DenseRange (MeasureTheory.Lp.simpleFunc.coeSimpleFuncNonnegToLpNonneg p μ G)


theorem not_tendsto_iff_exists_frequently_nmem {f : α → β} {l₁ : Filter α} {l₂ : Filter β} :
    ¬Tendsto f l₁ l₂ ↔ ∃ s ∈ l₂, ∃ᶠ x in l₁, f x ∉ s

{α : Type u}
{β : Type v}
{f : α → β}
{l₁ : Filter α}
{l₂ : Filter β}

¬Filter.Tendsto f l₁ l₂ ↔ ∃ s ∈ l₂, ∃ᶠ (x : α) in l₁, f x ∉ s


theorem continuousAt_extChartAt_symm'' {x : M} {y : E} (h : y ∈ (extChartAt I x).target) :
    ContinuousAt (extChartAt I x).symm y

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(I : ModelWithCorners 𝕜 E H)
[ChartedSpace H M]
{x : M}
{y : E}
(h : y ∈ (extChartAt I x).target)


/-- The resolvent is a unit when the argument is in the resolvent set. -/
theorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r)

{R : Type u}
{A : Type v}
[CommSemiring R]
[Ring A]
[Algebra R A]
{r : R}
{a : A}


@[simp]
theorem nonMemberSubfamily_nonMemberSubfamily :
    (𝒜.nonMemberSubfamily a).nonMemberSubfamily a = 𝒜.nonMemberSubfamily a

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{a : α}

Finset.nonMemberSubfamily a (Finset.nonMemberSubfamily a 𝒜) = Finset.nonMemberSubfamily a 𝒜


lemma inl_eq_inr_iff [Mono f] (x₁ : X₁) (x₂ : X₂) :
    (inl f g x₁ = inr f g x₂) ↔
      ∃ (s : S), f s = x₁ ∧ g s = x₂

{S X₁ X₂ : Type u}
(f : S ⟶ X₁)
(g : S ⟶ X₂)
[CategoryTheory.Mono f]
(x₁ : X₁)
(x₂ : X₂)

CategoryTheory.Limits.Types.Pushout.inl f g x₁ = CategoryTheory.Limits.Types.Pushout.inr f g x₂ ↔
  ∃ s, f s = x₁ ∧ g s = x₂


theorem zorn_superset (S : Set (Set α))
    (h : ∀ c ⊆ S, IsChain (· ⊆ ·) c → ∃ lb ∈ S, ∀ s ∈ c, lb ⊆ s) :
    ∃ m ∈ S, ∀ a ∈ S, a ⊆ m → a = m

(h : ∀ c ⊆ S, IsChain (fun x x_1 => x ⊆ x_1) c → ∃ lb ∈ S, ∀ s ∈ c, lb ⊆ s)


@[simp]
theorem _root_.PowerBasis.ofGenMemAdjoin'_dim (B : PowerBasis R S) (hint : IsIntegral R x)
    (hx : B.gen ∈ adjoin R ({x} : Set S)) :
    (B.ofGenMemAdjoin' hint hx).dim = (minpoly R x).natDegree

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
[IsDomain R]
[Algebra R S]
[IsDomain S]
[NoZeroSMulDivisors R S]
[IsIntegrallyClosed R]
{x : S}
(B : PowerBasis R S)
(hint : IsIntegral R x)
(hx : B.gen ∈ Algebra.adjoin R {x})


theorem eq_false_of_not_eq_true {a : Prop} (h : Not a = True) : a = False


lemma exact_iff_epi [HasZeroObject C] (hg : S.g = 0) :
    S.Exact ↔ Epi S.f

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
(S : CategoryTheory.ShortComplex C)
[CategoryTheory.Limits.HasZeroObject C]
(hg : S.g = 0)


theorem IsLocalMaxOn.inter (hf : IsLocalMaxOn f s a) (t) : IsLocalMaxOn f (s ∩ t) a

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


theorem uniformContinuous_coe : @UniformContinuous (α →ᵇ β) (α → β) _ _ (⇑)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]


theorem eqRec_heq_self {α : Sort _} {a : α} {motive : (a' : α) → a = a' → Sort _}
    (x : motive a (rfl : a = a)) {a' : α} (e : a = a') :
    HEq (@Eq.rec α a motive x a' e) x

{α : Sort u_1}
{a : α}
{motive : (a' : α) → a = a' → Sort u_2}
(x : motive a ⋯)
{a' : α}
(e : a = a')


theorem measurable_measure {μ : α → Measure β} :
    Measurable μ ↔ ∀ (s : Set β), MeasurableSet s → Measurable fun b => μ b s

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : α → MeasureTheory.Measure β}

Measurable μ ↔ ∀ (s : Set β), MeasurableSet s → Measurable fun b => (μ b) s


theorem gauge_lt_one_subset_self (hs : Convex ℝ s) (h₀ : (0 : E) ∈ s) (absorbs : Absorbent ℝ s) :
    { x | gauge s x < 1 } ⊆ s

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
(hs : Convex ℝ s)
(h₀ : 0 ∈ s)
(absorbs : Absorbent ℝ s)


@[simp]
theorem LinearEquiv.finsuppUnique_symm_apply [Unique α] (m : M) :
    (LinearEquiv.finsuppUnique R M α).symm m = Finsupp.single default m

{R : Type u_1}
{M : Type u_3}
[AddCommMonoid M]
[Semiring R]
[Module R M]
{α : Type u_4}
[Unique α]
(m : M)

(Finsupp.LinearEquiv.finsuppUnique R M α).symm m = Finsupp.single default m


theorem AddSubmonoid.toSubmonoid'_closure (S : Set (Additive M)) :
    AddSubmonoid.toSubmonoid' (AddSubmonoid.closure S)
      = Submonoid.closure (Multiplicative.ofAdd ⁻¹' S)

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

AddSubmonoid.toSubmonoid' (AddSubmonoid.closure S) = Submonoid.closure (⇑Multiplicative.ofAdd ⁻¹' S)


theorem primeFactorsList_chain' (n) : List.Chain' (· ≤ ·) (primeFactorsList n)

List.Chain' (fun x x_1 => x ≤ x_1) n.primeFactorsList


theorem mapDomain_support [DecidableEq β] {f : α → β} {s : α →₀ M} :
    (s.mapDomain f).support ⊆ s.support.image f

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddCommMonoid M]
[DecidableEq β]
{f : α → β}
{s : α →₀ M}

(Finsupp.mapDomain f s).support ⊆ Finset.image f s.support


/-- The Legendre symbol is multiplicative in `a` for `p` fixed. -/
protected theorem mul (a b : ℤ) : legendreSym p (a * b) = legendreSym p a * legendreSym p b


/-- **First moment method**. A measurable function is greater than its integral on a set f
positive measure. -/
theorem measure_lintegral_le_pos (hint : ∫⁻ a, f a ∂μ ≠ ∞) : 0 < μ {x | ∫⁻ a, f a ∂μ ≤ f x}

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
[MeasureTheory.IsProbabilityMeasure μ]
(hint : ∫⁻ (a : α), f a ∂μ ≠ ⊤)


lemma adjoin_id_eq_span_one_add (s : Set 𝕜) :
    ((StarAlgebra.adjoin 𝕜 {(restrict s (.id 𝕜) : C(s, 𝕜))}) : Set C(s, 𝕜)) =
      (span 𝕜 {(1 : C(s, 𝕜))} : Set C(s, 𝕜)) + (adjoin 𝕜 {(restrict s (.id 𝕜) : C(s, 𝕜))})

↑(StarAlgebra.adjoin 𝕜 {ContinuousMap.restrict s (ContinuousMap.id 𝕜)}) =
  ↑(Submodule.span 𝕜 {1}) + ↑(NonUnitalStarAlgebra.adjoin 𝕜 {ContinuousMap.restrict s (ContinuousMap.id 𝕜)})


@[simp]
theorem modByMonicHom_root (h : IsAdjoinRootMonic S f) (hdeg : 1 < natDegree f) :
    h.modByMonicHom h.root = X

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)
(hdeg : 1 < f.natDegree)


theorem IsIntegral.tower_bot_of_field {R A B : Type*} [CommRing R] [Field A]
    [CommRing B] [Nontrivial B] [Algebra R A] [Algebra A B] [Algebra R B] [IsScalarTower R A B]
    {x : A} (h : IsIntegral R (algebraMap A B x)) : IsIntegral R x

{R : Type u_6}
{A : Type u_7}
{B : Type u_8}
[CommRing R]
[Field A]
[CommRing B]
[Nontrivial B]
[Algebra R A]
[Algebra A B]
[Algebra R B]
[IsScalarTower R A B]
{x : A}
(h : IsIntegral R ((algebraMap A B) x))


/--
If `X` is homotopy equivalent to `Y`, and `Y` is homotopy equivalent to `Z`, then `X` is homotopy
equivalent to `Z`.
-/
@[simps!]
def trans (h₁ : X ≃ₕ Y) (h₂ : Y ≃ₕ Z) : X ≃ₕ Z

{X : Type u}
{Y : Type v}
{Z : Type w}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(h₁ : X ≃ₕ Y)
(h₂ : Y ≃ₕ Z)

∀ (a : Z), ↑(h₁.trans h₂).symm a = ↑h₁.symm (↑h₂.symm a)


/-- If `L` is a finite separable extension of `K = Frac(A)`, where `A` is a Dedekind domain,
the integral closure `C` of `A` in `L` is a Dedekind domain.

This cannot be an instance since `A`, `K` or `L` can't be inferred. See also the instance
`integralClosure.isDedekindDomain_fractionRing` where `K := FractionRing A`
and `C := integralClosure A L`. -/
theorem IsIntegralClosure.isDedekindDomain [IsDedekindDomain A] : IsDedekindDomain C

(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]
(C : Type u_5)
[CommRing C]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[Algebra C L]
[IsIntegralClosure C A L]
[Algebra A C]
[IsScalarTower A C L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsDomain C]
[IsDedekindDomain A]


/-- Let `f` be a function continuous on a convex (or, equivalently, connected) subset `D`
of the real line. If `f` is differentiable on the interior of `D` and `f'` is strictly positive,
then `f` is a strictly monotone function on `D`. -/
lemma strictMonoOn_of_hasDerivWithinAt_pos {D : Set ℝ} (hD : Convex ℝ D) {f f' : ℝ → ℝ}
    (hf : ContinuousOn f D) (hf' : ∀ x ∈ interior D, HasDerivWithinAt f (f' x) (interior D) x)
    (hf'₀ : ∀ x ∈ interior D, 0 < f' x) : StrictMonoOn f D


@[to_additive]
lemma BddAbove.range_inv {α : Type*} {f : α → G} (hf : BddAbove (range f)) :
    BddBelow (range (fun x => (f x)⁻¹))

[CovariantClass G G (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]

[CovariantClass G G (Function.swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


@[to_additive]
theorem prod_eq_prod_diff_singleton_mul [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
    (f : α → β) : ∏ x ∈ s, f x = (∏ x ∈ s \ {i}, f x) * f i

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
[DecidableEq α]
{s : Finset α}
{i : α}
(h : i ∈ s)
(f : α → β)


theorem sOppSide_lineMap_right {s : AffineSubspace R P} {x y : P} (hx : x ∈ s) (hy : y ∉ s) {t : R}
    (ht : t < 0) : s.SOppSide y (lineMap x y t)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y : P}
(hx : x ∈ s)
(hy : y ∉ s)
{t : R}
(ht : t < 0)

s.SOppSide y ((AffineMap.lineMap x y) t)


lemma _root_.Antitone.image_uIcc_subset (hf : Antitone f) : f '' uIcc a b ⊆ uIcc (f a) (f b)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Lattice β]
{f : α → β}
{a b : α}
(hf : Antitone f)

f '' Set.uIcc a b ⊆ Set.uIcc (f a) (f b)


/-- An intermediate field is closed under scalar multiplication. -/
theorem smul_mem {y : L} : y ∈ S → ∀ {x : K}, x • y ∈ S

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


@[simp]
theorem arrowCongr_symm (e₁ : A₁ ≃ₐ[R] A₁') (e₂ : A₂ ≃ₐ[R] A₂') :
    (arrowCongr e₁ e₂).symm = arrowCongr e₁.symm e₂.symm

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

(e₁.arrowCongr e₂).symm = e₁.symm.arrowCongr e₂.symm


theorem wDest'_wMk' {α : TypeVec n} (x : P (α.append1 (P.W α))) : P.wDest' (P.wMk' x) = x

{n : ℕ}
(P : MvPFunctor.{u} (n + 1))
{α : TypeVec.{u} n}
(x : ↑P (α ::: P.W α))


theorem foldl_eq_foldr (hcomm : Commutative f) (hassoc : Associative f) :
    ∀ a l, foldl f a l = foldr f a l

{α : Type u}
{f : α → α → α}
(hcomm : Commutative f)
(hassoc : Associative f)
(a : α)
(l : List α)


theorem restrict_restrict_eq {R₁ R₂ : Set α} (M : Matroid α) (hR : R₂ ⊆ R₁) :
    (M ↾ R₁) ↾ R₂ = M ↾ R₂

{α : Type u_1}
{R₁ R₂ : Set α}
(M : Matroid α)
(hR : R₂ ⊆ R₁)

(M.restrict R₁).restrict R₂ = M.restrict R₂


theorem restrict_apply {i : Set α} (hi : MeasurableSet i) {j : Set α} (hj : MeasurableSet j) :
    v.restrict i j = v (j ∩ i)

{α : Type u_1}
[MeasurableSpace α]
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
(v : MeasureTheory.VectorMeasure α M)
{i : Set α}
(hi : MeasurableSet i)
{j : Set α}
(hj : MeasurableSet j)


@[simp low] theorem true_eq (b : Bool) : (true = b) = (b = true)


nonrec theorem IsLocalMin.neg (hf : IsLocalMin f a) : IsLocalMax (fun x => -f x) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[OrderedAddCommGroup β]
{f : α → β}
{a : α}
(hf : IsLocalMin f a)


@[simp]
theorem trans_toLinearMap (f : A₁ ≃ₐ[R] A₂) (g : A₂ ≃ₐ[R] A₃) :
    (f.trans g).toLinearMap = g.toLinearMap.comp f.toLinearMap

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
{A₃ : Type uA₃}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Semiring A₃]
[Algebra R A₁]
[Algebra R A₂]
[Algebra R A₃]
(f : A₁ ≃ₐ[R] A₂)
(g : A₂ ≃ₐ[R] A₃)

(f.trans g).toLinearMap = g.toLinearMap ∘ₗ f.toLinearMap


@[simp]
theorem mem_supp_iff (x : R) : x ∈ supp v ↔ v x = (⊤ : Γ₀)

{R : Type u_3}
{Γ₀ : Type u_4}
[LinearOrderedAddCommMonoidWithTop Γ₀]
[CommRing R]
(v : AddValuation R Γ₀)
(x : R)


@[to_additive]
lemma zpow_lt_zpow_iff (ha : 1 < a) : a ^ m < a ^ n ↔ m < n

{α : Type u_1}
[OrderedAddCommGroup α]
{m n : ℤ}
{a : α}
(ha : 0 < a)


theorem aeval_zero : aeval x (0 : R[X]) = 0

{R : Type u}
{A : Type z}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(x : A)


/-- See also `NormedSpace.eq_iff_forall_dual_eq`. -/
theorem geometric_hahn_banach_point_point [T1Space E] (hxy : x ≠ y) :
    ∃ f : E →L[ℝ] ℝ, f x < f y

{E : Type u_2}
[TopologicalSpace E]
[AddCommGroup E]
[TopologicalAddGroup E]
[Module ℝ E]
[ContinuousSMul ℝ E]
{x y : E}
[LocallyConvexSpace ℝ E]
[T1Space E]
(hxy : x ≠ y)


theorem coe_extChartAt_transDiffeomorph (x : M) :
    ⇑(extChartAt (I.transDiffeomorph e) x) = e ∘ extChartAt I x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_5}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
(e : E ≃ₘ⟮𝓘(𝕜, E), 𝓘(𝕜, E')⟯ E')
(x : M)

↑(extChartAt (I.transDiffeomorph e) x) = ⇑e ∘ ↑(extChartAt I x)


theorem Heap.WF.singleton : (Heap.singleton a).WF le 0

∀ {α : Type u_1} {a : α} {le : α → α → Bool},
  Batteries.BinomialHeap.Imp.Heap.WF le 0 (Batteries.BinomialHeap.Imp.Heap.singleton a)


/-- Weighted generalized mean inequality, version for sums over finite sets, with `ℝ≥0∞`-valued
functions and real exponents. -/
theorem rpow_arith_mean_le_arith_mean_rpow (w z : ι → ℝ≥0∞) (hw' : ∑ i ∈ s, w i = 1) {p : ℝ}
    (hp : 1 ≤ p) : (∑ i ∈ s, w i * z i) ^ p ≤ ∑ i ∈ s, w i * z i ^ p

{ι : Type u}
(s : Finset ι)
(w z : ι → ℝ≥0∞)
(hw' : ∑ i ∈ s, w i = 1)
{p : ℝ}
(hp : 1 ≤ p)


theorem _root_.Set.Finite.nullMeasurableSet_biUnion {f : ι → Set α} {s : Set ι} (hs : s.Finite)
    (h : ∀ b ∈ s, NullMeasurableSet (f b) μ) : NullMeasurableSet (⋃ b ∈ s, f b) μ

(h : ∀ b ∈ s, MeasureTheory.NullMeasurableSet (f b) μ)

MeasureTheory.NullMeasurableSet (⋃ b ∈ s, f b) μ


theorem comap_map_of_isPrime_disjoint (I : Ideal R) (hI : I.IsPrime) (hM : Disjoint (M : Set R) I) :
    Ideal.comap (algebraMap R S) (Ideal.map (algebraMap R S) I) = I

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(I : Ideal R)
(hI : I.IsPrime)
(hM : Disjoint ↑M ↑I)


theorem convex_empty : Convex 𝕜 (∅ : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]


@[to_additive mem_prod]
theorem mem_prod {s : Subsemigroup M} {t : Subsemigroup N} {p : M × N} :
    p ∈ s.prod t ↔ p.1 ∈ s ∧ p.2 ∈ t

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{s : AddSubsemigroup M}
{t : AddSubsemigroup N}
{p : M × N}


theorem symm_apply_eq (h : α ≃ᵢ β) {x : α} {y : β} : h.symm y = x ↔ y = h x

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(h : α ≃ᵢ β)
{x : α}
{y : β}


theorem le_coe_natAdd (m : Nat) (i : Fin n) : m ≤ natAdd m i


@[simp]
lemma comp_toOrderHom {a b c : SimplexCategory} (f : a ⟶ b) (g : b ⟶ c) :
    (f ≫ g).toOrderHom = g.toOrderHom.comp f.toOrderHom

SimplexCategory.Hom.toOrderHom (f ≫ g) = (SimplexCategory.Hom.toOrderHom g).comp (SimplexCategory.Hom.toOrderHom f)


@[simp]
theorem default_eq_zero (n : ℕ) [NeZero n] : (default : Fin n) = 0


theorem ge_of_tendsto {x : Filter β} [NeBot x] (lim : Tendsto f x (𝓝 a))
    (h : ∀ᶠ c in x, b ≤ f c) : b ≤ a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder α]
[ClosedIciTopology α]
{f : β → α}
{a b : α}
{x : Filter β}
[x.NeBot]
(lim : Filter.Tendsto f x (𝓝 a))
(h : ∀ᶠ (c : β) in x, b ≤ f c)


theorem monotone_stabilizes (f : ℕ →o (Submodule R M)ᵒᵈ) : ∃ n, ∀ m, n ≤ m → f n = f m

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
[IsArtinian R M]
(f : ℕ →o (Submodule R M)ᵒᵈ)


/-- Given a surjective `CommMonoid` homomorphism `g : M →* P`, and a submonoid `S ⊆ M`,
the induced monoid homomorphism from the localization of `M` at `S` to the
localization of `P` at `g S`, is surjective.
-/
@[to_additive "Given a surjective `AddCommMonoid` homomorphism `g : M →+ P`, and a
submonoid `S ⊆ M`, the induced monoid homomorphism from the localization of `M` at `S`
to the localization of `P` at `g S`, is surjective. "]
theorem map_surjective_of_surjective (hg : Surjective g) (k : LocalizationMap (S.map g) Q) :
    Surjective (map f (apply_coe_mem_map g S) k)

(k : (Submonoid.map g S).LocalizationMap Q)


@[simp]
theorem onQuot_comap_eq {J : Ideal R} (hJ : J ≤ supp v) :
    (v.onQuot hJ).comap (Ideal.Quotient.mk J) = v

{R : Type u_1}
{Γ₀ : Type u_2}
[CommRing R]
[LinearOrderedAddCommMonoidWithTop Γ₀]
(v : AddValuation R Γ₀)
{J : Ideal R}
(hJ : J ≤ v.supp)

AddValuation.comap (Ideal.Quotient.mk J) (v.onQuot hJ) = v