/-- If `f` has a local max on `s` at `a` and both `y` and `-y` belong to the positive tangent cone
of `s` at `a`, then `f' y = 0`. -/
theorem IsLocalMaxOn.fderivWithin_eq_zero (h : IsLocalMaxOn f s a)
    (hy : y ∈ posTangentConeAt s a) (hy' : -y ∈ posTangentConeAt s a) :
    (fderivWithin ℝ f s a : E → ℝ) y = 0

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{s : Set E}
{a y : E}
(h : IsLocalMaxOn f s a)
(hy : y ∈ posTangentConeAt s a)
(hy' : -y ∈ posTangentConeAt s a)


theorem coe_eq_inv_of_involutive (hφ : FixedPointFree φ) (h2 : Function.Involutive φ) :
    ⇑φ = (·⁻¹)

{G : Type u_1}
[Group G]
{φ : G →* G}
[Finite G]
(hφ : MonoidHom.FixedPointFree ⇑φ)
(h2 : Function.Involutive ⇑φ)


theorem bijective_iff_has_inverse : Bijective f ↔ ∃ g, LeftInverse g f ∧ RightInverse g f

Function.Bijective f ↔ ∃ g, Function.LeftInverse g f ∧ Function.RightInverse g f


theorem card_le : #(Σn, L.BoundedFormula α n) ≤
    max ℵ₀ (Cardinal.lift.{max u v} #α + Cardinal.lift.{u'} L.card)

Cardinal.mk ((n : ℕ) × L.BoundedFormula α n) ≤
  max Cardinal.aleph0 (Cardinal.lift.{max u v, u'} (Cardinal.mk α) + Cardinal.lift.{u', max u v} L.card)


protected theorem DirectedOn.disjoint_sSup_right (h : DirectedOn (· ≤ ·) s) :
    Disjoint a (sSup s) ↔ ∀ ⦃b⦄, b ∈ s → Disjoint a b

(h : DirectedOn (fun x x_1 => x ≤ x_1) s)

Disjoint a (sSup s) ↔ ∀ ⦃b : α⦄, b ∈ s → Disjoint a b


theorem inclusion_injective {S T : NonUnitalSubalgebra R A} (h : S ≤ T) :
    Function.Injective (inclusion h)

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{S T : NonUnitalSubalgebra R A}
(h : S ≤ T)


theorem uniformContinuous_coe_fun [∀ i, ContinuousSMul 𝕜 (E i)] :
    UniformContinuous (DFunLike.coe : ContinuousMultilinearMap 𝕜 E F → (Π i, E i) → F)

{𝕜 : Type u_1}
{ι : Type u_2}
{E : ι → Type u_3}
{F : Type u_4}
[NormedField 𝕜]
[(i : ι) → TopologicalSpace (E i)]
[(i : ι) → AddCommGroup (E i)]
[(i : ι) → Module 𝕜 (E i)]
[AddCommGroup F]
[Module 𝕜 F]
[UniformSpace F]
[UniformAddGroup F]
[∀ (i : ι), ContinuousSMul 𝕜 (E i)]


@[simp]
theorem inter_val (s₁ s₂ : Finset α) : (s₁ ∩ s₂).1 = s₁.1 ∩ s₂.1

{α : Type u_1}
[DecidableEq α]
(s₁ s₂ : Finset α)


/-- Multiplying by all the matrices either in `listTransvecCol M` and `listTransvecRow M` kills
all the coefficients in the last column but the last one. -/
theorem listTransvecCol_mul_mul_listTransvecRow_last_row (hM : M (inr unit) (inr unit) ≠ 0)
    (i : Fin r) :
    ((listTransvecCol M).prod * M * (listTransvecRow M).prod) (inl i) (inr unit) = 0

(M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜)

((Matrix.Pivot.listTransvecCol M).prod * M * (Matrix.Pivot.listTransvecRow M).prod) (Sum.inl i) (Sum.inr ()) = 0


@[elab_as_elim]
protected theorem induction {p : (α →₀ M) → Prop} (f : α →₀ M) (h0 : p 0)
    (ha : ∀ (a b) (f : α →₀ M), a ∉ f.support → b ≠ 0 → p f → p (single a b + f)) : p f

(ha : ∀ (a : α) (b : M) (f : α →₀ M), a ∉ f.support → b ≠ 0 → p f → p (Finsupp.single a b + f))


/-- If `α` is a linear pred order, `β` is a preorder, and `f : α → β` is a monotone function, then
the intervals `Set.Ico (f Order.pred n) (f n)` are pairwise disjoint. -/
theorem pairwise_disjoint_on_Ico_pred [PredOrder α] [Preorder β] {f : α → β} (hf : Monotone f) :
    Pairwise (Disjoint on fun n => Ico (f (pred n)) (f n))

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[PredOrder α]
[Preorder β]
{f : α → β}
(hf : Monotone f)

Pairwise (Disjoint on fun n => Set.Ico (f (Order.pred n)) (f n))


/-- The tensor of a family of linear maps from `Eᵢ` to `E'ᵢ`, as a continuous multilinear map of
the family.
-/
@[simps!]
noncomputable def mapLMultilinear : ContinuousMultilinearMap 𝕜 (fun (i : ι) ↦ E i →L[𝕜] E' i)
    ((⨂[𝕜] i, E i) →L[𝕜] ⨂[𝕜] i, E' i)

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

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

∀ (a : ⨂[𝕜] (i : ι), E i),
  ((PiTensorProduct.mapLMultilinear 𝕜 E E') f) a =
    (PiTensorProduct.liftAux ((PiTensorProduct.tprodL 𝕜).compContinuousLinearMap f).toMultilinearMap) a


theorem approx_mono' {i : ℕ} : Fix.approx f i ≤ Fix.approx f (succ i)

(f : ((a : α) → Part (β a)) →o (a : α) → Part (β a))

Part.Fix.approx (⇑f) i ≤ Part.Fix.approx (⇑f) i.succ


theorem weightedSMul_add_measure {m : MeasurableSpace α} (μ ν : Measure α) {s : Set α}
    (hμs : μ s ≠ ∞) (hνs : ν s ≠ ∞) :
    (weightedSMul (μ + ν) s : F →L[ℝ] F) = weightedSMul μ s + weightedSMul ν s

{α : Type u_1}
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{m : MeasurableSpace α}
(μ ν : MeasureTheory.Measure α)
{s : Set α}
(hμs : μ s ≠ ⊤)
(hνs : ν s ≠ ⊤)

MeasureTheory.weightedSMul (μ + ν) s = MeasureTheory.weightedSMul μ s + MeasureTheory.weightedSMul ν s


/-- If `y` and `z` are on the same ray as `x`, then so is `y + z`. -/
theorem add_right (hy : SameRay R x y) (hz : SameRay R x z) : SameRay R x (y + z)

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{x y z : M}
(hy : SameRay R x y)
(hz : SameRay R x z)


@[simp]
theorem adjugate_zero [Nontrivial n] : adjugate (0 : Matrix n n α) = 0

{n : Type v}
{α : Type w}
[DecidableEq n]
[Fintype n]
[CommRing α]
[Nontrivial n]


/-- The finrank of `M × M'` is `(finrank R M) + (finrank R M')`. -/
@[simp]
theorem FiniteDimensional.finrank_prod [Module.Finite R M] [Module.Finite R M'] :
    finrank R (M × M') = finrank R M + finrank R M'

{R : Type u}
{M : Type v}
{M' : Type v'}
[Ring R]
[AddCommGroup M]
[AddCommGroup M']
[Module R M]
[Module R M']
[StrongRankCondition R]
[Module.Free R M]
[Module.Free R M']
[Module.Finite R M]
[Module.Finite R M']

FiniteDimensional.finrank R (M × M') = FiniteDimensional.finrank R M + FiniteDimensional.finrank R M'


{α : Type u_1}
[Preorder α]
[Add α]
[Sub α]
[OrderedSub α]
{a b : α}


/-- The inclusion map between `StarSubalgebra`s given by `Subtype.map id` as a `StarAlgHom`. -/
@[simps]
def inclusion {S₁ S₂ : StarSubalgebra R A} (h : S₁ ≤ S₂) : S₁ →⋆ₐ[R] S₂

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
{S₁ S₂ : StarSubalgebra R A}
(h : S₁ ≤ S₂)

∀ (a : ↥S₁), (StarSubalgebra.inclusion h) a = Subtype.map id h a


lemma pow_sub₀ (a : G₀) (ha : a ≠ 0) (h : n ≤ m) : a ^ (m - n) = a ^ m * (a ^ n)⁻¹

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


theorem iUnion_of_singleton_coe (s : Set α) : ⋃ i : s, ({(i : α)} : Set α) = s


protected theorem measurableSet_lt_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω < i}

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[PartialOrder ι]
{τ : Ω → ι}
{f : MeasureTheory.Filtration ι m}
(hτ : MeasureTheory.IsStoppingTime f τ)
(h_countable : (Set.range τ).Countable)
(i : ι)


theorem filter_union_right (s : Finset α) : s.filter p ∪ s.filter q = s.filter fun x => p x ∨ q x

{α : Type u_1}
(p q : α → Prop)
[DecidablePred p]
[DecidablePred q]
[DecidableEq α]
(s : Finset α)

Finset.filter p s ∪ Finset.filter q s = Finset.filter (fun x => p x ∨ q x) s


/-- Bind operation for `SupIndep`. -/
theorem SupIndep.sup [DecidableEq ι] {s : Finset ι'} {g : ι' → Finset ι} {f : ι → α}
    (hs : s.SupIndep fun i => (g i).sup f) (hg : ∀ i' ∈ s, (g i').SupIndep f) :
    (s.sup g).SupIndep f

{α : Type u_1}
{ι : Type u_3}
{ι' : Type u_4}
[DistribLattice α]
[OrderBot α]
[DecidableEq ι]
{s : Finset ι'}
{g : ι' → Finset ι}
{f : ι → α}
(hs : s.SupIndep fun i => (g i).sup f)
(hg : ∀ i' ∈ s, (g i').SupIndep f)


/-- In a non-trivial `MulZeroClass`, the `0` element is not right-regular. -/
theorem not_isRightRegular_zero_iff : ¬IsRightRegular (0 : R) ↔ Nontrivial R


@[to_additive (attr := simp) (reorder := 9 10)]
theorem map_pow [Monoid G] [Monoid H] [MonoidHomClass F G H] (f : F) (a : G) :
    ∀ n : ℕ, f (a ^ n) = f a ^ n

{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[AddMonoid G]
[AddMonoid H]
[AddMonoidHomClass F G H]
(f : F)
(n : ℕ)
(a : G)


/-- The identity morphism on an `Action V G`. -/
@[simps]
def id (M : Action V G) : Action.Hom M M

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


@[to_additive]
theorem rightInverse_inv : RightInverse (fun a : G ↦ a⁻¹) fun a ↦ a⁻¹

Function.RightInverse (fun a => a⁻¹) fun a => a⁻¹


/--
A single compiler `Pass`, consisting of the actual pass function operating
on the `Decl`s as well as meta information.
-/
structure Pass where
  /--
  Which occurrence of the pass in the pipeline this is.
  Some passes, like simp, can occur multiple times in the pipeline.
  For most passes this value does not matter.
  -/
  occurrence : Nat := 0
  /--
  Which phase this `Pass` is supposed to run in
  -/
  phase : Phase
  /--
  Resulting phase.
  -/
  phaseOut : Phase := phase
  phaseInv : phaseOut ≥ phase := by simp_arith
  /--
  The name of the `Pass`
  -/
  name : Name
  /--
  The actual pass function, operating on the `Decl`s.
  -/
  run : Array Decl → CompilerM (Array Decl)


theorem LinearMap.toMatrix_mulVec_repr (f : M₁ →ₗ[R] M₂) (x : M₁) :
    LinearMap.toMatrix v₁ v₂ f *ᵥ v₁.repr x = v₂.repr (f x)

{R : Type u_1}
[CommSemiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype n]
[Finite m]
[DecidableEq n]
{M₁ : Type u_5}
{M₂ : Type u_6}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R M₁]
[Module R M₂]
(v₁ : Basis n R M₁)
(v₂ : Basis m R M₂)
(f : M₁ →ₗ[R] M₂)
(x : M₁)

(LinearMap.toMatrix v₁ v₂) f *ᵥ ⇑(v₁.repr x) = ⇑(v₂.repr (f x))


theorem Finite.sup {s t : Set α} : s.Finite → t.Finite → (s ⊔ t).Finite


/-- `fromThinSkeleton C` exhibits the thin skeleton as a skeleton. -/
lemma thinSkeleton_isSkeleton : IsSkeletonOf C (ThinSkeleton C) (fromThinSkeleton C)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[Quiver.IsThin C]

CategoryTheory.IsSkeletonOf C (CategoryTheory.ThinSkeleton C) (CategoryTheory.ThinSkeleton.fromThinSkeleton C)


@[to_additive]
theorem Continuous.isOpen_mulSupport [T1Space X] [One X] [TopologicalSpace Y] {f : Y → X}
    (hf : Continuous f) : IsOpen (mulSupport f)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[T1Space X]
[One X]
[TopologicalSpace Y]
{f : Y → X}
(hf : Continuous f)


@[to_additive]
theorem Bornology.IsBounded.inv : IsBounded s → IsBounded s⁻¹

{E : Type u_1}
[SeminormedAddGroup E]
{s : Set E}

Bornology.IsBounded s → Bornology.IsBounded (-s)


@[to_additive (attr := simp)]
theorem map_comap_map {f : M →ₙ* N} : ((S.map f).comap f).map f = S.map f

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(S : AddSubsemigroup M)
{f : AddHom M N}

AddSubsemigroup.map f (AddSubsemigroup.comap f (AddSubsemigroup.map f S)) = AddSubsemigroup.map f S


@[to_additive]
theorem mem_leftTransversals_iff_existsUnique_quotient_mk''_eq :
    S ∈ leftTransversals (H : Set G) ↔
      ∀ q : Quotient (QuotientGroup.leftRel H), ∃! s : S, Quotient.mk'' s.1 = q

{G : Type u_1}
[Group G]
{H : Subgroup G}
{S : Set G}

S ∈ Subgroup.leftTransversals ↑H ↔ ∀ (q : Quotient (QuotientGroup.leftRel H)), ∃! s, Quotient.mk'' ↑s = q


theorem image_interior_subset (hf : IsOpenMap f) (s : Set X) :
    f '' interior s ⊆ interior (f '' s)

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : IsOpenMap f)
(s : Set X)


/-- The equivalence of functor categories given by currying/uncurrying.
-/
@[simps!]
def currying : C ⥤ D ⥤ E ≌ C × D ⥤ E

{C : Type u₂}
[CategoryTheory.Category.{v₂, u₂} C]
{D : Type u₃}
[CategoryTheory.Category.{v₃, u₃} D]
{E : Type u₄}
[CategoryTheory.Category.{v₄, u₄} E]
(F : CategoryTheory.Functor (C × D) E)
(X : C)
(Y : D)

((CategoryTheory.currying.inverse.obj F).obj X).obj Y = F.obj (X, Y)


@[simp]
theorem coe_toAddMonoidHom : ⇑f.toAddMonoidHom = f

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
(f : NormedAddGroupHom V₁ V₂)


@[simp] lemma top_mul_bot : (⊤ : EReal) * ⊥ = ⊥


@[simp, norm_cast]
theorem coe_ofNat (n : ℕ) [n.AtLeastTwo] :
    ((no_index OfNat.ofNat n : α →ᵇ R) : α → R) = OfNat.ofNat n

{α : Type u}
[TopologicalSpace α]
{R : Type u_2}
[SeminormedRing R]
(n : ℕ)
[n.AtLeastTwo]


theorem coeFn_negPart_eq_max (f : Lp ℝ p μ) : ∀ᵐ a ∂μ, negPart f a = max (-f a) 0

{α : Type u_1}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
(f : ↥(MeasureTheory.Lp ℝ p μ))

∀ᵐ (a : α) ∂μ, ↑↑(MeasureTheory.Lp.negPart f) a = max (-↑↑f a) 0


@[simp]
theorem castPred_one [NeZero n] (h := Fin.ext_iff.not.2 one_lt_last.ne) :
    castPred (1 : Fin (n + 2)) h = 1

{n : ℕ}
[NeZero n]
(h : ¬1 = Fin.last (n + 1) := ⋯)


theorem Monic.as_sum (hp : p.Monic) :
    p = X ^ p.natDegree + ∑ i ∈ range p.natDegree, C (p.coeff i) * X ^ i

{R : Type u}
[Semiring R]
{p : R[X]}
(hp : p.Monic)

p = Polynomial.X ^ p.natDegree + ∑ i ∈ Finset.range p.natDegree, Polynomial.C (p.coeff i) * Polynomial.X ^ i


lemma restrict_sub {R M M₁ : Type*}
    [Ring R] [AddCommGroup M] [AddCommGroup M₁] [Module R M] [Module R M₁]
    {p : Submodule R M} {q : Submodule R M₁} {f g : M →ₗ[R] M₁}
    (hf : MapsTo f p q) (hg : MapsTo g p q)
    (hfg : MapsTo (f - g) p q := fun _ hx ↦ q.sub_mem (hf hx) (hg hx)) :
    f.restrict hf - g.restrict hg = (f - g).restrict hfg

{R : Type u_10}
{M : Type u_11}
{M₁ : Type u_12}
[Ring R]
[AddCommGroup M]
[AddCommGroup M₁]
[Module R M]
[Module R M₁]
{p : Submodule R M}
{q : Submodule R M₁}
{f g : M →ₗ[R] M₁}
(hf : Set.MapsTo ⇑f ↑p ↑q)
(hg : Set.MapsTo ⇑g ↑p ↑q)
(hfg : Set.MapsTo ⇑(f - g) ↑p ↑q := ⋯)


theorem fourier_neg {n : ℤ} {x : AddCircle T} : fourier (-n) x = conj (fourier n x)

(fourier (-n)) x = (starRingEnd ℂ) ((fourier n) x)


@[to_additive]
theorem pure_bind (f : α → FreeGroup β) (x) : pure x >>= f = f x

{α β : Type u}
(f : α → FreeGroup β)
(x : α)


@[simp]
theorem compQuasiMeasurePreserving_mk {g : β → γ} (hg : AEStronglyMeasurable g ν)
    (hf : QuasiMeasurePreserving f μ ν) :
    (mk g hg).compQuasiMeasurePreserving f hf = mk (g ∘ f) (hg.comp_quasiMeasurePreserving hf)

(hg : MeasureTheory.AEStronglyMeasurable g ν)

(hf : MeasureTheory.Measure.QuasiMeasurePreserving f μ ν)

(MeasureTheory.AEEqFun.mk g hg).compQuasiMeasurePreserving f hf = MeasureTheory.AEEqFun.mk (g ∘ f) ⋯


theorem not_mem_of_mem {C : G.ComponentCompl K} {c : V} (cC : c ∈ C) : c ∉ K

{V : Type u}
{G : SimpleGraph V}
{K : Set V}
{C : G.ComponentCompl K}
{c : V}
(cC : c ∈ C)


@[simp] lemma logHomeomorph_apply (x : ℝ≥0∞) : logHomeomorph x = log x


theorem contMDiffWithinAt_top :
    SmoothWithinAt I I' f s x ↔ ∀ n : ℕ, ContMDiffWithinAt I I' n f s x

{𝕜 : 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]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{s : Set M}
{x : M}

SmoothWithinAt I I' f s x ↔ ∀ (n : ℕ), ContMDiffWithinAt I I' (↑n) f s x


private theorem finSepDegree_adjoin_simple_dvd_finrank (α : E) :
    finSepDegree F F⟮α⟯ ∣ finrank F F⟮α⟯

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(α : E)

Field.finSepDegree F ↥F⟮α⟯ ∣ FiniteDimensional.finrank F ↥F⟮α⟯


@[norm_cast] lemma Function.Embedding.coe_sumSet (h : Disjoint s t) :
    (Function.Embedding.sumSet h : s ⊕ t → α) = Sum.elim (↑) (↑)

{α : Type u_1}
{s t : Set α}
(h : Disjoint s t)

⇑(Function.Embedding.sumSet h) = Sum.elim Subtype.val Subtype.val


/-- Constructor for morphisms `F ⟶ G` in `ComposableArrows C n` which takes as inputs
a family of morphisms `F.obj i ⟶ G.obj i` and the naturality condition only for the
maps in `Fin (n + 1)` given by inequalities of the form `i ≤ i + 1`. -/
@[simps]
def homMk {F G : ComposableArrows C n} (app : ∀ i, F.obj i ⟶ G.obj i)
    (w : ∀ (i : ℕ) (hi : i < n), F.map' i (i + 1) ≫ app _ = app _ ≫ G.map' i (i + 1)) :
    F ⟶ G

{F G : CategoryTheory.ComposableArrows C n}

(app : (i : Fin (n + 1)) → F.obj i ⟶ G.obj i)

(w :
  ∀ (i : ℕ) (hi : i < n),
    CategoryTheory.CategoryStruct.comp (F.map' i (i + 1) ⋯ hi) (app ⟨i + 1, ⋯⟩) =
      CategoryTheory.CategoryStruct.comp (app ⟨i, ⋯⟩) (G.map' i (i + 1) ⋯ hi))

(CategoryTheory.ComposableArrows.homMk app w).app i = app i


@[reassoc (attr := simp)]
theorem limitObjIsoLimitCompEvaluation_inv_limit_map [HasLimitsOfShape J C] {i j : K}
    (F : J ⥤ K ⥤ C) (f : i ⟶ j) : (limitObjIsoLimitCompEvaluation _ _).inv ≫ (limit F).map f =
    limMap (whiskerLeft _ ((evaluation _ _).map f)) ≫ (limitObjIsoLimitCompEvaluation _ _).inv

(CategoryTheory.Limits.limitObjIsoLimitCompEvaluation F i).inv ≫ (CategoryTheory.Limits.limit F).map f =
  CategoryTheory.Limits.limMap (CategoryTheory.whiskerLeft F ((CategoryTheory.evaluation K C).map f)) ≫
    (CategoryTheory.Limits.limitObjIsoLimitCompEvaluation F j).inv


/-- Change a cone on `F.unop : J ⥤ C` into a cocone on `F : Jᵒᵖ ⥤ Cᵒᵖ`. -/
@[simps]
def coconeOfConeUnop (c : Cone F.unop) : Cocone F

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : Jᵒᵖ ⥤ Cᵒᵖ}
(c : CategoryTheory.Limits.Cone F.unop)

(CategoryTheory.Limits.coconeOfConeUnop c).pt = Opposite.op c.pt


/-- The homotopy equivalence from a short complex to itself that is induced
by the identity. -/
@[simps]
def refl (S : ShortComplex C) : HomotopyEquiv S S

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(S : CategoryTheory.ShortComplex C)

(CategoryTheory.ShortComplex.HomotopyEquiv.refl S).homotopyHomInvId = CategoryTheory.ShortComplex.Homotopy.ofEq ⋯


@[to_additive (attr := simp, norm_cast)]
theorem op_natCast [NatCast α] (n : ℕ) : op (n : α) = n


@[to_additive]
theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) : ∏ x ∈ s, f x = 1

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
{f : α → β}
{s : Finset α}
(h : ∀ x ∈ s, f x = 1)


theorem expand_inj {p : ℕ} (hp : 0 < p) {f g : R[X]} : expand R p f = expand R p g ↔ f = g

{R : Type u}
[CommSemiring R]
{p : ℕ}
(hp : 0 < p)
{f g : R[X]}

(Polynomial.expand R p) f = (Polynomial.expand R p) g ↔ f = g


@[simp]
theorem foldrm_map (g : β → γ) (f : γ → α → m α) (a : α) (l : t β) :
    foldrm f a (g <$> l) = foldrm (f ∘ g) a l

{α β γ : Type u}
{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
{m : Type u → Type u}
[Monad m]
[LawfulMonad m]
(g : β → γ)
(f : γ → α → m α)
(a : α)
(l : t β)

Traversable.foldrm f a (g <$> l) = Traversable.foldrm (f ∘ g) a l


/-- The filters `residual ℝ` and `ae volume` are disjoint. This means that there exists a residual
set of Lebesgue measure zero (e.g., the set of Liouville numbers). -/
theorem Real.disjoint_residual_ae : Disjoint (residual ℝ) (ae volume)

Disjoint (residual ℝ) (MeasureTheory.ae MeasureTheory.volume)


theorem RightInverse.leftInverse_of_surjective {f : α → β} {g : β → α} :
    RightInverse f g → Surjective f → LeftInverse f g

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
{g : β → α}

Function.RightInverse f g → Function.Surjective f → Function.LeftInverse f g


lemma nonneg_iff_exists_ofReal : 0 ≤ z ↔ ∃ x ≥ (0 : ℝ), x = z


lemma map_id : map φ φ (𝟙 _) (𝟙 _) (by rw [id_comp, comp_id]) = 𝟙 _

CochainComplex.mappingCone.map φ φ (𝟙 K) (𝟙 L) ⋯ = 𝟙 (CochainComplex.mappingCone φ)


theorem biInf_const {ι : Sort _} {a : α} {s : Set ι} (hs : s.Nonempty) : ⨅ i ∈ s, a = a

{α : Type u_1}
[CompleteLattice α]
{ι : Type u_9}
{a : α}
{s : Set ι}
(hs : s.Nonempty)


theorem ext_iff (A B : GL n R) : A = B ↔ ∀ i j, (A : Matrix n n R) i j = (B : Matrix n n R) i j

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(A B : GL n R)


/--
A setoid is a type with a distinguished equivalence relation, denoted `≈`.
This is mainly used as input to the `Quotient` type constructor.
-/
class Setoid (α : Sort u) where
  /-- `x ≈ y` is the distinguished equivalence relation of a setoid. -/
  r : α → α → Prop
  /-- The relation `x ≈ y` is an equivalence relation. -/
  iseqv : Equivalence r


@[simp]
theorem ofDual_lt_ofDual_iff {a b : WithBot αᵒᵈ} : WithBot.ofDual a < WithBot.ofDual b ↔ b < a

{α : Type u_1}
[LT α]
{a b : WithBot αᵒᵈ}


protected theorem neg_sub (a b : Int) : -(a - b) = b - a


theorem Set.Finite.isOpen_biInter {s : Set α} {f : α → Set X} (hs : s.Finite)
    (h : ∀ i ∈ s, IsOpen (f i)) :
    IsOpen (⋂ i ∈ s, f i)

{X : Type u}
{α : Type u_1}
[TopologicalSpace X]
{s : Set α}
{f : α → Set X}
(hs : s.Finite)
(h : ∀ i ∈ s, IsOpen (f i))


@[to_additive]
theorem inf_mul_assoc (A B C : Subgroup G) (h : C ≤ A) :
    ((A ⊓ B : Subgroup G) : Set G) * C = (A : Set G) ∩ (↑B * ↑C)

{G : Type u_2}
[AddGroup G]
(A B C : AddSubgroup G)
(h : C ≤ A)


@[to_additive]
theorem finprod_mem_eq_prod (f : α → M) {s : Set α} (hf : (s ∩ mulSupport f).Finite) :
    ∏ᶠ i ∈ s, f i = ∏ i ∈ hf.toFinset, f i

(hf : (s ∩ Function.mulSupport f).Finite)

∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ i ∈ hf.toFinset, f i


theorem castPred_inj {i j : Fin (n + 1)} {hi : i ≠ last n} {hj : j ≠ last n} :
    castPred i hi = castPred j hj ↔ i = j

{n : ℕ}
{i j : Fin (n + 1)}
{hi : i ≠ Fin.last n}
{hj : j ≠ Fin.last n}


lemma _root_.Set.Finite.eventuallyLE_iUnion {ι : Type*} {s : Set ι} (hs : s.Finite)
    {f g : ι → Set α} (hle : ∀ i ∈ s, f i ≤ᶠ[l] g i) : (⋃ i ∈ s, f i) ≤ᶠ[l] (⋃ i ∈ s, g i)

{α : Type u}
{l : Filter α}
{ι : Type u_2}
{s : Set ι}
(hs : s.Finite)
{f g : ι → Set α}
(hle : ∀ i ∈ s, f i ≤ᶠ[l] g i)


theorem LiftRelAux.swap (R : α → β → Prop) (C) (a b) :
    LiftRelAux (swap R) (swap C) b a = LiftRelAux R C a b

(C : Computation α → Computation β → Prop)

Computation.LiftRelAux (Function.swap R) (Function.swap C) b a = Computation.LiftRelAux R C a b


theorem continuousOn_prod_of_discrete_left [DiscreteTopology α] {f : α × β → γ} {s : Set (α × β)} :
    ContinuousOn f s ↔ ∀ a, ContinuousOn (f ⟨a, ·⟩) {b | (a, b) ∈ s}

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[DiscreteTopology α]
{f : α × β → γ}
{s : Set (α × β)}

ContinuousOn f s ↔ ∀ (a : α), ContinuousOn (fun x => f (a, x)) {b | (a, b) ∈ s}


/-- Given a tower of algebras `R → A → B`, and a square-zero `I : ideal B`,
there is a 1-1 correspondence between `R`-derivations from `A` to `I` and
lifts `A →ₐ[R] B` of the canonical map `A →ₐ[R] B ⧸ I`. -/
@[simps!]
def derivationToSquareZeroEquivLift : Derivation R A I ≃
    { f : A →ₐ[R] B // (Ideal.Quotient.mkₐ R I).comp f = IsScalarTower.toAlgHom R A (B ⧸ I) }

(f : { f // (Ideal.Quotient.mkₐ R I).comp f = IsScalarTower.toAlgHom R A (B ⧸ I) })

↑(((derivationToSquareZeroEquivLift I hI).symm f) c) = ↑f c - (algebraMap A B) c


/-- `CoheytingHomClass F α β` states that `F` is a type of co-Heyting homomorphisms.

You should extend this class when you extend `CoheytingHom`. -/
class CoheytingHomClass (F α β : Type*) [CoheytingAlgebra α] [CoheytingAlgebra β] [FunLike F α β]
  extends LatticeHomClass F α β : Prop where
  /-- The proposition that a co-Heyting homomorphism preserves the top element. -/
  map_top (f : F) : f ⊤ = ⊤
  /-- The proposition that a co-Heyting homomorphism preserves the difference operation. -/
  map_sdiff (f : F) : ∀ a b, f (a \ b) = f a \ f b

{F : Type u_6}
{α : Type u_7}
{β : Type u_8}
[CoheytingAlgebra α]
[CoheytingAlgebra β]
[FunLike F α β]
[self : CoheytingHomClass F α β]
(f : F)
(a b : α)


/-- The cardinality of a quaternion algebra, as a set. -/
theorem mk_univ_quaternionAlgebra : #(Set.univ : Set ℍ[R,c₁,c₂]) = #R ^ 4

Cardinal.mk ↑Set.univ = Cardinal.mk R ^ 4


theorem StrictAnti.le_iff_le (hf : StrictAnti f) {a b : α} : f a ≤ f b ↔ b ≤ a

{α : Type u}
{β : Type v}
[LinearOrder α]
[Preorder β]
{f : α → β}
(hf : StrictAnti f)
{a b : α}


@[reassoc]
theorem kernel_map_comp_preserves_kernel_iso_inv {X' Y' : C} (g : X' ⟶ Y') [HasKernel g]
    [HasKernel (G.map g)] [PreservesLimit (parallelPair g 0) G] (p : X ⟶ X') (q : Y ⟶ Y')
    (hpq : f ≫ q = p ≫ g) :
    kernel.map (G.map f) (G.map g) (G.map p) (G.map q) (by rw [← G.map_comp, hpq, G.map_comp]) ≫
        (PreservesKernel.iso G _).inv =
      (PreservesKernel.iso G _).inv ≫ G.map (kernel.map f g p q hpq)

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.parallelPair f 0) G]

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.parallelPair g 0) G]

CategoryTheory.Limits.kernel.map (G.map f) (G.map g) (G.map p) (G.map q) ⋯ ≫
    (CategoryTheory.Limits.PreservesKernel.iso G g).inv =
  (CategoryTheory.Limits.PreservesKernel.iso G f).inv ≫ G.map (CategoryTheory.Limits.kernel.map f g p q hpq)


theorem coeff_mul_X_pow' (p : R[X]) (n d : ℕ) :
    (p * X ^ n).coeff d = ite (n ≤ d) (p.coeff (d - n)) 0

{R : Type u}
[Semiring R]
(p : R[X])
(n d : ℕ)

(p * Polynomial.X ^ n).coeff d = if n ≤ d then p.coeff (d - n) else 0


theorem lt_iff_exists_coe : ∀ {a b : WithBot α}, a < b ↔ ∃ p : α, b = p ∧ a < p


theorem some_mem_insertNone {s : Finset α} {a : α} : some a ∈ insertNone s ↔ a ∈ s


@[norm_cast, simp]
theorem coe_inv (x : R) : ((x⁻¹ : R) : ℍ[R]) = (↑x)⁻¹

{R : Type u_1}
[LinearOrderedField R]
(x : R)

↑x⁻¹ = (↑x)⁻¹


@[to_additive]
lemma exists_right_transversal (H : Subgroup G) (g : G) :
    ∃ S ∈ rightTransversals (H : Set G), g ∈ S

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
(g : G)

∃ S ∈ AddSubgroup.rightTransversals ↑H, g ∈ S


theorem equitableOn_iff_exists_eq_eq_add_one {s : Set α} {f : α → ℕ} :
    s.EquitableOn f ↔ ∃ b, ∀ a ∈ s, f a = b ∨ f a = b + 1


@[to_additive addCHaar_sup_le]
theorem chaar_sup_le {K₀ : PositiveCompacts G} (K₁ K₂ : Compacts G) :
    chaar K₀ (K₁ ⊔ K₂) ≤ chaar K₀ K₁ + chaar K₀ K₂

{K₀ : TopologicalSpace.PositiveCompacts G}

MeasureTheory.Measure.haar.chaar K₀ (K₁ ⊔ K₂) ≤
  MeasureTheory.Measure.haar.chaar K₀ K₁ + MeasureTheory.Measure.haar.chaar K₀ K₂


/-- Interpret an `Equiv` as a `PartialEquiv` by restricting it to `s` in the domain
and to `t` in the codomain. -/
@[simps (config := .asFn)]
def _root_.Equiv.toPartialEquivOfImageEq (e : α ≃ β) (s : Set α) (t : Set β) (h : e '' s = t) :
    PartialEquiv α β

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
(s : Set α)
(t : Set β)
(h : ⇑e '' s = t)

(e.toPartialEquivOfImageEq s t h).target = t


theorem reachable_of_edist_ne_top (h : G.edist u v ≠ ⊤) :
    G.Reachable u v

{V : Type u_1}
{G : SimpleGraph V}
{u v : V}
(h : G.edist u v ≠ ⊤)


theorem mgf_const (c : ℝ) [IsProbabilityMeasure μ] : mgf (fun _ => c) μ t = exp (t * c)

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{t : ℝ}
(c : ℝ)
[MeasureTheory.IsProbabilityMeasure μ]

ProbabilityTheory.mgf (fun x => c) μ t = rexp (t * c)


@[to_additive]
theorem sup_eq_range (s t : Submonoid N) : s ⊔ t = mrange (s.subtype.coprod t.subtype)

{N : Type u_4}
[AddCommMonoid N]
(s t : AddSubmonoid N)

s ⊔ t = AddMonoidHom.mrange (s.subtype.coprod t.subtype)


theorem inter_assoc (a b c : Set α) : a ∩ b ∩ c = a ∩ (b ∩ c)


theorem add_congr {w x y z : PGame} (h₁ : w ≈ x) (h₂ : y ≈ z) : w + y ≈ x + z

{w x y z : SetTheory.PGame}
(h₁ : w ≈ x)
(h₂ : y ≈ z)


@[simp]
theorem exp_sub_pi_mul_I (z : ℂ) : exp (z - π * I) = -exp z

Complex.exp (z - ↑Real.pi * Complex.I) = -Complex.exp z


lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂

Surreal.Multiplication.P3 x₁ x₂ y₁ y₂ ↔ Surreal.Multiplication.P3 y₁ y₂ x₁ x₂


/-- If `E` is a cone which is a limit on the level of presheaves,
then the limit presheaf is again a sheaf.

This is used to show that the forgetful functor from sheaves to presheaves creates limits.
-/
theorem isSheaf_of_isLimit (F : K ⥤ Sheaf J D) (E : Cone (F ⋙ sheafToPresheaf J D))
    (hE : IsLimit E) : Presheaf.IsSheaf J E.pt

{J : CategoryTheory.GrothendieckTopology C}

(F : CategoryTheory.Functor K (CategoryTheory.Sheaf J D))

(E : CategoryTheory.Limits.Cone (F.comp (CategoryTheory.sheafToPresheaf J D)))


theorem IsInfix.length_le (h : l₁ <:+: l₂) : l₁.length ≤ l₂.length

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


/-- The identity pseudofunctor. -/
@[simps]
def id (B : Type u₁) [Bicategory.{w₁, v₁} B] : Pseudofunctor B B

(B : Type u₁)
[CategoryTheory.Bicategory B]
(a : B)

(CategoryTheory.Pseudofunctor.id B).mapId a = CategoryTheory.Iso.refl (CategoryTheory.CategoryStruct.id a)


@[to_additive]
theorem BddAbove.mul {s t : Set M} (hs : BddAbove s) (ht : BddAbove t) : BddAbove (s * t)

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

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


theorem Cofix.ext {α : TypeVec n} (x y : Cofix F α) (h : x.dest = y.dest) : x = y

{n : ℕ}
{F : TypeVec.{u} (n + 1) → Type u}
[q : MvQPF F]
{α : TypeVec.{u} n}
(x y : MvQPF.Cofix F α)
(h : x.dest = y.dest)


theorem eq_conj_eqToHom {X Y : C} (f : X ⟶ Y) : f = eqToHom rfl ≫ f ≫ eqToHom rfl

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

f =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
    (CategoryTheory.CategoryStruct.comp f (CategoryTheory.eqToHom ⋯))


/-- If `f : ℂ → E` is continuous on a closed ball of positive radius and is differentiable at all
but countably many points of the corresponding open ball, then it is analytic on the open ball with
coefficients of the power series given by Cauchy integral formulas. -/
theorem hasFPowerSeriesOnBall_of_differentiable_off_countable {R : ℝ≥0} {c : ℂ} {f : ℂ → E}
    {s : Set ℂ} (hs : s.Countable) (hc : ContinuousOn f (closedBall c R))
    (hd : ∀ z ∈ ball c R \ s, DifferentiableAt ℂ f z) (hR : 0 < R) :
    HasFPowerSeriesOnBall f (cauchyPowerSeries f c R) c R

(hc : ContinuousOn f (Metric.closedBall c ↑R))

(hd : ∀ z ∈ Metric.ball c ↑R \ s, DifferentiableAt ℂ f z)

HasFPowerSeriesOnBall f (cauchyPowerSeries f c ↑R) c ↑R


theorem num_eq_zero_iff [Nontrivial R] {I : FractionalIdeal R⁰ K} : I.num = 0 ↔ I = 0

{R : Type u_1}
[CommRing R]
{K : Type u_3}
[Field K]
[Algebra R K]
[IsFractionRing R K]
[Nontrivial R]
{I : FractionalIdeal R⁰ K}


theorem ofFractionRing_neg (p : FractionRing K[X]) :
    ofFractionRing (-p) = -ofFractionRing p

{K : Type u}
[CommRing K]
(p : FractionRing K[X])

{ toFractionRing := -p } = -{ toFractionRing := p }


@[simp]
theorem blockDiagonal'_conjTranspose {α} [AddMonoid α] [StarAddMonoid α]
    (M : ∀ i, Matrix (m' i) (n' i) α) : (blockDiagonal' M)ᴴ = blockDiagonal' fun k => (M k)ᴴ

{o : Type u_4}
{m' : o → Type u_7}
{n' : o → Type u_8}
[DecidableEq o]
{α : Type u_14}
[AddMonoid α]
[StarAddMonoid α]
(M : (i : o) → Matrix (m' i) (n' i) α)

(Matrix.blockDiagonal' M)ᴴ = Matrix.blockDiagonal' fun k => (M k)ᴴ


/-- The bifunctor `Cᵒᵖ ⥤ C ⥤ SSet.{v}` which sends `K : Cᵒᵖ` and `L : C` to `sHom K.unop L`. -/
@[simps]
noncomputable def sHomFunctor : Cᵒᵖ ⥤ C ⥤ SSet.{v}

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.SimplicialCategory C]
(K : Cᵒᵖ)

∀ {X Y : C} (φ : X ⟶ Y),
  ((CategoryTheory.SimplicialCategory.sHomFunctor C).obj K).map φ =
    CategoryTheory.SimplicialCategory.sHomWhiskerLeft (Opposite.unop K) φ


theorem mem_of_mem_nhds : s ∈ 𝓝 x → x ∈ s

{X : Type u}
{x : X}
{s : Set X}
[TopologicalSpace X]

s ∈ 𝓝 x → x ∈ s


@[simp] theorem empty_append (s : String) : "" ++ s = s


@[to_additive]
lemma exists_left_transversal (H : Subgroup G) (g : G) :
    ∃ S ∈ leftTransversals (H : Set G), g ∈ S

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
(g : G)

∃ S ∈ AddSubgroup.leftTransversals ↑H, g ∈ S


theorem toSimpleFunc_toLp (f : α →ₛ E) (hfi : Memℒp f p μ) : toSimpleFunc (toLp f hfi) =ᵐ[μ] f

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
(f : MeasureTheory.SimpleFunc α E)
(hfi : MeasureTheory.Memℒp (↑f) p μ)

↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc (MeasureTheory.Lp.simpleFunc.toLp f hfi)) =ᵐ[μ] ↑f


/-- An alternative formula for the braiding isomorphism which swaps a binary biproduct,
using the fact that the biproduct is a coproduct.
-/
@[simps]
def biprod.braiding' (P Q : C) : P ⊞ Q ≅ Q ⊞ P

(CategoryTheory.Limits.biprod.braiding' P Q).inv =
  CategoryTheory.Limits.biprod.desc CategoryTheory.Limits.biprod.inr CategoryTheory.Limits.biprod.inl


/-- The prelax functor from `Cat` to `Cat` defined with `WithInitial`. -/
@[simps]
def prelaxfunctor : PrelaxFunctor Cat Cat

CategoryTheory.WithInitial.prelaxfunctor.obj C = CategoryTheory.Cat.of (CategoryTheory.WithInitial ↑C)


@[simp]
lemma cyclesMap_zero : cyclesMap (0 : K ⟶ L) i = 0


/-- The span of a set of points contains the set of points. -/
theorem subset_span (S : Set (ℙ K V)) : S ⊆ span S

{K : Type u_1}
{V : Type u_2}
[Field K]
[AddCommGroup V]
[Module K V]
(S : Set (Projectivization K V))


/-- In a `p ^ (k + 1)`-th cyclotomic extension of `ℚ `, we have that `ζ` is not congruent to an
  integer modulo `p` if `p ≠ 2`. -/
theorem not_exists_int_prime_dvd_sub_of_prime_ne_two
    [hcycl : IsCyclotomicExtension {p ^ (k + 1)} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) (hodd : p ≠ 2) :
    ¬(∃ n : ℤ, (p : 𝓞 K) ∣ (hζ.toInteger - n : 𝓞 K))


/-- `Irreducible p` states that `p` is non-unit and only factors into units.

We explicitly avoid stating that `p` is non-zero, this would require a semiring. Assuming only a
monoid allows us to reuse irreducible for associated elements.
-/
structure Irreducible [Monoid α] (p : α) : Prop where
  /-- `p` is not a unit -/
  not_unit : ¬IsUnit p
  /-- if `p` factors then one factor is a unit -/
  isUnit_or_isUnit' : ∀ a b, p = a * b → IsUnit a ∨ IsUnit b

{α : Type u_1}
[Monoid α]
{p : α}
(self : Irreducible p)
(a b : α)


theorem Base.exchange_base_of_indep' (hB : M.Base B) (he : e ∈ B) (hf : f ∉ B)
    (hI : M.Indep (insert f B \ {e})) : M.Base (insert f B \ {e})

{α : Type u_1}
{M : Matroid α}
{B : Set α}
{e f : α}
(hB : M.Base B)
(he : e ∈ B)
(hf : f ∉ B)
(hI : M.Indep (insert f B \ {e}))


theorem integral_trim_ae (hm : m ≤ m0) {f : β → G} (hf : AEStronglyMeasurable f (μ.trim hm)) :
    ∫ x, f x ∂μ = ∫ x, f x ∂μ.trim hm

(hf : MeasureTheory.AEStronglyMeasurable f (μ.trim hm))

∫ (x : β), f x ∂μ = ∫ (x : β), f x ∂μ.trim hm


theorem toMeasure_mono {s t : Set α} (hs : MeasurableSet s) (ht : MeasurableSet t)
    (h : s ∩ p.support ⊆ t) : p.toMeasure s ≤ p.toMeasure t

{α : Type u_1}
[MeasurableSpace α]
(p : PMF α)
{s t : Set α}
(hs : MeasurableSet s)
(ht : MeasurableSet t)
(h : s ∩ p.support ⊆ t)


private lemma coroot_eq_coreflection_of_root_eq' [CharZero R] [NoZeroSMulDivisors R M]
    (p : PerfectPairing R M N)
    (root : ι ↪ M)
    (coroot : ι ↪ N)
    (hp : ∀ i, p.toLin (root i) (coroot i) = 2)
    (hr : ∀ i, MapsTo (preReflection (root i) (p.toLin.flip (coroot i))) (range root) (range root))
    (hc : ∀ i, MapsTo (preReflection (coroot i) (p.toLin (root i))) (range coroot) (range coroot))
    {i j k : ι} (hk : root k = preReflection (root i) (p.toLin.flip (coroot i)) (root j)) :
    coroot k = preReflection (coroot i) (p.toLin (root i)) (coroot j)

(hp : ∀ (i : ι), (p.toLin (root i)) (coroot i) = 2)

(hr :
  ∀ (i : ι),
    Set.MapsTo (⇑(Module.preReflection (root i) (p.toLin.flip (coroot i)))) (Set.range ⇑root) (Set.range ⇑root))

(hc :
  ∀ (i : ι), Set.MapsTo (⇑(Module.preReflection (coroot i) (p.toLin (root i)))) (Set.range ⇑coroot) (Set.range ⇑coroot))

(hk : root k = (Module.preReflection (root i) (p.toLin.flip (coroot i))) (root j))

coroot k = (Module.preReflection (coroot i) (p.toLin (root i))) (coroot j)


@[simp]
lemma binaryProductIso_inv_comp_fst :
    (binaryProductIso F G).inv ≫ Limits.prod.fst = prod.fst

(F G : CategoryTheory.Functor C (Type w))

CategoryTheory.CategoryStruct.comp (CategoryTheory.FunctorToTypes.binaryProductIso F G).inv
    CategoryTheory.Limits.prod.fst =
  CategoryTheory.FunctorToTypes.prod.fst


@[simp]
theorem coe_inverse' (f : A →ₛₙₐ[φ] B) (g : B → A)
    (k : Function.RightInverse φ' φ)
    (h₁ : Function.LeftInverse g f) (h₂ : Function.RightInverse g f) :
    (inverse' f g k h₁ h₂ : B → A) = g

{R : Type u}
{S : Type u₁}
[Monoid R]
[Monoid S]
{φ : R →* S}
{A : Type v}
{B : Type w}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction S B]
{φ' : S →* R}
(f : A →ₛₙₐ[φ] B)
(g : B → A)
(k : Function.RightInverse ⇑φ' ⇑φ)
(h₁ : Function.LeftInverse g ⇑f)
(h₂ : Function.RightInverse g ⇑f)


@[simp]
theorem filter_apply (a : α) :
    (p.filter s h) a = s.indicator p a * (∑' a', (s.indicator p) a')⁻¹

{α : Type u_1}
{p : PMF α}
{s : Set α}
(h : ∃ a ∈ s, a ∈ p.support)
(a : α)

(p.filter s h) a = s.indicator (⇑p) a * (∑' (a' : α), s.indicator (⇑p) a')⁻¹


theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F]
    [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F))

(Fq F : Type)
[Field Fq]
[Field F]
[Algebra Fq[X] F]
[Algebra (RatFunc Fq) F]
[IsScalarTower Fq[X] (RatFunc Fq) F]

Function.Injective ⇑(algebraMap Fq[X] F)


protected theorem max_const [LinearOrder ι] {f : Filtration ι m} {τ : Ω → ι}
    (hτ : IsStoppingTime f τ) (i : ι) : IsStoppingTime f fun ω => max (τ ω) i

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
(hτ : MeasureTheory.IsStoppingTime f τ)
(i : ι)

MeasureTheory.IsStoppingTime f fun ω => max (τ ω) i


@[simp]
theorem sheafificationAdjunction_unit_app (P : Cᵒᵖ ⥤ D) :
    (sheafificationAdjunction J D).unit.app P = toSheafify J P

(J : CategoryTheory.GrothendieckTopology C)

(CategoryTheory.sheafificationAdjunction J D).unit.app P = CategoryTheory.toSheafify J P


@[simp]
theorem image₂_eq_empty_iff : image₂ f s t = ∅ ↔ s = ∅ ∨ t = ∅

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}


@[simp]
theorem comp_apply (f : InfTopHom β γ) (g : InfTopHom α β) (a : α) : (f.comp g) a = f (g a)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Inf α]
[Top α]
[Inf β]
[Top β]
[Inf γ]
[Top γ]
(f : InfTopHom β γ)
(g : InfTopHom α β)
(a : α)


theorem toDualContinuousMultilinearMap_le_projectiveSeminorm (x : ⨂[𝕜] i, E i) :
    ‖toDualContinuousMultilinearMap F x‖ ≤ projectiveSeminorm x

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

‖(PiTensorProduct.toDualContinuousMultilinearMap F) x‖ ≤ PiTensorProduct.projectiveSeminorm x


@[simp]
lemma egauge_zero_zero : egauge 𝕜 (0 : Set E) 0 = 0

(𝕜 : Type u_1)
[NormedDivisionRing 𝕜]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]


@[simp]
theorem brange_const {o : Ordinal} (ho : o ≠ 0) {c : α} : (brange o fun _ _ => c) = {c}

{α : Type u_1}
{o : Ordinal.{u_4}}
(ho : o ≠ 0)
{c : α}


@[reassoc (attr := simp)]
theorem triangle_assoc_comp_right_inv (f : a ⟶ b) (g : b ⟶ c) :
    (ρ_ f).inv ▷ g ≫ (α_ f (𝟙 b) g).hom = f ◁ (λ_ g).inv

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c : B}
(f : a ⟶ b)
(g : b ⟶ c)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.rightUnitor f).inv g)
    (CategoryTheory.Bicategory.associator f (CategoryTheory.CategoryStruct.id b) g).hom =
  CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.leftUnitor g).inv


theorem conj_inv {a b : α} : (b * a * b⁻¹)⁻¹ = b * a⁻¹ * b⁻¹


theorem dvd_antisymm {m n : ℕ+} : m ∣ n → n ∣ m → m = n


theorem infinitesimal_def {x : ℝ*} : Infinitesimal x ↔ ∀ r : ℝ, 0 < r → -(r : ℝ*) < x ∧ x < r

x.Infinitesimal ↔ ∀ (r : ℝ), 0 < r → -↑r < x ∧ x < ↑r


lemma cast_def (q : ℚ≥0) : (q : α) = q.num / q.den

{α : Type u_1}
[DivisionSemiring α]
(q : ℚ≥0)


theorem takeWhile (p : Char → Bool) : ∀ {s}, Valid s → Valid (s.takeWhile p)


private theorem cos_add_aux {a b c d : ℂ} :
    (a + b) * (c + d) - (b - a) * (d - c) * -1 = 2 * (a * c + b * d)


theorem Perm.bind_left (l : List α) {f g : α → List β} (h : ∀ a ∈ l, f a ~ g a) :
    l.bind f ~ l.bind g

{α : Type u_1}
{β : Type u_2}
(l : List α)
{f g : α → List β}
(h : ∀ a ∈ l, (f a).Perm (g a))


@[simp]
theorem inf_prod : (s₁ ⊓ s₂) ×ˢ t = s₁ ×ˢ t ⊓ s₂ ×ˢ t

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

(s₁ ⊓ s₂) ×ˢ t = s₁ ×ˢ t ⊓ s₂ ×ˢ t


theorem exists_ae_eq_range_subset (H : AEMeasurable f μ) {t : Set β} (ht : ∀ᵐ x ∂μ, f x ∈ t)
    (h₀ : t.Nonempty) : ∃ g, Measurable g ∧ range g ⊆ t ∧ f =ᵐ[μ] g

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{f : α → β}
{μ : MeasureTheory.Measure α}
(H : AEMeasurable f μ)
{t : Set β}
(ht : ∀ᵐ (x : α) ∂μ, f x ∈ t)
(h₀ : t.Nonempty)

∃ g, Measurable g ∧ Set.range g ⊆ t ∧ f =ᵐ[μ] g


@[simp] theorem getLsb_or {x y : BitVec v} : (x ||| y).getLsb i = (x.getLsb i || y.getLsb i)


theorem tail' (hab : ReflTransGen r a b) (hbc : r b c) : TransGen r a c

{α : Type u_1}
{r : α → α → Prop}
{a b c : α}
(hab : Relation.ReflTransGen r a b)
(hbc : r b c)


/-- The cartesian product of two equivalences of categories. -/
@[simps]
def prod (E₁ : A ≌ B) (E₂ : C ≌ D) : A × C ≌ B × D

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(E₁ : A ≌ B)
(E₂ : C ≌ D)

(E₁.prod E₂).functor = E₁.functor.prod E₂.functor


theorem not_inj : ∀ {x y : Bool}, (!x) = (!y) → x = y


theorem zipWith_neLocus_eq_left [DecidableEq N] [Zero M] [DecidableEq P] [Zero P] [Zero N]
    {F : M → N → P} (F0 : F 0 0 = 0) (f : α →₀ M) (g₁ g₂ : α →₀ N)
    (hF : ∀ f, Function.Injective fun g => F f g) :
    (zipWith F F0 f g₁).neLocus (zipWith F F0 f g₂) = g₁.neLocus g₂

(hF : ∀ (f : M), Function.Injective fun g => F f g)

(Finsupp.zipWith F F0 f g₁).neLocus (Finsupp.zipWith F F0 f g₂) = g₁.neLocus g₂


@[simp]
theorem subtypeDomain_extendDomain (f : Subtype P →₀ M) :
    subtypeDomain P f.extendDomain = f

{α : Type u_1}
{M : Type u_13}
[Zero M]
{P : α → Prop}
[DecidablePred P]
(f : Subtype P →₀ M)

Finsupp.subtypeDomain P f.extendDomain = f


@[simp]
theorem symmDiff_snd [GeneralizedCoheytingAlgebra α] [GeneralizedCoheytingAlgebra β]
    (a b : α × β) : (a ∆ b).2 = a.2 ∆ b.2

{α : Type u_2}
{β : Type u_3}
[GeneralizedCoheytingAlgebra α]
[GeneralizedCoheytingAlgebra β]
(a b : α × β)


/-- The braiding isomorphism which swaps a binary product. -/
@[simps]
def prod.braiding (P Q : C) [HasBinaryProduct P Q] [HasBinaryProduct Q P] : P ⨯ Q ≅ Q ⨯ P

(CategoryTheory.Limits.prod.braiding P Q).inv =
  CategoryTheory.Limits.prod.lift CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.fst


@[simp]
theorem beth_succ (o : Ordinal) : beth (succ o) = 2 ^ beth o

Cardinal.beth (Order.succ o) = 2 ^ Cardinal.beth o


@[to_additive]
lemma prod_dite_of_true {p : α → Prop} {_ : DecidablePred p} (h : ∀ i ∈ s, p i) (f : ∀ i, p i → β)
    (g : ∀ i, ¬ p i → β) :
    ∏ i ∈ s, (if hi : p i then f i hi else g i hi) = ∏ i : s, f i.1 (h _ i.2)

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
[AddCommMonoid β]
{p : α → Prop}

∀ {x : DecidablePred p} (h : ∀ i ∈ s, p i) (f : (i : α) → p i → β) (g : (i : α) → ¬p i → β),
  (∑ i ∈ s, if hi : p i then f i hi else g i hi) = ∑ i : { x // x ∈ s }, f ↑i ⋯


@[to_additive]
theorem IsClosed.mul_right_of_isCompact (ht : IsClosed t) (hs : IsCompact s) :
    IsClosed (t * s)

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{s t : Set G}
(ht : IsClosed t)
(hs : IsCompact s)


@[simp]
theorem extendWith_some [∀ i, Zero (α i)] (f : Π₀ i, α (some i)) (a : α none) (i : ι) :
    f.extendWith a (some i) = f i

{ι : Type u}
{α : Option ι → Type v}
[(i : Option ι) → Zero (α i)]
(f : Π₀ (i : ι), α (some i))
(a : α none)
(i : ι)

(DFinsupp.extendWith a f) (some i) = f i


@[simp] lemma one_succAbove_succ {n : ℕ} (j : Fin n) :
    (1 : Fin (n + 2)).succAbove j.succ = j.succ.succ


@[simp]
theorem swap_rightInverse : Function.RightInverse (@swap α β) swap


@[simp]
theorem ofFinsupp_neg {R : Type u} [Ring R] {a} : (⟨-a⟩ : R[X]) = -⟨a⟩

{ toFinsupp := -a } = -{ toFinsupp := a }


theorem iteratedDerivWithin_univ : iteratedDerivWithin n f univ = iteratedDeriv n f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}

iteratedDerivWithin n f Set.univ = iteratedDeriv n f


theorem finInsepDegree_def' : finInsepDegree F E = Cardinal.toNat (insepDegree F E)

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]

Field.finInsepDegree F E = Cardinal.toNat (Field.insepDegree F E)


theorem lf_iff_lt_or_fuzzy {x y : PGame} : x ⧏ y ↔ x < y ∨ x ‖ y


@[simp] theorem apply_le_mass (μ : FiniteMeasure Ω) (s : Set Ω) : μ s ≤ μ.mass

{Ω : Type u_1}
[MeasurableSpace Ω]
(μ : MeasureTheory.FiniteMeasure Ω)
(s : Set Ω)


/-- The obvious functor `(J ⥤ ShortComplex C) ⥤ ShortComplex (J ⥤ C)`. -/
@[simps]
def inverse : (J ⥤ ShortComplex C) ⥤ ShortComplex (J ⥤ C)

(F : CategoryTheory.Functor J (CategoryTheory.ShortComplex C))

((CategoryTheory.ShortComplex.FunctorEquivalence.inverse J C).obj F).X₂ = F.comp CategoryTheory.ShortComplex.π₂


/-- If the Hausdorff distance is `< r`, any point in one of the sets is at distance
`< r` of a point in the other set. -/
theorem exists_dist_lt_of_hausdorffDist_lt {r : ℝ} (h : x ∈ s) (H : hausdorffDist s t < r)
    (fin : hausdorffEdist s t ≠ ⊤) : ∃ y ∈ t, dist x y < r

{α : Type u}
[PseudoMetricSpace α]
{s t : Set α}
{x : α}
{r : ℝ}
(h : x ∈ s)
(H : Metric.hausdorffDist s t < r)
(fin : EMetric.hausdorffEdist s t ≠ ⊤)


@[simp]
theorem symm_symm_eq {X Y : C} (α : X ≅ Y) : α.symm.symm = α

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


theorem id_apply (x : M₁) : id R₁ M₁ x = x

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
(x : M₁)


/-- An additive functor `F` is `R`-linear provided `F.map` is an `R`-module morphism. -/
class Functor.Linear {C D : Type*} [Category C] [Category D] [Preadditive C] [Preadditive D]
  [Linear R C] [Linear R D] (F : C ⥤ D) [F.Additive] : Prop where
  /-- the functor induces a linear map on morphisms -/
  map_smul : ∀ {X Y : C} (f : X ⟶ Y) (r : R), F.map (r • f) = r • F.map f := by aesop_cat

[self : CategoryTheory.Functor.Linear R F]


/-- If `P u` is `False` for any set `u` that has nonempty intersection both with `s` and `t`, then
`μ (s ∪ t) = μ s + μ t`, where `μ = inducedOuterMeasure m P0 m0`.

E.g., if `α` is an (e)metric space and `P u = diam u < r`, then this lemma implies that
`μ (s ∪ t) = μ s + μ t` on any two sets such that `r ≤ edist x y` for all `x ∈ s` and `y ∈ t`. -/
theorem inducedOuterMeasure_union_of_false_of_nonempty_inter {s t : Set α}
    (h : ∀ u, (s ∩ u).Nonempty → (t ∩ u).Nonempty → ¬P u) :
    inducedOuterMeasure m P0 m0 (s ∪ t) =
      inducedOuterMeasure m P0 m0 s + inducedOuterMeasure m P0 m0 t

(h : ∀ (u : Set α), (s ∩ u).Nonempty → (t ∩ u).Nonempty → ¬P u)

(MeasureTheory.inducedOuterMeasure m P0 m0) (s ∪ t) =
  (MeasureTheory.inducedOuterMeasure m P0 m0) s + (MeasureTheory.inducedOuterMeasure m P0 m0) t


@[simps! tensorObj tensorHom tensorUnit whiskerLeft whiskerRight associator]
instance prodMonoidal : MonoidalCategory (C₁ × C₂)

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

∀ {X₁ Y₁ X₂ Y₂ : C₁ × C₂} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂),
  CategoryTheory.MonoidalCategory.tensorHom f g =
    (CategoryTheory.MonoidalCategory.tensorHom f.1 g.1, CategoryTheory.MonoidalCategory.tensorHom f.2 g.2)


theorem ext' (h : c.snd = d.snd) : c = d

{α : Type u_2}
{β : Type u_3}
{r : α → β → Prop}
{c d : Concept α β r}
(h : c.toProd.2 = d.toProd.2)


@[simp]
theorem coe_rangeRestrict (f : R →ₙ+* S) (x : R) : (f.rangeRestrict x : S) = f x

{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
(f : R →ₙ+* S)
(x : R)


@[simp]
theorem coe_constVSub_symm (p : P) : ⇑(constVSub p).symm = fun (v : G) => -v +ᵥ p

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[AddTorsor G P]
(p : P)

⇑(Equiv.constVSub p).symm = fun v => -v +ᵥ p


@[simp]
theorem comap_asIdeal (y : PrimeSpectrum S) : (comap f y).asIdeal = Ideal.comap f y.asIdeal

{R : Type u}
{S : Type v}
[CommSemiring R]
[CommSemiring S]
(f : R →+* S)
(y : PrimeSpectrum S)

((PrimeSpectrum.comap f) y).asIdeal = Ideal.comap f y.asIdeal


theorem l_le {a : α} {b : β} : a ≤ u b → l a ≤ b

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{a : α}
{b : β}


theorem sum_apply' [Countable ι] (κ : ι → Kernel α β) (a : α) {s : Set β} (hs : MeasurableSet s) :
    Kernel.sum κ a s = ∑' n, κ n a s

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
[Countable ι]
(κ : ι → ProbabilityTheory.Kernel α β)
(a : α)
{s : Set β}
(hs : MeasurableSet s)

((ProbabilityTheory.Kernel.sum κ) a) s = ∑' (n : ι), ((κ n) a) s


theorem integral_sub {f g : α → G} (hf : Integrable f μ) (hg : Integrable g μ) :
    ∫ a, f a - g a ∂μ = ∫ a, f a ∂μ - ∫ a, g a ∂μ

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → G}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)

∫ (a : α), f a - g a ∂μ = ∫ (a : α), f a ∂μ - ∫ (a : α), g a ∂μ


theorem chain_of_chain_pmap {S : β → β → Prop} {p : α → Prop} (f : ∀ a, p a → β) {l : List α}
    (hl₁ : ∀ a ∈ l, p a) {a : α} (ha : p a) (hl₂ : Chain S (f a ha) (List.pmap f l hl₁))
    (H : ∀ a b ha hb, S (f a ha) (f b hb) → R a b) : Chain R a l

(hl₂ : List.Chain S (f a ha) (List.pmap f l hl₁))

(H : ∀ (a b : α) (ha : p a) (hb : p b), S (f a ha) (f b hb) → R a b)


/-- `OrderDual` as a functor. -/
@[simps]
def dual : CompleteLat ⥤ CompleteLat

CompleteLat.dual.obj X = CompleteLat.of (↑X)ᵒᵈ


theorem setLintegral_setLaverage (μ : Measure α) [IsFiniteMeasure μ] (f : α → ℝ≥0∞) (s : Set α) :
    ∫⁻ _x in s, ⨍⁻ a in s, f a ∂μ ∂μ = ∫⁻ x in s, f x ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure μ]
(f : α → ℝ≥0∞)
(s : Set α)

∫⁻ (_x : α) in s, ⨍⁻ (a : α) in s, f a ∂μ ∂μ = ∫⁻ (x : α) in s, f x ∂μ


theorem lift_unique (Φ : Quotient r ⥤ D) (hΦ : functor r ⋙ Φ = F) : Φ = lift r F H

(H : ∀ (x y : C) (f₁ f₂ : x ⟶ y), r f₁ f₂ → F.map f₁ = F.map f₂)

(Φ : CategoryTheory.Functor (CategoryTheory.Quotient r) D)

(hΦ : (CategoryTheory.Quotient.functor r).comp Φ = F)


/--
`HasRankNullity.{u}` is a class of rings satisfying
1. Every `R`-module `M : Type u` has a linear independent subset of cardinality `Module.rank R M`.
2. `rank (M ⧸ N) + rank N = rank M` for every `R`-module `M : Type u` and every `N : Submodule R M`.

Usually such a ring satisfies `HasRankNullity.{w}` for all universes `w`, and the universe
argument is there because of technical limitations to universe polymorphism.

See `DivisionRing.hasRankNullity` and `IsDomain.hasRankNullity`.
-/
@[pp_with_univ]
class HasRankNullity (R : Type v) [inst : Ring R] : Prop where
  exists_set_linearIndependent : ∀ (M : Type u) [AddCommGroup M] [Module R M],
    ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val
  rank_quotient_add_rank : ∀ {M : Type u} [AddCommGroup M] [Module R M] (N : Submodule R M),
    Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M

{R : Type v}
[inst : Ring R]
[self : HasRankNullity.{u, v} R]
(M : Type u)
[AddCommGroup M]
[Module R M]

∃ s, #↑s = Module.rank R M ∧ LinearIndependent (ι := ↑s) R Subtype.val


/-- In a bicategory, we can compose the 1-morphisms `f : a ⟶ b` and `g : b ⟶ c` to obtain
a 1-morphism `f ≫ g : a ⟶ c`. This composition does not need to be strictly associative,
but there is a specified associator, `α_ f g h : (f ≫ g) ≫ h ≅ f ≫ (g ≫ h)`.
There is an identity 1-morphism `𝟙 a : a ⟶ a`, with specified left and right unitor
isomorphisms `λ_ f : 𝟙 a ≫ f ≅ f` and `ρ_ f : f ≫ 𝟙 a ≅ f`.
These associators and unitors satisfy the pentagon and triangle equations.

See https://ncatlab.org/nlab/show/bicategory.
-/
@[nolint checkUnivs]
class Bicategory (B : Type u) extends CategoryStruct.{v} B where
  -- category structure on the collection of 1-morphisms:
  homCategory : ∀ a b : B, Category.{w} (a ⟶ b) := by infer_instance
  -- left whiskering:
  whiskerLeft {a b c : B} (f : a ⟶ b) {g h : b ⟶ c} (η : g ⟶ h) : f ≫ g ⟶ f ≫ h
  -- right whiskering:
  whiskerRight {a b c : B} {f g : a ⟶ b} (η : f ⟶ g) (h : b ⟶ c) : f ≫ h ⟶ g ≫ h
  -- associator:
  associator {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) : (f ≫ g) ≫ h ≅ f ≫ g ≫ h
  -- left unitor:
  leftUnitor {a b : B} (f : a ⟶ b) : 𝟙 a ≫ f ≅ f
  -- right unitor:
  rightUnitor {a b : B} (f : a ⟶ b) : f ≫ 𝟙 b ≅ f
  -- axioms for left whiskering:
  whiskerLeft_id : ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), whiskerLeft f (𝟙 g) = 𝟙 (f ≫ g) := by
    aesop_cat
  whiskerLeft_comp :
    ∀ {a b c} (f : a ⟶ b) {g h i : b ⟶ c} (η : g ⟶ h) (θ : h ⟶ i),
      whiskerLeft f (η ≫ θ) = whiskerLeft f η ≫ whiskerLeft f θ := by
    aesop_cat
  id_whiskerLeft :
    ∀ {a b} {f g : a ⟶ b} (η : f ⟶ g),
      whiskerLeft (𝟙 a) η = (leftUnitor f).hom ≫ η ≫ (leftUnitor g).inv := by
    aesop_cat
  comp_whiskerLeft :
    ∀ {a b c d} (f : a ⟶ b) (g : b ⟶ c) {h h' : c ⟶ d} (η : h ⟶ h'),
      whiskerLeft (f ≫ g) η =
        (associator f g h).hom ≫ whiskerLeft f (whiskerLeft g η) ≫ (associator f g h').inv := by
    aesop_cat
  -- axioms for right whiskering:
  id_whiskerRight : ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), whiskerRight (𝟙 f) g = 𝟙 (f ≫ g) := by
    aesop_cat
  comp_whiskerRight :
    ∀ {a b c} {f g h : a ⟶ b} (η : f ⟶ g) (θ : g ⟶ h) (i : b ⟶ c),
      whiskerRight (η ≫ θ) i = whiskerRight η i ≫ whiskerRight θ i := by
    aesop_cat
  whiskerRight_id :
    ∀ {a b} {f g : a ⟶ b} (η : f ⟶ g),
      whiskerRight η (𝟙 b) = (rightUnitor f).hom ≫ η ≫ (rightUnitor g).inv := by
    aesop_cat
  whiskerRight_comp :
    ∀ {a b c d} {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c) (h : c ⟶ d),
      whiskerRight η (g ≫ h) =
        (associator f g h).inv ≫ whiskerRight (whiskerRight η g) h ≫ (associator f' g h).hom := by
    aesop_cat
  -- associativity of whiskerings:
  whisker_assoc :
    ∀ {a b c d} (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g') (h : c ⟶ d),
      whiskerRight (whiskerLeft f η) h =
        (associator f g h).hom ≫ whiskerLeft f (whiskerRight η h) ≫ (associator f g' h).inv := by
    aesop_cat
  -- exchange law of left and right whiskerings:
  whisker_exchange :
    ∀ {a b c} {f g : a ⟶ b} {h i : b ⟶ c} (η : f ⟶ g) (θ : h ⟶ i),
      whiskerLeft f θ ≫ whiskerRight η i = whiskerRight η h ≫ whiskerLeft g θ := by
    aesop_cat
  -- pentagon identity:
  pentagon :
    ∀ {a b c d e} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) (i : d ⟶ e),
      whiskerRight (associator f g h).hom i ≫
          (associator f (g ≫ h) i).hom ≫ whiskerLeft f (associator g h i).hom =
        (associator (f ≫ g) h i).hom ≫ (associator f g (h ≫ i)).hom := by
    aesop_cat
  -- triangle identity:
  triangle :
    ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c),
      (associator f (𝟙 b) g).hom ≫ whiskerLeft f (leftUnitor g).hom
      = whiskerRight (rightUnitor f).hom g := by
    aesop_cat

{B : Type u}
[self : CategoryTheory.Bicategory B]
{a b : B}
{f g : a ⟶ b}
(η : f ⟶ g)

CategoryTheory.Bicategory.whiskerRight η (CategoryTheory.CategoryStruct.id b) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.rightUnitor f).hom
    (CategoryTheory.CategoryStruct.comp η (CategoryTheory.Bicategory.rightUnitor g).inv)


theorem inter_subset (a b c : Set α) : a ∩ b ⊆ c ↔ a ⊆ bᶜ ∪ c

a ∩ b ⊆ c ↔ a ⊆ bᶜ ∪ c


@[simp]
theorem apply_symm_apply (e : r ≃r s) (x : β) : e (e.symm x) = x

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(e : r ≃r s)
(x : β)


@[simp] theorem and_iff_right_iff_imp : ∀(a b : Bool), ((a && b) = b) ↔ (b → a)


@[symm]
theorem adj_symm (G' : Subgraph G) {u v : V} (h : G'.Adj u v) : G'.Adj v u

{V : Type u}
{G : SimpleGraph V}
(G' : G.Subgraph)
{u v : V}
(h : G'.Adj u v)


theorem hasMFDerivAt_id (x : M) :
    HasMFDerivAt I I (@id M) x (ContinuousLinearMap.id 𝕜 (TangentSpace I x))

{𝕜 : 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]
[SmoothManifoldWithCorners I M]
(x : M)

HasMFDerivAt I I id x (ContinuousLinearMap.id 𝕜 (TangentSpace I x))


@[simp] theorem get!_eq_getElem? [Inhabited α] (a : Array α) (i : Nat) : a.get! i = (a.get? i).getD default

{α : Type u_1}
[Inhabited α]
(a : Array α)
(i : Nat)


@[simp]
theorem mgf_const' (c : ℝ) : mgf (fun _ => c) μ t = (μ Set.univ).toReal * exp (t * c)

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{t : ℝ}
(c : ℝ)

ProbabilityTheory.mgf (fun x => c) μ t = (μ Set.univ).toReal * rexp (t * c)


/-- A restatement of `Types.Limit.lift_π_apply` that uses `Pi.π` and `Pi.lift`. -/
@[simp 1001]
theorem pi_lift_π_apply {β : Type v} [Small.{u} β] (f : β → Type u) {P : Type u}
    (s : ∀ b, P ⟶ f b) (b : β) (x : P) :
    (Pi.π f b : (piObj f) → f b) (@Pi.lift β _ _ f _ P s x) = s b x

{β : Type v}
[Small.{u, v} β]
(f : β → Type u)
{P : Type u}
(s : (b : β) → P ⟶ f b)
(b : β)
(x : P)

CategoryTheory.Limits.Pi.π f b (CategoryTheory.Limits.Pi.lift s x) = s b x


theorem inf_congr {f g : β → α} (hs : s₁ = s₂) (hfg : ∀ a ∈ s₂, f a = g a) :
    s₁.inf f = s₂.inf g

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
{s₁ s₂ : Finset β}
{f g : β → α}
(hs : s₁ = s₂)
(hfg : ∀ a ∈ s₂, f a = g a)


@[simp]
protected theorem closure_singleton (l : Filter α) : closure {l} = Ici l


theorem ω_mul_ωb (q : ℕ+) : (ω : X q) * ωb = 1


@[simp, norm_cast]
theorem coeComplex_imI (z : ℂ) : (z : ℍ).imI = z.im


@[simp]
theorem next_nat_succ (i : ℕ) : (ComplexShape.down ℕ).next (i + 1) = i


theorem unop {P X Y Z : Cᵒᵖ} {fst : P ⟶ X} {snd : P ⟶ Y} {f : X ⟶ Z} {g : Y ⟶ Z}
    (h : IsPullback fst snd f g) : IsPushout g.unop f.unop snd.unop fst.unop

(h : CategoryTheory.IsPullback fst snd f g)

CategoryTheory.IsPushout g.unop f.unop snd.unop fst.unop


theorem ofComapInfPrincipal_eq_of_map (h : m '' s ∈ g) : (ofComapInfPrincipal h).map m = g

{α : Type u}
{β : Type v}
{m : α → β}
{s : Set α}
{g : Ultrafilter β}
(h : m '' s ∈ g)

Ultrafilter.map m (Ultrafilter.ofComapInfPrincipal h) = g


theorem ContDiff.continuous_iteratedDeriv {n : ℕ∞} (m : ℕ) (h : ContDiff 𝕜 n f)
    (hmn : (m : ℕ∞) ≤ n) : Continuous (iteratedDeriv m f)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{n : ℕ∞}
(m : ℕ)
(h : ContDiff 𝕜 n f)
(hmn : ↑m ≤ n)


/-- Construct a multifork using a collection `ι` of morphisms. -/
@[simps]
def ofι (I : MulticospanIndex.{w} C) (P : C) (ι : ∀ a, P ⟶ I.left a)
    (w : ∀ b, ι (I.fstTo b) ≫ I.fst b = ι (I.sndTo b) ≫ I.snd b) : Multifork I

(I : CategoryTheory.Limits.MulticospanIndex C)

(w :
  ∀ (b : I.R),
    CategoryTheory.CategoryStruct.comp (ι (I.fstTo b)) (I.fst b) =
      CategoryTheory.CategoryStruct.comp (ι (I.sndTo b)) (I.snd b))

(CategoryTheory.Limits.Multifork.ofι I P ι w).pt = P


theorem toInvSubmonoid_surjective : Function.Surjective (toInvSubmonoid M S)

{R : Type u_1}
[CommRing R]
(M : Submonoid R)
(S : Type u_2)
[CommRing S]
[Algebra R S]
[IsLocalization M S]

Function.Surjective ⇑(IsLocalization.toInvSubmonoid M S)


theorem Antitone.convex_ge (hf : Antitone f) (r : β) : Convex 𝕜 { x | r ≤ f x }

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{f : E → β}
(hf : Antitone f)
(r : β)


@[simp]
theorem coe_fieldRange : (f.fieldRange : Set L) = Set.range f

{K : Type u}
{L : Type v}
[DivisionRing K]
[DivisionRing L]
(f : K →+* L)


@[simp] lemma supIrred_Iic (a : α) : SupIrred (Iic a)


theorem cos_pi_div_two_sub (x : ℝ) : cos (π / 2 - x) = sin x


theorem monomial_zero_right (n : ℕ) : monomial n (0 : R) = 0


protected theorem eq_of_smul_eq_smul_left {a : ℤ} {b c : ℤ√d} (ha : a ≠ 0) (h : ↑a * b = a * c) :
    b = c

{d a : ℤ}
{b c : ℤ√d}
(ha : a ≠ 0)
(h : ↑a * b = ↑a * c)


@[to_additive]
theorem toTopologicalSpace_injective :
    Function.Injective (toTopologicalSpace : GroupTopology α → TopologicalSpace α)


@[simp] -- Porting note: changed arguments to make `simpNF` happy: merged `hx₁` and `hx₂` into `hx`
theorem Trivialization.continuousLinearEquivAt_prod {e₁ : Trivialization F₁ (π F₁ E₁)}
    {e₂ : Trivialization F₂ (π F₂ E₂)} [e₁.IsLinear 𝕜] [e₂.IsLinear 𝕜] {x : B}
    (hx : x ∈ (e₁.prod e₂).baseSet) :
    (e₁.prod e₂).continuousLinearEquivAt 𝕜 x hx =
      (e₁.continuousLinearEquivAt 𝕜 x hx.1).prod (e₂.continuousLinearEquivAt 𝕜 x hx.2)

[TopologicalSpace (Bundle.TotalSpace F₁ E₁)]

[TopologicalSpace (Bundle.TotalSpace F₂ E₂)]

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

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

Trivialization.continuousLinearEquivAt 𝕜 (e₁.prod e₂) x hx =
  (Trivialization.continuousLinearEquivAt 𝕜 e₁ x ⋯).prod (Trivialization.continuousLinearEquivAt 𝕜 e₂ x ⋯)


@[simp] lemma chainTop_neg : chainTop (-α) β = chainBot α β

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
[NoZeroSMulDivisors ℤ R]
[NoZeroSMulDivisors R M]
[IsNoetherian R M]
(α : L → R)
(β : LieModule.Weight R L M)

LieModule.chainTop (-α) β = LieModule.chainBot α β


@[simp]
theorem lookupAll_nil (a : α) : lookupAll a [] = @nil (β a)

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)


@[simp] lemma mk_smul (i : NumDenSameDeg 𝒜 x) (m : α) : mk (m • i) = m • mk i

(i : HomogeneousLocalization.NumDenSameDeg 𝒜 x)

HomogeneousLocalization.mk (m • i) = m • HomogeneousLocalization.mk i


@[simp]
theorem sup_sdiff_left_self : (a ⊔ b) \ a = b \ a

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


@[simp]
theorem map_apply {M : Matrix m n α} {f : α → β} {i : m} {j : n} : M.map f i j = f (M i j)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{β : Type w}
{M : Matrix m n α}
{f : α → β}
{i : m}
{j : n}


@[to_additive addOrder_dvd_exponent]
theorem order_dvd_exponent (g : G) : orderOf g ∣ exponent G


lemma eq_if_preStoneCechUnit_eq {a b : α} (h : preStoneCechUnit a = preStoneCechUnit b) :
    g a = g b


theorem IsUnit.isRelPrime_right (h : IsUnit y) : IsRelPrime x y

{α : Type u_1}
[CommMonoid α]
{x y : α}
(h : IsUnit y)


nonrec lemma withDensity_mul [IsSFiniteKernel κ] {f : α → β → ℝ≥0} {g : α → β → ℝ≥0∞}
    (hf : Measurable (Function.uncurry f)) (hg : Measurable (Function.uncurry g)) :
    withDensity κ (fun a x ↦ f a x * g a x)
      = withDensity (withDensity κ fun a x ↦ f a x) g

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ : ProbabilityTheory.Kernel α β}
[ProbabilityTheory.IsSFiniteKernel κ]
{f : α → β → ℝ≥0}
{g : α → β → ℝ≥0∞}
(hf : Measurable (Function.uncurry f))
(hg : Measurable (Function.uncurry g))

(κ.withDensity fun a x => ↑(f a x) * g a x) = (κ.withDensity fun a x => ↑(f a x)).withDensity g


theorem vcomp_app' (α : F ⟶ G) (β : G ⟶ H) (X : C) : (α ≫ β).app X = α.app X ≫ β.app X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G H : CategoryTheory.Functor C D}
(α : F ⟶ G)
(β : G ⟶ H)
(X : C)

(CategoryTheory.CategoryStruct.comp α β).app X = CategoryTheory.CategoryStruct.comp (α.app X) (β.app X)


/-- Two compositions (possibly of different integers) coincide if and only if they have the
same sequence of blocks. -/
theorem sigma_eq_iff_blocks_eq {c : Σn, Composition n} {c' : Σn, Composition n} :
    c = c' ↔ c.2.blocks = c'.2.blocks


/-- Any morphism from a terminal object is split mono. -/
theorem IsTerminal.isSplitMono_from {X Y : C} (t : IsTerminal X) (f : X ⟶ Y) : IsSplitMono f

(t : CategoryTheory.Limits.IsTerminal X)


theorem subsingleton_iff :
    Subsingleton R[S⁻¹] ↔ 0 ∈ S

{R : Type u_1}
[Ring R]
{S : Submonoid R}
[OreLocalization.OreSet S]

Subsingleton (OreLocalization S R) ↔ 0 ∈ S


@[fun_prop]
theorem Differentiable.comp_differentiableOn {g : F → G} (hg : Differentiable 𝕜 g)
    (hf : DifferentiableOn 𝕜 f s) : DifferentiableOn 𝕜 (g ∘ f) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E → F}
{s : Set E}
{g : F → G}
(hg : Differentiable 𝕜 g)
(hf : DifferentiableOn 𝕜 f s)


@[simp]
theorem sSup_le_iff : sSup s ≤ a ↔ ∀ b ∈ s, b ≤ a

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


theorem add_pf_zero_add (b : R) : 0 + b = b


/-- A product of a function `f : Fin (n + 1) → β` over all `Fin (n + 1)`
is the product of `f 0` plus the remaining product -/
@[to_additive "A sum of a function `f : Fin (n + 1) → β` over all `Fin (n + 1)` is the sum of
`f 0` plus the remaining product"]
theorem prod_univ_succ [CommMonoid β] {n : ℕ} (f : Fin (n + 1) → β) :
    ∏ i, f i = f 0 * ∏ i : Fin n, f i.succ

{β : Type u_2}
[CommMonoid β]
{n : ℕ}
(f : Fin (n + 1) → β)

∏ i : Fin (n + 1), f i = f 0 * ∏ i : Fin n, f i.succ


@[reassoc (attr := simp)]
lemma toCycles_i : S.toCycles ≫ S.iCycles = S.f

CategoryTheory.CategoryStruct.comp S.toCycles S.iCycles = S.f


theorem coe_injective : Injective ((↑) : MultilinearMap R M₁ M₂ → (∀ i, M₁ i) → M₂)

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]


theorem gt_mem_sets_of_limsInf_gt : f.IsBounded (· ≥ ·) → b < f.limsInf → ∀ᶠ a in f, b < a

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
{f : Filter α}
{b : α}

Filter.IsBounded (fun x x_1 => x ≥ x_1) f → b < f.limsInf → ∀ᶠ (a : α) in f, b < a


@[simp, norm_cast]
theorem coe_toFinset (l : List α) : (l.toFinset : Set α) = { a | a ∈ l }

{α : Type u_1}
[DecidableEq α]
(l : List α)


/-- This mixin class describes an order where all intervals bounded above are finite. This is
slightly weaker than `LocallyFiniteOrder` + `OrderBot` as it allows empty types. -/
class LocallyFiniteOrderBot (α : Type*) [Preorder α] where
  /-- Left-infinite right-open interval -/
  finsetIio : α → Finset α
  /-- Left-infinite right-closed interval -/
  finsetIic : α → Finset α
  /-- `x ∈ finsetIic a ↔ x ≤ a` -/
  finset_mem_Iic : ∀ a x : α, x ∈ finsetIic a ↔ x ≤ a
  /-- `x ∈ finsetIio a ↔ x < a` -/
  finset_mem_Iio : ∀ a x : α, x ∈ finsetIio a ↔ x < a

{α : Type u_1}
[Preorder α]
[self : LocallyFiniteOrderBot α]
(a x : α)

x ∈ LocallyFiniteOrderBot.finsetIic a ↔ x ≤ a


@[measurability]
theorem measurable_fst {_ : MeasurableSpace α} {_ : MeasurableSpace β} :
    Measurable (Prod.fst : α × β → α)

∀ {x : MeasurableSpace α} {x_1 : MeasurableSpace β}, Measurable Prod.fst


/-- If `F` reflects isos and `F.map f` is an iso, then `f` is an iso. -/
theorem isIso_of_reflects_iso {A B : C} (f : A ⟶ B) (F : C ⥤ D) [IsIso (F.map f)]
    [F.ReflectsIsomorphisms] : IsIso f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{A B : C}
(f : A ⟶ B)
(F : C ⥤ D)
[CategoryTheory.IsIso (F.map f)]
[F.ReflectsIsomorphisms]


theorem isCompactElement {a : α} {b : Iic a} (h : CompleteLattice.IsCompactElement (b : α)) :
    CompleteLattice.IsCompactElement b

(h : CompleteLattice.IsCompactElement ↑b)


@[simp]
theorem tendsto_Ioo_atTop {f : β → Ioo a b} :
    Tendsto f l atTop ↔ Tendsto (fun x => (f x : α)) l (𝓝[<] b)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
{l : Filter β}
{f : β → ↑(Set.Ioo a b)}

Filter.Tendsto f l Filter.atTop ↔ Filter.Tendsto (fun x => ↑(f x)) l (𝓝[<] b)


@[simp] lemma smoothSheaf.eval_germ (U : Opens M) (x : U)
    (f : (smoothSheaf IM I M N).presheaf.obj (op U)) :
    smoothSheaf.eval IM I N (x : M) ((smoothSheaf IM I M N).presheaf.germ x f) = f x

(f : (smoothSheaf IM I M N).presheaf.obj (Opposite.op U))

smoothSheaf.eval IM I N (↑x) ((smoothSheaf IM I M N).presheaf.germ x f) = ↑f x


@[simp]
theorem cospanCompIso_app_one : (cospanCompIso F f g).app WalkingCospan.one = Iso.refl _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
{X Y Z : C}
(f : X ⟶ Z)
(g : Y ⟶ Z)

(CategoryTheory.Limits.cospanCompIso F f g).app CategoryTheory.Limits.WalkingCospan.one =
  CategoryTheory.Iso.refl ((CategoryTheory.Limits.cospan f g ⋙ F).obj CategoryTheory.Limits.WalkingCospan.one)


@[simp, norm_cast]
theorem val_smul [Monoid R] [DistribMulAction R A] [StarModule R A] (r : R) (x : skewAdjoint A) :
    ↑(r • x) = r • (x : A)

{R : Type u_1}
{A : Type u_2}
[Star R]
[TrivialStar R]
[AddCommGroup A]
[StarAddMonoid A]
[Monoid R]
[DistribMulAction R A]
[StarModule R A]
(r : R)
(x : ↥(skewAdjoint A))


theorem lapMatrix_toLinearMap₂'_apply'_eq_zero_iff_forall_reachable (x : V → ℝ) :
    Matrix.toLinearMap₂' ℝ (G.lapMatrix ℝ) x x = 0 ↔
      ∀ i j : V, G.Reachable i j → x i = x j

{V : Type u_1}
[Fintype V]
[DecidableEq V]
(G : SimpleGraph V)
[DecidableRel G.Adj]
(x : V → ℝ)

(((Matrix.toLinearMap₂' ℝ) (SimpleGraph.lapMatrix ℝ G)) x) x = 0 ↔ ∀ (i j : V), G.Reachable i j → x i = x j


theorem Coprime.coprime_mul_left (H : Coprime (k * m) n) : Coprime m n


@[simp] protected theorem Char.sizeOf (a : Char) : sizeOf a = a.toNat + 3


@[simp]
theorem reverse_involutive : Function.Involutive (reverse (Q := Q))

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}


@[to_additive]
theorem op_iSup (S : ι → Subgroup G) : (iSup S).op = ⨆ i, (S i).op

{ι : Sort u_1}
{G : Type u_2}
[AddGroup G]
(S : ι → AddSubgroup G)


@[to_additive]
theorem prod_union_inter [DecidableEq α] :
    (∏ x ∈ s₁ ∪ s₂, f x) * ∏ x ∈ s₁ ∩ s₂, f x = (∏ x ∈ s₁, f x) * ∏ x ∈ s₂, f x

{α : Type u_3}
{β : Type u_4}
{s₁ s₂ : Finset α}
{f : α → β}
[CommMonoid β]
[DecidableEq α]


@[to_additive (attr := simp)]
theorem div_div_div_cancel_left (a b c : G) : c / a / (c / b) = b / a

{G : Type u_3}
[AddCommGroup G]
(a b c : G)


theorem covers_iff (S : Sieve X) (f : Y ⟶ X) : J.Covers S f ↔ S.pullback f ∈ J Y

(J : CategoryTheory.GrothendieckTopology C)

J.Covers S f ↔ CategoryTheory.Sieve.pullback f S ∈ J.sieves Y


@[to_additive]
theorem mulIndicator_const_preimage_eq_union (U : Set α) (s : Set M) (a : M) [Decidable (a ∈ s)]
    [Decidable ((1 : M) ∈ s)] : (U.mulIndicator fun _ => a) ⁻¹' s =
      (if a ∈ s then U else ∅) ∪ if (1 : M) ∈ s then Uᶜ else ∅

{α : Type u_1}
{M : Type u_4}
[Zero M]
(U : Set α)
(s : Set M)
(a : M)
[Decidable (a ∈ s)]
[Decidable (0 ∈ s)]

(U.indicator fun x => a) ⁻¹' s = (if a ∈ s then U else ∅) ∪ if 0 ∈ s then Uᶜ else ∅


/-- The `Equiv` between spaces of matrices induced by an `Equiv` between their
coefficients. This is `Matrix.map` as an `Equiv`. -/
@[simps apply]
def mapMatrix (f : α ≃ β) : Matrix m n α ≃ Matrix m n β

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{β : Type w}
(f : α ≃ β)
(M : Matrix m n α)


theorem fromTypes_succ {n} (p : Fin (n + 1) → Type u) (τ : Type u) :
    FromTypes p τ = (vecHead p → FromTypes (vecTail p) τ)

{n : ℕ}
(p : Fin (n + 1) → Type u)
(τ : Type u)

Function.FromTypes p τ = (Matrix.vecHead p → Function.FromTypes (Matrix.vecTail p) τ)


@[simp]
lemma preNormEDS_four : preNormEDS b c d 4 = d


theorem strictAnti_iff {f : WithTop α → β} :
    StrictAnti f ↔ StrictAnti (fun a ↦ f a : α → β) ∧ ∀ x : α, f ⊤ < f x

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : WithTop α → β}

StrictAnti f ↔ (StrictAnti fun a => f ↑a) ∧ ∀ (x : α), f ⊤ < f ↑x


@[simp]
theorem quotientKerEquivOfRightInverse.Symm.apply {g : S → R} (hf : Function.RightInverse g f)
    (x : S) : (quotientKerEquivOfRightInverse hf).symm x = Ideal.Quotient.mk (ker f) (g x)

{R : Type u}
{S : Type v}
[CommRing R]
[Semiring S]
{f : R →+* S}
{g : S → R}
(hf : Function.RightInverse g ⇑f)
(x : S)

(RingHom.quotientKerEquivOfRightInverse hf).symm x = (Ideal.Quotient.mk (RingHom.ker f)) (g x)


/-- A point is in the affine span of a single point if and only if they are equal. -/
@[simp]
theorem mem_affineSpan_singleton : p₁ ∈ affineSpan k ({p₂} : Set P) ↔ p₁ = p₂

(k : Type u_1)
(V : Type u_2)
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{p₁ p₂ : P}


/-- Given three nonzero vectors, adding the angles between them in cyclic order, with the first
vector in each angle negated, results in π. If the vectors add to 0, this is a version of the
sum of the angles of a triangle. -/
@[simp]
theorem oangle_add_cyc3_neg_left {x y z : V} (hx : x ≠ 0) (hy : y ≠ 0) (hz : z ≠ 0) :
    o.oangle (-x) y + o.oangle (-y) z + o.oangle (-z) x = π

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

o.oangle (-x) y + o.oangle (-y) z + o.oangle (-z) x = ↑π


/-- Use quadratic reciproity to reduce to smaller `b`. -/
theorem jacobiSymNat.qr₁ (a b : ℕ) (r : ℤ) (ha : a % 4 = 1) (hb : b % 2 = 1)
    (hr : jacobiSymNat b a = r) : jacobiSymNat a b = r

(hr : Mathlib.Meta.NormNum.jacobiSymNat b a = r)

Mathlib.Meta.NormNum.jacobiSymNat a b = r


/-- Functional equation for the odd Hurwitz zeta function. -/
theorem completedHurwitzZetaOdd_one_sub (a : UnitAddCircle) (s : ℂ) :
    completedHurwitzZetaOdd a (1 - s) = completedSinZeta a s

HurwitzZeta.completedHurwitzZetaOdd a (1 - s) = HurwitzZeta.completedSinZeta a s


lemma inf'_Ici (a : α) : (Ici a).inf' nonempty_Ici id = a

{α : Type u_2}
[SemilatticeInf α]
[LocallyFiniteOrderTop α]
(a : α)


theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V)
    (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) :
    ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t

(s : (CategoryTheory.forget C).obj (F.obj (Opposite.op U)))

(t : (CategoryTheory.forget C).obj (F.obj (Opposite.op V)))

(h : (F.germ ⟨x, mU⟩) s = (F.germ ⟨x, mV⟩) t)

∃ W, ∃ (_ : x ∈ W), ∃ iU iV, (F.map iU.op) s = (F.map iV.op) t


/-- The product of a multiset of elements of a submonoid of a `CommMonoid` is an element of
the submonoid. -/
@[to_additive
      "The sum of a multiset of elements of an `AddSubmonoid` of an `AddCommMonoid`
      is an element of the `AddSubmonoid`. "]
theorem multiset_prod_mem {M} [CommMonoid M] {s : Set M} (hs : IsSubmonoid s) (m : Multiset M) :
    (∀ a ∈ m, a ∈ s) → m.prod ∈ s

{M : Type u_3}
[CommMonoid M]
{s : Set M}
(hs : IsSubmonoid s)
(m : Multiset M)


@[simp]
theorem midpoint_vsub_right (p₁ p₂ : P) : midpoint R p₁ p₂ -ᵥ p₂ = (⅟ 2 : R) • (p₁ -ᵥ p₂)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(p₁ p₂ : P)

midpoint R p₁ p₂ -ᵥ p₂ = ⅟2 • (p₁ -ᵥ p₂)


theorem succFn_le_of_lt (i j : ι) (hij : i < j) : succFn i ≤ j

{ι : Type u_1}
[LinearOrder ι]
(i j : ι)
(hij : i < j)


@[to_additive]
theorem mul_inv_le_iff_le_mul' : a * b⁻¹ ≤ c ↔ a ≤ b * c

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


theorem term_add_const {α} [AddCommMonoid α] (n x a k a') (h : a + k = a') :
    @term α _ n x a + k = term n x a'

{α : Type u_1}
[AddCommMonoid α]
(n : ℕ)
(x a k a' : α)
(h : a + k = a')

Mathlib.Tactic.Abel.term n x a + k = Mathlib.Tactic.Abel.term n x a'


/-- The type of compact sets of a topological space. -/
structure Compacts (α : Type*) [TopologicalSpace α] where
  /-- the carrier set, i.e. the points in this set -/
  carrier : Set α
  isCompact' : IsCompact carrier

{α : Type u_4}
[TopologicalSpace α]
(self : TopologicalSpace.Compacts α)


theorem abs_sub_lt_one_of_floor_eq_floor {α : Type*} [LinearOrderedCommRing α] [FloorRing α]
    {a b : α} (h : ⌊a⌋ = ⌊b⌋) : |a - b| < 1

{α : Type u_4}
[LinearOrderedCommRing α]
[FloorRing α]
{a b : α}
(h : ⌊a⌋ = ⌊b⌋)


theorem iSup_eq_iSup_subseq_of_antitone {ι₁ ι₂ α : Type*} [Preorder ι₂] [CompleteLattice α]
    {l : Filter ι₁} [l.NeBot] {f : ι₂ → α} {φ : ι₁ → ι₂} (hf : Antitone f)
    (hφ : Tendsto φ l atBot) : ⨆ i, f i = ⨆ i, f (φ i)

{ι₁ : Type u_3}
{ι₂ : Type u_4}
{α : Type u_5}
[Preorder ι₂]
[CompleteLattice α]
{l : Filter ι₁}
[l.NeBot]
{f : ι₂ → α}
{φ : ι₁ → ι₂}
(hf : Antitone f)
(hφ : Filter.Tendsto φ l Filter.atBot)


lemma map_addPolynomial (x y L : R) :
    (W.map f).toAffine.addPolynomial (f x) (f y) (f L) = (W.addPolynomial x y L).map f

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
{S : Type v}
[CommRing S]
(f : R →+* S)
(x y L : R)

(WeierstrassCurve.map W f).toAffine.addPolynomial (f x) (f y) (f L) = Polynomial.map f (W.addPolynomial x y L)


@[simp]
theorem dlookup_list_toFinmap (a : α) (s : List (Sigma β)) : lookup a s.toFinmap = s.dlookup a

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(s : List (Sigma β))

Finmap.lookup a s.toFinmap = List.dlookup a s


@[simp]
theorem asString_inj {l l' : List Char} : l.asString = l'.asString ↔ l = l'


/-- If G and H are naturally isomorphic functors, establish an equivalence of hom-sets. -/
@[simps]
def equivHomsetRightOfNatIso {G G' : D ⥤ C} (iso : G ≅ G') {X : C} {Y : D} :
    (X ⟶ G.obj Y) ≃ (X ⟶ G'.obj Y)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{G G' : CategoryTheory.Functor D C}
(iso : G ≅ G')
{X : C}
{Y : D}
(g : X ⟶ G'.obj Y)

(CategoryTheory.Adjunction.equivHomsetRightOfNatIso iso).symm g = CategoryTheory.CategoryStruct.comp g (iso.inv.app Y)


/-- `tail` and `init` commute. We state this lemma in a non-dependent setting, as otherwise it
would involve a cast to convince Lean that the two types are equal, making it harder to use. -/
theorem tail_init_eq_init_tail {β : Type*} (q : Fin (n + 2) → β) :
    tail (init q) = init (tail q)

{n : ℕ}
{β : Type u_1}
(q : Fin (n + 2) → β)

Fin.tail (Fin.init q) = Fin.init (Fin.tail q)


theorem indepSet_empty_right [IsProbabilityMeasure μ] (s : Set Ω) : IndepSet s ∅ μ

{Ω : Type u_1}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsProbabilityMeasure μ]
(s : Set Ω)


@[simp]
theorem npow_one (x : M) : x ^ 1 = x

{M : Type u_1}
[MulOneClass M]
[Pow M ℕ]
[NatPowAssoc M]
(x : M)


/-- `c.toOver` is a lift of `c` under the forgetful functor. -/
@[simps!]
def Cocone.mapCoconeToOver {F : J ⥤ C} (c : Cocone F) : (Over.forget c.pt).mapCocone c.toOver ≅ c

{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)

c.mapCoconeToOver.inv.hom = CategoryTheory.CategoryStruct.id c.pt


/-- Uniformizers are nonzero. -/
theorem valuation_uniformizer_ne_zero : Classical.choose (v.valuation_exists_uniformizer K) ≠ 0

(v : IsDedekindDomain.HeightOneSpectrum R)


@[simp]
theorem bernoulli'_four : bernoulli' 4 = -1 / 30


@[to_additive]
protected theorem zpow_mem {x : G} (hx : x ∈ K) : ∀ n : ℤ, x ^ n ∈ K

{G : Type u_1}
[AddGroup G]
(K : AddSubgroup G)
{x : G}
(hx : x ∈ K)
(n : ℤ)


@[simp]
theorem EuclideanSpace.edist_single_same (i : ι) (a b : 𝕜) :
    edist (EuclideanSpace.single i (a : 𝕜)) (EuclideanSpace.single i (b : 𝕜)) = edist a b

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
[DecidableEq ι]
[Fintype ι]
(i : ι)
(a b : 𝕜)

edist (EuclideanSpace.single i a) (EuclideanSpace.single i b) = edist a b


theorem IsUnit.isNilpotent_mul_unit_of_commute_iff [MonoidWithZero R] {r u : R}
    (hu : IsUnit u) (h_comm : Commute r u) :
    IsNilpotent (r * u) ↔ IsNilpotent r

{R : Type u_1}
[MonoidWithZero R]
{r u : R}
(hu : IsUnit u)
(h_comm : Commute r u)


/-- Functorially precompose a cocone for `F` by a natural transformation `G ⟶ F` to give a cocone
for `G`. -/
@[simps]
def precompose {G : J ⥤ C} (α : G ⟶ F) : Cocone F ⥤ Cocone G

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F G : J ⥤ C}
(α : G ⟶ F)
(c : CategoryTheory.Limits.Cocone F)

((CategoryTheory.Limits.Cocones.precompose α).obj c).pt = c.pt


/-- A function which is continuous on a separable set `s` is almost everywhere strongly measurable
with respect to `μ.restrict s`. -/
theorem ContinuousOn.aestronglyMeasurable_of_isSeparable [TopologicalSpace α]
    [PseudoMetrizableSpace α] [OpensMeasurableSpace α] [TopologicalSpace β]
    [PseudoMetrizableSpace β] {f : α → β} {s : Set α} {μ : Measure α} (hf : ContinuousOn f s)
    (hs : MeasurableSet s) (h's : TopologicalSpace.IsSeparable s) :
    AEStronglyMeasurable f (μ.restrict s)

MeasureTheory.AEStronglyMeasurable f (μ.restrict s)


/-- The natural equivalence `E × (F × G) ≃ (E × F) × G` is smooth.

Warning: see remarks attached to `contDiff_prodAssoc`
-/
theorem contDiff_prodAssoc_symm : ContDiff 𝕜 ⊤ <| (Equiv.prodAssoc E F G).symm

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]

ContDiff 𝕜 ⊤ ⇑(Equiv.prodAssoc E F G).symm


@[gcongr] theorem compl_subset_compl_of_subset (h : t ⊆ s) : sᶜ ⊆ tᶜ


/-- The uncurried form of a continuous map `X → C(Y, Z)` is a continuous map `X × Y → Z`. -/
theorem continuous_uncurry_of_continuous [LocallyCompactSpace Y] (f : C(X, C(Y, Z))) :
    Continuous (Function.uncurry fun x y => f x y)

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

Continuous (Function.uncurry fun x y => (f x) y)


/-- A scheme with vanishing diameter along each branch induces a continuous map. -/
theorem VanishingDiam.map_continuous [TopologicalSpace β] [DiscreteTopology β]
    (hA : VanishingDiam A) : Continuous (inducedMap A).2

{β : Type u_1}
{α : Type u_2}
{A : List β → Set α}
[PseudoMetricSpace α]
[TopologicalSpace β]
[DiscreteTopology β]
(hA : CantorScheme.VanishingDiam A)


/-- Making this a global instance would make the typeclass search go in an infinite loop. -/
theorem hasPullback_symmetry [HasPullback f g] : HasPullback g f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z : C}
(f : X ⟶ Z)
(g : Y ⟶ Z)
[CategoryTheory.Limits.HasPullback f g]


(S : CategoryTheory.ShortComplex.SnakeInput C)


theorem bernoulli_spec' (n : ℕ) :
    (∑ k ∈ antidiagonal n, ((k.1 + k.2).choose k.2 : ℚ) / (k.2 + 1) * bernoulli k.1) =
      if n = 0 then 1 else 0

∑ k ∈ Finset.antidiagonal n, ↑((k.1 + k.2).choose k.2) / (↑k.2 + 1) * bernoulli k.1 = if n = 0 then 1 else 0


theorem basisSets_iff {U : Set E} :
    U ∈ p.basisSets ↔ ∃ (i : Finset ι) (r : ℝ), 0 < r ∧ U = ball (i.sup p) 0 r

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : SeminormFamily 𝕜 E ι)
{U : Set E}

U ∈ p.basisSets ↔ ∃ i r, 0 < r ∧ U = (i.sup p).ball 0 r


theorem minimal_nonempty_closed_subsingleton [T0Space X] {s : Set X} (hs : IsClosed s)
    (hmin : ∀ t, t ⊆ s → t.Nonempty → IsClosed t → t = s) : s.Subsingleton

(hmin : ∀ t ⊆ s, t.Nonempty → IsClosed t → t = s)


theorem monomial_one_one_eq_X : monomial 1 (1 : R) = X

(Polynomial.monomial 1) 1 = Polynomial.X


theorem subtypeDomain_finsupp_sum [Zero N] {s : β →₀ N} {h : β → N → α →₀ M} :
    (s.sum h).subtypeDomain p = s.sum fun c d => (h c d).subtypeDomain p

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
{N : Type u_7}
[AddCommMonoid M]
{p : α → Prop}
[Zero N]
{s : β →₀ N}
{h : β → N → α →₀ M}

Finsupp.subtypeDomain p (s.sum h) = s.sum fun c d => Finsupp.subtypeDomain p (h c d)


theorem ContDiffWithinAt.congr_of_eventuallyEq (h : ContDiffWithinAt 𝕜 n f s x)
    (h₁ : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : ContDiffWithinAt 𝕜 n f₁ s x

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


theorem ContMDiffWithinAt.of_le (hf : ContMDiffWithinAt I I' n f s x) (le : m ≤ n) :
    ContMDiffWithinAt I I' m f s x

{𝕜 : 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]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{s : Set M}
{x : M}
{m n : ℕ∞}
(hf : ContMDiffWithinAt I I' n f s x)
(le : m ≤ n)


@[to_additive (attr := simp)]
theorem mul_div_cancel (a b : G) : a * (b / a) = b

{G : Type u_3}
[AddCommGroup G]
(a b : G)


theorem prod_ofPNatMultiset (v : Multiset ℕ+) (h) : ((ofPNatMultiset v h).prod : ℕ+) = v.prod

(v : Multiset ℕ+)
(h : ∀ p ∈ v, p.Prime)

(PrimeMultiset.ofPNatMultiset v h).prod = v.prod


theorem mem_coprod_iff {s : Set (α × β)} {f : Filter α} {g : Filter β} :
    s ∈ f.coprod g ↔ (∃ t₁ ∈ f, Prod.fst ⁻¹' t₁ ⊆ s) ∧ ∃ t₂ ∈ g, Prod.snd ⁻¹' t₂ ⊆ s

{α : Type u_1}
{β : Type u_2}
{s : Set (α × β)}
{f : Filter α}
{g : Filter β}


@[simp]
theorem mem_iSup_iff {f : ι → LowerSet α} : (a ∈ ⨆ i, f i) ↔ ∃ i, a ∈ f i

{α : Type u_1}
{ι : Sort u_4}
[LE α]
{a : α}
{f : ι → LowerSet α}


theorem measure_eq_extend (hs : MeasurableSet s) :
    μ s = extend (fun t (_ht : MeasurableSet t) => μ t) s

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

μ s = MeasureTheory.extend (fun t _ht => μ t) s


/-- The set of `x : Option α` such that `isSome x` is equivalent to `α`. -/
@[simps]
def optionIsSomeEquiv (α) : { x : Option α // x.isSome } ≃ α

↑((Equiv.optionIsSomeEquiv α).symm x) = some x


/-- A functor `F : A ⥤ B` preserves the sheafification for the Grothendieck
topology `J` on a category `C` if whenever a morphism of presheaves `f : P₁ ⟶ P₂`
in `Cᵒᵖ ⥤ A` is such that becomes an iso after sheafification, then it is
also the case of `whiskerRight f F : P₁ ⋙ F ⟶ P₂ ⋙ F`. -/
class PreservesSheafification : Prop where
  le : J.W ≤ J.W.inverseImage ((whiskeringRight Cᵒᵖ A B).obj F)

{J : CategoryTheory.GrothendieckTopology C}

J.W ≤ J.W.inverseImage ((CategoryTheory.whiskeringRight Cᵒᵖ A B).obj F)


@[simp]
theorem preimage_add_const_uIcc : (fun x => x + a) ⁻¹' [[b, c]] = [[b - a, c - a]]

{α : Type u_1}
[LinearOrderedAddCommGroup α]
(a b c : α)


/-- The identity based functor. -/
@[simps]
def id (𝒳 : BasedCategory.{v₂, u₂} 𝒮) : 𝒳 ⥤ᵇ 𝒳

{𝒮 : Type u₁}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
(𝒳 : CategoryTheory.BasedCategory 𝒮)

(CategoryTheory.BasedFunctor.id 𝒳).toFunctor = CategoryTheory.Functor.id 𝒳.obj


@[to_additive VAddAntidiagonal.eq_of_fst_le_fst_of_snd_le_snd]
theorem eq_of_fst_le_fst_of_snd_le_snd (h₁ : (x : G × P).1 ≤ (y : G × P).1)
    (h₂ : (x : G × P).2 ≤ (y : G × P).2) : x = y

{G : Type u_1}
{P : Type u_2}
{s : Set G}
{t : Set P}
{a : P}
[PartialOrder G]
[PartialOrder P]
[VAdd G P]
[IsOrderedCancelVAdd G P]
{x y : ↑(s.vaddAntidiagonal t a)}
(h₁ : (↑x).1 ≤ (↑y).1)
(h₂ : (↑x).2 ≤ (↑y).2)


theorem measure_biUnion_lt_top {s : Set β} {f : β → Set α} (hs : s.Finite)
    (hfin : ∀ i ∈ s, μ (f i) ≠ ∞) : μ (⋃ i ∈ s, f i) < ∞

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set β}
{f : β → Set α}
(hs : s.Finite)
(hfin : ∀ i ∈ s, μ (f i) ≠ ⊤)


@[simp]
theorem sign_toReal {θ : Angle} (h : θ ≠ π) : SignType.sign θ.toReal = θ.sign


theorem contDiffAt_log {n : ℕ∞} : ContDiffAt ℝ n log x ↔ x ≠ 0


lemma sUnion_union_diffFinset₀_of_subset (hC : IsSetSemiring C) (hs : s ∈ C)
    (hI : ↑I ⊆ C) (hI_ss : ∀ t ∈ I, t ⊆ s) [DecidableEq (Set α)] :
    ⋃₀ ↑(I ∪ hC.diffFinset₀ hs hI) = s

{α : Type u_1}
{C : Set (Set α)}
{s : Set α}
{I : Finset (Set α)}
(hC : MeasureTheory.IsSetSemiring C)
(hs : s ∈ C)
(hI : ↑I ⊆ C)
(hI_ss : ∀ t ∈ I, t ⊆ s)
[DecidableEq (Set α)]


theorem IsAntichain.maximals_lowerClosure [PartialOrder α] (hs : IsAntichain (· ≤ ·) s) :
    maximals (· ≤ ·) (lowerClosure s : Set α) = s

(hs : IsAntichain (fun x x_1 => x ≤ x_1) s)

maximals (fun x x_1 => x ≤ x_1) ↑(lowerClosure s) = s


@[simp] theorem not_cast {x : BitVec w} (h : w = w') : ~~~(cast h x) = cast h (~~~x)

{w w' : Nat}
{x : BitVec w}
(h : w = w')

~~~BitVec.cast h x = BitVec.cast h (~~~x)


theorem contains_eq_any_beq [BEq α] (l : List α) (a : α) : l.contains a = l.any (a == ·)

{α : Type u_1}
[BEq α]
(l : List α)
(a : α)


theorem Equiv.uniformEmbedding {α β : Type*} [UniformSpace α] [UniformSpace β] (f : α ≃ β)
    (h₁ : UniformContinuous f) (h₂ : UniformContinuous f.symm) : UniformEmbedding f

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[UniformSpace β]
(f : α ≃ β)
(h₁ : UniformContinuous ⇑f)
(h₂ : UniformContinuous ⇑f.symm)


@[simp]
theorem shiftFunctor_map_apply {β : Type*} [AddCommGroup β] (s : β)
    {X Y : GradedObjectWithShift s C} (f : X ⟶ Y) (t : β) (n : ℤ) :
    (shiftFunctor (GradedObjectWithShift s C) n).map f t = f (t + n • s)

{X Y : CategoryTheory.GradedObjectWithShift s C}

(CategoryTheory.shiftFunctor (CategoryTheory.GradedObjectWithShift s C) n).map f t = f (t + n • s)


/-- The span of a set of points in a projective space is equal to the infimum of the collection of
subspaces which contain the set. -/
theorem span_eq_sInf {S : Set (ℙ K V)} : span S = sInf { W : Subspace K V| S ⊆ W }

{K : Type u_1}
{V : Type u_2}
[Field K]
[AddCommGroup V]
[Module K V]
{S : Set (Projectivization K V)}

Projectivization.Subspace.span S = sInf {W | S ⊆ ↑W}


theorem log_mul (hx : x ≠ 0) (hy : y ≠ 0) : log (x * y) = log x + log y

Real.log (x * y) = Real.log x + Real.log y


lemma lt_one_iff_eq_zero : n < 1 ↔ n = 0


theorem iSup_plift_down (f : ι → α) : ⨆ i, f (PLift.down i) = ⨆ i, f i

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


/-- The category of `MonoOver α`, for `α : Type u`, is equivalent to the partial order `Set α`.
-/
@[simps]
noncomputable def Types.monoOverEquivalenceSet (α : Type u) : MonoOver α ≌ Set α

(α : Type u)
(f : CategoryTheory.MonoOver α)

(Types.monoOverEquivalenceSet α).functor.obj f = Set.range f.obj.hom


theorem isCoatom_iff (s : Set α) : IsCoatom s ↔ ∃ x, s = {x}ᶜ


/-- The triangle (polygon) inequality for sequences of points; `Finset.Ico` version. -/
theorem dist_le_Ico_sum_dist (f : ℕ → α) {m n} (h : m ≤ n) :
    dist (f m) (f n) ≤ ∑ i ∈ Finset.Ico m n, dist (f i) (f (i + 1))

{α : Type u}
[PseudoMetricSpace α]
(f : ℕ → α)
{m n : ℕ}
(h : m ≤ n)


/-- Let `c : Set (Set α)` be an open cover of a compact set `s`. Then there exists an entourage
`n` such that for each `x ∈ s` its `n`-neighborhood is contained in some `t ∈ c`. -/
theorem lebesgue_number_lemma_sUnion {S : Set (Set α)}
    (hK : IsCompact K) (hopen : ∀ s ∈ S, IsOpen s) (hcover : K ⊆ ⋃₀ S) :
    ∃ V ∈ 𝓤 α, ∀ x ∈ K, ∃ s ∈ S, ball x V ⊆ s

{α : Type ua}
[UniformSpace α]
{K : Set α}
{S : Set (Set α)}
(hK : IsCompact K)
(hopen : ∀ s ∈ S, IsOpen s)
(hcover : K ⊆ ⋃₀ S)

∃ V ∈ 𝓤 α, ∀ x ∈ K, ∃ s ∈ S, UniformSpace.ball x V ⊆ s


/-- A weighted sum of pairwise subtractions, expressed as a subtraction of two `weightedVSub`
expressions. -/
theorem sum_smul_vsub_eq_weightedVSub_sub (w : ι → k) (p₁ p₂ : ι → P) :
    (∑ i ∈ s, w i • (p₁ i -ᵥ p₂ i)) = s.weightedVSub p₁ w - s.weightedVSub p₂ w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(w : ι → k)
(p₁ p₂ : ι → P)

∑ i ∈ s, w i • (p₁ i -ᵥ p₂ i) = (s.weightedVSub p₁) w - (s.weightedVSub p₂) w


theorem bisim' {α : Type*} (Q : α → Prop) (u v : α → M P)
    (h : ∀ x, Q x → ∃ a f f',
          M.dest (u x) = ⟨a, f⟩
          ∧ M.dest (v x) = ⟨a, f'⟩
          ∧ ∀ i, ∃ x', Q x' ∧ f i = u x' ∧ f' i = v x'
      ) :
    ∀ x, Q x → u x = v x

(h :
  ∀ (x : α),
    Q x → ∃ a f f', (u x).dest = ⟨a, f⟩ ∧ (v x).dest = ⟨a, f'⟩ ∧ ∀ (i : P.B a), ∃ x', Q x' ∧ f i = u x' ∧ f' i = v x')


@[simp]
theorem zero_prod (ν : Measure β) : (0 : Measure α).prod ν = 0

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
(ν : MeasureTheory.Measure β)


theorem lt_logb_iff_rpow_lt_of_base_lt_one (hy : 0 < y) : x < logb b y ↔ y < b ^ x


theorem ofModuleMonoidAlgebra_obj_ρ (M : ModuleCat.{u} (MonoidAlgebra k G)) :
    (ofModuleMonoidAlgebra.obj M).ρ = Representation.ofModule M

{k G : Type u}
[CommRing k]
[Monoid G]
(M : ModuleCat (MonoidAlgebra k G))

(Rep.ofModuleMonoidAlgebra.obj M).ρ = Representation.ofModule ↑M


/-- Generalization of Rayleigh's theorem on Beatty sequences. Let `r` be a real number greater
than 1, and `1/r + 1/s = 1`. Then the complement of `B_r` is `B'_s`. -/
theorem compl_beattySeq {r s : ℝ} (hrs : r.IsConjExponent s) :
    {beattySeq r k | k}ᶜ = {beattySeq' s k | k}

{x | ∃ k, beattySeq r k = x}ᶜ = {x | ∃ k, beattySeq' s k = x}


@[to_additive]
theorem mul_div (a b c : G) : a * (b / c) = a * b / c

{G : Type u_3}
[SubNegMonoid G]
(a b c : G)


theorem iInf_pow_smul (h : IsHausdorff I M) : (⨅ n : ℕ, I ^ n • ⊤ : Submodule R M) = ⊥

{R : Type u_1}
[CommRing R]
{I : Ideal R}
{M : Type u_2}
[AddCommGroup M]
[Module R M]
(h : IsHausdorff I M)


@[ext]
theorem ext {f g : α →ₛ β} (H : ∀ a, f a = g a) : f = g

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{f g : MeasureTheory.SimpleFunc α β}
(H : ∀ (a : α), ↑f a = ↑g a)


/-- **Optional Sampling theorem**. If `τ` is a bounded stopping time and `σ` is another stopping
time, then the value of a martingale `f` at the stopping time `min τ σ` is almost everywhere equal
to the conditional expectation of `f` stopped at `τ` with respect to the σ-algebra generated
by `σ`. -/
theorem stoppedValue_min_ae_eq_condexp [SigmaFiniteFiltration μ ℱ] (h : Martingale f ℱ μ)
    (hτ : IsStoppingTime ℱ τ) (hσ : IsStoppingTime ℱ σ) {n : ι} (hτ_le : ∀ x, τ x ≤ n)
    [h_sf_min : SigmaFinite (μ.trim (hτ.min hσ).measurableSpace_le)] :
    (stoppedValue f fun x => min (σ x) (τ x)) =ᵐ[μ] μ[stoppedValue f τ|hσ.measurableSpace]

{τ σ : Ω → ι}

[h_sf_min : MeasureTheory.SigmaFinite (μ.trim ⋯)]

(MeasureTheory.stoppedValue f fun x => min (σ x) (τ x)) =ᵐ[μ] μ[MeasureTheory.stoppedValue f τ|hσ.measurableSpace]


/-- the equivalence given by multiplication on the left by `t`  -/
@[simps]
noncomputable def unitsSMulEquiv : NormalWord d ≃ NormalWord d

{d : HNNExtension.NormalWord.TransversalPair G A B}

(HNNExtension.NormalWord.unitsSMulEquiv φ) w = HNNExtension.NormalWord.unitsSMul φ 1 w


/-- If `A` is a row strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_row_lt_diag (h : ∀ k, ∑ j ∈ Finset.univ.erase k, ‖A k j‖ < ‖A k k‖) :
    A.det ≠ 0

(h : ∀ (k : n), ∑ j ∈ Finset.univ.erase k, ‖A k j‖ < ‖A k k‖)


theorem HasEigenvector.pow_apply {f : End R M} {μ : R} {v : M} (hv : f.HasEigenvector μ v) (n : ℕ) :
    (f ^ n) v = μ ^ n • v

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f : Module.End R M}
{μ : R}
{v : M}
(hv : f.HasEigenvector μ v)
(n : ℕ)


@[simp]
theorem eval₂_monomial {n : ℕ} {r : R} : (monomial n r).eval₂ f x = f r * x ^ n

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(f : R →+* S)
(x : S)
{n : ℕ}
{r : R}

Polynomial.eval₂ f x ((Polynomial.monomial n) r) = f r * x ^ n


theorem le_tsub_iff_left (h : a ≤ c) : b ≤ c - a ↔ a + b ≤ c

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

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


theorem le_iSup₂ {f : ∀ i, κ i → α} (i : ι) (j : κ i) : f i j ≤ ⨆ (i) (j), f i j

{α : Type u_1}
{ι : Sort u_5}
{κ : ι → Sort u_7}
[CompleteLattice α]
{f : (i : ι) → κ i → α}
(i : ι)
(j : κ i)


@[to_additive (attr := elab_as_elim)]
theorem induction_on {p : Localization S → Prop} (x) (H : ∀ y : M × S, p (mk y.1 y.2)) : p x

(H : ∀ (y : M × ↥S), p (Localization.mk y.1 y.2))


@[to_additive]
lemma prod_mulIndicator_eq_prod_inter [DecidableEq ι] (s t : Finset ι) (f : ι → β) :
    ∏ i ∈ s, (t : Set ι).mulIndicator f i = ∏ i ∈ s ∩ t, f i

{ι : Type u_1}
{β : Type u_4}
[AddCommMonoid β]
[DecidableEq ι]
(s t : Finset ι)
(f : ι → β)

∑ i ∈ s, (↑t).indicator f i = ∑ i ∈ s ∩ t, f i


lemma neg_llr [SigmaFinite μ] [SigmaFinite ν] (hμν : μ ≪ ν) :
    - llr μ ν =ᵐ[μ] llr ν μ

{α : Type u_1}
{mα : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite μ]
[MeasureTheory.SigmaFinite ν]
(hμν : μ.AbsolutelyContinuous ν)

-MeasureTheory.llr μ ν =ᵐ[μ] MeasureTheory.llr ν μ


lemma map_leftHomologyMap' : F.map (ShortComplex.leftHomologyMap' φ hl₁ hl₂) =
    ShortComplex.leftHomologyMap' (F.mapShortComplex.map φ) (hl₁.map F) (hl₂.map F)

F.map (CategoryTheory.ShortComplex.leftHomologyMap' φ hl₁ hl₂) =
  CategoryTheory.ShortComplex.leftHomologyMap' (F.mapShortComplex.map φ) (hl₁.map F) (hl₂.map F)


/--
This is a variant of `GlueData` that only requires conditions on `V (i, j)` when `i ≠ j`.
See `GlueData.ofGlueData'`
-/
structure GlueData' where
  /-- Indexing type of a glue data. -/
  J : Type v
  /-- Objects of a glue data to be glued. -/
  U : J → C
  /-- Objects representing the intersections. -/
  V : ∀ (i j : J), i ≠ j → C
  /-- The inclusion maps of the intersection into the object. -/
  f : ∀ i j h, V i j h ⟶ U i
  f_mono : ∀ i j h, Mono (f i j h) := by infer_instance
  f_hasPullback : ∀ i j k hij hik, HasPullback (f i j hij) (f i k hik) := by infer_instance
  /-- The transition maps between the intersections. -/
  t : ∀ i j h, V i j h ⟶ V j i h.symm
  /-- The transition maps between the intersection of intersections. -/
  t' : ∀ i j k hij hik hjk,
    pullback (f i j hij) (f i k hik) ⟶ pullback (f j k hjk) (f j i hij.symm)
  t_fac : ∀ i j k hij hik hjk, t' i j k hij hik hjk ≫ pullback.snd _ _ =
    pullback.fst _ _ ≫ t i j hij
  t_inv : ∀ i j hij, t i j hij ≫ t j i hij.symm = 𝟙 _
  cocycle : ∀ i j k hij hik hjk, t' i j k hij hik hjk ≫
    t' j k i hjk hij.symm hik.symm ≫ t' k i j hik.symm hjk.symm hij = 𝟙 _

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
(self : CategoryTheory.GlueData' C)
(i j k : self.J)
(hij : i ≠ j)
(hik : i ≠ k)

CategoryTheory.Limits.HasPullback (self.f i j hij) (self.f i k hik)


@[to_additive]
lemma HasProd.tprod_fiberwise [T2Space α] {f : β → α} {a : α} (hf : HasProd f a) (g : β → γ) :
    HasProd (fun c : γ ↦ ∏' b : g ⁻¹' {c}, f b) a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommGroup α]
[UniformSpace α]
[UniformGroup α]
[CompleteSpace α]
[T2Space α]
{f : β → α}
{a : α}
(hf : HasProd f a)
(g : β → γ)

HasProd (fun c => ∏' (b : ↑(g ⁻¹' {c})), f ↑b) a


theorem balancedHull.balanced (s : Set E) : Balanced 𝕜 (balancedHull 𝕜 s)

{𝕜 : Type u_1}
{E : Type u_2}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(s : Set E)


/-- The `p`-adic valuation of `(p * n)!` is `n` more than that of `n!`. -/
theorem padicValNat_factorial_mul (n : ℕ) [hp : Fact p.Prime] :
    padicValNat p (p * n) ! = padicValNat p n ! + n

{p : ℕ}
(n : ℕ)
[hp : Fact (Nat.Prime p)]

padicValNat p (p * n)! = padicValNat p n ! + n


theorem exists_of_set' {l : List α} (h : n < l.length) :
    ∃ l₁ l₂, l = l₁ ++ l[n] :: l₂ ∧ l₁.length = n ∧ l.set n a' = l₁ ++ a' :: l₂

{α : Type u_1}
{n : Nat}
{a' : α}
{l : List α}
(h : n < l.length)


@[to_additive]
theorem relindex_dvd_of_le_left (hHK : H ≤ K) : K.relindex L ∣ H.relindex L

{G : Type u_1}
[Group G]
{H K : Subgroup G}
(L : Subgroup G)
(hHK : H ≤ K)


theorem FG.sup {N₁ N₂ : Submodule R M} (hN₁ : N₁.FG) (hN₂ : N₂.FG) : (N₁ ⊔ N₂).FG

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{N₁ N₂ : Submodule R M}
(hN₁ : N₁.FG)
(hN₂ : N₂.FG)


theorem Convex.uniformContinuous_gauge (hc : Convex ℝ s) (h₀ : s ∈ 𝓝 (0 : E)) :
    UniformContinuous (gauge s)

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{s : Set E}
(hc : Convex ℝ s)
(h₀ : s ∈ 𝓝 0)


/-- If a function to a `T1Space` tends to some limit `y` at some point `x`, then necessarily
`y = f x`. -/
theorem eq_of_tendsto_nhds [TopologicalSpace Y] [T1Space Y] {f : X → Y} {x : X} {y : Y}
    (h : Tendsto f (𝓝 x) (𝓝 y)) : f x = y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T1Space Y]
{f : X → Y}
{x : X}
{y : Y}
(h : Filter.Tendsto f (𝓝 x) (𝓝 y))


theorem degrees_rename_of_injective {p : MvPolynomial σ R} {f : σ → τ} (h : Function.Injective f) :
    degrees (rename f p) = (degrees p).map f

{R : Type u}
{σ : Type u_1}
{τ : Type u_2}
[CommSemiring R]
{p : MvPolynomial σ R}
{f : σ → τ}
(h : Function.Injective f)

((MvPolynomial.rename f) p).degrees = Multiset.map f p.degrees