theorem mem_ball_self (h : 0 < ε) : x ∈ ball x ε

{α : Type u}
[PseudoMetricSpace α]
{x : α}
{ε : ℝ}
(h : 0 < ε)


theorem HasStrictDerivAt.comp_of_eq
    (hh₂ : HasStrictDerivAt h₂ h₂' y) (hh : HasStrictDerivAt h h' x) (hy : y = h x) :
    HasStrictDerivAt (h₂ ∘ h) (h₂' * h') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{h : 𝕜 → 𝕜'}
{h₂ : 𝕜' → 𝕜'}
{h' h₂' y : 𝕜'}
(hh₂ : HasStrictDerivAt h₂ h₂' y)
(hh : HasStrictDerivAt h h' x)
(hy : y = h x)


/-- A Cauchy sequence in a complete space converges -/
theorem cauchySeq_tendsto_of_complete [Preorder β] [CompleteSpace α] {u : β → α}
    (H : CauchySeq u) : ∃ x, Tendsto u atTop (𝓝 x)

{α : Type u}
{β : Type v}
[uniformSpace : UniformSpace α]
[Preorder β]
[CompleteSpace α]
{u : β → α}
(H : CauchySeq u)

∃ x, Filter.Tendsto u Filter.atTop (𝓝 x)


/-- Two sets are at zero Hausdorff distance if and only if they have the same closures. -/
theorem hausdorffDist_zero_iff_closure_eq_closure (fin : hausdorffEdist s t ≠ ⊤) :
    hausdorffDist s t = 0 ↔ closure s = closure t

{α : Type u}
[PseudoMetricSpace α]
{s t : Set α}
(fin : EMetric.hausdorffEdist s t ≠ ⊤)

Metric.hausdorffDist s t = 0 ↔ closure s = closure t


@[to_additive (attr := simp, norm_cast)]
theorem toSubgroup_top : ((⊤ : OpenSubgroup G) : Subgroup G) = ⊤

{G : Type u_1}
[Group G]
[TopologicalSpace G]


@[to_additive]
lemma ofUnits_strictMono : StrictMono (ofUnits (M := M))


@[to_additive (attr := norm_cast)]
theorem coe_mk (x : G) (hx : x ∈ H) : ((⟨x, hx⟩ : H) : G) = x

{G : Type u_1}
[Group G]
(H : Subgroup G)
(x : G)
(hx : x ∈ H)


@[simp] nonrec theorem sub_im : (a - b).im = a.im - b.im

{R : Type u_3}
[CommRing R]
(a b : ℍ[R])


theorem tr_reaches_rev {σ₁ σ₂ f₁ f₂} {tr : σ₁ → σ₂ → Prop} (H : Respects f₁ f₂ tr) {a₁ a₂}
    (aa : tr a₁ a₂) {b₂} (ab : Reaches f₂ a₂ b₂) :
    ∃ c₁ c₂, Reaches f₂ b₂ c₂ ∧ tr c₁ c₂ ∧ Reaches f₁ a₁ c₁

{σ₁ : Type u_1}
{σ₂ : Type u_2}
{f₁ : σ₁ → Option σ₁}
{f₂ : σ₂ → Option σ₂}
{tr : σ₁ → σ₂ → Prop}
(H : Turing.Respects f₁ f₂ tr)
{a₁ : σ₁}
{a₂ : σ₂}
(aa : tr a₁ a₂)
{b₂ : σ₂}
(ab : Turing.Reaches f₂ a₂ b₂)

∃ c₁ c₂, Turing.Reaches f₂ b₂ c₂ ∧ tr c₁ c₂ ∧ Turing.Reaches f₁ a₁ c₁


/-- We say that the action of `M` on `α` has `MeasurableSMul` if for each `c` the map `x ↦ c • x`
is a measurable function and for each `x` the map `c ↦ c • x` is a measurable function. -/
@[to_additive]
class MeasurableSMul (M α : Type*) [SMul M α] [MeasurableSpace M] [MeasurableSpace α] :
    Prop where
  measurable_const_smul : ∀ c : M, Measurable (c • · : α → α)
  measurable_smul_const : ∀ x : α, Measurable (· • x : M → α)

{M : Type u_2}
{α : Type u_3}
[SMul M α]
[MeasurableSpace M]
[MeasurableSpace α]
[self : MeasurableSMul M α]
(x : α)


@[simp]
theorem associator_inv_hom (X Y Z : Mon_ C) : (α_ X Y Z).inv.hom = (α_ X.X Y.X Z.X).inv

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
(X Y Z : Mon_ C)


/-- If `H` is a subgroup of `G` of cardinality `p ^ n`,
  then `H` is contained in a subgroup of cardinality `p ^ (n + 1)`
  if `p ^ (n + 1)` divides the cardinality of `G` -/
theorem exists_subgroup_card_pow_succ [Finite G] {p : ℕ} {n : ℕ} [hp : Fact p.Prime]
    (hdvd : p ^ (n + 1) ∣ Nat.card G) {H : Subgroup G} (hH : Nat.card H = p ^ n) :
    ∃ K : Subgroup G, Nat.card K = p ^ (n + 1) ∧ H ≤ K

{G : Type u}
[Group G]
[Finite G]
{p n : ℕ}
[hp : Fact (Nat.Prime p)]
(hdvd : p ^ (n + 1) ∣ Nat.card G)
{H : Subgroup G}
(hH : Nat.card ↥H = p ^ n)


@[simp]
theorem valuation_zero : valuation (0 : ℚ_[p]) = 0


/-- A decidable proposition is intuitionistically Heyting-regular. -/
-- Porting note: removed @[nolint decidable_classical]
theorem isRegular_of_decidable (p : Prop) [Decidable p] : IsRegular p


@[to_additive Summable.of_nat_of_neg_add_one]
lemma Multipliable.of_nat_of_neg_add_one {f : ℤ → M}
    (hf₁ : Multipliable fun n : ℕ ↦ f n)  (hf₂ : Multipliable fun n : ℕ ↦ f (-(n + 1))) :
    Multipliable f

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
[ContinuousAdd M]
{f : ℤ → M}
(hf₁ : Summable fun n => f ↑n)
(hf₂ : Summable fun n => f (-(↑n + 1)))


@[simp]
theorem coe_unitGroupMulEquiv_apply (a : A.unitGroup) :
    ((A.unitGroupMulEquiv a : A) : K) = ((a : Kˣ) : K)

{K : Type u}
[Field K]
(A : ValuationSubring K)
(a : ↥A.unitGroup)


theorem isPowerOfTwo_nextPowerOfTwo (n : Nat) : n.nextPowerOfTwo.isPowerOfTwo

(n power : Nat)
(h₁ : power > 0)
(h₂ : power.isPowerOfTwo)

(Nat.nextPowerOfTwo.go n power h₁).isPowerOfTwo


@[simp] lemma comap_top (f : LatticeHom α β) : (⊤ : Sublattice β).comap f = ⊤

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


theorem Base.base_of_basis_superset (hB : M.Base B) (hBX : B ⊆ X) (hIX : M.Basis I X) :
    M.Base I

{α : Type u_1}
{M : Matroid α}
{B I X : Set α}
(hB : M.Base B)
(hBX : B ⊆ X)
(hIX : M.Basis I X)


protected theorem Decidable.not_forall {p : α → Prop} [Decidable (∃ x, ¬p x)]
    [∀ x, Decidable (p x)] : (¬∀ x, p x) ↔ ∃ x, ¬p x

{α : Sort u_1}
{p : α → Prop}
[Decidable (∃ x, ¬p x)]
[(x : α) → Decidable (p x)]


@[to_additive add_const]
theorem StrictAntiOn.mul_const' (hf : StrictAntiOn f s) (c : α) :
    StrictAntiOn (fun x => f x * c) s

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


@[simp]
theorem coe_addMonoidHom_id : (NonUnitalRingHom.id α : α →+ α) = AddMonoidHom.id α

{α : Type u_2}
[NonUnitalNonAssocSemiring α]

↑(NonUnitalRingHom.id α) = AddMonoidHom.id α


@[to_additive]
theorem not_step_singleton : ∀ {p : α × Bool}, ¬Step [p] L

{α : Type u}
{L : List (α × Bool)}
{p : α × Bool}


@[to_additive (attr := simp)]
theorem alternatingProd_nil : alternatingProd ([] : List α) = 1


theorem coe_eq_toEquiv (h : α ≃ᵢ β) (a : α) : h a = h.toEquiv a

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


theorem union_congr_right (hs : s ⊆ t ∪ u) (ht : t ⊆ s ∪ u) : s ∪ u = t ∪ u

{α : Type u}
{s t u : Set α}
(hs : s ⊆ t ∪ u)
(ht : t ⊆ s ∪ u)


theorem IsNClique.mono (h : G ≤ H) : G.IsNClique n s → H.IsNClique n s

{α : Type u_1}
{G H : SimpleGraph α}
{n : ℕ}
{s : Finset α}
(h : G ≤ H)


@[to_additive (attr := simp)]
theorem const_one [One β] : const α (1 : β) = 1

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[One β]


@[to_additive nsmul_zero, simp] lemma one_pow : ∀ n, (1 : M) ^ n = 1


/-- The domain of a final functor is connected if and only if its codomain is connected. -/
theorem isConnected_iff_of_final (F : C ⥤ D) [CategoryTheory.Functor.Final F] :
    IsConnected C ↔ IsConnected D

{C : Type u}
{D : Type u₂}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
[F.Final]

CategoryTheory.IsConnected C ↔ CategoryTheory.IsConnected D


theorem map_traverse (x : t α) : map f <$> traverse g x = traverse (map f ∘ g) x

{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
{F : Type u → Type u}
[Applicative F]
[LawfulApplicative F]
{α β γ : Type u}
(g : α → F β)
(f : β → γ)
(x : t α)

Functor.map f <$> traverse g x = traverse (Functor.map f ∘ g) x


/-- Each element of the monoid defines a monoid homomorphism. -/
@[simps]
def MulDistribMulAction.toMonoidEnd :
    M →* Monoid.End A

(M : Type u_1)
(A : Type u_4)
[Monoid M]
[Monoid A]
[MulDistribMulAction M A]
(r : M)

(MulDistribMulAction.toMonoidEnd M A) r = MulDistribMulAction.toMonoidHom A r


@[to_additive (attr := simp)]
theorem div_get_eq [Div α] (a b : Part α) (hab : Dom (a / b)) :
    (a / b).get hab = a.get (left_dom_of_div_dom hab) / b.get (right_dom_of_div_dom hab)

{α : Type u_1}
[Div α]
(a b : Part α)
(hab : (a / b).Dom)


lemma UniformConvexOn.add (hf : UniformConvexOn s φ f) (hg : UniformConvexOn s ψ g) :
    UniformConvexOn s (φ + ψ) (f + g)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{φ ψ : ℝ → ℝ}
{s : Set E}
{f g : E → ℝ}
(hf : UniformConvexOn s φ f)
(hg : UniformConvexOn s ψ g)


theorem StableUnderBaseChange.op {P : MorphismProperty C} (hP : StableUnderBaseChange P) :
    StableUnderCobaseChange P.op

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P : CategoryTheory.MorphismProperty C}
(hP : P.StableUnderBaseChange)


theorem map_dvd_map [Ring S] (f : R →+* S) (hf : Function.Injective f) {x y : R[X]}
    (hx : x.Monic) : x.map f ∣ y.map f ↔ x ∣ y

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(f : R →+* S)
(hf : Function.Injective ⇑f)
{x y : R[X]}
(hx : x.Monic)

Polynomial.map f x ∣ Polynomial.map f y ↔ x ∣ y


lemma ball_prod_same (x : α) (y : β) (r : ℝ) : ball x r ×ˢ ball y r = ball (x, y) r

{α : Type u_1}
{β : Type u_2}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
(x : α)
(y : β)
(r : ℝ)

Metric.ball x r ×ˢ Metric.ball y r = Metric.ball (x, y) r


protected theorem mul_assoc (x y z : A ⊗[R] B) : mul (mul x y) z = mul x (mul y z)

{R : Type uR}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
[NonUnitalSemiring B]
[Module R B]
[SMulCommClass R B B]
[IsScalarTower R B B]
(x y z : A ⊗[R] B)

(Algebra.TensorProduct.mul ((Algebra.TensorProduct.mul x) y)) z =
  (Algebra.TensorProduct.mul x) ((Algebra.TensorProduct.mul y) z)


/-- `Equiv.mulRight` as an `OrderIso`. See also `OrderEmbedding.mulRight`. -/
@[to_additive (attr := simps! (config := { simpRhs := true }) toEquiv apply)
  "`Equiv.addRight` as an `OrderIso`. See also `OrderEmbedding.addRight`."]
def OrderIso.mulRight (a : α) : α ≃o α

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


lemma CstarRing.nnnorm_mem_spectrum_of_nonneg [Nontrivial A] {a : A} (ha : 0 ≤ a := by cfc_tac) :
    ‖a‖₊ ∈ spectrum ℝ≥0 a

{A : Type u_1}
[NormedRing A]
[StarRing A]
[CstarRing A]
[CompleteSpace A]
[NormedAlgebra ℂ A]
[StarModule ℂ A]
[PartialOrder A]
[StarOrderedRing A]
[Nontrivial A]
{a : A}
(ha : 0 ≤ a := by cfc_tac)


/-- The function `x ^ s * exp (-b * x)` tends to `0` at `+∞`, for any real `s` and `b > 0`. -/
theorem tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero (s : ℝ) (b : ℝ) (hb : 0 < b) :
    Tendsto (fun x : ℝ => x ^ s * exp (-b * x)) atTop (𝓝 0)

Filter.Tendsto (fun x => x ^ s * rexp (-b * x)) Filter.atTop (𝓝 0)


theorem isGLB_le_isLUB (ha : IsGLB s a) (hb : IsLUB s b) (hs : s.Nonempty) : a ≤ b

{α : Type u}
[Preorder α]
{s : Set α}
{a b : α}
(ha : IsGLB s a)
(hb : IsLUB s b)
(hs : s.Nonempty)


/-- Every functor out of the walking pair is naturally isomorphic (actually, equal) to a `pair` -/
@[simps!]
def diagramIsoPair (F : Discrete WalkingPair ⥤ C) :
    F ≅ pair (F.obj ⟨WalkingPair.left⟩) (F.obj ⟨WalkingPair.right⟩)

(F : CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair ⥤ C)

(X : CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair)

(CategoryTheory.Limits.diagramIsoPair F).inv.app X =
  (CategoryTheory.Limits.WalkingPair.rec
      (CategoryTheory.Iso.refl (F.obj { as := CategoryTheory.Limits.WalkingPair.left }))
      (CategoryTheory.Iso.refl (F.obj { as := CategoryTheory.Limits.WalkingPair.right })) X.as).inv


theorem coev_app_comp_pre_app (f : B ⟶ A) [Exponentiable B] :
    (exp.coev A).app X ≫ (pre f).app (A ⨯ X) =
      (exp.coev B).app X ≫ (exp B).map (Limits.prod.map f (𝟙 _))

CategoryTheory.CategoryStruct.comp ((CategoryTheory.exp.coev A).app X) ((CategoryTheory.pre f).app (A ⨯ X)) =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.exp.coev B).app X)
    ((CategoryTheory.exp B).map (CategoryTheory.Limits.prod.map f (CategoryTheory.CategoryStruct.id X)))


@[to_additive (attr := simp)]
theorem MonoidHom.finsupp_prod_apply [Zero β] [Monoid N] [CommMonoid P] (f : α →₀ β)
    (g : α → β → N →* P) (x : N) : f.prod g x = f.prod fun i fi => g i fi x

{α : Type u_1}
{β : Type u_7}
{N : Type u_10}
{P : Type u_11}
[Zero β]
[AddMonoid N]
[AddCommMonoid P]
(f : α →₀ β)
(g : α → β → N →+ P)
(x : N)

(f.sum g) x = f.sum fun i fi => (g i fi) x


theorem nndist_le (hf : LipschitzWith K f) (x y : α) : nndist (f x) (f y) ≤ K * nndist x y

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : LipschitzWith K f)
(x y : α)


protected lemma GrowsPolynomially.add {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) (hf' : 0 ≤ᶠ[atTop] f) (hg' : 0 ≤ᶠ[atTop] g) :
    GrowsPolynomially fun x => f x + g x

(hf : AkraBazziRecurrence.GrowsPolynomially f)

(hg : AkraBazziRecurrence.GrowsPolynomially g)

AkraBazziRecurrence.GrowsPolynomially fun x => f x + g x


@[trans]
theorem EventuallyLE.trans (H₁ : f ≤ᶠ[l] g) (H₂ : g ≤ᶠ[l] h) : f ≤ᶠ[l] h

{α : Type u}
{β : Type v}
[Preorder β]
{l : Filter α}
{f g h : α → β}
(H₁ : f ≤ᶠ[l] g)
(H₂ : g ≤ᶠ[l] h)


@[norm_cast] lemma coe_pow (f : Perm α) (n : ℕ) : ⇑(f ^ n) = f^[n]


theorem cos_arctan_pos (x : ℝ) : 0 < cos (arctan x)


theorem exp_multiset_sum (s : Multiset ℝ) : exp s.sum = (s.map exp).prod

Real.exp s.sum = (Multiset.map Real.exp s).prod


@[simp]
theorem fundamentalDomain_reindex {ι' : Type*} (e : ι ≃ ι') :
    fundamentalDomain (b.reindex e) = fundamentalDomain b

{E : Type u_1}
{ι : Type u_2}
{K : Type u_3}
[NormedLinearOrderedField K]
[NormedAddCommGroup E]
[NormedSpace K E]
(b : Basis ι K E)
{ι' : Type u_4}
(e : ι ≃ ι')

Zspan.fundamentalDomain (b.reindex e) = Zspan.fundamentalDomain b


@[to_additive]
theorem prod_lt_one (h : ∀ i ∈ s, f i < 1) (hs : s.Nonempty) : ∏ i ∈ s, f i < 1

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelCommMonoid M]
{f : ι → M}
{s : Finset ι}
(h : ∀ i ∈ s, f i < 1)
(hs : s.Nonempty)


theorem limsup_add_le [CountableInterFilter f] (u v : α → ℝ≥0∞) :
    f.limsup (u + v) ≤ f.limsup u + f.limsup v

{α : Type u_1}
{f : Filter α}
[CountableInterFilter f]
(u v : α → ℝ≥0∞)

Filter.limsup (u + v) f ≤ Filter.limsup u f + Filter.limsup v f


theorem IsOpen.uniqueMDiffOn (hs : IsOpen s) : UniqueMDiffOn I s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(hs : IsOpen s)


/--
Given a natural isomorphism `G ⋙ ℱ ≅ G ⋙ ℱ'` between presheaves of types,
where `G` is locally-full and cover-dense, and `ℱ, ℱ'` are sheaves,
we may obtain a natural isomorphism between sheaves.
-/
@[simps]
noncomputable def sheafIso {ℱ ℱ' : SheafOfTypes.{v} K} (i : G.op ⋙ ℱ.val ≅ G.op ⋙ ℱ'.val) :
    ℱ ≅ ℱ'

{K : CategoryTheory.GrothendieckTopology D}

(i : G.op.comp ℱ.val ≅ G.op.comp ℱ'.val)

(CategoryTheory.Functor.IsCoverDense.Types.sheafIso i).inv.val =
  (CategoryTheory.Functor.IsCoverDense.Types.presheafIso i).inv


@[simp]
theorem card_pair_eq_one_or_two : ({a,b} : Finset α).card = 1 ∨ ({a,b} : Finset α).card = 2

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


/-- If `k.right` is a monomorphism, then `k` is a monomorphism. In other words, `Under.forget X`
reflects epimorphisms.
The converse does not hold without additional assumptions on the underlying category, see
`CategoryTheory.Under.mono_right_of_mono`.
-/
theorem mono_of_mono_right {f g : Under X} (k : f ⟶ g) [hk : Mono k.right] : Mono k

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
{f g : CategoryTheory.Under X}
(k : f ⟶ g)
[hk : CategoryTheory.Mono k.right]


theorem _root_.integral_cexp_quadratic (hb : b.re < 0) (c d : ℂ) :
    ∫ x : ℝ, cexp (b * x ^ 2 + c * x + d) = (π / -b) ^ (1 / 2 : ℂ) * cexp (d - c^2 / (4 * b))


lemma specializingMap_iff_isClosed_image_closure_singleton (hf : Continuous f) :
    SpecializingMap f ↔ ∀ x, IsClosed (f '' closure {x})

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

SpecializingMap f ↔ ∀ (x : X), IsClosed (f '' closure {x})


lemma in₀₂_iff' :
    (graph t).Adj (in₀ a) (in₂ c) ↔ ∃ x : α × β × γ, x ∈ t ∧ x.1 = a ∧ x.2.2 = c

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{t : Finset (α × β × γ)}
{a : α}
{c : γ}

(SimpleGraph.TripartiteFromTriangles.graph t).Adj (Sum3.in₀ a) (Sum3.in₂ c) ↔ ∃ x ∈ t, x.1 = a ∧ x.2.2 = c


/-- If `‖y‖ → ∞`, then we can assume `y ≠ x` for any fixed `x`. -/
@[to_additive eventually_ne_of_tendsto_norm_atTop "If `‖y‖→∞`, then we can assume `y≠x` for any
fixed `x`"]
theorem eventually_ne_of_tendsto_norm_atTop' {l : Filter α} {f : α → E}
    (h : Tendsto (fun y => ‖f y‖) l atTop) (x : E) : ∀ᶠ y in l, f y ≠ x

(h : Filter.Tendsto (fun y => ‖f y‖) l Filter.atTop)


@[to_additive]
theorem smul_of_tower_def (r : M) (x : s) :
    r • x = ⟨r • x, smul_one_smul N r x.1 ▸ smul_mem _ x.2⟩

{S : Type u'}
{M : Type v}
{N : Type u_1}
{α : Type u_2}
[SetLike S α]
[VAdd M N]
[VAdd M α]
[AddMonoid N]
[AddAction N α]
[VAddMemClass S N α]
[VAddAssocClass M N α]
(s : S)
(r : M)
(x : ↥s)


theorem preimage_coe_nonempty {s t : Set α} :
    (((↑) : s → α) ⁻¹' t).Nonempty ↔ (s ∩ t).Nonempty

(Subtype.val ⁻¹' t).Nonempty ↔ (s ∩ t).Nonempty


theorem choose_le_pow (r n : ℕ) : (n.choose r : α) ≤ (n ^ r : α) / r !

{α : Type u_1}
[LinearOrderedSemifield α]
(r n : ℕ)


theorem trivial_def {V : Type u} [AddCommGroup V] [Module k V] (g : G) (v : V) :
    (trivial k G V).ρ g v = v

{k G : Type u}
[CommRing k]
[Monoid G]
{V : Type u}
[AddCommGroup V]
[Module k V]
(g : G)
(v : V)


theorem swap' {f} (hf : Nat.Primrec (unpaired f)) : Nat.Primrec (unpaired (swap f))

{f : ℕ → ℕ → ℕ}
(hf : Nat.Primrec (Nat.unpaired f))

Nat.Primrec (Nat.unpaired (Function.swap f))


theorem prod_span_singleton {ι : Type*} (s : Finset ι) (x : ι → A) :
    (∏ i ∈ s, span R ({x i} : Set A)) = span R {∏ i ∈ s, x i}

{R : Type u}
[CommSemiring R]
{A : Type v}
[CommSemiring A]
[Algebra R A]
{ι : Type u_1}
(s : Finset ι)
(x : ι → A)

∏ i ∈ s, Submodule.span R {x i} = Submodule.span R {∏ i ∈ s, x i}


@[simp]
theorem count_eq_one_of_mem [DecidableEq α] {a : α} {s : Multiset α} (d : Nodup s) (h : a ∈ s) :
    count a s = 1

{α : Type u_1}
[DecidableEq α]
{a : α}
{s : Multiset α}
(d : s.Nodup)
(h : a ∈ s)


theorem uniformContinuous_extend : UniformContinuous (pkg.extend f)

{α : Type u_1}
[UniformSpace α]
(pkg : AbstractCompletion α)
{β : Type u_2}
[UniformSpace β]
{f : α → β}
[CompleteSpace β]


theorem mem_sSup_of_mem {S : Set (Submodule R M)} {s : Submodule R M} (hs : s ∈ S) :
    ∀ {x : M}, x ∈ s → x ∈ sSup S

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{S : Set (Submodule R M)}
{s : Submodule R M}
(hs : s ∈ S)
{x : M}


@[to_additive]
theorem IsSubgroup.div_mem {s : Set G} (hs : IsSubgroup s) {x y : G} (hx : x ∈ s) (hy : y ∈ s) :
    x / y ∈ s

{G : Type u_1}
[Group G]
{s : Set G}
(hs : IsSubgroup s)
{x y : G}
(hx : x ∈ s)
(hy : y ∈ s)


theorem infinite_pigeonhole_set {β α : Type u} {s : Set β} (f : s → α) (θ : Cardinal)
    (hθ : θ ≤ #s) (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) :
    ∃ (a : α) (t : Set β) (h : t ⊆ s), θ ≤ #t ∧ ∀ ⦃x⦄ (hx : x ∈ t), f ⟨x, h hx⟩ = a

{β α : Type u}
{s : Set β}
(f : ↑s → α)
(θ : Cardinal.{u})
(hθ : θ ≤ #↑s)
(h₁ : ℵ₀ ≤ θ)
(h₂ : #α < θ.ord.cof)

∃ a t, ∃ (h : t ⊆ s), θ ≤ #↑t ∧ ∀ ⦃x : β⦄ (hx : x ∈ t), f ⟨x, ⋯⟩ = a


theorem mem_Lp_of_ae_bound [IsFiniteMeasure μ] {f : α →ₘ[μ] E} (C : ℝ) (hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) :
    f ∈ Lp E p μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[MeasureTheory.IsFiniteMeasure μ]
{f : α →ₘ[μ] E}
(C : ℝ)
(hfC : ∀ᵐ (x : α) ∂μ, ‖↑f x‖ ≤ C)


@[refl]
theorem refl (p : Path x₀ x₁) : p.Homotopic p

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ : X}
(p : Path x₀ x₁)


@[simp] lemma to_WithLowerSet_symm_eq : (@toLowerSet α).symm = ofLowerSet


/-- Expressing locally uniform convergence on a set using `edist`. -/
theorem tendstoLocallyUniformlyOn_iff {ι : Type*} [TopologicalSpace β] {F : ι → β → α} {f : β → α}
    {p : Filter ι} {s : Set β} :
    TendstoLocallyUniformlyOn F f p s ↔
      ∀ ε > 0, ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, ∀ᶠ n in p, ∀ y ∈ t, edist (f y) (F n y) < ε

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
{ι : Type u_2}
[TopologicalSpace β]
{F : ι → β → α}
{f : β → α}
{p : Filter ι}
{s : Set β}

TendstoLocallyUniformlyOn F f p s ↔ ∀ ε > 0, ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, ∀ᶠ (n : ι) in p, ∀ y ∈ t, edist (f y) (F n y) < ε


protected lemma GrowsPolynomially.zpow (p : ℤ) (hf : GrowsPolynomially f)
    (hf_nonneg : ∀ᶠ x in atTop, 0 ≤ f x) : GrowsPolynomially fun x => (f x) ^ p

(hf : AkraBazziRecurrence.GrowsPolynomially f)

(hf_nonneg : ∀ᶠ (x : ℝ) in Filter.atTop, 0 ≤ f x)

AkraBazziRecurrence.GrowsPolynomially fun x => f x ^ p


/-- Functor translating a functor into the category of monoid objects
to a monoid object in the functor category
-/
@[simps]
def inverse : (C ⥤ Mon_ D) ⥤ Mon_ (C ⥤ D)

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

CategoryTheory.Monoidal.MonFunctorCategoryEquivalence.inverse.obj F =
  CategoryTheory.Monoidal.MonFunctorCategoryEquivalence.inverseObj F


theorem _root_.Finset.nullMeasurableSet_biInter {f : ι → Set α} (s : Finset ι)
    (h : ∀ b ∈ s, NullMeasurableSet (f b) μ) : NullMeasurableSet (⋂ b ∈ s, f b) μ

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

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


@[simp]
theorem ordConnectedComponent_empty : ordConnectedComponent ∅ x = ∅


theorem isOpenMap_iff (hg : OpenEmbedding g) :
    IsOpenMap f ↔ IsOpenMap (g ∘ f)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{f : X → Y}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(hg : OpenEmbedding g)


/-- The short complex `T.obj₁ ⟶ T.obj₂ ⟶ T.obj₃` attached to a distinguished triangle. -/
@[simps]
def shortComplexOfDistTriangle (T : Triangle C) (hT : T ∈ distTriang C) : ShortComplex C

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(CategoryTheory.Pretriangulated.shortComplexOfDistTriangle T hT).f = T.mor₁


lemma eq_zero_of_zpow_eq_zero {n : ℤ} : a ^ n = 0 → a = 0

{G₀ : Type u_3}
[GroupWithZero G₀]
{a : G₀}
{n : ℤ}


theorem Base.card_eq_card_of_base (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) :
    B₁.encard = B₂.encard

{α : Type u_1}
{M : Matroid α}
{B₁ B₂ : Set α}
(hB₁ : M.Base B₁)
(hB₂ : M.Base B₂)


theorem closure_image_closure (h : Continuous f) :
    closure (f '' closure s) = closure (f '' s)

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


lemma ball_eq_of_mem {x y : X} {r : ℝ} (h : y ∈ ball x r) : ball x r = ball y r

{X : Type u_1}
[PseudoMetricSpace X]
[IsUltrametricDist X]
{x y : X}
{r : ℝ}
(h : y ∈ Metric.ball x r)


/-- The category of algebras over an additive monad on a preadditive category is preadditive. -/
@[simps]
instance Monad.algebraPreadditive : Preadditive (Monad.Algebra T)

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
(T : CategoryTheory.Monad C)
[T.Additive]
(F G : T.Algebra)
(n : ℕ)
(α : F ⟶ G)


theorem isLimit_iff (c : Cone F) :
    Nonempty (IsLimit c) ↔ ∀ s ∈ F.sections, ∃! x : c.pt, ∀ j, c.π.app j x = s j

{J : Type v}
[CategoryTheory.Category.{w, v} J]
{F : J ⥤ Type u}
(c : CategoryTheory.Limits.Cone F)

Nonempty (CategoryTheory.Limits.IsLimit c) ↔ ∀ s ∈ F.sections, ∃! x, ∀ (j : J), c.π.app j x = s j


/-- Monotone convergence for a supremum over a directed family and indexed by a countable type. -/
theorem lintegral_iSup_directed [Countable β] {f : β → α → ℝ≥0∞} (hf : ∀ b, AEMeasurable (f b) μ)
    (h_directed : Directed (· ≤ ·) f) : ∫⁻ a, ⨆ b, f b a ∂μ = ⨆ b, ∫⁻ a, f b a ∂μ

{f : β → α → ℝ≥0∞}

(h_directed : Directed (fun x x_1 => x ≤ x_1) f)

∫⁻ (a : α), ⨆ b, f b a ∂μ = ⨆ b, ∫⁻ (a : α), f b a ∂μ


theorem inv_pos_lt_iff_one_lt_mul' (ha : 0 < a) : a⁻¹ < b ↔ 1 < a * b

{α : Type u_2}
[LinearOrderedSemifield α]
{a b : α}
(ha : 0 < a)


theorem seminormFromConst_def (x : R) :
    seminormFromConst hf1 hc hpm x = seminormFromConst' hf1 hc hpm x

{R : Type u_1}
[CommRing R]
{c : R}
{f : RingSeminorm R}
(hf1 : f 1 ≤ 1)
(hc : f c ≠ 0)
(hpm : IsPowMul ⇑f)
(x : R)

(seminormFromConst hf1 hc hpm) x = seminormFromConst' hf1 hc hpm x


theorem integral_circleTransform (f : ℂ → E) :
    (∫ θ : ℝ in (0)..2 * π, circleTransform R z w f θ) =
      (2 * ↑π * I)⁻¹ • ∮ z in C(z, R), (z - w)⁻¹ • f z

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(R : ℝ)
(z w : ℂ)
(f : ℂ → E)

∫ (θ : ℝ) in 0 ..2 * π, Complex.circleTransform R z w f θ =
  (2 * ↑π * Complex.I)⁻¹ • ∮ (z : ℂ) in C(z, R), (z - w)⁻¹ • f z


/-- For a functor `F : C ⥤ D` and an object `d : D`, we obtain a contravariant functor from the
category of structured arrows `d ⟶ F.obj c` to the category of costructured arrows
`F.op.obj c ⟶ (op d)`.
-/
@[simps]
def toCostructuredArrow (F : C ⥤ D) (d : D) :
    (StructuredArrow d F)ᵒᵖ ⥤ CostructuredArrow F.op (op d)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
(d : D)

∀ {X Y : (CategoryTheory.StructuredArrow d F)ᵒᵖ} (f : X ⟶ Y),
  (CategoryTheory.StructuredArrow.toCostructuredArrow F d).map f =
    CategoryTheory.CostructuredArrow.homMk f.unop.right.op ⋯


@[to_additive (attr := simp)]
lemma stabilizer_finset_empty : stabilizer G (∅ : Finset α) = ⊤

{G : Type u_1}
{α : Type u_3}
[AddGroup G]
[AddAction G α]
[DecidableEq α]


theorem le_rev_iff {i j : Fin n} : i ≤ rev j ↔ j ≤ rev i


theorem gcd_pos_of_ne_zero_left {i : ℤ} (j : ℤ) (hi : i ≠ 0) : 0 < gcd i j


theorem iUnion_spanningSets (μ : Measure α) [SigmaFinite μ] : ⋃ i : ℕ, spanningSets μ i = univ

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

⋃ i, MeasureTheory.spanningSets μ i = Set.univ


private theorem add_csize_pos : 0 < i + Char.utf8Size c


theorem comap_neBot {f : Filter β} {m : α → β} (hm : ∀ t ∈ f, ∃ a, m a ∈ t) : NeBot (comap m f)

{α : Type u}
{β : Type v}
{f : Filter β}
{m : α → β}
(hm : ∀ t ∈ f, ∃ a, m a ∈ t)


@[to_additive]
theorem of_mulSupport_subset_isCompact [R1Space α] {K : Set α}
    (hK : IsCompact K) (h : mulSupport f ⊆ K) : HasCompactMulSupport f

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[Zero β]
{f : α → β}
[R1Space α]
{K : Set α}
(hK : IsCompact K)
(h : Function.support f ⊆ K)


/-- In a separable space, a family of nonempty disjoint open sets is countable. -/
theorem _root_.Set.PairwiseDisjoint.countable_of_isOpen [SeparableSpace α] {ι : Type*}
    {s : ι → Set α} {a : Set ι} (h : a.PairwiseDisjoint s) (ho : ∀ i ∈ a, IsOpen (s i))
    (hne : ∀ i ∈ a, (s i).Nonempty) : a.Countable

{α : Type u}
[t : TopologicalSpace α]
[TopologicalSpace.SeparableSpace α]
{ι : Type u_2}
{s : ι → Set α}
{a : Set ι}
(h : a.PairwiseDisjoint s)
(ho : ∀ i ∈ a, IsOpen (s i))
(hne : ∀ i ∈ a, (s i).Nonempty)


@[to_additive]
theorem noncommProd_cons' (s : Multiset α) (a : α) (comm) :
    noncommProd (a ::ₘ s) comm = noncommProd s (comm.mono fun _ => mem_cons_of_mem) * a

(comm : {x | x ∈ a ::ₘ s}.Pairwise AddCommute)

(a ::ₘ s).noncommSum comm = s.noncommSum ⋯ + a


theorem divInt_num_den (z : d ≠ 0) (h : n /. d = ⟨n', d', z', c⟩) :
    ∃ m, m ≠ 0 ∧ n = n' * m ∧ d = d' * m

(h : n /. d = { num := n', den := d', den_nz := z', reduced := c })


theorem range_mfderiv_eq_univ {x : M} (hx : x ∈ e.source) : range (mfderiv I I' e x) = univ

(he : PartialHomeomorph.MDifferentiable I I' e)

Set.range ⇑(mfderiv I I' (↑e) x) = Set.univ


/-- The data needed to induce a `MonoidalCategory` via the functor `F`; namely, pre-existing
definitions of `⊗`, `𝟙_`, `▷`, `◁` that are preserved by `F`.
-/
structure InducingFunctorData [MonoidalCategoryStruct D] (F : D ⥤ C) where
  /-- Analogous to `CategoryTheory.LaxMonoidalFunctor.μIso` -/
  μIso : ∀ X Y,
    F.obj X ⊗ F.obj Y ≅ F.obj (X ⊗ Y)
  whiskerLeft_eq : ∀ (X : D) {Y₁ Y₂ : D} (f : Y₁ ⟶ Y₂),
    F.map (X ◁ f) = (μIso _ _).inv ≫ (F.obj X ◁ F.map f) ≫ (μIso _ _).hom := by
    aesop_cat
  whiskerRight_eq : ∀ {X₁ X₂ : D} (f : X₁ ⟶ X₂) (Y : D),
    F.map (f ▷ Y) = (μIso _ _).inv ≫ (F.map f ▷ F.obj Y) ≫ (μIso _ _).hom := by
    aesop_cat
  tensorHom_eq : ∀ {X₁ Y₁ X₂ Y₂ : D} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂),
    F.map (f ⊗ g) = (μIso _ _).inv ≫ (F.map f ⊗ F.map g) ≫ (μIso _ _).hom := by
    aesop_cat
  /-- Analogous to `CategoryTheory.LaxMonoidalFunctor.εIso` -/
  εIso : 𝟙_ _ ≅ F.obj (𝟙_ _)
  associator_eq : ∀ X Y Z : D,
    F.map (α_ X Y Z).hom =
      (((μIso _ _).symm ≪≫ ((μIso _ _).symm ⊗ .refl _))
        ≪≫ α_ (F.obj X) (F.obj Y) (F.obj Z)
        ≪≫ ((.refl _ ⊗ μIso _ _) ≪≫ μIso _ _)).hom := by
    aesop_cat
  leftUnitor_eq : ∀ X : D,
    F.map (λ_ X).hom =
      (((μIso _ _).symm ≪≫ (εIso.symm ⊗ .refl _)) ≪≫ λ_ (F.obj X)).hom := by
    aesop_cat
  rightUnitor_eq : ∀ X : D,
    F.map (ρ_ X).hom =
      (((μIso _ _).symm ≪≫ (.refl _ ⊗ εIso.symm)) ≪≫ ρ_ (F.obj X)).hom := by
    aesop_cat

(self : CategoryTheory.Monoidal.InducingFunctorData F)

F.map (X ◁ f) = (self.μIso X Y₁).inv ≫ F.obj X ◁ F.map f ≫ (self.μIso X Y₂).hom


@[simp]
theorem Injective.of_comp_iff (hf : Injective f) (g : γ → α) :
    Injective (f ∘ g) ↔ Injective g

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
(hf : Function.Injective f)
(g : γ → α)

Function.Injective (f ∘ g) ↔ Function.Injective g


protected theorem rename (hφ : φ.IsSymmetric) (e : σ ≃ τ) : (rename e φ).IsSymmetric

{σ : Type u_1}
{R : Type u_2}
{τ : Type u_3}
[CommSemiring R]
{φ : MvPolynomial σ R}
(hφ : φ.IsSymmetric)
(e : σ ≃ τ)


theorem finite_nat_iff {a b : ℕ} : Finite a b ↔ a ≠ 1 ∧ 0 < b


/-- The infimum of two congruence relations equals the infimum of the underlying binary
    operations. -/
@[to_additive (attr := simp, norm_cast)
  "The infimum of two additive congruence relations equals the infimum of the underlying binary
  operations."]
theorem coe_inf {c d : Con M} : ⇑(c ⊓ d) = ⇑c ⊓ ⇑d


@[to_additive]
theorem mul_right_iterate_apply_one : (· * a)^[n] 1 = a ^ n

{G : Type u_3}
[AddMonoid G]
(a : G)
(n : ℕ)


@[to_additive]
theorem cons_cons {p} : Red L₁ L₂ → Red (p :: L₁) (p :: L₂)

{α : Type u}
{L₁ L₂ : List (α × Bool)}
{p : α × Bool}

FreeGroup.Red L₁ L₂ → FreeGroup.Red (p :: L₁) (p :: L₂)


theorem mem_Ioc_of_Ioo (h : x ∈ Ioo a b) : x ∈ Ioc a b

{α : Type u_1}
[Preorder α]
{a b x : α}
(h : x ∈ Set.Ioo a b)


@[simp]
theorem map_map {M : DMatrix m n α} {β : m → n → Type w} {γ : m → n → Type z}
    {f : ∀ ⦃i j⦄, α i j → β i j} {g : ∀ ⦃i j⦄, β i j → γ i j} :
    (M.map f).map g = M.map fun i j x => g (f x)

{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
{M : DMatrix m n α}
{β : m → n → Type w}
{γ : m → n → Type z}
{f : ⦃i : m⦄ → ⦃j : n⦄ → α i j → β i j}
{g : ⦃i : m⦄ → ⦃j : n⦄ → β i j → γ i j}


/-- If `α` is a preorder with no maximal element, then `atTop ≤ cofinite`. -/
theorem atTop_le_cofinite [Preorder α] [NoMaxOrder α] : (atTop : Filter α) ≤ cofinite

{α : Type u_2}
[Preorder α]
[NoMaxOrder α]


theorem pairwise_iff_exists_forall [Nonempty ι] (s : Set α) (f : α → ι) {r : ι → ι → Prop}
    [IsEquiv ι r] : s.Pairwise (r on f) ↔ ∃ z, ∀ x ∈ s, r (f x) z

{α : Type u_1}
{ι : Type u_4}
[Nonempty ι]
(s : Set α)
(f : α → ι)
{r : ι → ι → Prop}
[IsEquiv ι r]


theorem pnatDen_eq_iff_den_eq {x : ℚ} {n : ℕ+} : x.pnatDen = n ↔ x.den = ↑n


/-- The `vectorSpan` of two points is the span of their difference. -/
theorem vectorSpan_pair (p₁ p₂ : P) : vectorSpan k ({p₁, p₂} : Set P) = k ∙ p₁ -ᵥ p₂

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

vectorSpan k {p₁, p₂} = Submodule.span k {p₁ -ᵥ p₂}


@[to_additive (attr := simp)]
theorem smul_inl : a • (inl b : α ⊕ β) = inl (a • b)

{M : Type u_1}
{α : Type u_4}
{β : Type u_5}
[SMul M α]
[SMul M β]
(a : M)
(b : α)


/-- The reduct of any model of `φ.onTheory T` is a model of `T`. -/
@[simps]
def reduct {L' : Language} (φ : L →ᴸ L') (M : (φ.onTheory T).ModelType) : T.ModelType

{L : FirstOrder.Language}
{T : L.Theory}
{L' : FirstOrder.Language}
(φ : L →ᴸ L')
(M : (φ.onTheory T).ModelType)

(FirstOrder.Language.Theory.ModelType.reduct φ M).struc = φ.reduct ↑M


/-- The **Holley Inequality**. -/
lemma holley (hμ₀ : 0 ≤ μ) (hf : 0 ≤ f) (hg : 0 ≤ g) (hμ : Monotone μ)
    (hfg : ∑ a, f a = ∑ a, g a) (h : ∀ a b, f a * g b ≤ f (a ⊓ b) * g (a ⊔ b)) :
    ∑ a, μ a * f a ≤ ∑ a, μ a * g a

(h : ∀ (a b : α), f a * g b ≤ f (a ⊓ b) * g (a ⊔ b))


@[simp]
theorem limit.lift_pre (c : Cone F) :
    limit.lift F c ≫ limit.pre F E = limit.lift (E ⋙ F) (c.whisker E)

[CategoryTheory.Limits.HasLimit (E ⋙ F)]

CategoryTheory.Limits.limit.lift F c ≫ CategoryTheory.Limits.limit.pre F E =
  CategoryTheory.Limits.limit.lift (E ⋙ F) (CategoryTheory.Limits.Cone.whisker E c)


lemma eq_zero_of_natDegree_lt_card_of_eval_eq_zero {R} [CommRing R] [IsDomain R]
    (p : R[X]) {ι} [Fintype ι] {f : ι → R} (hf : Function.Injective f)
    (heval : ∀ i, p.eval (f i) = 0) (hcard : natDegree p < Fintype.card ι) : p = 0

(heval : ∀ (i : ι), Polynomial.eval (f i) p = 0)


theorem continuousLinearMapCoordChange_apply (b : B)
    (hb : b ∈ e₁.baseSet ∩ e₂.baseSet ∩ (e₁'.baseSet ∩ e₂'.baseSet)) (L : F₁ →SL[σ] F₂) :
    continuousLinearMapCoordChange σ e₁ e₁' e₂ e₂' b L =
      (continuousLinearMap σ e₁' e₂' ⟨b, (continuousLinearMap σ e₁ e₂).symm b L⟩).2

(σ : 𝕜₁ →+* 𝕜₂)

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

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

(e₁ e₁' : Trivialization F₁ Bundle.TotalSpace.proj)

(e₂ e₂' : Trivialization F₂ Bundle.TotalSpace.proj)

(Pretrivialization.continuousLinearMapCoordChange σ e₁ e₁' e₂ e₂' b) L =
  (↑(Pretrivialization.continuousLinearMap σ e₁' e₂')
      { proj := b, snd := (Pretrivialization.continuousLinearMap σ e₁ e₂).symm b L }).2


@[to_additive (attr := simp, norm_cast)]
theorem unop_natCast [NatCast α] (n : ℕ) : unop (n : αᵐᵒᵖ) = n


theorem length_div_two_le_count_bool (hl : Chain' (· ≠ ·) l) (b : Bool) :
    length l / 2 ≤ count b l

(hl : List.Chain' (fun x x_1 => x ≠ x_1) l)


private theorem add_left_aux4' (y z : E) :
    (‖2 • z + y‖ * ‖2 • z + y‖ - ‖y - 2 • z‖ * ‖y - 2 • z‖) / 2 =
    ‖y + z‖ * ‖y + z‖ - ‖y - z‖ * ‖y - z‖

{E : Type u_2}
[NormedAddCommGroup E]
[InnerProductSpaceable E]
(y z : E)


private theorem someExistsOneDivLT_measurableSet : MeasurableSet (someExistsOneDivLT s i)

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

MeasurableSet (MeasureTheory.SignedMeasure.someExistsOneDivLT s i)


theorem constantCoeff_one : constantCoeff R 1 = 1


theorem coe_add_eq_top_iff {y : WithTop α} : ↑x + y = ⊤ ↔ y = ⊤

{α : Type u}
[Add α]
{x : α}
{y : WithTop α}


@[simp]
theorem neighborSet_iSup (f : ι → G.Subgraph) (v : V) :
    (⨆ i, f i).neighborSet v = ⋃ i, (f i).neighborSet v

{ι : Sort u_1}
{V : Type u}
{G : SimpleGraph V}
(f : ι → G.Subgraph)
(v : V)


theorem setToFun_congr_left' (hT : DominatedFinMeasAdditive μ T C)
    (hT' : DominatedFinMeasAdditive μ T' C') (h : ∀ s, MeasurableSet s → μ s < ∞ → T s = T' s)
    (f : α → E) : setToFun μ T hT f = setToFun μ T' hT' f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT' : MeasureTheory.DominatedFinMeasAdditive μ T' C')

(h : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → T s = T' s)

MeasureTheory.setToFun μ T hT f = MeasureTheory.setToFun μ T' hT' f


@[simp] theorem RingHom.comp_id_commSemiringCat
    {G : CommSemiRingCat.{u}} {H : Type u} [CommSemiring H] (f : G →+* H) : f.comp (𝟙 G) = f

{G : CommSemiRingCat}
{H : Type u}
[CommSemiring H]
(f : ↑G →+* H)


@[to_additive (attr := simp)] theorem MonoidHom.id_grp_comp
    {G : Type u} [Group G] {H : Grp.{u}} (f : G →* H) : MonoidHom.comp (𝟙 H) f = f

{G : Type u}
[Group G]
{H : Grp}
(f : G →* ↑H)


lemma distinguished_cocone_triangle {X Y : HomotopyCategory C (ComplexShape.up ℤ)} (f : X ⟶ Y) :
    ∃ (Z : HomotopyCategory C (ComplexShape.up ℤ)) (g : Y ⟶ Z) (h : Z ⟶ X⟦1⟧),
      Triangle.mk f g h ∈ distinguishedTriangles C

∃ Z g h, CategoryTheory.Pretriangulated.Triangle.mk f g h ∈ HomotopyCategory.Pretriangulated.distinguishedTriangles C


theorem restrict_restrict' (ht : MeasurableSet t) :
    (μ.restrict t).restrict s = μ.restrict (s ∩ t)

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
(ht : MeasurableSet t)


@[simp] lemma obj_carrier (M : FGModuleCat R) : M.obj.carrier = M.carrier

{R : Type u}
[Ring R]
(M : FGModuleCat R)


@[simp]
lemma num_div_den (q : ℚ≥0) : (q.num : ℚ≥0) / q.den = q


theorem differentiableWithinAt_arccos_Iic {x : ℝ} :
    DifferentiableWithinAt ℝ arccos (Iic x) x ↔ x ≠ 1

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


@[simp]
theorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]


theorem deleteVerts_adj {u v : V} :
    (G'.deleteVerts s).Adj u v ↔ u ∈ G'.verts ∧ ¬u ∈ s ∧ v ∈ G'.verts ∧ ¬v ∈ s ∧ G'.Adj u v

{V : Type u}
{G : SimpleGraph V}
{G' : G.Subgraph}
{s : Set V}
{u v : V}

(G'.deleteVerts s).Adj u v ↔ u ∈ G'.verts ∧ u ∉ s ∧ v ∈ G'.verts ∧ v ∉ s ∧ G'.Adj u v


/-- `v.satisfies_fmla f` asserts that formula `f` is satisfied by the valuation.
A formula is satisfied if all clauses in it are satisfied. -/
structure Valuation.satisfies_fmla (v : Valuation) (f : Fmla) : Prop where
  prop : ∀ c, c ∈ f → v.satisfies c

{v : Sat.Valuation}
{f : Sat.Fmla}
(self : v.satisfies_fmla f)
(c : Sat.Clause)


theorem parallel_congr_left {S T : WSeq (Computation α)} {a} (h1 : ∀ s ∈ S, s ~> a)
    (H : S.LiftRel Equiv T) : parallel S ~ parallel T

(h1 : ∀ (s : Computation α), s ∈ S → s.Promises a)

(H : Stream'.WSeq.LiftRel Computation.Equiv S T)

(Computation.parallel S).Equiv (Computation.parallel T)


@[reassoc]
theorem coevaluation_comp_rightAdjointMate {X Y : C} [HasRightDual X] [HasRightDual Y] (f : X ⟶ Y) :
    η_ Y (Yᘁ) ≫ _ ◁ (fᘁ) = η_ _ _ ≫ f ▷ _

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


theorem sup'_inf_sup' (f : ι → α) (g : κ → α) :
    s.sup' hs f ⊓ t.sup' ht g = (s ×ˢ t).sup' (hs.product ht) fun i => f i.1 ⊓ g i.2

{α : Type u_2}
{ι : Type u_5}
{κ : Type u_6}
[DistribLattice α]
{s : Finset ι}
{t : Finset κ}
(hs : s.Nonempty)
(ht : t.Nonempty)
(f : ι → α)
(g : κ → α)

s.sup' hs f ⊓ t.sup' ht g = (s ×ˢ t).sup' ⋯ fun i => f i.1 ⊓ g i.2


theorem isLowerSet_iff_Iio_subset : IsLowerSet s ↔ ∀ ⦃a⦄, a ∈ s → Iio a ⊆ s

{α : Type u_1}
[PartialOrder α]
{s : Set α}

IsLowerSet s ↔ ∀ ⦃a : α⦄, a ∈ s → Set.Iio a ⊆ s


/-- A total complex shape for three complexes shapes `c₁`, `c₂`, `c₁₂` on three types
`I₁`, `I₂` and `I₁₂` consists of the data and properties that will allow the construction
of a total complex functor `HomologicalComplex₂ C c₁ c₂ ⥤ HomologicalComplex C c₁₂` which
sends `K` to a complex which in degree `i₁₂ : I₁₂` consists of the coproduct
of the `(K.X i₁).X i₂` such that `π ⟨i₁, i₂⟩ = i₁₂`. -/
class TotalComplexShape  where
  /-- a map on indices -/
  π : I₁ × I₂ → I₁₂
  /-- the sign of the horizontal differential in the total complex -/
  ε₁ : I₁ × I₂ → ℤˣ
  /-- the sign of the vertical differential in the total complex -/
  ε₂ : I₁ × I₂ → ℤˣ
  rel₁ {i₁ i₁' : I₁} (h : c₁.Rel i₁ i₁') (i₂ : I₂) : c₁₂.Rel (π ⟨i₁, i₂⟩) (π ⟨i₁', i₂⟩)
  rel₂ (i₁ : I₁) {i₂ i₂' : I₂} (h : c₂.Rel i₂ i₂') : c₁₂.Rel (π ⟨i₁, i₂⟩) (π ⟨i₁, i₂'⟩)
  ε₂_ε₁ {i₁ i₁' : I₁} {i₂ i₂' : I₂} (h₁ : c₁.Rel i₁ i₁') (h₂ : c₂.Rel i₂ i₂') :
    ε₂ ⟨i₁, i₂⟩ * ε₁ ⟨i₁, i₂'⟩ = - ε₁ ⟨i₁, i₂⟩ * ε₂ ⟨i₁', i₂⟩

{I₁ : Type u_1}
{I₂ : Type u_2}
{I₁₂ : Type u_3}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
{c₁₂ : ComplexShape I₁₂}
[self : TotalComplexShape c₁ c₂ c₁₂]
{i₁ i₁' : I₁}
(h : c₁.Rel i₁ i₁')
(i₂ : I₂)

c₁₂.Rel (TotalComplexShape.π c₁ c₂ c₁₂ (i₁, i₂)) (TotalComplexShape.π c₁ c₂ c₁₂ (i₁', i₂))


/-- Any element semiconjugates `1` to `1`. -/
@[to_additive (attr := simp) "Any element semiconjugates `0` to `0`."]
theorem one_right (a : M) : SemiconjBy a 1 1


theorem add_def (α β : Type u) : #α + #β = #(α ⊕ β)

Cardinal.mk α + Cardinal.mk β = Cardinal.mk (α ⊕ β)


theorem L1.norm_of_fun_eq_integral_norm {f : α → H} (hf : Integrable f μ) :
    ‖hf.toL1 f‖ = ∫ a, ‖f a‖ ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{H : Type u_7}
[NormedAddCommGroup H]
{f : α → H}
(hf : MeasureTheory.Integrable f μ)

‖MeasureTheory.Integrable.toL1 f hf‖ = ∫ (a : α), ‖f a‖ ∂μ


@[simp]
theorem dist_toBCF_eq_dist {f g : C₀(α, β)} : dist f.toBCF g.toBCF = dist f g

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[Zero β]
{f g : α →C₀ β}


theorem hasStrictDerivAt_neg : HasStrictDerivAt Neg.neg (-1) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)


lemma negAddY_eq' {P Q : Fin 3 → R} : W'.negAddY P Q * (P z * Q z) ^ 3 =
    (P y * Q z ^ 3 - Q y * P z ^ 3) * (W'.addX P Q * (P z * Q z) ^ 2 - P x * Q z ^ 2 * addZ P Q ^ 2)
      + P y * Q z ^ 3 * addZ P Q ^ 3

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P Q : Fin 3 → R}

W'.negAddY P Q * (P z * Q z) ^ 3 =
  (P y * Q z ^ 3 - Q y * P z ^ 3) *
      (W'.addX P Q * (P z * Q z) ^ 2 - P x * Q z ^ 2 * WeierstrassCurve.Jacobian.addZ P Q ^ 2) +
    P y * Q z ^ 3 * WeierstrassCurve.Jacobian.addZ P Q ^ 3


theorem tsub_tsub_le_tsub_add {a b c : α} : a - (b - c) ≤ a - b + c

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


theorem card_fintype_uIcc : Fintype.card (Set.uIcc a b) = (b - a : ℤ).natAbs + 1

Fintype.card ↑(Set.uIcc a b) = (↑↑b - ↑↑a).natAbs + 1


@[simp]
theorem subgraphOfAdj_connected {v w : V} (hvw : G.Adj v w) : (G.subgraphOfAdj hvw).Connected

{V : Type u}
{G : SimpleGraph V}
{v w : V}
(hvw : G.Adj v w)


/-- The translation of a star-convex set is also star-convex. -/
theorem StarConvex.preimage_add_right (hs : StarConvex 𝕜 (z + x) s) :
    StarConvex 𝕜 x ((fun x => z + x) ⁻¹' s)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{x z : E}
{s : Set E}
(hs : StarConvex 𝕜 (z + x) s)


theorem support_single_subset {i : ι} {b : β i} : (single i b).support ⊆ {i}

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]


theorem coeff_X_mul_zero (p : R[X]) : coeff (X * p) 0 = 0


theorem tendsto_nhds {β : Type*} {f : List α → β} {r : List α → Filter β}
    (h_nil : Tendsto f (pure []) (r []))
    (h_cons :
      ∀ l a,
        Tendsto f (𝓝 l) (r l) →
          Tendsto (fun p : α × List α => f (p.1::p.2)) (𝓝 a ×ˢ 𝓝 l) (r (a::l))) :
    ∀ l, Tendsto f (𝓝 l) (r l)

(h_nil : Filter.Tendsto f (pure []) (r []))

(h_cons :
  ∀ (l : List α) (a : α),
    Filter.Tendsto f (𝓝 l) (r l) → Filter.Tendsto (fun p => f (p.1 :: p.2)) (𝓝 a ×ˢ 𝓝 l) (r (a :: l)))


@[to_additive]
theorem smul_inv_mem_fixedBy_iff_mem_fixedBy {a : α} {g : G} :
    g⁻¹ • a ∈ fixedBy α g ↔ a ∈ fixedBy α g

{α : Type u_1}
{G : Type u_2}
[Group G]
[MulAction G α]
{a : α}
{g : G}

g⁻¹ • a ∈ MulAction.fixedBy α g ↔ a ∈ MulAction.fixedBy α g


theorem le_pi {g : Filter (∀ i, α i)} : g ≤ pi f ↔ ∀ i, Tendsto (eval i) g (f i)

{ι : Type u_1}
{α : ι → Type u_2}
{f : (i : ι) → Filter (α i)}
{g : Filter ((i : ι) → α i)}

g ≤ Filter.pi f ↔ ∀ (i : ι), Filter.Tendsto (Function.eval i) g (f i)


/-- Given a fork over `∏ᶜ I.left ⇉ ∏ᶜ I.right`, we may obtain a multifork. -/
@[simps pt]
noncomputable def ofPiFork (c : Fork I.fstPiMap I.sndPiMap) : Multifork I

(I : CategoryTheory.Limits.MulticospanIndex C)

(c : CategoryTheory.Limits.Fork I.fstPiMap I.sndPiMap)

(CategoryTheory.Limits.Multifork.ofPiFork I c).pt = c.pt


@[to_additive]
theorem exists_iff_exists_existsUnique :
    (∃ a0 b0 : G, a0 ∈ A ∧ b0 ∈ B ∧ UniqueMul A B a0 b0) ↔
      ∃ g : G, ∃! ab, ab ∈ A ×ˢ B ∧ ab.1 * ab.2 = g

(∃ a0 b0, a0 ∈ A ∧ b0 ∈ B ∧ UniqueMul A B a0 b0) ↔ ∃ g, ∃! ab, ab ∈ A ×ˢ B ∧ ab.1 * ab.2 = g


lemma isEllSequence_id : IsEllSequence id


theorem smul_apply (f : M [⋀^ι]→L[A] N) (c : R') (v : ι → M) : (c • f) v = c • f v

{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[AddCommMonoid M]
[TopologicalSpace M]
[AddCommMonoid N]
[TopologicalSpace N]
{R' : Type u_7}
{A : Type u_9}
[Monoid R']
[Semiring A]
[Module A M]
[Module A N]
[DistribMulAction R' N]
[ContinuousConstSMul R' N]
[SMulCommClass A R' N]
(f : M [⋀^ι]→L[A] N)
(c : R')
(v : ι → M)


@[to_additive Ioc_add_Ico_subset]
theorem Ioc_mul_Ico_subset' [LocallyFiniteOrder α] (a b c d : α) :
    Ioc a b * Ico c d ⊆ Ioo (a * c) (b * d)

[CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1]

[CovariantClass α α (Function.swap HMul.hMul) LT.lt]

Finset.Ioc a b * Finset.Ico c d ⊆ Finset.Ioo (a * c) (b * d)


lemma W_toSheafify (P : Cᵒᵖ ⥤ A) : J.W (toSheafify J P)

(J : CategoryTheory.GrothendieckTopology C)


theorem modifyNthTail_id : ∀ n (l : List α), l.modifyNthTail id n = l


@[simps!]
instance : MonoidalCategoryStruct (Dial C)

(CategoryTheory.MonoidalCategory.leftUnitor X).hom.F =
  CategoryTheory.Limits.prod.lift (CategoryTheory.Limits.terminal.from (((⊤_ C) ⨯ X.src) ⨯ X.tgt))
    CategoryTheory.Limits.prod.snd


theorem lt_length (i : Fin c.length) : (i : ℕ) + 1 < c.boundaries.card

{n : ℕ}
(c : CompositionAsSet n)
(i : Fin c.length)


@[deprecated (since := "2024-04-14")]
theorem coe_zero : ⇑(0 : BilinForm R M) = 0

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]


/-- The binomial distribution on one coin is the bernoully distribution. -/
theorem binomial_one_eq_bernoulli (p : ℝ≥0∞) (h : p ≤ 1) :
    binomial p h 1 = (bernoulli p h).map (cond · 1 0)

PMF.binomial p h 1 = PMF.map (fun x => bif x then 1 else 0) (PMF.bernoulli p h)


theorem nnnorm_eq [NumberField K] (x : K) :
    ‖canonicalEmbedding K x‖₊ = Finset.univ.sup (fun φ : K →+* ℂ => ‖φ x‖₊)

{K : Type u_1}
[Field K]
[NumberField K]
(x : K)

‖(NumberField.canonicalEmbedding K) x‖₊ = Finset.univ.sup fun φ => ‖φ x‖₊


@[deprecated forall_mem_image (since := "2024-02-21")]
theorem mem_image_elim_on {f : α → β} {s : Set α} {C : β → Prop} {y : β} (h_y : y ∈ f '' s)
    (h : ∀ x : α, x ∈ s → C (f x)) : C y

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{s : Set α}
{C : β → Prop}
{y : β}
(h_y : y ∈ f '' s)
(h : ∀ x ∈ s, C (f x))


@[to_additive (attr := simp, norm_cast)]
theorem toSubgroup_comap (H : OpenSubgroup N) (f : G →* N) (hf : Continuous f) :
    (H.comap f hf : Subgroup G) = (H : Subgroup N).comap f

{G : Type u_1}
[Group G]
[TopologicalSpace G]
{N : Type u_2}
[Group N]
[TopologicalSpace N]
(H : OpenSubgroup N)
(f : G →* N)
(hf : Continuous ⇑f)

↑(OpenSubgroup.comap f hf H) = Subgroup.comap f ↑H


lemma everywherePosSubset_subset (μ : Measure α) (s : Set α) : μ.everywherePosSubset s ⊆ s

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


theorem isIntegral_algebraMap {x : R} : IsIntegral R (algebraMap R A x)

{R : Type u_1}
{A : Type u_3}
[CommRing R]
[Ring A]
[Algebra R A]
{x : R}


theorem separatingLeft_dualProd :
    (dualProd R M).SeparatingLeft ↔ Function.Injective (Module.Dual.eval R M)

(R : Type u_1)
(M : Type u_2)
[CommRing R]
[AddCommGroup M]
[Module R M]

LinearMap.SeparatingLeft (LinearMap.dualProd R M) ↔ Function.Injective ⇑(Module.Dual.eval R M)


@[simp] lemma unop_zpow (x : αᵐᵒᵖ) (z : ℤ) : unop (x ^ z) = unop x ^ z

{α : Type u_1}
[DivInvMonoid α]
(x : αᵐᵒᵖ)
(z : ℤ)

MulOpposite.unop (x ^ z) = MulOpposite.unop x ^ z


@[to_additive]
theorem union_mul_inter_subset : (s ∪ t) * (s ∩ t) ⊆ s * t

{α : Type u_2}
[CommSemigroup α]
{s t : Set α}


@[simp]
theorem prod_map_id {α β : TypeVec n} : (@TypeVec.id _ α ⊗' @TypeVec.id _ β) = id

TypeVec.prod.map TypeVec.id TypeVec.id = TypeVec.id


theorem eq_of_comp_left_eq {f g : X ⟶ Y} (w : ∀ {Z : C} (h : Y ⟶ Z), f ≫ h = g ≫ h) :
    f = g

(w : ∀ {Z : C} (h : Y ⟶ Z), CategoryTheory.CategoryStruct.comp f h = CategoryTheory.CategoryStruct.comp g h)


theorem BilinForm.mul_toMatrix'_mul (B : BilinForm R₂ (n → R₂)) (M : Matrix o n R₂)
    (N : Matrix n o R₂) : M * BilinForm.toMatrix' B * N =
      BilinForm.toMatrix' (B.comp (Matrix.toLin' Mᵀ) (Matrix.toLin' N))

{R₂ : Type u_5}
[CommSemiring R₂]
{n : Type u_11}
{o : Type u_12}
[Fintype n]
[Fintype o]
[DecidableEq n]
[DecidableEq o]
(B : LinearMap.BilinForm R₂ (n → R₂))
(M : Matrix o n R₂)
(N : Matrix n o R₂)

M * LinearMap.BilinForm.toMatrix' B * N =
  LinearMap.BilinForm.toMatrix' (B.comp (Matrix.toLin' M.transpose) (Matrix.toLin' N))


@[simp, norm_cast]
theorem coe_univ : ↑(univ : Finset α) = (Set.univ : Set α)


/-- This can be seen as a version of `small_of_surjective` in which the function `f` doesn't
    actually land in `β` but in some larger type `γ` related to `β` via an injective function `g`.
    -/
theorem small_of_injective_of_exists {α : Type v} {β : Type w} {γ : Type v'} [Small.{u} α]
    (f : α → γ) {g : β → γ} (hg : Function.Injective g) (h : ∀ b : β, ∃ a : α, f a = g b) :
    Small.{u} β

{α : Type v}
{β : Type w}
{γ : Type v'}
[Small.{u, v} α]
(f : α → γ)
{g : β → γ}
(hg : Function.Injective g)
(h : ∀ (b : β), ∃ a, f a = g b)


/-- When the first map `S.f` is zero, this is the homology data on `S` given
by the chosen `kernel S.g` -/
@[simps]
noncomputable def ofHasKernel (hf : S.f = 0) [HasKernel S.g] :
    S.HomologyData

(CategoryTheory.ShortComplex.HomologyData.ofHasKernel S hf).iso =
  CategoryTheory.Iso.refl (CategoryTheory.ShortComplex.LeftHomologyData.ofHasKernel S hf).H


@[simp]
theorem inf_lt_right : a ⊓ b < b ↔ ¬b ≤ a

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


/--
The category of comonoid objects in a cartesian monoidal category is equivalent
to the category itself, via the forgetful functor.
-/
@[simps] def comonEquiv : Comon_ C ≌ C

comonEquiv.counitIso =
  CategoryTheory.NatIso.ofComponents (fun X => CategoryTheory.Iso.refl ((cartesianComon_ C ⋙ Comon_.forget C).obj X)) ⋯


theorem toIterator : ∀ {s}, ValidFor l m r s → s.toIterator.ValidFor l.reverse (m ++ r)

Substring.ValidFor l m r s → String.Iterator.ValidFor l.reverse (m ++ r) s.toIterator


theorem gcd_div_gcd_div_gcd {i j : ℤ} (H : 0 < gcd i j) : gcd (i / gcd i j) (j / gcd i j) = 1

(i / ↑(i.gcd j)).gcd (j / ↑(i.gcd j)) = 1


@[norm_cast]
theorem coe_pair {a b : α} : (({a, b} : Finset α) : Set α) = {a, b}

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


@[simp, norm_cast]
theorem coe_toRegular (a : α) : (toRegular a : α) = aᶜᶜ

{α : Type u_1}
[HeytingAlgebra α]
(a : α)


/-- Induction principle for the algebra generated by a set `s`: show that `p x y` holds for any
`x y ∈ adjoin R s` given that it holds for `x y ∈ s` and that it satisfies a number of
natural properties. -/
@[elab_as_elim]
theorem adjoin_induction₂ {p : A → A → Prop} {a b : A} (ha : a ∈ adjoin R s) (hb : b ∈ adjoin R s)
    (Hs : ∀ x ∈ s, ∀ y ∈ s, p x y) (Halg : ∀ r₁ r₂, p (algebraMap R A r₁) (algebraMap R A r₂))
    (Halg_left : ∀ (r), ∀ x ∈ s, p (algebraMap R A r) x)
    (Halg_right : ∀ (r), ∀ x ∈ s, p x (algebraMap R A r))
    (Hadd_left : ∀ x₁ x₂ y, p x₁ y → p x₂ y → p (x₁ + x₂) y)
    (Hadd_right : ∀ x y₁ y₂, p x y₁ → p x y₂ → p x (y₁ + y₂))
    (Hmul_left : ∀ x₁ x₂ y, p x₁ y → p x₂ y → p (x₁ * x₂) y)
    (Hmul_right : ∀ x y₁ y₂, p x y₁ → p x y₂ → p x (y₁ * y₂)) : p a b

(Halg : ∀ (r₁ r₂ : R), p ((algebraMap R A) r₁) ((algebraMap R A) r₂))

(Halg_left : ∀ (r : R), ∀ x ∈ s, p ((algebraMap R A) r) x)

(Halg_right : ∀ (r : R), ∀ x ∈ s, p x ((algebraMap R A) r))

(Hadd_left : ∀ (x₁ x₂ y : A), p x₁ y → p x₂ y → p (x₁ + x₂) y)

(Hadd_right : ∀ (x y₁ y₂ : A), p x y₁ → p x y₂ → p x (y₁ + y₂))

(Hmul_left : ∀ (x₁ x₂ y : A), p x₁ y → p x₂ y → p (x₁ * x₂) y)

(Hmul_right : ∀ (x y₁ y₂ : A), p x y₁ → p x y₂ → p x (y₁ * y₂))


@[simps]
instance hasForgetToHeytAlg : HasForget₂ BoolAlg HeytAlg

(CategoryTheory.HasForget₂.forget₂.obj X).str = inferInstance


theorem HasFiniteFPowerSeriesAt.neg (hf : HasFiniteFPowerSeriesAt f pf x n) :
    HasFiniteFPowerSeriesAt (-f) (-pf) x n

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{pf : FormalMultilinearSeries 𝕜 E F}
{x : E}
{n : ℕ}
(hf : HasFiniteFPowerSeriesAt f pf x n)


/-- **Minkowski inequality**: the `L_p` seminorm of the infinite sum of two vectors is less than or
equal to the infinite sum of the `L_p`-seminorms of the summands, if these infinite sums both
exist. A version for `NNReal`-valued functions. For an alternative version, convenient if the
infinite sums are already expressed as `p`-th powers, see `Lp_add_le_hasSum_of_nonneg`. -/
theorem Lp_add_le_tsum {f g : ι → ℝ≥0} {p : ℝ} (hp : 1 ≤ p) (hf : Summable fun i => f i ^ p)
    (hg : Summable fun i => g i ^ p) :
    (Summable fun i => (f i + g i) ^ p) ∧
      (∑' i, (f i + g i) ^ p) ^ (1 / p) ≤
        (∑' i, f i ^ p) ^ (1 / p) + (∑' i, g i ^ p) ^ (1 / p)

{ι : Type u}
{f g : ι → ℝ≥0}
{p : ℝ}
(hp : 1 ≤ p)
(hf : Summable fun i => f i ^ p)
(hg : Summable fun i => g i ^ p)


/-- The additive map forgetting that a bounded continuous function is bounded. -/
@[simps]
def toContinuousMapAddHom : (α →ᵇ β) →+ C(α, β)

(α : Type u)
(β : Type v)
[TopologicalSpace α]
[PseudoMetricSpace β]
[AddMonoid β]
[BoundedAdd β]
[ContinuousAdd β]
(self : BoundedContinuousFunction α β)

(BoundedContinuousFunction.toContinuousMapAddHom α β) self = self.toContinuousMap


@[to_additive]
theorem map_mul_left_nhds_one (x : G) : map (x * ·) (𝓝 1) = 𝓝 x

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
(x : G)

Filter.map (fun x_1 => x + x_1) (𝓝 0) = 𝓝 x


/--
If the unit and counit of a given adjunction are (pointwise) isomorphisms, then we can upgrade the
adjunction to an equivalence.
-/
@[simps!]
noncomputable def toEquivalence (adj : F ⊣ G) [∀ X, IsIso (adj.unit.app X)]
    [∀ Y, IsIso (adj.counit.app Y)] : C ≌ D

[∀ (X : C), CategoryTheory.IsIso (adj.unit.app X)]

[∀ (Y : D), CategoryTheory.IsIso (adj.counit.app Y)]

adj.toEquivalence.counitIso.inv.app X = CategoryTheory.inv (adj.counit.app X)


theorem set_biUnion_insert_update {x : α} {t : Finset α} (f : α → Set β) {s : Set β} (hx : x ∉ t) :
    ⋃ i ∈ insert x t, @update _ _ _ f x s i = s ∪ ⋃ i ∈ t, f i

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
{x : α}
{t : Finset α}
(f : α → Set β)
{s : Set β}
(hx : x ∉ t)

⋃ i ∈ insert x t, Function.update f x s i = s ∪ ⋃ i ∈ t, f i


@[fun_prop]
theorem continuousAt_rpow_const (x : ℝ) (q : ℝ) (h : x ≠ 0 ∨ 0 ≤ q) :
    ContinuousAt (fun x : ℝ => x ^ q) x


@[to_additive]
theorem toList_map (f : α → β) (xs : FreeMonoid α) : toList (map f xs) = xs.toList.map f

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

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


@[to_additive]
lemma prod_of_injective (e : ι → κ) (he : Injective e) (f : ι → α) (g : κ → α)
    (h' : ∀ i ∉ Set.range e, g i = 1) (h : ∀ i, f i = g (e i)) : ∏ i, f i = ∏ j, g j

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[Fintype ι]
[Fintype κ]
[AddCommMonoid α]
(e : ι → κ)
(he : Function.Injective e)
(f : ι → α)
(g : κ → α)
(h' : ∀ i ∉ Set.range e, g i = 0)
(h : ∀ (i : ι), f i = g (e i))


@[simp]
theorem leibniz : X (f * f') = f • X f' + f' • X f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
(X : LeftInvariantDerivation I G)
(f : C^⊤⟮I, G; 𝓘(𝕜, 𝕜), 𝕜⟯)
{f' : C^⊤⟮I, G; 𝓘(𝕜, 𝕜), 𝕜⟯}


theorem reflexive_right : IsReflexive R N

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(p : PerfectPairing R M N)


theorem tsub_add_cancel_of_le (h : a ≤ b) : b - a + a = b

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


@[norm_cast, simp]
theorem coe_zero : ((0 : P →ᴬ[R] W) : P → W) = 0

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace W]


@[simp] lemma isOpen_toEquiv_preimage [AlexandrovDiscrete α] {s : Set (Specialization α)} :
  IsOpen (toEquiv ⁻¹' s) ↔ IsUpperSet s

{α : Type u_1}
[TopologicalSpace α]
[AlexandrovDiscrete α]
{s : Set (Specialization α)}

IsOpen (⇑Specialization.toEquiv ⁻¹' s) ↔ IsUpperSet s


@[measurability]
protected theorem MeasurableSet.pi {s : Set δ} {t : ∀ i : δ, Set (π i)} (hs : s.Countable)
    (ht : ∀ i ∈ s, MeasurableSet (t i)) : MeasurableSet (s.pi t)

{δ : Type u_4}
{π : δ → Type u_6}
[(a : δ) → MeasurableSpace (π a)]
{s : Set δ}
{t : (i : δ) → Set (π i)}
(hs : s.Countable)
(ht : ∀ i ∈ s, MeasurableSet (t i))


theorem pow_injective_of_not_unit [CancelCommMonoidWithZero α] {q : α} (hq : ¬IsUnit q)
    (hq' : q ≠ 0) : Function.Injective fun n : ℕ => q ^ n

{α : Type u_1}
[CancelCommMonoidWithZero α]
{q : α}
(hq : ¬IsUnit q)
(hq' : q ≠ 0)


theorem mul_zero_subset (s : Finset α) : s * 0 ⊆ 0

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


theorem not_prime_of_int_mul {a b : ℤ} {c : ℕ} (ha : a.natAbs ≠ 1) (hb : b.natAbs ≠ 1)
    (hc : a * b = (c : ℤ)) : ¬Nat.Prime c

{a b : ℤ}
{c : ℕ}
(ha : a.natAbs ≠ 1)
(hb : b.natAbs ≠ 1)
(hc : a * b = ↑c)


theorem toLinearMap_symm_comp_eq (f : M₃ →ₛₗ[σ₃₁] M₁) (g : M₃ →ₛₗ[σ₃₂] M₂) :
    e₁₂.symm.toLinearMap.comp g = f ↔ g = e₁₂.toLinearMap.comp f

{R₁ : Type u_2}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M₁ : Type u_9}
{M₂ : Type u_10}
{M₃ : Type u_11}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
{module_M₁ : Module R₁ M₁}
{module_M₂ : Module R₂ M₂}
{module_M₃ : Module R₃ M₃}
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
{σ₃₂ : R₃ →+* R₂}
{σ₃₁ : R₃ →+* R₁}
[RingHomCompTriple σ₃₂ σ₂₁ σ₃₁]
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
{e₁₂ : M₁ ≃ₛₗ[σ₁₂] M₂}
[RingHomCompTriple σ₃₁ σ₁₂ σ₃₂]
(f : M₃ →ₛₗ[σ₃₁] M₁)
(g : M₃ →ₛₗ[σ₃₂] M₂)

(↑e₁₂.symm).comp g = f ↔ g = (↑e₁₂).comp f


@[simp]
lemma algebraTensorAlgEquiv_symm_monomial (m : σ →₀ ℕ) (a : A) :
    (algebraTensorAlgEquiv R A).symm (monomial m a) = a ⊗ₜ monomial m 1

(R : Type u)
[CommSemiring R]
{σ : Type u_1}
(A : Type u_3)
[CommSemiring A]
[Algebra R A]
(m : σ →₀ ℕ)
(a : A)

(MvPolynomial.algebraTensorAlgEquiv R A).symm ((MvPolynomial.monomial m) a) = a ⊗ₜ[R] (MvPolynomial.monomial m) 1


@[simp]
theorem rotate_length (l : List α) : rotate l l.length = l


theorem essSup_mono_measure' {α : Type*} {β : Type*} {_ : MeasurableSpace α}
    {μ ν : MeasureTheory.Measure α} [CompleteLattice β] {f : α → β} (hμν : ν ≤ μ) :
    essSup f ν ≤ essSup f μ

∀ {x : MeasurableSpace α} {μ ν : MeasureTheory.Measure α} [inst : CompleteLattice β] {f : α → β},
  ν ≤ μ → essSup f ν ≤ essSup f μ


@[reassoc (attr := simp)]
theorem comp_epiDesc [Epi f] {T : C} (g : X ⟶ T) (hg : kernel.ι f ≫ g = 0) :
    f ≫ epiDesc f g hg = g

(hg : CategoryTheory.Limits.kernel.ι f ≫ g = 0)

f ≫ CategoryTheory.Abelian.epiDesc f g hg = g


theorem extendTo𝕜'_apply (fr : F →L[ℝ] ℝ) (x : F) :
    fr.extendTo𝕜' x = (fr x : 𝕜) - (I : 𝕜) * (fr ((I : 𝕜) • x) : 𝕜)

{𝕜 : Type u_1}
[RCLike 𝕜]
{F : Type u_2}
[SeminormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedSpace ℝ F]
[IsScalarTower ℝ 𝕜 F]
(fr : F →L[ℝ] ℝ)
(x : F)

fr.extendTo𝕜' x = ↑(fr x) - RCLike.I * ↑(fr (RCLike.I • x))


theorem mop_injective : Function.Injective (mop : C → Cᴹᵒᵖ)


@[simp]
theorem map_pure' {α β} : ∀ (f : α → β) (a), f <$> pure a = pure (f a)

f <$> Computation.pure a = Computation.pure (f a)


theorem Measurable.le {α} {m m0 : MeasurableSpace α} {_ : MeasurableSpace β} (hm : m ≤ m0)
    {f : α → β} (hf : Measurable[m] f) : Measurable[m0] f

{β : Type u_2}
{α : Type u_7}
{m m0 : MeasurableSpace α}

∀ {x : MeasurableSpace β}, m ≤ m0 → ∀ {f : α → β}, Measurable f → Measurable f


@[simp]
theorem symm_smul₀ {c : G₀} (hc : c ≠ 0) :
    (smul₀ c hc : α ≃ᵐ α).symm = smul₀ c⁻¹ (inv_ne_zero hc)

{G₀ : Type u_2}
{α : Type u_3}
[MeasurableSpace G₀]
[MeasurableSpace α]
[GroupWithZero G₀]
[MulAction G₀ α]
[MeasurableSMul G₀ α]
{c : G₀}
(hc : c ≠ 0)

(MeasurableEquiv.smul₀ c hc).symm = MeasurableEquiv.smul₀ c⁻¹ ⋯


@[simp] theorem im_idem : a.im.im = a.im


@[simp] theorem getElem_map (f : α → β) (as : Array α) (i : Nat) (h) :
    ((as.map f)[i]) = f (as[i]'(size_map .. ▸ h))

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(as : Array α)
(i : Nat)
(h : i < (Array.map f as).size)


theorem IsLittleO.right_isBigO_sub {f₁ f₂ : α → E'} (h : f₁ =o[l] f₂) :
    f₂ =O[l] fun x => f₂ x - f₁ x

{α : Type u_1}
{E' : Type u_6}
[SeminormedAddCommGroup E']
{l : Filter α}
{f₁ f₂ : α → E'}
(h : f₁ =o[l] f₂)


lemma measurableAtom_subset {s : Set β} {x : β} (hs : MeasurableSet s) (hx : x ∈ s) :
    measurableAtom x ⊆ s

{β : Type u_2}
[MeasurableSpace β]
{s : Set β}
{x : β}
(hs : MeasurableSet s)
(hx : x ∈ s)


theorem disjoint_closedBall_ball_iff (hδ : 0 ≤ δ) (hε : 0 < ε) :
    Disjoint (closedBall x δ) (ball y ε) ↔ δ + ε ≤ dist x y

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{x y : E}
{δ ε : ℝ}
(hδ : 0 ≤ δ)
(hε : 0 < ε)

Disjoint (Metric.closedBall x δ) (Metric.ball y ε) ↔ δ + ε ≤ dist x y


theorem finite_iff_finite_of_encard_eq_encard (h : s.encard = t.encard) : s.Finite ↔ t.Finite

{α : Type u_1}
{s t : Set α}
(h : s.encard = t.encard)


@[simp]
theorem sup_insert [DecidableEq β] {b : β} : (insert b s : Finset β).sup f = f b ⊔ s.sup f

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
{s : Finset β}
{f : β → α}
[DecidableEq β]
{b : β}


private theorem basic_inter {X : Compactum} (A B : Set X) : basic (A ∩ B) = basic A ∩ basic B

Compactum.basic (A ∩ B) = Compactum.basic A ∩ Compactum.basic B


@[simp]
lemma centralizer_centralizer_centralizer {R} [Semiring R] {s : Set R} :
    centralizer s.centralizer.centralizer = centralizer s

Subsemiring.centralizer s.centralizer.centralizer = Subsemiring.centralizer s


theorem isTopologicalBasis_Iic_principal :
    IsTopologicalBasis (range (Iic ∘ 𝓟 : Set α → Set (Filter α)))

TopologicalSpace.IsTopologicalBasis (Set.range (Set.Iic ∘ 𝓟))


@[simp]
theorem map_cons (f : α → β) (a s) : map f (a ::ₘ s) = f a ::ₘ map f s

{α : Type u_1}
{β : Type v}
(f : α → β)
(a : α)
(s : Multiset α)

Multiset.map f (a ::ₘ s) = f a ::ₘ Multiset.map f s


theorem eq_zero_iff_ae_eq_zero {f : Lp E p μ} : f = 0 ↔ f =ᵐ[μ] 0

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


/-- The standard decomposition of `ℜ a + Complex.I • ℑ a = a` of an element of a star module over
`ℂ` into a linear combination of self adjoint elements. -/
theorem realPart_add_I_smul_imaginaryPart (a : A) : (ℜ a : A) + I • (ℑ a : A) = a

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

↑(realPart a) + Complex.I • ↑(imaginaryPart a) = a


private theorem log_b_ne_zero : log b ≠ 0

{b : ℝ}
(b_pos : 0 < b)
(b_ne_one : b ≠ 1)


theorem Algebra.leftMulMatrix_complex (z : ℂ) :
    Algebra.leftMulMatrix Complex.basisOneI z = !![z.re, -z.im; z.im, z.re]

(Algebra.leftMulMatrix Complex.basisOneI) z = !![z.re, -z.im; z.im, z.re]


@[simp]
theorem submoduleMap_coe_apply (f : M →ₗ[R] M₁) {p : Submodule R M} (x : p) :
    ↑(f.submoduleMap p x) = f x

{R : Type u_1}
{M : Type u_5}
{M₁ : Type u_6}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₁]
[Module R M]
[Module R M₁]
(f : M →ₗ[R] M₁)
{p : Submodule R M}
(x : ↥p)


theorem insert_setBlack {t : RBNode α} :
    (t.insert cmp v).setBlack = (t.ins cmp v).setBlack

{α : Type u_1}
{cmp : α → α → Ordering}
{v : α}
{t : Batteries.RBNode α}

(Batteries.RBNode.insert cmp t v).setBlack = (Batteries.RBNode.ins cmp v t).setBlack


/-- Construct a right unitor from specified limit cones.
-/
@[simps]
def BinaryFan.rightUnitor {X : C} {s : Cone (Functor.empty.{0} C)} (P : IsLimit s)
    {t : BinaryFan X s.pt} (Q : IsLimit t) : t.pt ≅ X

{s : CategoryTheory.Limits.Cone (CategoryTheory.Functor.empty C)}

{t : CategoryTheory.Limits.BinaryFan X s.pt}

(CategoryTheory.Limits.BinaryFan.rightUnitor P Q).inv =
  Q.lift
    (CategoryTheory.Limits.BinaryFan.mk (CategoryTheory.CategoryStruct.id X)
      (P.lift { pt := X, π := { app := fun x => x.as.elim, naturality := ⋯ } }))


theorem filterSup : μ.FiniteAtFilter f → μ.FiniteAtFilter g → μ.FiniteAtFilter (f ⊔ g)

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : Filter α}


@[mono]
theorem coprodᵢ_mono (hf : ∀ i, f₁ i ≤ f₂ i) : Filter.coprodᵢ f₁ ≤ Filter.coprodᵢ f₂

{ι : Type u_1}
{α : ι → Type u_2}
{f₁ f₂ : (i : ι) → Filter (α i)}
(hf : ∀ (i : ι), f₁ i ≤ f₂ i)


/-- Extract the isomorphism between the right objects from an isomorphism in the comma category. -/
@[simps!]
def rightIso {X Y : Comma L₁ R₁} (α : X ≅ Y) : X.right ≅ Y.right

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{L₁ : CategoryTheory.Functor A T}
{R₁ : CategoryTheory.Functor B T}
{X Y : CategoryTheory.Comma L₁ R₁}
(α : X ≅ Y)

(CategoryTheory.Comma.rightIso α).hom = α.hom.right


@[simp]
theorem coe_homothetyUnitsMulHom_apply (p : P) (t : Rˣ) :
    (homothetyUnitsMulHom p t : P → P) = AffineMap.homothety p (t : R)

{R : Type u_10}
{V : Type u_11}
{P : Type u_12}
[CommRing R]
[AddCommGroup V]
[Module R V]
[AffineSpace V P]
(p : P)
(t : Rˣ)

⇑((AffineEquiv.homothetyUnitsMulHom p) t) = ⇑(AffineMap.homothety p ↑t)


lemma toFinset_iUnion [Fintype β] [DecidableEq α] (f : β → Set α)
    [∀ w, Fintype (f w)] :
    Set.toFinset (⋃ (x : β), f x) =
    Finset.biUnion (Finset.univ : Finset β) (fun x => (f x).toFinset)

{α : Type u}
{β : Type v}
[Fintype β]
[DecidableEq α]
(f : β → Set α)
[(w : β) → Fintype ↑(f w)]

(⋃ x, f x).toFinset = Finset.univ.biUnion fun x => (f x).toFinset


@[simp]
theorem map_smul_of_tower [CompatibleSMul M M₂ R S] (fₗ : M →ₗ[S] M₂) (c : R) (x : M) :
    fₗ (c • x) = c • fₗ x

{M : Type u_9}
{M₂ : Type u_11}
[AddCommMonoid M]
[AddCommMonoid M₂]
{R : Type u_17}
{S : Type u_18}
[Semiring S]
[SMul R M]
[Module S M]
[SMul R M₂]
[Module S M₂]
[LinearMap.CompatibleSMul M M₂ R S]
(fₗ : M →ₗ[S] M₂)
(c : R)
(x : M)


theorem hasLimit_op_of_hasColimit (F : J ⥤ C) [HasColimit F] : HasLimit F.op

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{J : Type u₂}
[CategoryTheory.Category.{v₂, u₂} J]
(F : J ⥤ C)
[CategoryTheory.Limits.HasColimit F]


/-- Given a free groupoid and an arborescence of its generating quiver, the vertex
    group at the root is freely generated by loops coming from generating arrows
    in the complement of the tree. -/
lemma endIsFree : IsFreeGroup (End (root' T))

(T : WideSubquiver (Quiver.Symmetrify (IsFreeGroupoid.Generators G)))

[Quiver.Arborescence (WideSubquiver.toType (Quiver.Symmetrify (IsFreeGroupoid.Generators G)) T)]

IsFreeGroup (CategoryTheory.End (IsFreeGroupoid.SpanningTree.root' T))


@[simp]
lemma homologyMap_id [HasHomology S] :
    homologyMap (𝟙 S) = 𝟙 _

CategoryTheory.ShortComplex.homologyMap (CategoryTheory.CategoryStruct.id S) =
  CategoryTheory.CategoryStruct.id S.homology


theorem nontrivial_univ [Nontrivial α] : (univ : Set α).Nontrivial


@[fun_prop]
protected theorem HasStrictFDerivAt.prodMap (hf : HasStrictFDerivAt f f' p.1)
    (hf₂ : HasStrictFDerivAt f₂ f₂' p.2) : HasStrictFDerivAt (Prod.map f f₂) (f'.prodMap f₂') p

{𝕜 : 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]
{G' : Type u_5}
[NormedAddCommGroup G']
[NormedSpace 𝕜 G']
{f : E → F}
{f' : E →L[𝕜] F}
{f₂ : G → G'}
{f₂' : G →L[𝕜] G'}
(p : E × G)
(hf : HasStrictFDerivAt f f' p.1)
(hf₂ : HasStrictFDerivAt f₂ f₂' p.2)


@[simp]
theorem himp_compl (a : α) : a ⇨ aᶜ = aᶜ

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


/-- The set of roots of all polynomials of bounded degree and having coefficients in a finite set
is finite. -/
theorem bUnion_roots_finite {R S : Type*} [Semiring R] [CommRing S] [IsDomain S] [DecidableEq S]
    (m : R →+* S) (d : ℕ) {U : Set R} (h : U.Finite) :
    (⋃ (f : R[X]) (_ : f.natDegree ≤ d ∧ ∀ i, f.coeff i ∈ U),
        ((f.map m).roots.toFinset.toSet : Set S)).Finite

{R : Type u_1}
{S : Type u_2}
[Semiring R]
[CommRing S]
[IsDomain S]
[DecidableEq S]
(m : R →+* S)
(d : ℕ)
{U : Set R}
(h : U.Finite)

(⋃ f, ⋃ (_ : f.natDegree ≤ d ∧ ∀ (i : ℕ), f.coeff i ∈ U), ↑(Polynomial.map m f).roots.toFinset).Finite


@[simp]
theorem floor_sub_int (a : α) (z : ℤ) : ⌊a - z⌋ = ⌊a⌋ - z

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)
(z : ℤ)


@[fun_prop]
nonrec theorem HasFDerivWithinAt.add_const (hf : HasFDerivWithinAt f f' s x) (c : F) :
    HasFDerivWithinAt (fun y => f y + c) f' s x

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


theorem Sorted.rel_get_of_lt {l : List α} (h : l.Sorted r) {a b : Fin l.length} (hab : a < b) :
    r (l.get a) (l.get b)

{α : Type u}
{r : α → α → Prop}
{l : List α}
(h : List.Sorted r l)
{a b : Fin l.length}
(hab : a < b)


/-- A subgraph of a `SimpleGraph` is a subset of vertices along with a restriction of the adjacency
relation that is symmetric and is supported by the vertex subset.  They also form a bounded lattice.

Thinking of `V → V → Prop` as `Set (V × V)`, a set of darts (i.e., half-edges), then
`Subgraph.adj_sub` is that the darts of a subgraph are a subset of the darts of `G`. -/
@[ext]
structure Subgraph {V : Type u} (G : SimpleGraph V) where
  verts : Set V
  Adj : V → V → Prop
  adj_sub : ∀ {v w : V}, Adj v w → G.Adj v w
  edge_vert : ∀ {v w : V}, Adj v w → v ∈ verts
  symm : Symmetric Adj := by aesop_graph

{V : Type u}
{G : SimpleGraph V}
(self : G.Subgraph)
{v w : V}


theorem stalkToFiber_surjective (x : X) : Function.Surjective (F.stalkToFiber x)

{X : TopCat}
(F : TopCat.Presheaf (Type v) X)
(x : ↑X)


/-- For a quadratic character `χ` and when the characteristic `p` of the target ring
is a unit in the source ring and `n` is a natural number, the `p^n`th power of the Gauss
sum of`χ` and `ψ` is `χ (p^n)` times the original Gauss sum. -/
theorem MulChar.IsQuadratic.gaussSum_frob_iter (n : ℕ) (hp : IsUnit (p : R)) {χ : MulChar R R'}
    (hχ : IsQuadratic χ) (ψ : AddChar R R') :
    gaussSum χ ψ ^ p ^ n = χ ((p : R) ^ n) * gaussSum χ ψ

{R : Type u}
[CommRing R]
[Fintype R]
{R' : Type v}
[CommRing R']
(p : ℕ)
[fp : Fact (Nat.Prime p)]
[hch : CharP R' p]
(n : ℕ)
(hp : IsUnit ↑p)
{χ : MulChar R R'}
(hχ : χ.IsQuadratic)
(ψ : AddChar R R')

gaussSum χ ψ ^ p ^ n = χ (↑p ^ n) * gaussSum χ ψ


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


theorem intermediate_value_univ₂_eventually₁ [PreconnectedSpace X] {a : X} {l : Filter X} [NeBot l]
    {f g : X → α} (hf : Continuous f) (hg : Continuous g) (ha : f a ≤ g a) (he : g ≤ᶠ[l] f) :
    ∃ x, f x = g x

{X : Type u}
{α : Type v}
[TopologicalSpace X]
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[PreconnectedSpace X]
{a : X}
{l : Filter X}
[l.NeBot]
{f g : X → α}
(hf : Continuous f)
(hg : Continuous g)
(ha : f a ≤ g a)
(he : g ≤ᶠ[l] f)


@[simp]
theorem disjUnion_boxes (h : Disjoint π₁.iUnion π₂.iUnion) :
    (π₁.disjUnion π₂ h).boxes = π₁.boxes ∪ π₂.boxes

{π₁ π₂ : BoxIntegral.TaggedPrepartition I}


theorem Monotone.map_iInf_le [CompleteLattice β] {f : α → β} (hf : Monotone f) :
    f (iInf s) ≤ ⨅ i, f (s i)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
[CompleteLattice α]
{s : ι → α}
[CompleteLattice β]
{f : α → β}
(hf : Monotone f)


theorem isClosed_iff_of_mem (h : ∞ ∈ s) : IsClosed s ↔ IsClosed ((↑) ⁻¹' s : Set X)

{X : Type u_1}
[TopologicalSpace X]
{s : Set (OnePoint X)}
(h : OnePoint.infty ∈ s)

IsClosed s ↔ IsClosed (OnePoint.some ⁻¹' s)


theorem iInter_plift_up (f : PLift ι → Set α) : ⋂ i, f (PLift.up i) = ⋂ i, f i

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


@[simp]
theorem map_monomial (n : σ →₀ ℕ) (a : R) : map σ f (monomial R n a) = monomial S n (f a)

{σ : Type u_1}
{R : Type u_2}
{S : Type u_3}
[Semiring R]
[Semiring S]
(f : R →+* S)
(n : σ →₀ ℕ)
(a : R)

(MvPowerSeries.map σ f) ((MvPowerSeries.monomial R n) a) = (MvPowerSeries.monomial S n) (f a)


lemma range_eq_Icc_zero_sub_one (n : ℕ) (hn : n ≠ 0) : range n = Icc 0 (n - 1)


@[reassoc (attr := simp)]
lemma f'_cyclesMap' : h₁.f' ≫ cyclesMap' φ h₁ h₂ = φ.τ₁ ≫ h₂.f'

CategoryTheory.CategoryStruct.comp h₁.f' (CategoryTheory.ShortComplex.cyclesMap' φ h₁ h₂) =
  CategoryTheory.CategoryStruct.comp φ.τ₁ h₂.f'


@[trans]
theorem lf_of_lt_of_lf {x y z : PGame} (h₁ : x < y) (h₂ : y ⧏ z) : x ⧏ z

{x y z : SetTheory.PGame}
(h₁ : x < y)
(h₂ : y.LF z)


theorem TendstoUniformly.prod {ι' β' : Type*} [UniformSpace β'] {F' : ι' → α → β'} {f' : α → β'}
    {p' : Filter ι'} (h : TendstoUniformly F f p) (h' : TendstoUniformly F' f' p') :
    TendstoUniformly (fun (i : ι × ι') a => (F i.1 a, F' i.2 a)) (fun a => (f a, f' a))
      (p ×ˢ p')

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}
{ι' : Type u_1}
{β' : Type u_2}
[UniformSpace β']
{F' : ι' → α → β'}
{f' : α → β'}
{p' : Filter ι'}
(h : TendstoUniformly F f p)
(h' : TendstoUniformly F' f' p')

TendstoUniformly (fun i a => (F i.1 a, F' i.2 a)) (fun a => (f a, f' a)) (p ×ˢ p')


theorem not_mem_of_count_eq_zero {a : α} {l : List α} (h : count a l = 0) : a ∉ l

{α : Type u_1}
[DecidableEq α]
{a : α}
{l : List α}
(h : List.count a l = 0)


@[reassoc]
lemma totalFlipIso_hom_f_D₂ (j j' : J) :
    (K.totalFlipIso c).hom.f j ≫ K.D₂ c j j' =
      K.flip.D₁ c j j' ≫ (K.totalFlipIso c).hom.f j'

{C : Type u_1}
{I₁ : Type u_2}
{I₂ : Type u_3}
{J : Type u_4}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c : ComplexShape J)
[TotalComplexShape c₁ c₂ c]
[TotalComplexShape c₂ c₁ c]
[TotalComplexShapeSymmetry c₁ c₂ c]
[K.HasTotal c]
[K.flip.HasTotal c]
[DecidableEq J]
(j j' : J)


/-- The identity partial equivalence on a set `s` -/
@[simps! (config := mfld_cfg) apply, simps! (config := .lemmasOnly) source target]
def ofSet (s : Set X) (hs : IsOpen s) : PartialHomeomorph X X

{X : Type u_1}
[TopologicalSpace X]
(s : Set X)
(hs : IsOpen s)


@[to_additive]
theorem subset_lowerBounds_mul (s t : Set M) :
    lowerBounds s * lowerBounds t ⊆ lowerBounds (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]

lowerBounds s + lowerBounds t ⊆ lowerBounds (s + t)


@[simp] lemma not_comp_lt_lift : ¬ comp a < lift b

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

¬Booleanisation.comp a < Booleanisation.lift b


protected theorem map_iff [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] (f : α ≃ₜ β) :
    InnerRegular (Measure.map f μ) ↔ InnerRegular μ

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[BorelSpace α]
[MeasurableSpace β]
[TopologicalSpace β]
[BorelSpace β]
(f : α ≃ₜ β)

(MeasureTheory.Measure.map (⇑f) μ).InnerRegular ↔ μ.InnerRegular


@[to_additive]
lemma isClosedMap_mul_left (a : G) : IsClosedMap (a * ·)

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[ContinuousAdd G]
(a : G)


theorem heq_const_of_unique [Unique α] {β : α → Sort v} (f : ∀ a, β a) :
    HEq f (Function.const α (f default))

{α : Sort u_1}
[Unique α]
{β : α → Sort v}
(f : (a : α) → β a)


@[to_additive]
lemma Commute.smul_left [Mul α] [SMulCommClass M α α] [IsScalarTower M α α] {a b : α}
    (h : Commute a b) (r : M) : Commute (r • a) b

{M : Type u_1}
{α : Type u_7}
[VAdd M α]
[Add α]
[VAddCommClass M α α]
[VAddAssocClass M α α]
{a b : α}
(h : AddCommute a b)
(r : M)


/-- If `r` is a positive constant, `fun x ↦ r * f x` tends to infinity along a filter
if and only if `f` tends to infinity along the same filter. -/
theorem tendsto_const_mul_atTop_of_pos (hr : 0 < r) :
    Tendsto (fun x => r * f x) l atTop ↔ Tendsto f l atTop

{α : Type u_3}
{β : Type u_4}
[LinearOrderedSemifield α]
{l : Filter β}
{f : β → α}
{r : α}
(hr : 0 < r)

Filter.Tendsto (fun x => r * f x) l Filter.atTop ↔ Filter.Tendsto f l Filter.atTop


@[simp]
theorem join_add (S T) : @join α (S + T) = join S + join T

{α : Type u_1}
(S T : Multiset (Multiset α))


theorem card_cycleType_pos {σ : Perm α} : 0 < Multiset.card σ.cycleType ↔ σ ≠ 1

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{σ : Equiv.Perm α}


/-- Construct a bounded continuous function from a continuous function vanishing at infinity. -/
@[simps!]
def toBCF (f : C₀(α, β)) : α →ᵇ β

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[Zero β]
(f : α →C₀ β)
(a : α)


@[simp]
theorem Icc_diff_Ioo_self (h : a ≤ b) : Icc a b \ Ioo a b = {a, b}

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrder α]
{a b : α}
[DecidableEq α]
(h : a ≤ b)

Finset.Icc a b \ Finset.Ioo a b = {a, b}


@[simp] theorem map_tmul (f : M →ₗ[A] P) (g : N →ₗ[R] Q) (m : M) (n : N) :
    map f g (m ⊗ₜ n) = f m ⊗ₜ g n

{R : Type uR}
{A : Type uA}
{M : Type uM}
{N : Type uN}
{P : Type uP}
{Q : Type uQ}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid N]
[Module R N]
[AddCommMonoid P]
[Module R P]
[Module A P]
[IsScalarTower R A P]
[AddCommMonoid Q]
[Module R Q]
(f : M →ₗ[A] P)
(g : N →ₗ[R] Q)
(m : M)
(n : N)

(TensorProduct.AlgebraTensorModule.map f g) (m ⊗ₜ[R] n) = f m ⊗ₜ[R] g n


@[to_additive (attr := simp, norm_cast)]
theorem unop_intCast [IntCast α] (n : ℤ) : unop (n : αᵐᵒᵖ) = n


theorem IsStoppingTime.measurableSet_ge (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | i ≤ τ ω}

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


/-- See also `Ideal.mem_quotient_iff_mem` in case `I ≤ J`. -/
@[simp]
theorem mem_quotient_iff_mem_sup {I J : Ideal R} {x : R} :
    Quotient.mk I x ∈ J.map (Quotient.mk I) ↔ x ∈ J ⊔ I

{R : Type u}
[CommRing R]
{I J : Ideal R}
{x : R}

(Ideal.Quotient.mk I) x ∈ Ideal.map (Ideal.Quotient.mk I) J ↔ x ∈ J ⊔ I


theorem isCompl_range_inl_inr : IsCompl (range <| inl R M M₂) (range <| inr R M M₂)

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

IsCompl (LinearMap.range (LinearMap.inl R M M₂)) (LinearMap.range (LinearMap.inr R M M₂))


@[reassoc (attr := simp)]
theorem mapMono_naturality (i : Δ ⟶ Δ') [Mono i] :
    mapMono K i ≫ f.f Δ.len = f.f Δ'.len ≫ mapMono K' i

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{K K' : ChainComplex C ℕ}
(f : K ⟶ K')
{Δ Δ' : SimplexCategory}
(i : Δ ⟶ Δ')
[CategoryTheory.Mono i]

AlgebraicTopology.DoldKan.Γ₀.Obj.Termwise.mapMono K i ≫ f.f Δ.len =
  f.f Δ'.len ≫ AlgebraicTopology.DoldKan.Γ₀.Obj.Termwise.mapMono K' i


nonrec theorem HasDerivWithinAt.neg (h : HasDerivWithinAt f f' s x) :
    HasDerivWithinAt (fun x => -f x) (-f') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{s : Set 𝕜}
(h : HasDerivWithinAt f f' s x)


@[simp] protected theorem abs_mul_sign (x : EReal) : (x.abs * sign x : EReal) = x


/-- Subgroups of torsion-free groups are torsion-free. -/
@[to_additive "Subgroups of additive torsion-free groups are additively torsion-free."]
theorem IsTorsionFree.subgroup (tG : IsTorsionFree G) (H : Subgroup G) : IsTorsionFree H

{G : Type u_1}
[Group G]
(tG : Monoid.IsTorsionFree G)
(H : Subgroup G)


/-- The canonical map from the restriction to the subspace. -/
@[simps! val_base, simps! (config := .lemmasOnly) val_c_app]
def Scheme.ofRestrict : X.restrict h ⟶ X

{f : U ⟶ TopCat.of ↑↑X.toPresheafedSpace}

(V : (TopologicalSpace.Opens ↑↑X.toPresheafedSpace)ᵒᵖ)

(X.ofRestrict h).val.c.app V = X.presheaf.map (⋯.adjunction.counit.app (Opposite.unop V)).op


@[simp]
theorem length_transfer (hp) : (p.transfer H hp).length = p.length

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(p : G.Walk u v)
{H : SimpleGraph V}
(hp : ∀ e ∈ p.edges, e ∈ H.edgeSet)


@[norm_cast]
theorem natCast_div_self (n : ℕ) : ((n / n : ℕ) : ℚ) = n / n


@[to_additive]
theorem ker_apply {f : M →* P} {x y} : ker f x y ↔ f x = f y

{M : Type u_1}
{P : Type u_3}
[MulOneClass M]
[MulOneClass P]
{f : M →* P}
{x y : M}


theorem set_pi_mem_nhds {i : Set ι} {s : ∀ a, Set (π a)} {x : ∀ a, π a} (hi : i.Finite)
    (hs : ∀ a ∈ i, s a ∈ 𝓝 (x a)) : pi i s ∈ 𝓝 x

{ι : Type u_5}
{π : ι → Type u_6}
[T : (i : ι) → TopologicalSpace (π i)]
{i : Set ι}
{s : (a : ι) → Set (π a)}
{x : (a : ι) → π a}
(hi : i.Finite)
(hs : ∀ a ∈ i, s a ∈ 𝓝 (x a))


theorem le_ncard_diff (s t : Set α) (hs : s.Finite := by toFinite_tac) :
    t.ncard - s.ncard ≤ (t \ s).ncard

{α : Type u_1}
(s t : Set α)
(hs : s.Finite := by toFinite_tac)


/-- Viewing `R[X,Y,X']` as an `R[X']`-algebra, a polynomial `p : R[X',Y']` can be evaluated at
`Y : R[X,Y,X']` (substitution of `Y'` by `Y`), obtaining another polynomial in `R[X,Y,X']`.
When this polynomial is then evaluated at `X' = X`, the original polynomial `p` is recovered. -/
lemma eval_C_X_eval₂_map_C_X {p : R[X][Y]} :
    eval (C X) (eval₂ (mapRingHom <| algebraMap R R[X][Y]) (C Y) p) = p

{R : Type u_1}
[CommSemiring R]
{p : R[X][Y]}

Polynomial.eval (Polynomial.C Polynomial.X)
    (Polynomial.eval₂ (Polynomial.mapRingHom (algebraMap R R[X][Y])) (Polynomial.C Y) p) =
  p


theorem leftAdjointMate_comp {X Y Z : C} [HasLeftDual X] [HasLeftDual Y] {f : X ⟶ Y}
    {g : (ᘁX) ⟶ Z} :
    (ᘁf) ≫ g =
      (λ_ _).inv ≫
        η_ (ᘁX) X ▷ _ ≫ (g ⊗ f) ▷ _ ≫ (α_ _ _ _).hom ≫ _ ◁ ε_ _ _ ≫ (ρ_ _).hom

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{X Y Z : C}
[CategoryTheory.HasLeftDual X]
[CategoryTheory.HasLeftDual Y]
{f : X ⟶ Y}
{g : ᘁX ⟶ Z}

(ᘁf) ≫ g = (λ_ ᘁY).inv ≫ η_ (ᘁX) X ▷ ᘁY ≫ (g ⊗ f) ▷ ᘁY ≫ (α_ Z Y ᘁY).hom ≫ Z ◁ ε_ (ᘁY) Y ≫ (ρ_ Z).hom


@[to_additive]
theorem period_bounded_of_exponent_pos (exp_pos : 0 < Monoid.exponent M) (m : M) :
    BddAbove (Set.range (fun a : α => period m a))

(α : Type v)
{M : Type u}
[Monoid M]
[MulAction M α]
(exp_pos : 0 < Monoid.exponent M)
(m : M)

BddAbove (Set.range fun a => MulAction.period m a)


theorem continuousAt_angle {x : P × P × P} (hx12 : x.1 ≠ x.2.1) (hx32 : x.2.2 ≠ x.2.1) :
    ContinuousAt (fun y : P × P × P => ∠ y.1 y.2.1 y.2.2) x

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{x : P × P × P}
(hx12 : x.1 ≠ x.2.1)
(hx32 : x.2.2 ≠ x.2.1)

ContinuousAt (fun y => EuclideanGeometry.angle y.1 y.2.1 y.2.2) x


@[to_additive]
theorem mt (h : UniqueMul A B a0 b0) :
    ∀ ⦃a b⦄, a ∈ A → b ∈ B → a ≠ a0 ∨ b ≠ b0 → a * b ≠ a0 * b0

{G : Type u_1}
[Add G]
{A B : Finset G}
{a0 b0 : G}
(h : UniqueAdd A B a0 b0)
⦃a b : G⦄

a ∈ A → b ∈ B → a ≠ a0 ∨ b ≠ b0 → a + b ≠ a0 + b0


@[simp] theorem associated_pi [Invertible (2 : R)] (Q : ∀ i, QuadraticMap R (Mᵢ i) P) :
    associated (pi Q) = ∑ i, (Q i).associated.compl₁₂ (.proj i) (.proj i)

{ι : Type u_1}
{R : Type u_2}
{P : Type u_7}
{Mᵢ : ι → Type u_8}
[CommRing R]
[(i : ι) → AddCommGroup (Mᵢ i)]
[AddCommGroup P]
[(i : ι) → Module R (Mᵢ i)]
[Module R P]
[Fintype ι]
[Invertible 2]
(Q : (i : ι) → QuadraticMap R (Mᵢ i) P)

QuadraticMap.associated (QuadraticMap.pi Q) =
  ∑ i : ι, LinearMap.compl₁₂ (QuadraticMap.associated (Q i)) (LinearMap.proj i) (LinearMap.proj i)


theorem nadd_comm : ∀ a b, a ♯ b = b ♯ a


theorem KaehlerDifferential.total_surjective :
    Function.Surjective (Finsupp.total S (Ω[S⁄R]) S (KaehlerDifferential.D R S))

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]

Function.Surjective ⇑(Finsupp.total S (Ω[S⁄R]) S ⇑(KaehlerDifferential.D R S))


/-- The circumcenter of a triangle may be expressed explicitly as a multiple (by half the inverse
of the tangent of the angle at one of the vertices) of a `π / 2` rotation of the vector between
the other two vertices, plus the midpoint of those vertices. -/
theorem inv_tan_div_two_smul_rotation_pi_div_two_vadd_midpoint_eq_circumcenter (t : Triangle ℝ P)
    {i₁ i₂ i₃ : Fin 3} (h₁₂ : i₁ ≠ i₂) (h₁₃ : i₁ ≠ i₃) (h₂₃ : i₂ ≠ i₃) :
    ((Real.Angle.tan (∡ (t.points i₁) (t.points i₂) (t.points i₃)))⁻¹ / 2) •
      o.rotation (π / 2 : ℝ) (t.points i₃ -ᵥ t.points i₁) +ᵥ
        midpoint ℝ (t.points i₁) (t.points i₃) = t.circumcenter

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

((∡ (t.points i₁) (t.points i₂) (t.points i₃)).tan⁻¹ / 2) •
      (EuclideanGeometry.o.rotation ↑(π / 2)) (t.points i₃ -ᵥ t.points i₁) +ᵥ
    midpoint ℝ (t.points i₁) (t.points i₃) =
  Affine.Simplex.circumcenter t


/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` has a finite
limit `c` almost surely as `x` tends to `a` from the right or from the left, then the right
(resp., left) derivative of `u ↦ ∫ x in u..b, f x` at `a` equals `-c`. -/
theorem derivWithin_integral_of_tendsto_ae_left (hf : IntervalIntegrable f volume a b) {s t : Set ℝ}
    [FTCFilter a (𝓝[s] a) (𝓝[t] a)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] a))
    (ha : Tendsto f (𝓝[t] a ⊓ ae volume) (𝓝 c))
    (hs : UniqueDiffWithinAt ℝ s a := by uniqueDiffWithinAt_Ici_Iic_univ) :
    derivWithin (fun u => ∫ x in u..b, f x) s a = -c

(hf : IntervalIntegrable f MeasureTheory.volume a b)

[intervalIntegral.FTCFilter a (𝓝[s] a) (𝓝[t] a)]

(hmeas : StronglyMeasurableAtFilter f (𝓝[t] a) MeasureTheory.volume)

(ha : Filter.Tendsto f (𝓝[t] a ⊓ MeasureTheory.ae MeasureTheory.volume) (𝓝 c))

derivWithin (fun u => ∫ (x : ℝ) in u..b, f x) s a = -c


@[simp]
theorem id_apply (a : α) : CentroidHom.id α a = a

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
(a : α)


/-- The canonical perfection map from the perfection of a ring. -/
theorem of : PerfectionMap p (Perfection.coeff R p 0)

(p : ℕ)
[Fact (Nat.Prime p)]
(R : Type u₁)
[CommSemiring R]
[CharP R p]


@[simp]
theorem comp_id {α β : TypeVec n} (f : α ⟹ β) : f ⊚ id = f

{n : ℕ}
{α : TypeVec.{u_1} n}
{β : TypeVec.{u_2} n}
(f : α.Arrow β)


/-- If a function is concave on `s`, it remains concave when precomposed by an affine map. -/
theorem ConcaveOn.comp_affineMap {f : F → β} (g : E →ᵃ[𝕜] F) {s : Set F} (hf : ConcaveOn 𝕜 s f) :
    ConcaveOn 𝕜 (g ⁻¹' s) (f ∘ g)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{β : Type u_5}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[AddCommGroup F]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 F]
[SMul 𝕜 β]
{f : F → β}
(g : E →ᵃ[𝕜] F)
{s : Set F}
(hf : ConcaveOn 𝕜 s f)


lemma order_eq_top_iff {f : 𝕜 → E} {x : 𝕜} (hf : MeromorphicAt f x) :
    hf.order = ⊤ ↔ ∀ᶠ z in 𝓝[≠] x, f z = 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
{x : 𝕜}
(hf : MeromorphicAt f x)

hf.order = ⊤ ↔ ∀ᶠ (z : 𝕜) in 𝓝[≠] x, f z = 0


/-- Every fractional ideal of a noetherian integral domain is noetherian. -/
theorem isNoetherian [IsNoetherianRing R₁] (I : FractionalIdeal R₁⁰ K) : IsNoetherian R₁ I

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[frac : IsFractionRing R₁ K]
[IsDomain R₁]
[IsNoetherianRing R₁]
(I : FractionalIdeal R₁⁰ K)


@[simp] lemma Module.End.lie_apply (f : Module.End R M) (m : M) : ⁅f, m⁆ = f m

{R : Type u}
[CommRing R]
{M : Type w}
[AddCommGroup M]
[Module R M]
(f : Module.End R M)
(m : M)


/--
Accessing bits in `x.rotateRight r` the range `[0, w-r)` is equal to
accessing bits `x` in the range `[r, w)`.

Proof by example:
Let x := <6 5 4 3 2 1 0> : BitVec 7.
x.rotateRight 2 = (<6 5 4 3 2 | 1 0>).rotateRight 2 = <1 0 | 6 5 4 3 2>

(x.rotateLeft 2).getLsb ⟨i, i ≤ 7 - 2⟩
= <1 0 | 6 5 4 3 2>.getLsb ⟨i, i ≤ 7 - 2⟩
= <6 5 4 3 2>.getLsb i
= <6 5 4 3 2 | 1 0>[i + 2]
-/
theorem getLsb_rotateRightAux_of_le {x : BitVec w} {r : Nat} {i : Nat} (hi : i < w - r) :
    (x.rotateRightAux r).getLsb i = x.getLsb (r + i)

{w : Nat}
{x : BitVec w}
{r i : Nat}
(hi : i < w - r)


/-- In a `σ`-compact space, any closed set can be approximated by a compact subset. -/
theorem isCompact_isClosed {X : Type*} [TopologicalSpace X] [SigmaCompactSpace X]
    [MeasurableSpace X] (μ : Measure X) : InnerRegularWRT μ IsCompact IsClosed

{X : Type u_3}
[TopologicalSpace X]
[SigmaCompactSpace X]
[MeasurableSpace X]
(μ : MeasureTheory.Measure X)


theorem empty_mem_generateMeasurableRec (s : Set (Set α)) (i : ω₁) :
    ∅ ∈ generateMeasurableRec s i

(i : (Quotient.out (Cardinal.aleph 1).ord).α)

∅ ∈ MeasurableSpace.generateMeasurableRec s i


theorem symm_trans_source_eq (e e' : Pretrivialization F proj) :
    (e.toPartialEquiv.symm.trans e'.toPartialEquiv).source = (e.baseSet ∩ e'.baseSet) ×ˢ univ

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
(e e' : Pretrivialization F proj)

(e.symm.trans e'.toPartialEquiv).source = (e.baseSet ∩ e'.baseSet) ×ˢ Set.univ


theorem heq_of_eq (h : a = a') : HEq a a'


@[to_additive (attr := simp)]
theorem smul_closedBall (c : G) (x : X) (r : ℝ≥0∞) : c • closedBall x r = closedBall (c • x) r

{G : Type v}
{X : Type w}
[PseudoEMetricSpace X]
[Group G]
[MulAction G X]
[IsometricSMul G X]
(c : G)
(x : X)
(r : ℝ≥0∞)

c • EMetric.closedBall x r = EMetric.closedBall (c • x) r


/-- Defining property of the solution space : `u` is a solution
  iff it belongs to the solution space. -/
theorem is_sol_iff_mem_solSpace (u : ℕ → α) : E.IsSolution u ↔ u ∈ E.solSpace

{α : Type u_1}
[CommSemiring α]
(E : LinearRecurrence α)
(u : ℕ → α)


/-- If a function is continuous on a set for some topologies, then it is
continuous on the same set with respect to any finer topology on the source space. -/
theorem ContinuousOn.mono_dom {α β : Type*} {t₁ t₂ : TopologicalSpace α} {t₃ : TopologicalSpace β}
    (h₁ : t₂ ≤ t₁) {s : Set α} {f : α → β} (h₂ : @ContinuousOn α β t₁ t₃ f s) :
    @ContinuousOn α β t₂ t₃ f s

{α : Type u_7}
{β : Type u_8}
{t₁ t₂ : TopologicalSpace α}
{t₃ : TopologicalSpace β}
(h₁ : t₂ ≤ t₁)
{s : Set α}
{f : α → β}
(h₂ : ContinuousOn f s)


/-- `M` is a scalar matrix if and only if it commutes with every `stdBasisMatrix`. -/
theorem mem_range_scalar_iff_commute_stdBasisMatrix' {M : Matrix n n α} :
    M ∈ Set.range (Matrix.scalar n) ↔ ∀ (i j : n), Commute (stdBasisMatrix i j 1) M

{n : Type u_3}
{α : Type u_5}
[DecidableEq n]
[Semiring α]
[Fintype n]
{M : Matrix n n α}

M ∈ Set.range ⇑(Matrix.scalar n) ↔ ∀ (i j : n), Commute (Matrix.stdBasisMatrix i j 1) M


/-- The equivalence between `(α ⊕ β) →₀ γ` and `(α →₀ γ) × (β →₀ γ)`.

This is the `Finsupp` version of `Equiv.sum_arrow_equiv_prod_arrow`. -/
@[simps apply symm_apply]
def sumFinsuppEquivProdFinsupp {α β γ : Type*} [Zero γ] : (α ⊕ β →₀ γ) ≃ (α →₀ γ) × (β →₀ γ)

{α : Type u_13}
{β : Type u_14}
{γ : Type u_15}
[Zero γ]
(fg : (α →₀ γ) × (β →₀ γ))

Finsupp.sumFinsuppEquivProdFinsupp.symm fg = fg.1.sumElim fg.2


theorem sdiff_sup_sdiff_cancel (hba : b ≤ a) (hcb : c ≤ b) : a \ b ⊔ b \ c = a \ c

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b c : α}
(hba : b ≤ a)
(hcb : c ≤ b)


theorem gcd_assoc (i j k : ℤ) : gcd (gcd i j) k = gcd i (gcd j k)


@[simp]
theorem toFun_eq_coe {f : C(α, β)} : f.toFun = (f : α → β)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : C(α, β)}


/-- `WalkingParallelPair` as a category is equivalent to a special case of
`WalkingParallelFamily`.  -/
@[simps!]
def walkingParallelFamilyEquivWalkingParallelPair :
    WalkingParallelFamily.{w} (ULift Bool) ≌ WalkingParallelPair

∀ {X Y : CategoryTheory.Limits.WalkingParallelPair} (h : X ⟶ Y),
  CategoryTheory.Limits.walkingParallelFamilyEquivWalkingParallelPair.inverse.map h =
    match X, Y, h with
    | x, .(x), CategoryTheory.Limits.WalkingParallelPairHom.id .(x) =>
      CategoryTheory.CategoryStruct.id
        (match x with
        | CategoryTheory.Limits.WalkingParallelPair.zero => CategoryTheory.Limits.WalkingParallelFamily.zero
        | CategoryTheory.Limits.WalkingParallelPair.one => CategoryTheory.Limits.WalkingParallelFamily.one)
    | .(CategoryTheory.Limits.WalkingParallelPair.zero), .(CategoryTheory.Limits.WalkingParallelPair.one),
      CategoryTheory.Limits.WalkingParallelPairHom.left =>
      CategoryTheory.Limits.WalkingParallelFamily.Hom.line { down := true }
    | .(CategoryTheory.Limits.WalkingParallelPair.zero), .(CategoryTheory.Limits.WalkingParallelPair.one),
      CategoryTheory.Limits.WalkingParallelPairHom.right =>
      CategoryTheory.Limits.WalkingParallelFamily.Hom.line { down := false }


theorem IsCompact.elim_nhds_subcover (hs : IsCompact s) (U : X → Set X) (hU : ∀ x ∈ s, U x ∈ 𝓝 x) :
    ∃ t : Finset X, (∀ x ∈ t, x ∈ s) ∧ s ⊆ ⋃ x ∈ t, U x

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(hs : IsCompact s)
(U : X → Set X)
(hU : ∀ x ∈ s, U x ∈ 𝓝 x)

∃ t, (∀ x ∈ t, x ∈ s) ∧ s ⊆ ⋃ x ∈ t, U x


/-- An auxiliary lemma that can be used to prove `⇑(f ^ n) = ⇑f^[n]`. -/
theorem hom_coe_pow {F : Type*} [Monoid F] (c : F → M → M) (h1 : c 1 = id)
    (hmul : ∀ f g, c (f * g) = c f ∘ c g) (f : F) : ∀ n, c (f ^ n) = (c f)^[n]

(hmul : ∀ (f g : F), c (f * g) = c f ∘ c g)


theorem uIcc_eq_finset_map :
    uIcc a b = (range (max a b + 1 - min a b).toNat).map
      (Nat.castEmbedding.trans <| addLeftEmbedding <| min a b)

Finset.uIcc a b =
  Finset.map (Nat.castEmbedding.trans (addLeftEmbedding (min a b))) (Finset.range (max a b + 1 - min a b).toNat)


theorem ne_of_irrefl' {r} [IsIrrefl α r] : ∀ {x y : α}, r x y → y ≠ x

{α : Type u}
{r : α → α → Prop}
[IsIrrefl α r]
{x y : α}


/-- A pair (i, j) is contained in the antidiagonal of `n` if and only if `i + j = n`. -/
@[simp]
theorem mem_antidiagonal {n : ℕ} {x : ℕ × ℕ} : x ∈ antidiagonal n ↔ x.1 + x.2 = n

x ∈ Multiset.Nat.antidiagonal n ↔ x.1 + x.2 = n


theorem sub_lt_succ (a b) : a - b < succ a


theorem wittPolynomial_vars [CharZero R] (n : ℕ) : (wittPolynomial p R n).vars = range (n + 1)

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


@[reassoc]
theorem comp_tensor_id (f : W ⟶ X) (g : X ⟶ Y) : f ≫ g ⊗ 𝟙 Z = (f ⊗ 𝟙 Z) ≫ (g ⊗ 𝟙 Z)

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

CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.CategoryStruct.comp f g)
    (CategoryTheory.CategoryStruct.id Z) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.tensorHom f (CategoryTheory.CategoryStruct.id Z))
    (CategoryTheory.MonoidalCategory.tensorHom g (CategoryTheory.CategoryStruct.id Z))


/-- `Option.map f` is injective if `f` is injective. -/
theorem map_injective {f : α → β} (Hf : Function.Injective f) : Function.Injective (Option.map f)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(Hf : Function.Injective f)


theorem mem_closure_iff_nhds : x ∈ closure s ↔ ∀ t ∈ 𝓝 x, (t ∩ s).Nonempty

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


@[simp]
theorem lTensor_zero : lTensor M (0 : N →ₗ[R] P) = 0

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
{P : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]


lemma nonsingularLift_addMap {P Q : PointClass F} (hP : W.NonsingularLift P)
    (hQ : W.NonsingularLift Q) : W.NonsingularLift <| W.addMap P Q

{P Q : WeierstrassCurve.Jacobian.PointClass F}


/-- (Impl) A preliminary definition to avoid timeouts. -/
@[simps]
def conesEquivFunctor (B : C) {J : Type w} (F : Discrete J ⥤ Over B) :
    Cone (widePullbackDiagramOfDiagramOver B F) ⥤ Cone F

(F : CategoryTheory.Discrete J ⥤ CategoryTheory.Over B)

∀ {X Y : CategoryTheory.Limits.Cone (CategoryTheory.Over.ConstructProducts.widePullbackDiagramOfDiagramOver B F)}
  (f : X ⟶ Y),
  ((CategoryTheory.Over.ConstructProducts.conesEquivFunctor B F).map f).hom = CategoryTheory.Over.homMk f.hom ⋯


theorem invFun_neg (h : ¬∃ a, f a = b) : invFun f b = Classical.choice ‹_›

{α : Sort u_1}
{β : Sort u_2}
[Nonempty α]
{f : α → β}
{b : β}
(h : ¬∃ a, f a = b)

Function.invFun f b = Classical.choice inst✝


@[to_additive]
theorem IsLowerSet.smul (hs : IsLowerSet s) : IsLowerSet (a • s)

{α : Type u_1}
[OrderedAddCommGroup α]
{s : Set α}
{a : α}
(hs : IsLowerSet s)


theorem adjoin_toNonUnitalSubalgebra (s : Set A) :
    (adjoin R s).toNonUnitalSubalgebra = NonUnitalAlgebra.adjoin R (s ∪ star s)

(R : Type u)
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
(s : Set A)

(NonUnitalStarAlgebra.adjoin R s).toNonUnitalSubalgebra = NonUnitalAlgebra.adjoin R (s ∪ star s)


theorem HasDerivAt.exp (hf : HasDerivAt f f' x) :
    HasDerivAt (fun x => Real.exp (f x)) (Real.exp (f x) * f') x

{f : ℝ → ℝ}
{f' x : ℝ}
(hf : HasDerivAt f f' x)


theorem coprime_div_gcd_div_gcd
    (H : 0 < gcd m n) : Coprime (m / gcd m n) (n / gcd m n)


lemma _root_.Finset.Nonempty.piFinset_const {ι : Type*} [Fintype ι] [DecidableEq ι] {s : Finset α}
    (hs : s.Nonempty) : (piFinset fun _ : ι ↦ s).Nonempty

{α : Type u_1}
{ι : Type u_4}
[Fintype ι]
[DecidableEq ι]
{s : Finset α}
(hs : s.Nonempty)


@[simp]
theorem toSubalgebra_toSubmodule (p : Submodule R A) (h_one h_mul) :
    Subalgebra.toSubmodule (p.toSubalgebra h_one h_mul) = p

(h_mul : ∀ (x y : A), x ∈ p → y ∈ p → x * y ∈ p)


protected theorem smul (μ : Measure α) [OuterRegular μ] {x : ℝ≥0∞} (hx : x ≠ ∞) :
    (x • μ).OuterRegular

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
(μ : MeasureTheory.Measure α)
[μ.OuterRegular]
{x : ℝ≥0∞}
(hx : x ≠ ⊤)


theorem card_points [Fintype P] [Finite L] : Fintype.card P = order P L ^ 2 + order P L + 1

(P : Type u_1)
(L : Type u_2)
[Membership P L]
[Configuration.ProjectivePlane P L]
[Fintype P]
[Finite L]

Fintype.card P = Configuration.ProjectivePlane.order P L ^ 2 + Configuration.ProjectivePlane.order P L + 1


protected theorem Set.Finite.isClosed [T1Space X] {s : Set X} (hs : Set.Finite s) : IsClosed s

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{s : Set X}
(hs : s.Finite)


lemma negMulLog_mul (x y : ℝ) : negMulLog (x * y) = y * negMulLog x + x * negMulLog y

(x * y).negMulLog = y * x.negMulLog + x * y.negMulLog


theorem denom_dvd {x : RatFunc K} {q : K[X]} (hq : q ≠ 0) :
    denom x ∣ q ↔ ∃ p : K[X], x = algebraMap _ _ p / algebraMap _ _ q

{K : Type u}
[Field K]
{x : RatFunc K}
{q : K[X]}
(hq : q ≠ 0)

x.denom ∣ q ↔ ∃ p, x = (algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q


@[simp] lemma toFinset_factors (n : ℕ) : n.primeFactorsList.toFinset = n.primeFactors


theorem principal_le_principal_iff {p q : P} : principal q ≤ principal p ↔ p ≤ q

Order.PFilter.principal q ≤ Order.PFilter.principal p ↔ p ≤ q


lemma natDegree_Φ_pos [Nontrivial R] {n : ℤ} (hn : n ≠ 0) : 0 < (W.Φ n).natDegree

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
[Nontrivial R]
{n : ℤ}
(hn : n ≠ 0)


protected theorem nonneg_of_le {a b : α} (h : a ≤ b) : 0 ≤ variationOnFromTo f s a b

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
(f : α → E)
(s : Set α)
{a b : α}
(h : a ≤ b)


theorem uniformEmbedding_set_inclusion {s t : Set α} (hst : s ⊆ t) :
    UniformEmbedding (inclusion hst)

{α : Type u}
[UniformSpace α]
{s t : Set α}
(hst : s ⊆ t)


/-- If we're boundaryless, `extChartAt` has open target -/
theorem isOpen_extChartAt_target [I.Boundaryless] (x : M) : IsOpen (extChartAt I x).target

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


theorem single_mem_stdSimplex (i : ι) : Pi.single i 1 ∈ stdSimplex 𝕜 ι

(𝕜 : Type u_1)
{ι : Type u_5}
[OrderedSemiring 𝕜]
[Fintype ι]
[DecidableEq ι]
(i : ι)


theorem soIndefiniteEquiv_apply {i : R} (hi : i * i = -1) (A : so' p q R) :
    (soIndefiniteEquiv p q R hi A : Matrix (p ⊕ q) (p ⊕ q) R) =
      (Pso p q R i)⁻¹ * (A : Matrix (p ⊕ q) (p ⊕ q) R) * Pso p q R i

(A : ↥(LieAlgebra.Orthogonal.so' p q R))

↑((LieAlgebra.Orthogonal.soIndefiniteEquiv p q R hi) A) =
  (LieAlgebra.Orthogonal.Pso p q R i)⁻¹ * ↑A * LieAlgebra.Orthogonal.Pso p q R i