theorem good_lt_maxProducts (q : GoodProducts (π C (ord I · < o)))
    (l : MaxProducts C ho) : List.Lex (·<·) q.val.val l.val.val

(hsC : Profinite.NobelingProof.contained C (Order.succ o))

(ho : o < Ordinal.type fun x x_1 => x < x_1)

(q : ↑(Profinite.NobelingProof.GoodProducts (Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o)))

(l : ↑(Profinite.NobelingProof.GoodProducts.MaxProducts C ho))


theorem opow_le_opow_left {a b : Ordinal} (c : Ordinal) (ab : a ≤ b) : a ^ c ≤ b ^ c

{a b : Ordinal.{u_1}}
(c : Ordinal.{u_1})
(ab : a ≤ b)


/-- If `f` is analytic within `s` at `x`, some local extension of `f` is analytic at `x` -/
lemma AnalyticWithinAt.exists_analyticAt [CompleteSpace F] {f : E → F} {s : Set E} {x : E}
    (h : AnalyticWithinAt 𝕜 f s x) : ∃ g, f x = g x ∧ f =ᶠ[𝓝[s] x] g ∧ AnalyticAt 𝕜 g x

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f : E → F}
{s : Set E}
{x : E}
(h : AnalyticWithinAt 𝕜 f s x)


theorem NF.fst {e n a} : NF (oadd e n a) → NF e


theorem mul_of'_divOf (x : k[G]) (a : G) : x * of' k G a /ᵒᶠ a = x

{k : Type u_1}
{G : Type u_2}
[Semiring k]
[AddCancelCommMonoid G]
(x : AddMonoidAlgebra k G)
(a : G)

(x * AddMonoidAlgebra.of' k G a).divOf a = x


theorem Ioo_subset_Icc_self : Ioo a b ⊆ Icc a b


theorem aestronglyMeasurable'_condexpInd (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) :
    AEStronglyMeasurable' m (condexpInd G hm μ s x) μ

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[NormedSpace ℝ G]
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(x : G)

MeasureTheory.AEStronglyMeasurable' m (↑↑((MeasureTheory.condexpInd G hm μ s) x)) μ


/-- Lebesgue integral of a bounded function over a set of finite measure is finite.
Note that this lemma assumes no regularity of either `f` or `s`. -/
theorem setLIntegral_lt_top_of_le_nnreal {s : Set α} (hs : μ s ≠ ∞) {f : α → ℝ≥0∞}
    (hbdd : ∃ y : ℝ≥0, ∀ x ∈ s, f x ≤ y) : ∫⁻ x in s, f x ∂μ < ∞

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : μ s ≠ ⊤)
{f : α → ℝ≥0∞}
(hbdd : ∃ y, ∀ x ∈ s, f x ≤ ↑y)


theorem hasSum_lintegral_measure {ι} {_ : MeasurableSpace α} (f : α → ℝ≥0∞) (μ : ι → Measure α) :
    HasSum (fun i => ∫⁻ a, f a ∂μ i) (∫⁻ a, f a ∂Measure.sum μ)

∀ {x : MeasurableSpace α} (f : α → ℝ≥0∞) (μ : ι → MeasureTheory.Measure α),
  HasSum (fun i => ∫⁻ (a : α), f a ∂μ i) (∫⁻ (a : α), f a ∂MeasureTheory.Measure.sum μ)


theorem ConvexOn.dual (hf : ConvexOn 𝕜 s f) : ConcaveOn 𝕜 s (toDual ∘ f)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[SMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConvexOn 𝕜 s f)


theorem treesOfNumNodesEq_succ (n : ℕ) :
    treesOfNumNodesEq (n + 1) =
      (antidiagonal n).biUnion fun ij =>
        pairwiseNode (treesOfNumNodesEq ij.1) (treesOfNumNodesEq ij.2)

Tree.treesOfNumNodesEq (n + 1) =
  (Finset.antidiagonal n).biUnion fun ij =>
    Tree.pairwiseNode (Tree.treesOfNumNodesEq ij.1) (Tree.treesOfNumNodesEq ij.2)


/-- Version of `HasProd.update` for `CommMonoid` rather than `CommGroup`.
Rather than showing that `f.update` has a specific product in terms of `HasProd`,
it gives a relationship between the products of `f` and `f.update` given that both exist. -/
@[to_additive "Version of `HasSum.update` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that `f.update` has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `f.update` given that both exist."]
theorem HasProd.update' {α β : Type*} [TopologicalSpace α] [CommMonoid α] [T2Space α]
    [ContinuousMul α] [DecidableEq β] {f : β → α} {a a' : α} (hf : HasProd f a) (b : β) (x : α)
    (hf' : HasProd (update f b x) a') : a * x = a' * f b

(hf' : HasSum (Function.update f b x) a')


/-- Conjugation by a fixed element is continuous when `mul` is continuous. -/
@[to_additive (attr := continuity)
  "Conjugation by a fixed element is continuous when `add` is continuous."]
theorem TopologicalGroup.continuous_conj (g : G) : Continuous fun h : G => g * h * g⁻¹

{G : Type w}
[TopologicalSpace G]
[Inv G]
[Mul G]
[ContinuousMul G]
(g : G)


@[to_additive (attr := simp)]
lemma nndist_op (x y : α) : nndist (op x) (op y) = nndist x y

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

nndist (AddOpposite.op x) (AddOpposite.op y) = nndist x y


theorem lineMap_same_apply (p : P1) (c : k) : lineMap p p c = p

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
(p : P1)
(c : k)


@[simp]
theorem toFinset_union (s t : Multiset α) : (s ∪ t).toFinset = s.toFinset ∪ t.toFinset

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


/-- To construct a groupoid, one may consider classes of partial homeomorphisms such that
both the function and its inverse have some property. If this property is stable under composition,
one gets a groupoid. `Pregroupoid` bundles the properties needed for this construction, with the
groupoid of smooth functions with smooth inverses as an application. -/
structure Pregroupoid (H : Type*) [TopologicalSpace H] where
  /-- Property describing membership in this groupoid: the pregroupoid "contains"
    all functions `H → H` having the pregroupoid property on some `s : Set H` -/
  property : (H → H) → Set H → Prop
  /-- The pregroupoid property is stable under composition -/
  comp : ∀ {f g u v}, property f u → property g v →
    IsOpen u → IsOpen v → IsOpen (u ∩ f ⁻¹' v) → property (g ∘ f) (u ∩ f ⁻¹' v)
  /-- Pregroupoids contain the identity map (on `univ`) -/
  id_mem : property id univ
  /-- The pregroupoid property is "local", in the sense that `f` has the pregroupoid property on `u`
  iff its restriction to each open subset of `u` has it -/
  locality :
    ∀ {f u}, IsOpen u → (∀ x ∈ u, ∃ v, IsOpen v ∧ x ∈ v ∧ property f (u ∩ v)) → property f u
  /-- If `f = g` on `u` and `property f u`, then `property g u` -/
  congr : ∀ {f g : H → H} {u}, IsOpen u → (∀ x ∈ u, g x = f x) → property f u → property g u

{H : Type u_5}
[TopologicalSpace H]
(self : Pregroupoid H)
{f : H → H}
{u : Set H}

IsOpen u → (∀ x ∈ u, ∃ v, IsOpen v ∧ x ∈ v ∧ self.property f (u ∩ v)) → self.property f u


theorem eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul {f : α → F} {g : α → G} {c : ℝ≥0}
    (h : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ c * ‖g x‖₊) (p : ℝ≥0∞) : eLpNorm f p μ ≤ c • eLpNorm g p μ

(h : ∀ᵐ (x : α) ∂μ, ‖f x‖₊ ≤ c * ‖g x‖₊)

MeasureTheory.eLpNorm f p μ ≤ c • MeasureTheory.eLpNorm g p μ


theorem keys_kerase {a} {l : List (Sigma β)} : (kerase a l).keys = l.keys.erase a

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


theorem hasSum_inr [AddCommMonoid R] [AddCommMonoid M] {f : α → M} {a : M} (h : HasSum f a) :
    HasSum (fun x ↦ inr (f x)) (inr a : tsze R M)

{α : Type u_1}
{R : Type u_3}
(M : Type u_4)
[TopologicalSpace R]
[TopologicalSpace M]
[AddCommMonoid R]
[AddCommMonoid M]
{f : α → M}
{a : M}
(h : HasSum f a)

HasSum (fun x => TrivSqZeroExt.inr (f x)) (TrivSqZeroExt.inr a)


@[simp]
lemma toFinset_Ioi (a : α) [Fintype (Ioi a)] : (Ioi a).toFinset = Finset.Ioi a

{α : Type u_3}
[Preorder α]
[LocallyFiniteOrderTop α]
(a : α)
[Fintype ↑(Set.Ioi a)]


protected theorem smul_assoc : (I • J) • N = I • J • N

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(I J : Ideal R)
(N : Submodule R M)


/-- If at least one `π i` is infinite and the rest nonempty, the pi type of all `π` is infinite. -/
theorem Pi.infinite_of_exists_right {ι : Sort*} {π : ι → Sort*} (i : ι) [Infinite <| π i]
    [∀ i, Nonempty <| π i] : Infinite (∀ i : ι, π i)

{ι : Sort u_4}
{π : ι → Sort u_5}
(i : ι)
[Infinite (π i)]
[∀ (i : ι), Nonempty (π i)]


theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn 𝕜 f s) (hg : f =ᶠ[𝓝ˢ s] g) :
    AnalyticOn 𝕜 g s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{s : Set E}
(hf : AnalyticOn 𝕜 f s)
(hg : f =ᶠ[𝓝ˢ s] g)


@[simp]
theorem coe_smul (f : M [⋀^ι]→L[A] N) (c : R') : ⇑(c • f) = c • ⇑f

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


@[simp, norm_cast, nolint simpNF]
theorem coe_min (x y : ℚ≥0) : ((min x y : ℚ≥0) : ℚ) = min (x : ℚ) (y : ℚ)


theorem upperSemicontinuousWithinAt_ciInf {f : ι → α → δ'}
    (bdd : ∀ᶠ y in 𝓝[s] x, BddBelow (range fun i => f i y))
    (h : ∀ i, UpperSemicontinuousWithinAt (f i) s x) :
    UpperSemicontinuousWithinAt (fun x' => ⨅ i, f i x') s x

{f : ι → α → δ'}

(bdd : ∀ᶠ (y : α) in 𝓝[s] x, BddBelow (Set.range fun i => f i y))

(h : ∀ (i : ι), UpperSemicontinuousWithinAt (f i) s x)


lemma IsSublattice.image [FunLike F α β] [LatticeHomClass F α β] (hs : IsSublattice s) (f : F) :
    IsSublattice (f '' s)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
{s : Set α}
[FunLike F α β]
[LatticeHomClass F α β]
(hs : IsSublattice s)
(f : F)


@[simp]
theorem bind₁_onePoly_wittPolynomial [hp : Fact p.Prime] (n : ℕ) :
    bind₁ onePoly (wittPolynomial p ℤ n) = 1

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

(MvPolynomial.bind₁ WittVector.onePoly) (wittPolynomial p ℤ n) = 1


@[simp]
theorem frontier_Ioc [NoMaxOrder α] {a b : α} (h : a < b) : frontier (Ioc a b) = {a, b}

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMaxOrder α]
{a b : α}
(h : a < b)


theorem untrop_sum_eq_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finset S)
    (f : S → Tropical (WithTop R)) : untrop (∑ i ∈ s, f i) = sInf (untrop ∘ f '' s)

{R : Type u_1}
{S : Type u_2}
[ConditionallyCompleteLinearOrder R]
(s : Finset S)
(f : S → Tropical (WithTop R))

Tropical.untrop (∑ i ∈ s, f i) = sInf (Tropical.untrop ∘ f '' ↑s)


@[simp]
theorem map_iSup {β ι} (f : α → β) (m : ι → OuterMeasure α) : map f (⨆ i, m i) = ⨆ i, map f (m i)

{α : Type u_1}
{β : Type u_3}
{ι : Sort u_4}
(f : α → β)
(m : ι → MeasureTheory.OuterMeasure α)

(MeasureTheory.OuterMeasure.map f) (⨆ i, m i) = ⨆ i, (MeasureTheory.OuterMeasure.map f) (m i)


/-- This is the `iff` version of `Matrix.IsHermitian.fromBlocks`. -/
theorem isHermitian_fromBlocks_iff {A : Matrix m m α} {B : Matrix m n α} {C : Matrix n m α}
    {D : Matrix n n α} :
    (A.fromBlocks B C D).IsHermitian ↔ A.IsHermitian ∧ Bᴴ = C ∧ Cᴴ = B ∧ D.IsHermitian

{α : Type u_1}
{m : Type u_3}
{n : Type u_4}
[InvolutiveStar α]
{A : Matrix m m α}
{B : Matrix m n α}
{C : Matrix n m α}
{D : Matrix n n α}

(Matrix.fromBlocks A B C D).IsHermitian ↔ A.IsHermitian ∧ B.conjTranspose = C ∧ C.conjTranspose = B ∧ D.IsHermitian


@[to_additive]
theorem smul_Lp_sub (c : Mᵈᵐᵃ) : ∀ f g : Lp E p μ, c • (f - g) = c • f - c • g

[MeasureTheory.VAddInvariantMeasure M α μ]


theorem mk_perm_eq_two_power : #(Equiv.Perm α) = 2 ^ #α


@[simp] theorem reverse_infix : reverse l₁ <:+: reverse l₂ ↔ l₁ <:+: l₂

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.reverse <:+: l₂.reverse ↔ l₁ <:+: l₂


/-- The measure of a segment is the distance between its endpoints. -/
@[simp]
theorem hausdorffMeasure_segment {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [MeasurableSpace E] [BorelSpace E] (x y : E) : μH[1] (segment ℝ x y) = edist x y

{E : Type u_7}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(x y : E)


theorem round_le (x : α) (z : ℤ) : |x - round x| ≤ |x - z|

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


@[to_additive (attr := simp)]
theorem prod_sdiff_eq_div (h : s₁ ⊆ s₂) :
    ∏ x ∈ s₂ \ s₁, f x = (∏ x ∈ s₂, f x) / ∏ x ∈ s₁, f x

{α : Type u_3}
{β : Type u_4}
{s₁ s₂ : Finset α}
{f : α → β}
[CommGroup β]
[DecidableEq α]
(h : s₁ ⊆ s₂)


@[simp]
theorem map_eq_map {α β} (f : α → β) (l : List α) : f <$> l = map f l

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


@[to_additive]
protected lemma mul_div_mul_left (h : IsUnit c) (a b : α) : c * a / (c * b) = a / b

{α : Type u}
[SubtractionCommMonoid α]
{c : α}
(h : IsAddUnit c)
(a b : α)


theorem iUnion_setOf (P : ι → α → Prop) : ⋃ i, { x : α | P i x } = { x : α | ∃ i, P i x }

{α : Type u_1}
{ι : Sort u_4}
(P : ι → α → Prop)


theorem GradedAlgebra.ι_sq_zero (m : M) : GradedAlgebra.ι R M m * GradedAlgebra.ι R M m = 0

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

(ExteriorAlgebra.GradedAlgebra.ι R M) m * (ExteriorAlgebra.GradedAlgebra.ι R M) m = 0


theorem smul_iSup {ι : Sort*} {R} [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] (f : ι → ℝ≥0∞)
    (c : R) : (c • ⨆ i, f i) = ⨆ i, c • f i

{ι : Sort u_4}
{R : Type u_5}
[SMul R ℝ≥0∞]
[IsScalarTower R ℝ≥0∞ ℝ≥0∞]
(f : ι → ℝ≥0∞)
(c : R)


theorem toWeakDualBCNN_continuous : Continuous (@toWeakDualBCNN Ω _ _ _)

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


theorem vsub_mem_vsub (hb : b ∈ s) (hc : c ∈ t) : b -ᵥ c ∈ s -ᵥ t

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{s t : Set β}
{b c : β}
(hb : b ∈ s)
(hc : c ∈ t)


/-- If `E` is a fiber bundle over a conditionally complete linear order,
then it is trivial over any closed interval. -/
theorem FiberBundle.exists_trivialization_Icc_subset [ConditionallyCompleteLinearOrder B]
    [OrderTopology B] [FiberBundle F E] (a b : B) :
    ∃ e : Trivialization F (π F E), Icc a b ⊆ e.baseSet

[TopologicalSpace (Bundle.TotalSpace F E)]


@[simp]
theorem convexJoin_empty_right (s : Set E) : convexJoin 𝕜 s ∅ = ∅

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(s : Set E)


/-- The preimage of the image of a set under the quotient map to `connectedComponents α`
is the union of the connected components of the elements in it. -/
theorem connectedComponents_preimage_image (U : Set α) :
    (↑) ⁻¹' ((↑) '' U : Set (ConnectedComponents α)) = ⋃ x ∈ U, connectedComponent x

{α : Type u}
[TopologicalSpace α]
(U : Set α)

ConnectedComponents.mk ⁻¹' (ConnectedComponents.mk '' U) = ⋃ x ∈ U, connectedComponent x


/-- The `n = 1` case of the Ahlswede-Daykin inequality. Note that we can't just expand everything
out and bound termwise since `c₀ * d₁` appears twice on the RHS of the assumptions while `c₁ * d₀`
does not appear. -/
private lemma ineq {a₀ a₁ b₀ b₁ c₀ c₁ d₀ d₁ : β}
    (ha₀ : 0 ≤ a₀) (ha₁ : 0 ≤ a₁) (hb₀ : 0 ≤ b₀) (hb₁ : 0 ≤ b₁)
    (hc₀ : 0 ≤ c₀) (hc₁ : 0 ≤ c₁) (hd₀ : 0 ≤ d₀) (hd₁ : 0 ≤ d₁)
    (h₀₀ : a₀ * b₀ ≤ c₀ * d₀) (h₁₀ : a₁ * b₀ ≤ c₀ * d₁)
    (h₀₁ : a₀ * b₁ ≤ c₀ * d₁) (h₁₁ : a₁ * b₁ ≤ c₁ * d₁) :
    (a₀ + a₁) * (b₀ + b₁) ≤ (c₀ + c₁) * (d₀ + d₁)

{β : Type u_2}
[LinearOrderedCommSemiring β]
[ExistsAddOfLE β]
{a₀ a₁ b₀ b₁ c₀ c₁ d₀ d₁ : β}
(ha₀ : 0 ≤ a₀)
(ha₁ : 0 ≤ a₁)
(hb₀ : 0 ≤ b₀)
(hb₁ : 0 ≤ b₁)
(hc₀ : 0 ≤ c₀)
(hc₁ : 0 ≤ c₁)
(hd₀ : 0 ≤ d₀)
(hd₁ : 0 ≤ d₁)
(h₀₀ : a₀ * b₀ ≤ c₀ * d₀)
(h₁₀ : a₁ * b₀ ≤ c₀ * d₁)
(h₀₁ : a₀ * b₁ ≤ c₀ * d₁)
(h₁₁ : a₁ * b₁ ≤ c₁ * d₁)


theorem DifferentiableOn.zpow (hf : DifferentiableOn 𝕜 f t) (h : (∀ x ∈ t, f x ≠ 0) ∨ 0 ≤ m) :
    DifferentiableOn 𝕜 (fun x => f x ^ m) t

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{m : ℤ}
{f : E → 𝕜}
{t : Set E}
(hf : DifferentiableOn 𝕜 f t)
(h : (∀ x ∈ t, f x ≠ 0) ∨ 0 ≤ m)


@[to_additive]
theorem pairwise_disjoint_Ico_zpow :
    Pairwise (Disjoint on fun n : ℤ => Ico (b ^ n) (b ^ (n + 1)))

{α : Type u_1}
[OrderedAddCommGroup α]
(b : α)

Pairwise (Disjoint on fun n => Set.Ico (n • b) ((n + 1) • b))


theorem NullMeasurable.measurable_of_complete [μ.IsComplete] {_m1 : MeasurableSpace β} {f : α → β}
    (hf : NullMeasurable f μ) : Measurable f

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[μ.IsComplete]
{_m1 : MeasurableSpace β}
{f : α → β}
(hf : MeasureTheory.NullMeasurable f μ)


theorem toEnd (h : ValidFor l r it) : ValidFor (r.reverse ++ l) [] it.toEnd

{l r : List Char}
{it : String.Iterator}
(h : String.Iterator.ValidFor l r it)

String.Iterator.ValidFor (r.reverse ++ l) [] it.toEnd


@[simp]
theorem cyclicPermutations_inj {l l' : List α} :
    cyclicPermutations l = cyclicPermutations l' ↔ l = l'

l.cyclicPermutations = l'.cyclicPermutations ↔ l = l'


/-- Constructor for bicomplexes taking as inputs a graded object, horizontal differentials
and vertical differentials satisfying suitable relations. -/
@[simps]
def ofGradedObject :
    HomologicalComplex₂ C c₁ c₂

(X : CategoryTheory.GradedObject (I₁ × I₂) C)

(d₁ : (i₁ i₁' : I₁) → (i₂ : I₂) → X (i₁, i₂) ⟶ X (i₁', i₂))

(d₂ : (i₁ : I₁) → (i₂ i₂' : I₂) → X (i₁, i₂) ⟶ X (i₁, i₂'))

(shape₁ : ∀ (i₁ i₁' : I₁), ¬c₁.Rel i₁ i₁' → ∀ (i₂ : I₂), d₁ i₁ i₁' i₂ = 0)

(shape₂ : ∀ (i₁ : I₁) (i₂ i₂' : I₂), ¬c₂.Rel i₂ i₂' → d₂ i₁ i₂ i₂' = 0)

(d₁_comp_d₁ : ∀ (i₁ i₁' i₁'' : I₁) (i₂ : I₂), d₁ i₁ i₁' i₂ ≫ d₁ i₁' i₁'' i₂ = 0)

(d₂_comp_d₂ : ∀ (i₁ : I₁) (i₂ i₂' i₂'' : I₂), d₂ i₁ i₂ i₂' ≫ d₂ i₁ i₂' i₂'' = 0)

(comm : ∀ (i₁ i₁' : I₁) (i₂ i₂' : I₂), d₁ i₁ i₁' i₂ ≫ d₂ i₁' i₂ i₂' = d₂ i₁ i₂ i₂' ≫ d₁ i₁ i₁' i₂')

((HomologicalComplex₂.ofGradedObject c₁ c₂ X d₁ d₂ shape₁ shape₂ d₁_comp_d₁ d₂_comp_d₂ comm).X i₁).d i₂ i₂' =
  d₂ i₁ i₂ i₂'


theorem Equiv_isup_of_apply {i : ι} (x : S i) :
    Equiv_iSup S (of L ι _ (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) i x)
    = Substructure.inclusion (le_iSup _ _) x

{L : FirstOrder.Language}
{ι : Type v}
[Preorder ι]
[Nonempty ι]
[IsDirected ι fun x x_1 => x ≤ x_1]
{M : Type u_1}
[L.Structure M]
(S : ι →o L.Substructure M)
{i : ι}
(x : ↥(S i))

(FirstOrder.Language.DirectLimit.Equiv_iSup S)
    ((FirstOrder.Language.DirectLimit.of L ι (fun x => ↥(S x))
        (fun x x_1 h => FirstOrder.Language.Substructure.inclusion ⋯) i)
      x) =
  (FirstOrder.Language.Substructure.inclusion ⋯) x


@[simp]
theorem append_elim0 {α : Type*} (u : Fin m → α) :
    append u Fin.elim0 = u ∘ Fin.cast (Nat.add_zero _)


@[simp] theorem countP_map (p : β → Bool) (f : α → β) :
    ∀ l, countP p (map f l) = countP (p ∘ f) l

{α : Type u_2}
{β : Type u_1}
(p : β → Bool)
(f : α → β)
(l : List α)

List.countP p (List.map f l) = List.countP (p ∘ f) l


theorem IsBoundedUnder.isCoboundedUnder_le {u : γ → α} {l : Filter γ} [Preorder α] [NeBot l]
    (h : l.IsBoundedUnder (· ≥ ·) u) : l.IsCoboundedUnder (· ≤ ·) u

(h : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) l u)

Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) l u


@[simp, reassoc]
theorem t'_fst_fst_snd (i j k : 𝒰.J) :
    t' 𝒰 f g i j k ≫ pullback.fst _ _ ≫ pullback.fst _ _ ≫ pullback.snd _ _ =
      pullback.fst _ _ ≫ pullback.fst _ _ ≫ pullback.snd _ _

[∀ (i : 𝒰.J), CategoryTheory.Limits.HasPullback (𝒰.map i ≫ f) g]

AlgebraicGeometry.Scheme.Pullback.t' 𝒰 f g i j k ≫
    CategoryTheory.Limits.pullback.fst (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g j k)
        (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g j i) ≫
      CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst (𝒰.map j ≫ f) g ≫ 𝒰.map j) (𝒰.map k) ≫
        CategoryTheory.Limits.pullback.snd (𝒰.map j ≫ f) g =
  CategoryTheory.Limits.pullback.fst (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i j)
      (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i k) ≫
    CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst (𝒰.map i ≫ f) g ≫ 𝒰.map i) (𝒰.map j) ≫
      CategoryTheory.Limits.pullback.snd (𝒰.map i ≫ f) g


theorem subset_coe_map (f : α →o β) (s : NonemptyInterval α) : f '' s ⊆ s.map f

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[PartialOrder β]
(f : α →o β)
(s : NonemptyInterval α)


@[simp] lemma neg_emod_two (i : ℤ) : -i % 2 = i % 2


theorem exists_le_mul_self (a : R) : ∃ x ≥ 0, a ≤ x * x

{R : Type u_6}
[LinearOrderedSemiring R]
(a : R)


/-- This is an auxiliary data structure useful for constructing adjunctions.
See `Adjunction.mkOfHomEquiv`.
This structure won't typically be used anywhere else.
-/
-- Porting note(#5171): `has_nonempty_instance` linter not ported yet
-- @[nolint has_nonempty_instance]
structure CoreHomEquiv (F : C ⥤ D) (G : D ⥤ C) where
  /-- The equivalence between `Hom (F X) Y` and `Hom X (G Y)` -/
  homEquiv : ∀ X Y, (F.obj X ⟶ Y) ≃ (X ⟶ G.obj Y)
  /-- The property that describes how `homEquiv.symm` transforms compositions `X' ⟶ X ⟶ G Y` -/
  homEquiv_naturality_left_symm :
    ∀ {X' X Y} (f : X' ⟶ X) (g : X ⟶ G.obj Y),
      (homEquiv X' Y).symm (f ≫ g) = F.map f ≫ (homEquiv X Y).symm g := by
    aesop_cat
  /-- The property that describes how `homEquiv` transforms compositions `F X ⟶ Y ⟶ Y'` -/
  homEquiv_naturality_right :
    ∀ {X Y Y'} (f : F.obj X ⟶ Y) (g : Y ⟶ Y'),
      (homEquiv X Y') (f ≫ g) = (homEquiv X Y) f ≫ G.map g := by
    aesop_cat

(self : CategoryTheory.Adjunction.CoreHomEquiv F G)

(self.homEquiv X' Y).symm (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.CategoryStruct.comp (F.map f) ((self.homEquiv X Y).symm g)


theorem LieAlgebra.nilpotent_ad_of_nilpotent_algebra [IsNilpotent R L] :
    ∃ k : ℕ, ∀ x : L, ad R L x ^ k = 0

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]

∃ k, ∀ (x : L), (LieAlgebra.ad R L) x ^ k = 0


@[simp]
theorem support_mk_subset {s : Finset ι} {x : ∀ i : (↑s : Set ι), β i.1} : (mk s x).support ⊆ s

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


theorem isProper_of_ne_top (ne_top : I ≠ ⊤) : IsProper I

{P : Type u_1}
[LE P]
[IsDirected P fun x x_1 => x ≤ x_1]
[Nonempty P]
{I : Order.Ideal P}
(ne_top : I ≠ ⊤)


@[simp]
theorem toOpen_germ (U : Opens (PrimeSpectrum.Top R)) (x : U) :
    toOpen R U ≫ (structureSheaf R).presheaf.germ x = toStalk R x

(U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

AlgebraicGeometry.StructureSheaf.toOpen R U ≫ (AlgebraicGeometry.Spec.structureSheaf R).presheaf.germ x =
  AlgebraicGeometry.StructureSheaf.toStalk R ↑x


theorem snoc_rev {α n} (a : α) (f : Fin n → α) (i : Fin <| n + 1) :
    snoc (α := fun _ => α) f a i.rev = cons (α := fun _ => α) a (f ∘ Fin.rev : Fin _ → α) i

{α : Type u_1}
{n : ℕ}
(a : α)
(f : Fin n → α)
(i : Fin (n + 1))

Fin.snoc f a i.rev = Fin.cons a (f ∘ Fin.rev) i


lemma div_def' (q r : ℚ) : q / r = (q.num * r.den) /. (q.den * r.num)

q / r = Rat.divInt (q.num * ↑r.den) (↑q.den * r.num)


theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι → α}
    (hf : Directed (· ≤ ·) f) (he : Function.Injective e) :
    Directed (· ≤ ·) (Function.extend e f ⊥)

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

Directed (fun x x_1 => x ≤ x_1) (Function.extend e f ⊥)


@[to_additive (attr := congr)]
theorem noncommProd_congr {s₁ s₂ : Finset α} {f g : α → β} (h₁ : s₁ = s₂)
    (h₂ : ∀ x ∈ s₂, f x = g x) (comm) :
    noncommProd s₁ f comm =
      noncommProd s₂ g fun x hx y hy h => by
        dsimp only
        rw [← h₂ _ hx, ← h₂ _ hy]
        subst h₁
        exact comm hx hy h

(comm : (↑s₁).Pairwise fun a b => AddCommute (f a) (f b))

s₁.noncommSum f comm = s₂.noncommSum g ⋯


/-- Any partial order can be extended to a linear order.
-/
theorem extend_partialOrder {α : Type u} (r : α → α → Prop) [IsPartialOrder α r] :
    ∃ s : α → α → Prop, IsLinearOrder α s ∧ r ≤ s


theorem withDensityᵥ_smul_eq_withDensityᵥ_withDensity' {f : α → ℝ≥0∞} {g : α → E}
    (hf : AEMeasurable f μ) (hflt : ∀ᵐ x ∂μ, f x < ∞)
    (hfg : Integrable (fun x ↦ (f x).toReal • g x) μ) :
    μ.withDensityᵥ (fun x ↦ (f x).toReal • g x) = (μ.withDensity f).withDensityᵥ g

{f : α → ℝ≥0∞}

(hfg : MeasureTheory.Integrable (fun x => (f x).toReal • g x) μ)

(μ.withDensityᵥ fun x => (f x).toReal • g x) = (μ.withDensity f).withDensityᵥ g


lemma dual_surjective_of_injective (f : A →ₗ[R] B) (hf : Function.Injective f) :
    Function.Surjective (dual f)

{R : Type uR}
[CommRing R]
{A : Type uA}
[AddCommGroup A]
{B : Type uB}
[AddCommGroup B]
[Module R A]
[Module R B]
(f : A →ₗ[R] B)
(hf : Function.Injective ⇑f)


@[to_additive (attr := simp)]
lemma range_mk : range (QuotientGroup.mk (s := s)) = univ

{α : Type u_1}
[AddGroup α]
{s : AddSubgroup α}

Set.range QuotientAddGroup.mk = Set.univ


@[simp]
theorem subtypeₐᵢ_linearIsometry (s : AffineSubspace 𝕜 P) [Nonempty s] :
    s.subtypeₐᵢ.linearIsometry = s.direction.subtypeₗᵢ

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_10}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(s : AffineSubspace 𝕜 P)
[Nonempty ↥s]


theorem ext_iff (A B : unitaryGroup n α) : A = B ↔ ∀ i j, A i j = B i j

{n : Type u}
[DecidableEq n]
[Fintype n]
{α : Type v}
[CommRing α]
[StarRing α]
(A B : ↥(Matrix.unitaryGroup n α))


/-- Bijection between `MulOpposite` of a subsemiring `S` and its opposite. -/
@[simps!]
def mopRingEquivOp (S : Subsemiring R) : Sᵐᵒᵖ ≃+* S.op

{R : Type u_2}
[NonAssocSemiring R]
(S : Subsemiring R)

∀ (a : ↥S.op), S.mopRingEquivOp.symm a = MulOpposite.op (S.addEquivOp.symm a)


@[simp]
theorem gcd_singleton {a : α} : ({a} : Multiset α).gcd = normalize a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{a : α}


@[to_additive]
theorem prod_single_index [∀ i, Zero (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)] [CommMonoid γ]
    {i : ι} {b : β i} {h : ∀ i, β i → γ} (h_zero : h i 0 = 1) : (single i b).prod h = h i b


theorem map_of_continuousAt (h : x ~ᵢ y) (hx : ContinuousAt f x) (hy : ContinuousAt f y) :
    f x ~ᵢ f y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{x y : X}
{f : X → Y}
(h : x ~ᵢ y)
(hx : ContinuousAt f x)
(hy : ContinuousAt f y)


theorem colimit_rep_eq_iff_exists [HasColimit F] {i j : J} (x : F.obj i) (y : F.obj j) :
    colimit.ι F i x = colimit.ι F j y ↔ ∃ (k : _) (f : i ⟶ k) (g : j ⟶ k), F.map f x = F.map g y

[CategoryTheory.Limits.PreservesColimit F (CategoryTheory.forget C)]

(x : (CategoryTheory.forget C).obj (F.obj i))

(y : (CategoryTheory.forget C).obj (F.obj j))

(CategoryTheory.Limits.colimit.ι F i) x = (CategoryTheory.Limits.colimit.ι F j) y ↔ ∃ k f g, (F.map f) x = (F.map g) y


@[simp]
theorem bind_def {α β} : (· >>= ·) = sup (α := Finset α) (β := β)

[(P : Prop) → Decidable P]
{α β : Type u_1}


/-- Baire theorem: a countable intersection of dense open sets is dense. Formulated here with
an index set which is a countable type. -/
theorem dense_iInter_of_isOpen [Countable ι] {f : ι → Set X} (ho : ∀ i, IsOpen (f i))
    (hd : ∀ i, Dense (f i)) : Dense (⋂ s, f s)

{X : Type u_1}
{ι : Sort u_3}
[TopologicalSpace X]
[BaireSpace X]
[Countable ι]
{f : ι → Set X}
(ho : ∀ (i : ι), IsOpen (f i))
(hd : ∀ (i : ι), Dense (f i))


@[reassoc (attr := simp)]
theorem pullbackSymmetry_inv_comp_snd [HasPullback f g] :
    (pullbackSymmetry f g).inv ≫ pullback.snd f g = pullback.fst g f

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

(CategoryTheory.Limits.pullbackSymmetry f g).inv ≫ CategoryTheory.Limits.pullback.snd f g =
  CategoryTheory.Limits.pullback.fst g f


/--
The composition of the inverse of the isomorphism `pullbackSepcIso R S T` (from the pullback of
`Spec S ⟶ Spec R` and `Spec T ⟶ Spec R` to `Spec (S ⊗[R] T)`) with the first projection is
the morphism `Spec (S ⊗[R] T) ⟶ Spec S` obtained by applying `Spec.map` to the ring morphism
`s ↦ s ⊗ₜ[R] 1`.
-/
@[reassoc (attr := simp)]
lemma pullbackSpecIso_inv_fst :
    (pullbackSpecIso R S T).inv ≫ pullback.fst _ _ = Spec.map (ofHom includeLeftRingHom)

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

(AlgebraicGeometry.pullbackSpecIso R S T).inv ≫
    CategoryTheory.Limits.pullback.fst (AlgebraicGeometry.Spec.map (CommRingCat.ofHom (algebraMap R S)))
      (AlgebraicGeometry.Spec.map (CommRingCat.ofHom (algebraMap R T))) =
  AlgebraicGeometry.Spec.map (CommRingCat.ofHom Algebra.TensorProduct.includeLeftRingHom)


@[to_additive]
theorem finprod_mem_eq_one_of_infinite {f : α → M} {s : Set α} (hs : (s ∩ mulSupport f).Infinite) :
    ∏ᶠ i ∈ s, f i = 1

(hs : (s ∩ Function.support f).Infinite)


@[to_additive zsmul_strictMono_right]
lemma zpow_strictMono_left (hn : 0 < n) : StrictMono ((· ^ n) : α → α)

(α : Type u_1)
[OrderedAddCommGroup α]
{n : ℤ}
(hn : 0 < n)


/-- In a real vector space, a convex set with nonempty interior is a set of unique
differentiability at every point of its closure. -/
theorem uniqueDiffWithinAt_convex {s : Set G} (conv : Convex ℝ s) (hs : (interior s).Nonempty)
    {x : G} (hx : x ∈ closure s) : UniqueDiffWithinAt ℝ s x

{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{s : Set G}
(conv : Convex ℝ s)
(hs : (interior s).Nonempty)
{x : G}
(hx : x ∈ closure s)


@[simp]
theorem num_smul (c : NumDenSameDeg 𝒜 x) (m : α) : ((m • c).num : A) = m • c.num

(c : HomogeneousLocalization.NumDenSameDeg 𝒜 x)


@[simp] theorem encard_lt_top_iff : s.encard < ⊤ ↔ s.Finite


/-- `SatisfiesM` distributes over `<*>`, general version. -/
protected theorem seq [Applicative m] [LawfulApplicative m] {x : m α}
    (hf : SatisfiesM p₁ f) (hx : SatisfiesM p₂ x)
    (H : ∀ {f a}, p₁ f → p₂ a → q (f a)) : SatisfiesM q (f <*> x)

{m : Type u_1 → Type u_2}
{α : Type u_1}

∀ {α_1 : Type u_1} {p₁ : (α → α_1) → Prop} {f : m (α → α_1)} {p₂ : α → Prop} {q : α_1 → Prop} [inst : Applicative m]
  [inst_1 : LawfulApplicative m] {x : m α},
  SatisfiesM p₁ f →
    SatisfiesM p₂ x → (∀ {f : α → α_1} {a : α}, p₁ f → p₂ a → q (f a)) → SatisfiesM q (Seq.seq f fun x_1 => x)


theorem toMeasure_apply_eq_zero_iff (hs : MeasurableSet s) :
    p.toMeasure s = 0 ↔ Disjoint p.support s

{α : Type u_1}
[MeasurableSpace α]
(p : PMF α)
(s : Set α)
(hs : MeasurableSet s)


@[simp]
theorem star_zpow₀ [DivisionSemiring R] [StarRing R] (x : R) (z : ℤ) : star (x ^ z) = star x ^ z

{R : Type u}
[DivisionSemiring R]
[StarRing R]
(x : R)
(z : ℤ)


@[simp] lemma isNilpotent_reflect_iff {P : R[X]} {N : ℕ} (hN : P.natDegree ≤ N) :
    IsNilpotent (reflect N P) ↔ IsNilpotent P

{R : Type u_1}
[CommRing R]
{P : Polynomial R}
{N : ℕ}
(hN : P.natDegree ≤ N)

IsNilpotent (Polynomial.reflect N P) ↔ IsNilpotent P


lemma isIso_homologyMap_τ₃ (i : ι)
    (h₁ : Epi (homologyMap φ.τ₁ i))
    (h₂ : IsIso (homologyMap φ.τ₂ i))
    (h₃ : ∀ j, c.Rel i j → IsIso (homologyMap φ.τ₁ j))
    (h₄ : ∀ j, c.Rel i j → Mono (homologyMap φ.τ₂ j)) :
    IsIso (homologyMap φ.τ₃ i)

{S₁ S₂ : CategoryTheory.ShortComplex (HomologicalComplex C c)}

(h₁ : CategoryTheory.Epi (HomologicalComplex.homologyMap φ.τ₁ i))

(h₂ : CategoryTheory.IsIso (HomologicalComplex.homologyMap φ.τ₂ i))

(h₃ : ∀ (j : ι), c.Rel i j → CategoryTheory.IsIso (HomologicalComplex.homologyMap φ.τ₁ j))

(h₄ : ∀ (j : ι), c.Rel i j → CategoryTheory.Mono (HomologicalComplex.homologyMap φ.τ₂ j))

CategoryTheory.IsIso (HomologicalComplex.homologyMap φ.τ₃ i)


/-- The **Hales-Jewett theorem**: For any finite types `α` and `κ`, there exists a finite type `ι`
such that whenever the hypercube `ι → α` is `κ`-colored, there is a monochromatic combinatorial
line. -/
theorem exists_mono_in_high_dimension (α : Type u) [Finite α] (κ : Type v) [Finite κ] :
    ∃ (ι : Type) (_ : Fintype ι), ∀ C : (ι → α) → κ, ∃ l : Line α ι, l.IsMono C

∃ ι x, ∀ (C : (ι → α) → κ), ∃ l, Combinatorics.Line.IsMono C l


/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI. -/
lemma injOn_dualMap_subtype_span_root_coroot [NoZeroSMulDivisors ℤ M] :
    InjOn ((span R (range P.root)).subtype.dualMap ∘ₗ P.toLin.flip) (range P.coroot)

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
[Finite ι]
(P : RootPairing ι R M N)
[NoZeroSMulDivisors ℤ M]

Set.InjOn (⇑((Submodule.span R (Set.range ⇑P.root)).subtype.dualMap ∘ₗ P.toLin.flip)) (Set.range ⇑P.coroot)


@[simp]
theorem map_leftInverse [Nonempty β] [Nonempty δ] {f₁ : α → β} {g₁ : γ → δ} {f₂ : β → α}
    {g₂ : δ → γ} : LeftInverse (map f₁ g₁) (map f₂ g₂) ↔ LeftInverse f₁ f₂ ∧ LeftInverse g₁ g₂

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
[Nonempty β]
[Nonempty δ]
{f₁ : α → β}
{g₁ : γ → δ}
{f₂ : β → α}
{g₂ : δ → γ}

Function.LeftInverse (Prod.map f₁ g₁) (Prod.map f₂ g₂) ↔ Function.LeftInverse f₁ f₂ ∧ Function.LeftInverse g₁ g₂


@[simp]
theorem zero_apply (x : (⊤ : Submodule R E)) : (0 : E →ₗ.[R] F) x = 0

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(x : ↥⊤)


lemma not_surjective_countable_uncountable [Countable α] [Uncountable β] (f : α → β) :
    ¬Surjective f

{α : Sort u}
{β : Sort v}
[Countable α]
[Uncountable β]
(f : α → β)


lemma cfc_comp_zpow (f : R → R) (n : ℤ) (a : Aˣ)
    (hf : ContinuousOn f ((· ^ n) '' (spectrum R (a : A))) := by cfc_cont_tac)
    (ha : p a := by cfc_tac) :
    cfc (fun x ↦ f (x ^ n)) (a : A) = cfc f (↑(a ^ n) : A)

(hf : ContinuousOn f ((fun x => x ^ n) '' spectrum R ↑a) := by cfc_cont_tac)

cfc (fun x => f (x ^ n)) ↑a = cfc f ↑(a ^ n)


/-- The function `x ^ y` tends to `+∞` at `+∞` for any positive real `y`. -/
theorem tendsto_rpow_atTop {y : ℝ} (hy : 0 < y) : Tendsto (fun x : ℝ => x ^ y) atTop atTop

Filter.Tendsto (fun x => x ^ y) Filter.atTop Filter.atTop


lemma negAddY_of_X_eq' {P Q : Fin 3 → R} (hP : W'.Equation P) (hQ : W'.Equation Q)
    (hx : P x * Q z ^ 2 = Q x * P z ^ 2) :
    W'.negAddY P Q * (P z * Q z) ^ 3 = (P y * Q z ^ 3 - Q y * P z ^ 3) ^ 3

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P Q : Fin 3 → R}
(hP : W'.Equation P)
(hQ : W'.Equation Q)
(hx : P x * Q z ^ 2 = Q x * P z ^ 2)


@[simp]
theorem coe_nsmul (s : Cₛ^n⟮I; F, V⟯) (k : ℕ) : ⇑(k • s : Cₛ^n⟮I; F, V⟯) = k • ⇑s

[TopologicalSpace (Bundle.TotalSpace F V)]


@[simp, norm_cast] lemma cast_ofNat (n : ℕ) [n.AtLeastTwo] :
    ((no_index (OfNat.ofNat n : ℚ)) : α) = (OfNat.ofNat n : α)

{α : Type u_3}
[DivisionRing α]
(n : ℕ)
[n.AtLeastTwo]


@[to_additive]
theorem period_dvd_exponent (m : M) (a : α) : period m a ∣ Monoid.exponent M

{α : Type v}
{M : Type u}
[AddMonoid M]
[AddAction M α]
(m : M)
(a : α)

AddAction.period m a ∣ AddMonoid.exponent M


/-- Let `P` be a property on ideals. If `P` holds for square-zero ideals, and if
  `P I → P (J ⧸ I) → P J`, then `P` holds for all nilpotent ideals. -/
theorem Ideal.IsNilpotent.induction_on (hI : IsNilpotent I)
    {P : ∀ ⦃S : Type _⦄ [CommRing S], Ideal S → Prop}
    (h₁ : ∀ ⦃S : Type _⦄ [CommRing S], ∀ I : Ideal S, I ^ 2 = ⊥ → P I)
    (h₂ : ∀ ⦃S : Type _⦄ [CommRing S], ∀ I J : Ideal S, I ≤ J → P I →
      P (J.map (Ideal.Quotient.mk I)) → P J) :
    P I

{P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop}

(h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I)

(h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (Ideal.map (Ideal.Quotient.mk I) J) → P J)


/-- See also `pow_left_strictMono` and `Nat.pow_left_strictMono`. -/
lemma pow_left_strictMonoOn (hn : n ≠ 0) : StrictMonoOn (· ^ n : R → R) {a | 0 ≤ a}

{R : Type u_3}
[StrictOrderedSemiring R]
{n : ℕ}
(hn : n ≠ 0)

StrictMonoOn (fun x => x ^ n) {a | 0 ≤ a}


theorem integral_map_equiv {β} [MeasurableSpace β] (e : α ≃ᵐ β) (f : β → G) :
    ∫ y, f y ∂Measure.map e μ = ∫ x, f (e x) ∂μ

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{β : Type u_7}
[MeasurableSpace β]
(e : α ≃ᵐ β)
(f : β → G)

∫ (y : β), f y ∂MeasureTheory.Measure.map (⇑e) μ = ∫ (x : α), f (e x) ∂μ


@[simp]
theorem numDenom_div (p : K[X]) {q : K[X]} (hq : q ≠ 0) :
    numDenom (algebraMap _ _ p / algebraMap _ _ q) =
      (Polynomial.C (q / gcd p q).leadingCoeff⁻¹ * (p / gcd p q),
        Polynomial.C (q / gcd p q).leadingCoeff⁻¹ * (q / gcd p q))

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

((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q).numDenom =
  (Polynomial.C (q / gcd p q).leadingCoeff⁻¹ * (p / gcd p q), Polynomial.C (q / gcd p q).leadingCoeff⁻¹ * (q / gcd p q))


theorem eval_sum (p : R[X]) (f : ℕ → R → R[X]) (x : R) :
    (p.sum f).eval x = p.sum fun n a => (f n a).eval x

{R : Type u}
[Semiring R]
(p : R[X])
(f : ℕ → R → R[X])
(x : R)

Polynomial.eval x (p.sum f) = p.sum fun n a => Polynomial.eval x (f n a)


@[simp]
theorem equivRangeOfInjective_apply (h : Function.Injective f) (x : L) :
    f.equivRangeOfInjective h x = ⟨f x, mem_range_self f x⟩

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{L₂ : Type w}
[LieRing L₂]
[LieAlgebra R L₂]
(f : L →ₗ⁅R⁆ L₂)
(h : Function.Injective ⇑f)
(x : L)

(f.equivRangeOfInjective h) x = ⟨f x, ⋯⟩


/-- In an atomic lattice, every element `b` has a complement of the form `sSup s`, where each
element of `s` is an atom. See also `complementedLattice_of_sSup_atoms_eq_top`. -/
theorem exists_setIndependent_isCompl_sSup_atoms (h : sSup { a : α | IsAtom a } = ⊤) (b : α) :
    ∃ s : Set α, CompleteLattice.SetIndependent s ∧
    IsCompl b (sSup s) ∧ ∀ ⦃a⦄, a ∈ s → IsAtom a

{α : Type u_2}
[CompleteLattice α]
[IsModularLattice α]
[IsCompactlyGenerated α]
(h : sSup {a | IsAtom a} = ⊤)
(b : α)

∃ s, CompleteLattice.SetIndependent s ∧ IsCompl b (sSup s) ∧ ∀ ⦃a : α⦄, a ∈ s → IsAtom a


theorem toList_pow_apply_eq_rotate (p : Perm α) (x : α) (k : ℕ) :
    p.toList ((p ^ k) x) = (p.toList x).rotate k

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(p : Equiv.Perm α)
(x : α)
(k : ℕ)


/-- If `f : α →ᵤ[𝔖] β` is continuous at `x` and `x` admits a neighbourhood `V ∈ 𝔖`,
then evaluation of `g : α →ᵤ[𝔖] β` at `y : α` is continuous in `(g, y)` at `(f, x)`. -/
protected theorem continuousAt_eval₂ [TopologicalSpace α] {f : α →ᵤ[𝔖] β} {x : α}
    (h𝔖 : ∃ V ∈ 𝔖, V ∈ 𝓝 x) (hc : ContinuousAt (toFun 𝔖 f) x) :
    ContinuousAt (fun fx : (α →ᵤ[𝔖] β) × α ↦ toFun 𝔖 fx.1 fx.2) (f, x)

(hc : ContinuousAt ((UniformOnFun.toFun 𝔖) f) x)

ContinuousAt (fun fx => (UniformOnFun.toFun 𝔖) fx.1 fx.2) (f, x)


/-- The images of each component in the coproduct is disjoint. -/
lemma disjoint_opensRange_sigmaι (i j : ι) (h : i ≠ j) :
    Disjoint (Sigma.ι f i).opensRange (Sigma.ι f j).opensRange

{ι : Type u}
(f : ι → AlgebraicGeometry.Scheme)
(i j : ι)
(h : i ≠ j)

Disjoint (AlgebraicGeometry.Scheme.Hom.opensRange (CategoryTheory.Limits.Sigma.ι f i))
  (AlgebraicGeometry.Scheme.Hom.opensRange (CategoryTheory.Limits.Sigma.ι f j))


theorem DifferentiableOn.hasGradientAt (h : DifferentiableOn 𝕜 f s) (hs : s ∈ 𝓝 x) :
    HasGradientAt f (∇ f x) x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{x : F}
{s : Set F}
(h : DifferentiableOn 𝕜 f s)
(hs : s ∈ 𝓝 x)


/-- If `α` is an infinite type, then `α × α` and `α` have the same cardinality. -/
theorem mul_eq_self {c : Cardinal} (h : ℵ₀ ≤ c) : c * c = c


lemma oppositeShiftFunctorAdd_inv_app :
    (shiftFunctorAdd (OppositeShift C A) a b).inv.app X =
      ((shiftFunctorAdd C a b).hom.app X.unop).op

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{A : Type u_2}
[AddMonoid A]
[CategoryTheory.HasShift C A]
(X : CategoryTheory.OppositeShift C A)
(a b : A)

(CategoryTheory.shiftFunctorAdd (CategoryTheory.OppositeShift C A) a b).inv.app X =
  ((CategoryTheory.shiftFunctorAdd C a b).hom.app (Opposite.unop X)).op


theorem translationNumber_eq_of_semiconj {f g₁ g₂ : CircleDeg1Lift}
    (H : Function.Semiconj f g₁ g₂) : τ g₁ = τ g₂

{f g₁ g₂ : CircleDeg1Lift}
(H : Function.Semiconj ⇑f ⇑g₁ ⇑g₂)


/-- The type of families of functors `A → C ⥤ D` which are compatible with
the shift by `A` on the category `D`. -/
structure SingleFunctors where
  /-- a family of functors `C ⥤ D` indexed by the elements of the additive monoid `A` -/
  functor (a : A) : C ⥤ D
  /-- the isomorphism `functor a' ⋙ shiftFunctor D n ≅ functor a` when `n + a = a'` -/
  shiftIso (n a a' : A) (ha' : n + a = a') : functor a' ⋙ shiftFunctor D n ≅ functor a
  /-- `shiftIso 0` is the obvious isomorphism. -/
  shiftIso_zero (a : A) :
    shiftIso 0 a a (zero_add a) = isoWhiskerLeft _ (shiftFunctorZero D A)
  /-- `shiftIso (m + n)` is determined by `shiftIso m` and `shiftIso n`. -/
  shiftIso_add (n m a a' a'' : A) (ha' : n + a = a') (ha'' : m + a' = a'') :
    shiftIso (m + n) a a'' (by rw [add_assoc, ha', ha'']) =
      isoWhiskerLeft _ (shiftFunctorAdd D m n) ≪≫ (Functor.associator _ _ _).symm ≪≫
        isoWhiskerRight (shiftIso m a' a'' ha'') _ ≪≫ shiftIso n a a' ha'

(self : CategoryTheory.SingleFunctors C D A)

self.shiftIso (m + n) a a'' ⋯ =
  CategoryTheory.isoWhiskerLeft (self.functor a'') (CategoryTheory.shiftFunctorAdd D m n) ≪≫
    ((self.functor a'').associator (CategoryTheory.shiftFunctor D m) (CategoryTheory.shiftFunctor D n)).symm ≪≫
      CategoryTheory.isoWhiskerRight (self.shiftIso m a' a'' ha'') (CategoryTheory.shiftFunctor D n) ≪≫
        self.shiftIso n a a' ha'


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


@[reassoc (attr := simp)]
theorem braiding_inv_naturality_left {X Y : C} (f : X ⟶ Y) (Z : C) :
    f ▷ Z ≫ (β_ Z Y).inv = (β_ Z X).inv ≫ Z ◁ f

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


theorem ContDiff.rpow_const_of_ne (hf : ContDiff ℝ n f) (h : ∀ x, f x ≠ 0) :
    ContDiff ℝ n fun x => f x ^ p

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{p : ℝ}
{n : ℕ∞}
(hf : ContDiff ℝ n f)
(h : ∀ (x : E), f x ≠ 0)


@[to_additive]
theorem smul_subset_iff : s • t ⊆ u ↔ ∀ a ∈ s, ∀ b ∈ t, a • b ∈ u

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{s : Set α}
{t u : Set β}

s +ᵥ t ⊆ u ↔ ∀ a ∈ s, ∀ b ∈ t, a +ᵥ b ∈ u


@[gcongr]
theorem filter_subset_filter {s t : Finset α} (h : s ⊆ t) : s.filter p ⊆ t.filter p

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
{s t : Finset α}
(h : s ⊆ t)


@[to_additive (attr := simp)]
theorem relindex_sup_right [K.Normal] : K.relindex (H ⊔ K) = K.relindex H

{G : Type u_1}
[Group G]
(H K : Subgroup G)
[K.Normal]


@[to_additive (attr := simp)]
theorem Fintype.prod_sum_type (f : α₁ ⊕ α₂ → M) :
    ∏ x, f x = (∏ a₁, f (Sum.inl a₁)) * ∏ a₂, f (Sum.inr a₂)

{α₁ : Type u_4}
{α₂ : Type u_5}
{M : Type u_6}
[Fintype α₁]
[Fintype α₂]
[CommMonoid M]
(f : α₁ ⊕ α₂ → M)

∏ x : α₁ ⊕ α₂, f x = (∏ a₁ : α₁, f (Sum.inl a₁)) * ∏ a₂ : α₂, f (Sum.inr a₂)


theorem le_one_div (ha : 0 < a) (hb : 0 < b) : a ≤ 1 / b ↔ b ≤ 1 / a

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


/-- A base angle of an isosceles triangle is acute, oriented vector angle form. -/
theorem abs_oangle_sub_right_toReal_lt_pi_div_two {x y : V} (h : ‖x‖ = ‖y‖) :
    |(o.oangle x (x - y)).toReal| < π / 2

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


theorem nat_iterate {f : α → ℕ} {g : α → β} {h : α → β → β} (hf : Primrec f) (hg : Primrec g)
    (hh : Primrec₂ h) : Primrec fun a => (h a)^[f a] (g a)

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{f : α → ℕ}
{g : α → β}
{h : α → β → β}
(hf : Primrec f)
(hg : Primrec g)
(hh : Primrec₂ h)


@[simp]
theorem kernelSubobjectMap_comp {X'' Y'' : C} {f'' : X'' ⟶ Y''} [HasKernel f'']
    (sq : Arrow.mk f ⟶ Arrow.mk f') (sq' : Arrow.mk f' ⟶ Arrow.mk f'') :
    kernelSubobjectMap (sq ≫ sq') = kernelSubobjectMap sq ≫ kernelSubobjectMap sq'

(sq : CategoryTheory.Arrow.mk f ⟶ CategoryTheory.Arrow.mk f')

(sq' : CategoryTheory.Arrow.mk f' ⟶ CategoryTheory.Arrow.mk f'')

CategoryTheory.Limits.kernelSubobjectMap (sq ≫ sq') =
  CategoryTheory.Limits.kernelSubobjectMap sq ≫ CategoryTheory.Limits.kernelSubobjectMap sq'


@[to_additive (attr := simp)]
theorem map_comp (f : M →* N) (g : N →* P) : map (g.comp f) = (map g).comp (map f)

{M : Type u}
{N : Type v}
{P : Type w}
[Monoid M]
[Monoid N]
[Monoid P]
(f : M →* N)
(g : N →* P)

Units.map (g.comp f) = (Units.map g).comp (Units.map f)


protected theorem coe_sub (a b : Fin n) : ((a - b : Fin n) : Nat) = ((n - b) + a) % n


@[simp]
lemma self_pow_inv (r : ℕ) : padicValRat p ((p : ℚ) ^ r)⁻¹ = -r

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


theorem natCast_coeff_zero {n : ℕ} {R : Type*} [Semiring R] : (n : R[X]).coeff 0 = n


theorem Odd.zpow_neg_iff (hn : Odd n) : a ^ n < 0 ↔ a < 0

{α : Type u_1}
[LinearOrderedField α]
{a : α}
{n : ℤ}
(hn : Odd n)


/-- `Under.pushout f` is left adjoint to `Under.map f`. -/
@[simps! unit_app counit_app]
def mapPushoutAdj {X Y : C} (f : X ⟶ Y) : pushout f ⊣ map f

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

∀ (Y_1 : CategoryTheory.Under Y),
  (CategoryTheory.Under.mapPushoutAdj f).counit.app Y_1 =
    CategoryTheory.Under.homMk
      (CategoryTheory.Limits.pushout.desc (CategoryTheory.CategoryStruct.id Y_1.right) Y_1.hom ⋯) ⋯


theorem injective_foldl_comp {l : List (α → α)} {f : α → α}
    (hl : ∀ f ∈ l, Function.Injective f) (hf : Function.Injective f) :
    Function.Injective (@List.foldl (α → α) (α → α) Function.comp f l)

(hl : ∀ (f : α → α), f ∈ l → Function.Injective f)

Function.Injective (List.foldl Function.comp f l)


protected lemma lt_or_le (a b : ℤ) : a < b ∨ b ≤ a


@[simp]
theorem bot_snd : (⊥ : Concept α β r).snd = univ

{α : Type u_2}
{β : Type u_3}
{r : α → β → Prop}


/-- If `A` is subterminal, it is isomorphic to `A ⨯ A`. -/
@[simps!]
def IsSubterminal.isoDiag (hA : IsSubterminal A) [HasBinaryProduct A A] : A ⨯ A ≅ A

hA.isoDiag.inv = CategoryTheory.Limits.diag A


/-- Given a surjective linear map `L`, it is equivalent to require a property almost everywhere
in the source or the target spaces of `L`, with respect to additive Haar measures there. -/
lemma ae_comp_linearMap_mem_iff (h : Function.Surjective L) {s : Set F} (hs : MeasurableSet s) :
    (∀ᵐ x ∂μ, L x ∈ s) ↔ ∀ᵐ y ∂ν, y ∈ s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
[NormedAddCommGroup E]
[MeasurableSpace E]
[BorelSpace E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[MeasurableSpace F]
[BorelSpace F]
[NormedSpace 𝕜 F]
(L : E →ₗ[𝕜] F)
(μ : MeasureTheory.Measure E)
(ν : MeasureTheory.Measure F)
[μ.IsAddHaarMeasure]
[ν.IsAddHaarMeasure]
[LocallyCompactSpace E]
(h : Function.Surjective ⇑L)
{s : Set F}
(hs : MeasurableSet s)

(∀ᵐ (x : E) ∂μ, L x ∈ s) ↔ ∀ᵐ (y : F) ∂ν, y ∈ s


theorem edgeSet_injective : Injective (edgeSet : SimpleGraph V → Set (Sym2 V))


/-- Consider, for each `x` in a set `s`, a radius `r x ∈ (0, 1]`. Then one can find finitely
many disjoint balls of the form `closedBall x (r x)` covering a proportion `1/(N+1)` of `s`, if
there are no satellite configurations with `N+1` points.
-/
theorem exist_finset_disjoint_balls_large_measure (μ : Measure α) [IsFiniteMeasure μ] {N : ℕ}
    {τ : ℝ} (hτ : 1 < τ) (hN : IsEmpty (SatelliteConfig α N τ)) (s : Set α) (r : α → ℝ)
    (rpos : ∀ x ∈ s, 0 < r x) (rle : ∀ x ∈ s, r x ≤ 1) :
    ∃ t : Finset α, ↑t ⊆ s ∧ μ (s \ ⋃ x ∈ t, closedBall x (r x)) ≤ N / (N + 1) * μ s ∧
      (t : Set α).PairwiseDisjoint fun x => closedBall x (r x)

(hN : IsEmpty (Besicovitch.SatelliteConfig α N τ))

∃ t,
  ↑t ⊆ s ∧
    μ (s \ ⋃ x ∈ t, Metric.closedBall x (r x)) ≤ ↑N / (↑N + 1) * μ s ∧
      (↑t).PairwiseDisjoint fun x => Metric.closedBall x (r x)


@[to_additive (attr := simp)]
theorem MulHom.toMulEquiv_apply [Mul M] [Mul N] (f : M →ₙ* N) (g : N →ₙ* M)
    (h₁ : g.comp f = MulHom.id _) (h₂ : f.comp g = MulHom.id _) :
    ((MulHom.toMulEquiv f g h₁ h₂) : M → N) = f

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(f : AddHom M N)
(g : AddHom N M)
(h₁ : g.comp f = AddHom.id M)
(h₂ : f.comp g = AddHom.id N)


/-- Intersecting with a neighborhood of the point does not change the tangent cone. -/
theorem tangentCone_inter_nhds (ht : t ∈ 𝓝 x) : tangentConeAt 𝕜 (s ∩ t) x = tangentConeAt 𝕜 s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s t : Set E}
(ht : t ∈ 𝓝 x)


theorem le_functorPushforward_pullback (R : Sieve X) :
    R ≤ (R.functorPushforward F).functorPullback F

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

R ≤ CategoryTheory.Sieve.functorPullback F (CategoryTheory.Sieve.functorPushforward F R)


@[simp]
theorem RightExactFunctor.of_fst (F : C ⥤ D) [PreservesFiniteColimits F] :
    (RightExactFunctor.of F).obj = F

(CategoryTheory.RightExactFunctor.of F).obj = F


@[simp]
theorem dist_right_midpoint (p₁ p₂ : P) :
    dist p₂ (midpoint 𝕜 p₁ p₂) = ‖(2 : 𝕜)‖⁻¹ * dist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
[Invertible 2]
(p₁ p₂ : P)

dist p₂ (midpoint 𝕜 p₁ p₂) = ‖2‖⁻¹ * dist p₁ p₂


theorem tendsto_finset_range : Tendsto Finset.range atTop atTop

Filter.Tendsto Finset.range Filter.atTop Filter.atTop


protected theorem HasFPowerSeriesAt.eventually (hf : HasFPowerSeriesAt f p x) :
    ∀ᶠ r : ℝ≥0∞ in 𝓝[>] 0, HasFPowerSeriesOnBall f p x r

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
(hf : HasFPowerSeriesAt f p x)

∀ᶠ (r : ℝ≥0∞) in 𝓝[>] 0, HasFPowerSeriesOnBall f p x r


@[simp]
theorem Tape.mk'_right {Γ} [Inhabited Γ] (L R : ListBlank Γ) : (Tape.mk' L R).right = R.tail

{Γ : Type u_1}
[Inhabited Γ]
(L R : Turing.ListBlank Γ)


{V : Type u_1}
{G : SimpleGraph V}
{v : V}


@[simp]
theorem quotEquivOfEq_symm {R : Type*} [CommRing R] {I J : Ideal R} (h : I = J) :
    (Ideal.quotEquivOfEq h).symm = Ideal.quotEquivOfEq h.symm

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

(Ideal.quotEquivOfEq h).symm = Ideal.quotEquivOfEq ⋯


@[simp] theorem coe_id_of {X : Type u} [CommSemiring X] :
    @DFunLike.coe no_index (CommSemiRingCat.of X ⟶ CommSemiRingCat.of X) X
      (fun _ ↦ X) _
      (𝟙 (of X)) =
    @DFunLike.coe (X →+* X) X (fun _ ↦ X) _ (RingHom.id X)

⇑(𝟙 (CommSemiRingCat.of X)) = ⇑(RingHom.id X)


theorem UniformContinuous₂.tendstoUniformly [UniformSpace α] [UniformSpace γ] {f : α → β → γ}
    (h : UniformContinuous₂ f) {x : α} : TendstoUniformly f (f x) (𝓝 x)

{α : Type u}
{β : Type v}
{γ : Type w}
[UniformSpace β]
[UniformSpace α]
[UniformSpace γ]
{f : α → β → γ}
(h : UniformContinuous₂ f)
{x : α}


@[simp] theorem mul_ediv_cancel_left (b : Int) (H : a ≠ 0) : (a * b) / a = b


theorem mdifferentiableOn_extChartAt :
    MDifferentiableOn I 𝓘(𝕜, E) (extChartAt I x) (chartAt H x).source

{𝕜 : Type u_11}
[NontriviallyNormedField 𝕜]
{E : Type u_12}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_13}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_14}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{x : M}

MDifferentiableOn I 𝓘(𝕜, E) (↑(extChartAt I x)) (chartAt H x).source


lemma StrictAnti.mapsTo_Iio (h : StrictAnti f) : MapsTo f (Iio b) (Ioi (f b))

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{b : α}
(h : StrictAnti f)

Set.MapsTo f (Set.Iio b) (Set.Ioi (f b))


@[simp]
theorem keys_insert {a} {b : β a} (s : AList β) : (insert a b s).keys = a :: s.keys.erase a

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

(AList.insert a b s).keys = a :: s.keys.erase a


lemma iInter_const (s : Set β) : ⋂ _ : ι, s = s

{β : Type u_2}
{ι : Sort u_4}
[Nonempty ι]
(s : Set β)


@[reassoc]
theorem coprod.inl_desc {W X Y : C} [HasBinaryCoproduct X Y] (f : X ⟶ W) (g : Y ⟶ W) :
    coprod.inl ≫ coprod.desc f g = f

CategoryTheory.Limits.coprod.inl ≫ CategoryTheory.Limits.coprod.desc f g = f


lemma inf_eq_bot_of_bot_mem [OrderBot α] (h : ⊥ ∈ s) : sInf s = ⊥

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
[OrderBot α]
(h : ⊥ ∈ s)


theorem le_not_le_of_lt : ∀ {a b : α}, a < b → a ≤ b ∧ ¬b ≤ a


@[simp]
theorem bijective_frobenius : Bijective (frobenius R p)

(R : Type u_1)
(p : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]


@[simp]
theorem mk''_submodule (v : ℙ K V) : mk'' v.submodule v.finrank_submodule = v

{K : Type u_1}
{V : Type u_2}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(v : Projectivization K V)


protected theorem _root_.IsMax.isPredLimit : IsMax a → IsPredLimit a


@[reassoc]
lemma mapComp_id_right_hom (f : a ⟶ b) : (F.mapComp f (𝟙 b)).hom =
    F.map₂ (ρ_ f).hom ≫ (ρ_ (F.map f)).inv ≫ F.map f ◁ (F.mapId b).inv

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.Pseudofunctor B C)
{a b : B}
(f : a ⟶ b)

(F.mapComp f (CategoryTheory.CategoryStruct.id b)).hom =
  CategoryTheory.CategoryStruct.comp (F.map₂ (CategoryTheory.Bicategory.rightUnitor f).hom)
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.rightUnitor (F.map f)).inv
      (CategoryTheory.Bicategory.whiskerLeft (F.map f) (F.mapId b).inv))


/-- The diagram of the multifork attached to a presheaf
`F : Cᵒᵖ ⥤ A`, `S : C` and `E : PreOneHypercover S`. -/
@[simps]
def multicospanIndex (F : Cᵒᵖ ⥤ A) : MulticospanIndex A

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{A : Type u_1}
[CategoryTheory.Category.{u_2, u_1} A]
{S : C}
(E : CategoryTheory.PreOneHypercover S)
(F : CategoryTheory.Functor Cᵒᵖ A)
(j : E.I₁')

(E.multicospanIndex F).right j = F.obj (Opposite.op (E.Y j.snd))


@[scoped simp]
theorem map_nsmul_const [AddMonoid G] [AddMonoid H] [AddConstMapClass F G H a b]
    (f : F) (n : ℕ) : f (n • a) = f 0 + n • b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{a : G}
{b : H}
[AddMonoid G]
[AddMonoid H]
[AddConstMapClass F G H a b]
(f : F)
(n : ℕ)


theorem exists_max_image (s : Finset β) (f : β → α) (h : s.Nonempty) :
    ∃ x ∈ s, ∀ x' ∈ s, f x' ≤ f x

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
(s : Finset β)
(f : β → α)
(h : s.Nonempty)


/-- A uniform additive group is an additive group in which addition
  and negation are uniformly continuous. -/
class UniformAddGroup (α : Type*) [UniformSpace α] [AddGroup α] : Prop where
  uniformContinuous_sub : UniformContinuous fun p : α × α => p.1 - p.2

{α : Type u_3}
[UniformSpace α]
[AddGroup α]
[self : UniformAddGroup α]


theorem coe_of_mul_apply_of_le {i : ι} (r : A i) (r' : ⨁ i, A i) (n : ι) (h : i ≤ n) :
    ((of (fun i => A i) i r * r') n : R) = r * r' (n - i)

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

↑(((DirectSum.of (fun i => ↥(A i)) i) r * r') n) = ↑r * ↑(r' (n - i))


theorem Finite.exists_encard_eq_coe (h : s.Finite) : ∃ (n : ℕ), s.encard = n

{α : Type u_1}
{s : Set α}
(h : s.Finite)


@[simp] theorem comp_id (f : BoundedLatticeHom α β) : f.comp (BoundedLatticeHom.id α) = f

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


lemma ShortExact.ab_injective_f (hS : S.ShortExact) :
    Function.Injective S.f

{S : CategoryTheory.ShortComplex Ab}
(hS : S.ShortExact)


theorem IsProj.trace {p : Submodule R M} {f : M →ₗ[R] M} (h : IsProj p f) [Module.Free R p]
    [Module.Finite R p] [Module.Free R (ker f)] [Module.Finite R (ker f)] :
    trace R M f = (finrank R p : R)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{p : Submodule R M}
{f : M →ₗ[R] M}
(h : LinearMap.IsProj p f)
[Module.Free R ↥p]
[Module.Finite R ↥p]
[Module.Free R ↥(LinearMap.ker f)]
[Module.Finite R ↥(LinearMap.ker f)]

(LinearMap.trace R M) f = ↑(FiniteDimensional.finrank R ↥p)


@[simp]
theorem enum_eq_nil {l : List α} : List.enum l = [] ↔ l = []


@[simp] theorem prod_get_fst {a : Thunk α} {b : Thunk β} : (prod a b).get.1 = a.get

{α : Type u}
{β : Type v}
{a : Thunk α}
{b : Thunk β}


lemma IsTuranMaximal.le_iff_eq (hG : G.IsTuranMaximal r) (hH : H.CliqueFree (r + 1)) :
    G ≤ H ↔ G = H

{V : Type u_1}
[Fintype V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{r : ℕ}
{H : SimpleGraph V}
(hG : G.IsTuranMaximal r)
(hH : H.CliqueFree (r + 1))


@[reassoc (attr := simp)]
theorem biprod.lift_snd {W X Y : C} [HasBinaryBiproduct X Y] (f : W ⟶ X) (g : W ⟶ Y) :
    biprod.lift f g ≫ biprod.snd = g

CategoryTheory.Limits.biprod.lift f g ≫ CategoryTheory.Limits.biprod.snd = g


@[simp]
lemma sup_edge_self : G ⊔ edge s s = G

{V : Type u_1}
(G : SimpleGraph V)
(s : V)


theorem dvd_prime_pow {p : ℕ} (pp : Prime p) {m i : ℕ} : i ∣ p ^ m ↔ ∃ k ≤ m, i = p ^ k


theorem iInter_inter [Nonempty ι] (s : Set β) (t : ι → Set β) : (⋂ i, t i) ∩ s = ⋂ i, t i ∩ s

{β : Type u_2}
{ι : Sort u_4}
[Nonempty ι]
(s : Set β)
(t : ι → Set β)


/-- A structure extending partial homeomorphisms, defining a local trivialization of a projection
`proj : Z → B` with fiber `F`, as a partial homeomorphism between `Z` and `B × F` defined between
two sets of the form `proj ⁻¹' baseSet` and `baseSet × F`, acting trivially on the first coordinate.
-/
-- Porting note (#5171): was @[nolint has_nonempty_instance]
structure Trivialization (proj : Z → B) extends PartialHomeomorph Z (B × F) where
  baseSet : Set B
  open_baseSet : IsOpen baseSet
  source_eq : source = proj ⁻¹' baseSet
  target_eq : target = baseSet ×ˢ univ
  proj_toFun : ∀ p ∈ source, (toPartialHomeomorph p).1 = proj p

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
[TopologicalSpace Z]
{proj : Z → B}
(self : Trivialization F proj)


/--
Congruence in both function and argument. If `f₁ = f₂` and `a₁ = a₂` then
`f₁ a₁ = f₂ a₂`. This only works for nondependent functions; the theorem
statement is more complex in the dependent case.

For more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)
-/
theorem congr {α : Sort u} {β : Sort v} {f₁ f₂ : α → β} {a₁ a₂ : α} (h₁ : Eq f₁ f₂) (h₂ : Eq a₁ a₂) : Eq (f₁ a₁) (f₂ a₂)


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


lemma DifferentiableAt.lineDeriv_eq_fderiv (hf : DifferentiableAt 𝕜 f x) :
    lineDeriv 𝕜 f x v = fderiv 𝕜 f x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : E → F}
{x v : E}
(hf : DifferentiableAt 𝕜 f x)


lemma isClopen_iInter (hf : ∀ i, IsClopen (f i)) : IsClopen (⋂ i, f i)

{ι : Sort u_1}
{α : Type u_3}
[TopologicalSpace α]
[AlexandrovDiscrete α]
{f : ι → Set α}
(hf : ∀ (i : ι), IsClopen (f i))


theorem update_eq_single_add_erase (f : α →₀ M) (a : α) (b : M) :
    f.update a b = single a b + f.erase a

{α : Type u_1}
{M : Type u_5}
[AddZeroClass M]
(f : α →₀ M)
(a : α)
(b : M)

f.update a b = Finsupp.single a b + Finsupp.erase a f


theorem geom_series_mul_neg (x : R) (h : ‖x‖ < 1) : (∑' i : ℕ, x ^ i) * (1 - x) = 1

{R : Type u_4}
[NormedRing R]
[CompleteSpace R]
(x : R)
(h : ‖x‖ < 1)


theorem apply_eq_iff_eq (f : α ≃ β) {x y : α} : f x = f y ↔ x = y

{α : Sort u}
{β : Sort v}
(f : α ≃ β)
{x y : α}


theorem sigmaFinite_trim_bot_iff : SigmaFinite (μ.trim bot_le) ↔ IsFiniteMeasure μ

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

MeasureTheory.SigmaFinite (μ.trim ⋯) ↔ MeasureTheory.IsFiniteMeasure μ


@[simp]
theorem coord_apply_centroid [CharZero k] (b : AffineBasis ι k P) {s : Finset ι} {i : ι}
    (hi : i ∈ s) : b.coord i (s.centroid k b) = (s.card : k)⁻¹

{ι : Type u_1}
{k : Type u_3}
{V : Type u_4}
{P : Type u_5}
[AddCommGroup V]
[AffineSpace V P]
[DivisionRing k]
[Module k V]
[CharZero k]
(b : AffineBasis ι k P)
{s : Finset ι}
{i : ι}
(hi : i ∈ s)

(b.coord i) (Finset.centroid k s ⇑b) = (↑s.card)⁻¹


lemma IsMatching.iSup {ι : Sort _} {f : ι → Subgraph G} (hM : (i : ι) → (f i).IsMatching)
    (hd : Pairwise fun i j ↦ Disjoint (f i).support (f j).support) :
    (⨆ i, f i).IsMatching

(hd : Pairwise fun i j => Disjoint (f i).support (f j).support)


theorem measurable_iff_comap_le {m₁ : MeasurableSpace α} {m₂ : MeasurableSpace β} {f : α → β} :
    Measurable f ↔ m₂.comap f ≤ m₁

{α : Type u_1}
{β : Type u_2}
{m₁ : MeasurableSpace α}
{m₂ : MeasurableSpace β}
{f : α → β}

Measurable f ↔ MeasurableSpace.comap f m₂ ≤ m₁


/-- Given a homomorphism from a rack to a group, it factors through the enveloping group.
-/
theorem toEnvelGroup.univ (R : Type*) [Rack R] (G : Type*) [Group G] (f : R →◃ Quandle.Conj G) :
    (Quandle.Conj.map (toEnvelGroup.map f)).comp (toEnvelGroup R) = f

(R : Type u_1)
[Rack R]
(G : Type u_2)
[Group G]
(f : R →◃ Quandle.Conj G)

(Quandle.Conj.map (Rack.toEnvelGroup.map f)).comp (Rack.toEnvelGroup R) = f


theorem List.applyId_zip_eq [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs)
    (h₁ : xs.length = ys.length) (x y : α) (i : ℕ) (h₂ : xs[i]? = some x) :
    List.applyId.{u} (xs.zip ys) x = y ↔ ys[i]? = some y

{α : Type u}
[DecidableEq α]
{xs ys : List α}
(h₀ : xs.Nodup)
(h₁ : xs.length = ys.length)
(x y : α)
(i : ℕ)
(h₂ : xs[i]? = some x)

SlimCheck.InjectiveFunction.List.applyId (xs.zip ys) x = y ↔ ys[i]? = some y


/-- The span of the empty set is `⊥`. -/
@[simp]
theorem span_empty : affineSpan k (∅ : Set P) = ⊥

(k : Type u_1)
(V : Type u_2)
(P : Type u_3)
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]


@[simp]
theorem mul_adjMatrix_apply [NonAssocSemiring α] (M : Matrix V V α) (v w : V) :
    (M * G.adjMatrix α) v w = ∑ u ∈ G.neighborFinset w, M v u

{V : Type u_1}
{α : Type u_2}
(G : SimpleGraph V)
[DecidableRel G.Adj]
[Fintype V]
[NonAssocSemiring α]
(M : Matrix V V α)
(v w : V)

(M * SimpleGraph.adjMatrix α G) v w = ∑ u ∈ G.neighborFinset w, M v u


/-- Given Localization maps `f : M →* N` for a Submonoid `S ⊆ M` and
`k : M →* Q` for a Submonoid `T ⊆ M`, such that `S ≤ T`, and we have
`l : M →* A`, the composition of the induced map `f.lift` for `k` with
the induced map `k.lift` for `l` is equal to the  induced map `f.lift` for `l`. -/
@[to_additive
    "Given Localization maps `f : M →+ N` for a Submonoid `S ⊆ M` and
`k : M →+ Q` for a Submonoid `T ⊆ M`, such that `S ≤ T`, and we have
`l : M →+ A`, the composition of the induced map `f.lift` for `k` with
the induced map `k.lift` for `l` is equal to the  induced map `f.lift` for `l`"]
theorem lift_comp_lift {T : Submonoid M} (hST : S ≤ T) {Q : Type*} [CommMonoid Q]
    (k : LocalizationMap T Q) {A : Type*} [CommMonoid A] {l : M →* A}
    (hl : ∀ w : T, IsUnit (l w)) :
    (k.lift hl).comp (f.lift (map_units k ⟨_, hST ·.2⟩)) =
    f.lift (hl ⟨_, hST ·.2⟩)

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(f : S.LocalizationMap N)
{T : Submonoid M}
(hST : S ≤ T)
{Q : Type u_4}
[CommMonoid Q]
(k : T.LocalizationMap Q)
{A : Type u_5}
[CommMonoid A]
{l : M →* A}
(hl : ∀ (w : ↥T), IsUnit (l ↑w))


@[simp]
theorem codRestrict_apply' (p : L.Substructure N) (f : M ↪[L] N) {h} (x : M) :
    codRestrict p f h x = ⟨f x, h x⟩

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
(p : L.Substructure N)
(f : L.Embedding M N)
{h : ∀ (c : M), f c ∈ p}
(x : M)

(FirstOrder.Language.Embedding.codRestrict p f h) x = ⟨f x, ⋯⟩


lemma natDegree_le_pred (hf : p.natDegree ≤ n) (hn : p.coeff n = 0) : p.natDegree ≤ n - 1

{R : Type u}
{n : ℕ}
[Semiring R]
{p : R[X]}
(hf : p.natDegree ≤ n)
(hn : p.coeff n = 0)


theorem surjOn_image (f : α → β) (s : Set α) : SurjOn f s (f '' s)

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


@[simp]
theorem card_option [Finite α] : Nat.card (Option α) = Nat.card α + 1


theorem measure_union_add_inter₀ (s : Set α) (ht : NullMeasurableSet t μ) :
    μ (s ∪ t) + μ (s ∩ t) = μ s + μ t

(ht : MeasureTheory.NullMeasurableSet t μ)


@[to_additive]
theorem map_map {M'' N''} [MulOneClass M''] [MulOneClass N''] (f' : M' →* M'') (g' : N' →* N'')
    (f : M →* M') (g : N →* N') (x : M ∗ N) :
    map f' g' (map f g x) = map (f'.comp f) (g'.comp g) x

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[MulOneClass M]
[MulOneClass N]
[MulOneClass M']
[MulOneClass N']
{M'' : Type u_6}
{N'' : Type u_7}
[MulOneClass M'']
[MulOneClass N'']
(f' : M' →* M'')
(g' : N' →* N'')
(f : M →* M')
(g : N →* N')
(x : Monoid.Coprod M N)

(Monoid.Coprod.map f' g') ((Monoid.Coprod.map f g) x) = (Monoid.Coprod.map (f'.comp f) (g'.comp g)) x


@[to_additive]
theorem nhds_translation_div (x : G) : comap (· / x) (𝓝 1) = 𝓝 x

{G : Type w}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
(x : G)

Filter.comap (fun x_1 => x_1 / x) (𝓝 1) = 𝓝 x


/-- `(h : DualBases e ε).basis` shows the family of vectors `e` forms a basis. -/
@[simps]
def basis : Basis ι R M

{R : Type u_1}
{M : Type u_2}
{ι : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
{e : ι → M}
{ε : ι → Module.Dual R M}
[DecidableEq ι]
(h : Module.DualBases e ε)
(l : ι →₀ R)

h.basis.repr.symm l = Module.DualBases.lc e l


theorem isSubring_preimage {R : Type u} {S : Type v} [Ring R] [Ring S] (f : R →+* S) {s : Set S}
    (hs : IsSubring s) : IsSubring (f ⁻¹' s)


theorem image_neg_Ioi : Neg.neg '' Ioi a = Iio (-a)

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


theorem evalWhiskerLeft_of_cons
    (α : g ⟶ h) (η : h ⟶ i) {ηs : i ⟶ j} {θ : f ⊗ i ⟶ f ⊗ j} (pf_θ : f ◁ ηs = θ) :
    f ◁ (α ≫ η ≫ ηs) = f ◁ α ≫ f ◁ η ≫ θ

{θ : CategoryTheory.MonoidalCategory.tensorObj f i ⟶ CategoryTheory.MonoidalCategory.tensorObj f j}

(pf_θ : CategoryTheory.MonoidalCategory.whiskerLeft f ηs = θ)

CategoryTheory.MonoidalCategory.whiskerLeft f
    (CategoryTheory.CategoryStruct.comp α (CategoryTheory.CategoryStruct.comp η ηs)) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft f α)
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft f η) θ)


theorem rotateL_nil (l : Ordnode α) (x : α) : rotateL l x nil = node' l x nil

l.rotateL x Ordnode.nil = l.node' x Ordnode.nil


@[ext]
theorem ext {f g : M →ₗ⁅R,L⁆ N} (h : ∀ m, f m = g m) : f = g

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


theorem tendsto_closedBall_filterAt {K : ℝ} {x : α} {ι : Type*} {l : Filter ι} (w : ι → α)
    (δ : ι → ℝ) (δlim : Tendsto δ l (𝓝[>] 0)) (xmem : ∀ᶠ j in l, x ∈ closedBall (w j) (K * δ j)) :
    Tendsto (fun j => closedBall (w j) (δ j)) l ((vitaliFamily μ K).filterAt x)

(xmem : ∀ᶠ (j : ι) in l, x ∈ Metric.closedBall (w j) (K * δ j))

Filter.Tendsto (fun j => Metric.closedBall (w j) (δ j)) l ((IsUnifLocDoublingMeasure.vitaliFamily μ K).filterAt x)


theorem measurable_pi_iff {g : α → ∀ a, π a} : Measurable g ↔ ∀ a, Measurable fun x => g x a

{α : Type u_1}
{δ : Type u_4}
{π : δ → Type u_6}
[MeasurableSpace α]
[(a : δ) → MeasurableSpace (π a)]
{g : α → (a : δ) → π a}

Measurable g ↔ ∀ (a : δ), Measurable fun x => g x a


lemma W_inverseImage_whiskeringLeft :
    K.W.inverseImage ((whiskeringLeft Dᵒᵖ Cᵒᵖ A).obj G.op) = J.W

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[(G.sheafPushforwardContinuous A K J).EssSurj]

K.W.inverseImage ((CategoryTheory.whiskeringLeft Dᵒᵖ Cᵒᵖ A).obj G.op) = J.W


@[simp]
theorem continuum_add_ofNat {n : ℕ} [Nat.AtLeastTwo n] : 𝔠 + no_index (OfNat.ofNat n) = 𝔠

Cardinal.continuum + OfNat.ofNat n = Cardinal.continuum


@[simp] theorem re_star : (star a).re = a.re

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a : ℍ[R,c₁,c₂])


theorem numLeaves_eq_numNodes_succ (x : Tree α) : x.numLeaves = x.numNodes + 1


@[to_additive]
protected theorem ext_iff {f g : LocalizationMap S N} : f = g ↔ ∀ x, f.toMap x = g.toMap x

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{f g : S.LocalizationMap N}

f = g ↔ ∀ (x : M), f.toMap x = g.toMap x


lemma traceForm_apply_apply (x y : L) :
    traceForm R L M x y = trace R _ (φ x ∘ₗ φ y)

(R : Type u_1)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(x y : L)

((LieModule.traceForm R L M) x) y = (LinearMap.trace R M) (φ x ∘ₗ φ y)


theorem Theory.realize_sentence_of_mem [M ⊨ T] {φ : L.Sentence} (h : φ ∈ T) : M ⊨ φ

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
(T : L.Theory)
[M ⊨ T]
{φ : L.Sentence}
(h : φ ∈ T)


/-- There exists `π ∈ R` with `v`-adic valuation `Multiplicative.ofAdd (-1)`. -/
theorem intValuation_exists_uniformizer :
    ∃ π : R, v.intValuationDef π = Multiplicative.ofAdd (-1 : ℤ)

(v : IsDedekindDomain.HeightOneSpectrum R)

∃ π, v.intValuationDef π = ↑(Multiplicative.ofAdd (-1))


theorem supIndep_torsionBySet_ideal : S.SupIndep fun i => torsionBySet R M <| p i

(hp : (↑S).Pairwise fun i j => p i ⊔ p j = ⊤)

S.SupIndep fun i => Submodule.torsionBySet R M ↑(p i)


theorem inf_ite (p : β → Prop) [DecidablePred p] :
    (s.inf fun i ↦ ite (p i) (f i) (g i)) = (s.filter p).inf f ⊓ (s.filter fun i ↦ ¬ p i).inf g

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
{s : Finset β}
{f g : β → α}
(p : β → Prop)
[DecidablePred p]

(s.inf fun i => if p i then f i else g i) = (Finset.filter p s).inf f ⊓ (Finset.filter (fun i => ¬p i) s).inf g


/-- Bounding the norm of the iterated derivative of `B (f x) (g x)` within a set in terms of the
iterated derivatives of `f` and `g` when `B` is bilinear of norm at most `1`:
`‖D^n (x ↦ B (f x) (g x))‖ ≤ ∑_{k ≤ n} n.choose k ‖D^k f‖ ‖D^{n-k} g‖` -/
theorem ContinuousLinearMap.norm_iteratedFDerivWithin_le_of_bilinear_of_le_one
    (B : E →L[𝕜] F →L[𝕜] G) {f : D → E} {g : D → F} {N : ℕ∞} {s : Set D} {x : D}
    (hf : ContDiffOn 𝕜 N f s) (hg : ContDiffOn 𝕜 N g s) (hs : UniqueDiffOn 𝕜 s) (hx : x ∈ s) {n : ℕ}
    (hn : (n : ℕ∞) ≤ N) (hB : ‖B‖ ≤ 1) : ‖iteratedFDerivWithin 𝕜 n (fun y => B (f y) (g y)) s x‖ ≤
      ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * ‖iteratedFDerivWithin 𝕜 i f s x‖ *
        ‖iteratedFDerivWithin 𝕜 (n - i) g s x‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{D : Type uD}
[NormedAddCommGroup D]
[NormedSpace 𝕜 D]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(B : E →L[𝕜] F →L[𝕜] G)
{f : D → E}
{g : D → F}
{N : ℕ∞}
{s : Set D}
{x : D}
(hf : ContDiffOn 𝕜 N f s)
(hg : ContDiffOn 𝕜 N g s)
(hs : UniqueDiffOn 𝕜 s)
(hx : x ∈ s)
{n : ℕ}
(hn : ↑n ≤ N)
(hB : ‖B‖ ≤ 1)

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


theorem integrable_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) :
    Integrable fun x : ℝ => exp (-b * x ^ 2)

MeasureTheory.Integrable (fun x => rexp (-b * x ^ 2)) MeasureTheory.volume


lemma addMap_of_Z_eq_zero_right {P : PointClass F} {Q : Fin 3 → F} (hP : W.NonsingularLift P)
    (hQ : W.Nonsingular Q) (hQz : Q z = 0) : W.addMap P ⟦Q⟧ = P

{P : WeierstrassCurve.Jacobian.PointClass F}


protected theorem HasAntitoneBasis.comap {l : Filter α} {s : ι'' → Set α}
    (hf : HasAntitoneBasis l s) (m : β → α) : HasAntitoneBasis (comap m l) (m ⁻¹' s ·)

{α : Type u_1}
{β : Type u_2}
{ι'' : Type u_6}
[Preorder ι'']
{l : Filter α}
{s : ι'' → Set α}
(hf : l.HasAntitoneBasis s)
(m : β → α)

(Filter.comap m l).HasAntitoneBasis fun x => m ⁻¹' s x


/-- Normalization monoid: multiplying with `normUnit` gives a normal form for associated
elements. -/
class NormalizationMonoid (α : Type*) [CancelCommMonoidWithZero α] where
  /-- `normUnit` assigns to each element of the monoid a unit of the monoid. -/
  normUnit : α → αˣ
  /-- The proposition that `normUnit` maps `0` to the identity. -/
  normUnit_zero : normUnit 0 = 1
  /-- The proposition that `normUnit` respects multiplication of non-zero elements. -/
  normUnit_mul : ∀ {a b}, a ≠ 0 → b ≠ 0 → normUnit (a * b) = normUnit a * normUnit b
  /-- The proposition that `normUnit` maps units to their inverses. -/
  normUnit_coe_units : ∀ u : αˣ, normUnit u = u⁻¹

{α : Type u_2}
[CancelCommMonoidWithZero α]
[self : NormalizationMonoid α]
(u : αˣ)


@[simp]
theorem prod_smul (g : PushoutI φ) (w : NormalWord d) :
    (g • w).prod = g * w.prod

{d : Monoid.PushoutI.NormalWord.Transversal φ}


theorem incomp_trans [IsIncompTrans α r] {a b c : α} :
    ¬a ≺ b ∧ ¬b ≺ a → ¬b ≺ c ∧ ¬c ≺ b → ¬a ≺ c ∧ ¬c ≺ a

{α : Sort u}
{r : α → α → Prop}
[IsIncompTrans α r]
{a b c : α}

¬r a b ∧ ¬r b a → ¬r b c ∧ ¬r c b → ¬r a c ∧ ¬r c a


theorem meas_preimage_singleton_ne_zero (h : f.FinMeasSupp μ) {y : β} (hy : y ≠ 0) :
    μ (f ⁻¹' {y}) < ∞

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
[Zero β]
{μ : MeasureTheory.Measure α}
{f : MeasureTheory.SimpleFunc α β}
(h : f.FinMeasSupp μ)
{y : β}
(hy : y ≠ 0)


protected theorem StrictConvex.inter {t : Set E} (hs : StrictConvex 𝕜 s) (ht : StrictConvex 𝕜 t) :
    StrictConvex 𝕜 (s ∩ t)

{𝕜 : Type u_1}
{E : Type u_3}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[AddCommMonoid E]
[SMul 𝕜 E]
{s t : Set E}
(hs : StrictConvex 𝕜 s)
(ht : StrictConvex 𝕜 t)


theorem ClusterPt.neBot {F : Filter X} (h : ClusterPt x F) : NeBot (𝓝 x ⊓ F)

{X : Type u}
{x : X}
[TopologicalSpace X]
{F : Filter X}
(h : ClusterPt x F)


lemma nilRankAux_basis_indep [Nontrivial R] (b : Basis ι R L) (b' : Basis ι' R L) :
    nilRankAux φ b = (polyCharpoly φ b').natTrailingDegree

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
{ι : Type u_5}
{ι' : Type u_6}
[CommRing R]
[AddCommGroup L]
[Module R L]
[AddCommGroup M]
[Module R M]
(φ : L →ₗ[R] Module.End R M)
[Fintype ι]
[Fintype ι']
[DecidableEq ι]
[DecidableEq ι']
[Module.Free R M]
[Module.Finite R M]
[Nontrivial R]
(b : Basis ι R L)
(b' : Basis ι' R L)

φ.nilRankAux b = (φ.polyCharpoly b').natTrailingDegree


@[to_additive]
theorem _root_.Submonoid.pow_exponent_eq_one {S : Submonoid G} {g : G} (g_in_s : g ∈ S) :
    g ^ (Monoid.exponent S) = 1

{G : Type u}
[Monoid G]
{S : Submonoid G}
{g : G}
(g_in_s : g ∈ S)


theorem u_iInf_l [CompleteLattice α] [CompleteLattice β] (gi : GaloisCoinsertion l u) {ι : Sort x}
    (f : ι → α) : u (⨅ i, l (f i)) = ⨅ i, f i

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[CompleteLattice α]
[CompleteLattice β]
(gi : GaloisCoinsertion l u)
{ι : Sort x}
(f : ι → α)


@[simp] lemma ker_killingForm_eq_bot :
    LinearMap.ker (killingForm R L) = ⊥

(R : Type u_1)
(L : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsKilling R L]


@[simp]
theorem coe_compl (p : { p : R // IsIdempotentElem p }) : ↑pᶜ = (1 : R) - ↑p

{R : Type u_6}
[NonAssocRing R]
(p : { p // IsIdempotentElem p })


theorem append_left_nil {α : Type*} (u : Fin m → α) (v : Fin n → α) (hu : m = 0) :
    append u v = v ∘ Fin.cast (by rw [hu, Nat.zero_add])

{m n : ℕ}
{α : Type u_1}
(u : Fin m → α)
(v : Fin n → α)
(hu : m = 0)


theorem size_balanceL {l x r} (hl : Balanced l) (hr : Balanced r) (sl : Sized l) (sr : Sized r)
    (H : (∃ l', Raised l' (size l) ∧ BalancedSz l' (size r)) ∨
        ∃ r', Raised (size r) r' ∧ BalancedSz (size l) r') :
    size (@balanceL α l x r) = size l + size r + 1

(H :
  (∃ l', Ordnode.Raised l' l.size ∧ Ordnode.BalancedSz l' r.size) ∨
    ∃ r', Ordnode.Raised r.size r' ∧ Ordnode.BalancedSz l.size r')

(l.balanceL x r).size = l.size + r.size + 1


theorem padicNormE_lim_le {f : CauSeq ℚ_[p] norm} {a : ℝ} (ha : 0 < a) (hf : ∀ i, ‖f i‖ ≤ a) :
    ‖f.lim‖ ≤ a

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{f : CauSeq ℚ_[p] norm}
{a : ℝ}
(ha : 0 < a)
(hf : ∀ (i : ℕ), ‖↑f i‖ ≤ a)


/-- Subtracting `p` from its `orthogonalProjectionFn` produces a
result in the orthogonal direction. This lemma is only intended for
use in setting up the bundled version and should not be used once that
is defined. -/
theorem orthogonalProjectionFn_vsub_mem_direction_orthogonal {s : AffineSubspace ℝ P} [Nonempty s]
    [HasOrthogonalProjection s.direction] (p : P) :
    orthogonalProjectionFn s p -ᵥ p ∈ s.directionᗮ

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
(p : P)

EuclideanGeometry.orthogonalProjectionFn s p -ᵥ p ∈ s.directionᗮ


@[gcongr]
theorem accumulate_subset_accumulate [Preorder α] {x y} (h : x ≤ y) :
    Accumulate s x ⊆ Accumulate s y

{α : Type u_1}
{β : Type u_2}
{s : α → Set β}
[Preorder α]
{x y : α}
(h : x ≤ y)


lemma eval_polynomialX_of_Z_ne_zero {P : Fin 3 → F} (hPz : P z ≠ 0) :
    eval P W.polynomialX / P z ^ 4 =
      W.toAffine.polynomialX.evalEval (P x / P z ^ 2) (P y / P z ^ 3)

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P : Fin 3 → F}
(hPz : P z ≠ 0)

(MvPolynomial.eval P) W.polynomialX / P z ^ 4 =
  Polynomial.evalEval (P x / P z ^ 2) (P y / P z ^ 3) W.toAffine.polynomialX


theorem injective_iff_preservesEpimorphisms_preadditive_yoneda_obj' (J : C) :
    Injective J ↔ (preadditiveYonedaObj J).PreservesEpimorphisms

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

CategoryTheory.Injective J ↔ (CategoryTheory.preadditiveYonedaObj J).PreservesEpimorphisms


@[reassoc (attr := simp)]
lemma lift_f_fst_v (p q : ℤ) (hpq : p + 1 = q) :
    (lift φ α β eq).f p ≫ (fst φ).1.v p q hpq = α.1.v p q hpq

(α : CochainComplex.HomComplex.Cocycle K F 1)

(β : CochainComplex.HomComplex.Cochain K G 0)

(eq : CochainComplex.HomComplex.δ 0 1 β + (↑α).comp (CochainComplex.HomComplex.Cochain.ofHom φ) ⋯ = 0)

(CochainComplex.mappingCone.lift φ α β eq).f p ≫ (↑(CochainComplex.mappingCone.fst φ)).v p q hpq = (↑α).v p q hpq


theorem le_maximum_of_length_pos_of_mem (h : a ∈ l) (w : 0 < l.length) :
    a ≤ l.maximum_of_length_pos w

{α : Type u_1}
[LinearOrder α]
{l : List α}
{a : α}
(h : a ∈ l)
(w : 0 < l.length)


theorem ext_iff {f g : E →ₗ.[R] F} :
    f = g ↔
      ∃ _domain_eq : f.domain = g.domain,
        ∀ ⦃x : f.domain⦄ ⦃y : g.domain⦄ (_h : (x : E) = y), f x = g y

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{f g : E →ₗ.[R] F}

f = g ↔ ∃ (_ : f.domain = g.domain), ∀ ⦃x : ↥f.domain⦄ ⦃y : ↥g.domain⦄, ↑x = ↑y → ↑f x = ↑g y


@[simp]
theorem proj_apply (i : ι) (b : ∀ i, φ i) : (proj i : (∀ i, φ i) →L[R] φ i) b = b i

{R : Type u_1}
[Semiring R]
{ι : Type u_4}
{φ : ι → Type u_5}
[(i : ι) → TopologicalSpace (φ i)]
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
(i : ι)
(b : (i : ι) → φ i)


theorem swapCore_swapCore (r a b : α) : swapCore a b (swapCore a b r) = r

{α : Sort u_1}
[DecidableEq α]
(r a b : α)

Equiv.swapCore a b (Equiv.swapCore a b r) = r


@[simp] theorem rotateLeft_replicate (n) (a : α) : rotateLeft (replicate m a) n = replicate m a

{α : Type u_1}
{m : Nat}
(n : Nat)
(a : α)

(List.replicate m a).rotateLeft n = List.replicate m a


lemma cast_mono : Monotone (Int.cast : ℤ → R)

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


@[simp]
theorem order_zero : order (0 : HahnSeries Γ R) = 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
[Zero Γ]


theorem natDegree_add_le_iff_left {n : ℕ} (p q : R[X]) (qn : q.natDegree ≤ n) :
    (p + q).natDegree ≤ n ↔ p.natDegree ≤ n

{R : Type u}
[Semiring R]
{n : ℕ}
(p q : R[X])
(qn : q.natDegree ≤ n)


theorem toDual_map (f : α → β) (a : WithTop α) :
    WithTop.toDual (map f a) = WithBot.map (toDual ∘ f ∘ ofDual) (WithTop.toDual a)

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

WithTop.toDual (WithTop.map f a) = WithBot.map (⇑OrderDual.toDual ∘ f ∘ ⇑OrderDual.ofDual) (WithTop.toDual a)


@[fun_prop]
theorem differentiable_apply (i : ι) :
    Differentiable (𝕜 := 𝕜) (fun f : ∀ i, F' i => f i)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{ι : Type u_6}
[Fintype ι]
{F' : ι → Type u_7}
[(i : ι) → NormedAddCommGroup (F' i)]
[(i : ι) → NormedSpace 𝕜 (F' i)]
(i : ι)


/-- Taking sub-families preserves equicontinuity. -/
theorem Equicontinuous.comp {F : ι → X → α} (h : Equicontinuous F) (u : κ → ι) :
    Equicontinuous (F ∘ u)

{ι : Type u_1}
{κ : Type u_2}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{F : ι → X → α}
(h : Equicontinuous F)
(u : κ → ι)


theorem Nonempty.preimage {s : Set β} (hs : s.Nonempty) {f : α → β} (hf : Surjective f) :
    (f ⁻¹' s).Nonempty

{α : Type u_1}
{β : Type u_2}
{s : Set β}
(hs : s.Nonempty)
{f : α → β}
(hf : Function.Surjective f)


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

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

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


theorem not_isSuccLimit_iff' : ¬IsSuccLimit a ↔ a ∈ range (@succ α _ _)

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a : α}
[NoMaxOrder α]

¬Order.IsSuccLimit a ↔ a ∈ Set.range Order.succ


@[simp]
theorem edgeSet_inf {H₁ H₂ : Subgraph G} : (H₁ ⊓ H₂).edgeSet = H₁.edgeSet ∩ H₂.edgeSet

{V : Type u}
{G : SimpleGraph V}
{H₁ H₂ : G.Subgraph}


@[to_additive]
lemma mabs_mulIndicator_symmDiff (s t : Set α) (f : α → M) (x : α) :
    |mulIndicator (s ∆ t) f x|ₘ = |mulIndicator s f x / mulIndicator t f x|ₘ

{α : Type u_2}
{M : Type u_4}
[LinearOrderedAddCommGroup M]
(s t : Set α)
(f : α → M)
(x : α)

|(symmDiff s t).indicator f x| = |s.indicator f x - t.indicator f x|


theorem TopCat.Presheaf.isSheaf_of_openEmbedding (h : OpenEmbedding f) (hF : F.IsSheaf) :
    IsSheaf (h.isOpenMap.functor.op ⋙ F)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : TopCat}
{f : X ⟶ Y}
{F : TopCat.Presheaf C Y}
(h : OpenEmbedding ⇑f)
(hF : F.IsSheaf)

TopCat.Presheaf.IsSheaf (⋯.functor.op ⋙ F)


@[simp]
theorem frontier_Iic' {a : α} (ha : (Ioi a).Nonempty) : frontier (Iic a) = {a}

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a : α}
(ha : (Set.Ioi a).Nonempty)


theorem ext {i₁ i₂ : Pos} (h : i₁.byteIdx = i₂.byteIdx) : i₁ = i₂

{i₁ i₂ : String.Pos}
(h : i₁.byteIdx = i₂.byteIdx)


lemma AntitoneOn.mapsTo_Ici (h : AntitoneOn f (Ici a)) : MapsTo f (Ici a) (Iic (f a))

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{a : α}
(h : AntitoneOn f (Set.Ici a))

Set.MapsTo f (Set.Ici a) (Set.Iic (f a))


/-- Explicit formula for `L(χ, 3)`, where `χ` is the unique nontrivial Dirichlet character modulo 4.
-/
theorem hasSum_L_function_mod_four_eval_three :
    HasSum (fun n : ℕ => (1 : ℝ) / (n : ℝ) ^ 3 * Real.sin (π * n / 2)) (π ^ 3 / 32)

HasSum (fun n => 1 / ↑n ^ 3 * Real.sin (π * ↑n / 2)) (π ^ 3 / 32)


/-- Adding the angles between two vectors in each order, with the second vector in each angle
negated, results in 0. -/
@[simp]
theorem oangle_add_oangle_rev_neg_right (x y : V) : o.oangle x (-y) + o.oangle y (-x) = 0

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


@[to_additive (attr := simp)]
theorem inv_apply [∀ i, Inv <| f i] : x⁻¹ i = (x i)⁻¹

{I : Type u}
{f : I → Type v₁}
(x : (i : I) → f i)
(i : I)
[(i : I) → Neg (f i)]


theorem covolume_ne_zero : covolume L μ ≠ 0

(μ : MeasureTheory.Measure E := by volume_tac)


theorem forget₂_map_associator_hom (X Y Z : QuadraticModuleCat.{u} R) :
    (forget₂ (QuadraticModuleCat R) (ModuleCat R)).map (α_ X Y Z).hom =
      (α_ X.toModuleCat Y.toModuleCat Z.toModuleCat).hom

{R : Type u}
[CommRing R]
[Invertible 2]
(X Y Z : QuadraticModuleCat R)

(CategoryTheory.forget₂ (QuadraticModuleCat R) (ModuleCat R)).map (α_ X Y Z).hom =
  (α_ X.toModuleCat Y.toModuleCat Z.toModuleCat).hom


@[simp]
theorem preimage_sub_const_Iio : (fun x => x - a) ⁻¹' Iio b = Iio (b + a)

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

(fun x => x - a) ⁻¹' Set.Iio b = Set.Iio (b + a)


@[to_additive] lemma MonovaryOn.mul_left (h₁ : MonovaryOn f₁ g s) (h₂ : MonovaryOn f₂ g s) :
    MonovaryOn (f₁ * f₂) g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommGroup β]
{s : Set ι}
{f₁ f₂ : ι → α}
{g : ι → β}
(h₁ : MonovaryOn f₁ g s)
(h₂ : MonovaryOn f₂ g s)


theorem isCompactOperator_iff_exists_mem_nhds_isCompact_closure_image [T2Space M₂] (f : M₁ → M₂) :
    IsCompactOperator f ↔ ∃ V ∈ (𝓝 0 : Filter M₁), IsCompact (closure <| f '' V)

{M₁ : Type u_3}
{M₂ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[TopologicalSpace M₂]
[T2Space M₂]
(f : M₁ → M₂)

IsCompactOperator f ↔ ∃ V ∈ 𝓝 0, IsCompact (closure (f '' V))


protected theorem «exists» {p : ℝ≥0 → Prop} :
    (∃ x : ℝ≥0, p x) ↔ ∃ (x : ℝ) (hx : 0 ≤ x), p ⟨x, hx⟩

(∃ x, p x) ↔ ∃ x, ∃ (hx : 0 ≤ x), p ⟨x, hx⟩


theorem Monic.dvd_iff_fraction_map_dvd_fraction_map [IsIntegrallyClosed R] {p q : R[X]}
    (hp : p.Monic) (hq : q.Monic) : q.map (algebraMap R K) ∣ p.map (algebraMap R K) ↔ q ∣ p

{R : Type u_1}
[CommRing R]
{K : Type u_2}
[Field K]
[Algebra R K]
[IsFractionRing R K]
[IsIntegrallyClosed R]
{p q : R[X]}
(hp : p.Monic)
(hq : q.Monic)

Polynomial.map (algebraMap R K) q ∣ Polynomial.map (algebraMap R K) p ↔ q ∣ p


lemma div_le_div_right_of_nonpos {a a' b : EReal} (h : b ≤ 0) (h' : a ≤ a') :
    a' / b ≤ a / b


theorem nhds_inf {t₁ t₂ : TopologicalSpace α} {a : α} :
    @nhds α (t₁ ⊓ t₂) a = @nhds α t₁ a ⊓ @nhds α t₂ a

{α : Type u}
{t₁ t₂ : TopologicalSpace α}
{a : α}

𝓝 a = 𝓝 a ⊓ 𝓝 a


/--
If the unit and counit for the adjunction corresponding to a right adjoint functor are (pointwise)
isomorphisms, then the functor is an equivalence of categories.
-/
lemma Functor.isEquivalence_of_isRightAdjoint (G : C ⥤ D) [IsRightAdjoint G]
    [∀ X, IsIso ((Adjunction.ofIsRightAdjoint G).unit.app X)]
    [∀ Y, IsIso ((Adjunction.ofIsRightAdjoint G).counit.app Y)] : G.IsEquivalence

[∀ (X : D), CategoryTheory.IsIso ((CategoryTheory.Adjunction.ofIsRightAdjoint G).unit.app X)]

[∀ (Y : C), CategoryTheory.IsIso ((CategoryTheory.Adjunction.ofIsRightAdjoint G).counit.app Y)]


theorem lift_neBot_iff (hm : Monotone g) : (NeBot (f.lift g)) ↔ ∀ s ∈ f, NeBot (g s)

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Set α → Filter β}
(hm : Monotone g)


theorem and_congr (h₁ : a ↔ c) (h₂ : b ↔ d) : a ∧ b ↔ c ∧ d

{a c b d : Prop}
(h₁ : a ↔ c)
(h₂ : b ↔ d)


@[simp]
lemma comap_neg {f : M →ₗ[R] M₂} {p : Submodule R M₂} :
    p.comap (-f) = p.comap f

{R : Type u_1}
{M : Type u_5}
{M₂ : Type u_7}
[Ring R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M₂]
[Module R M₂]
{f : M →ₗ[R] M₂}
{p : Submodule R M₂}

Submodule.comap (-f) p = Submodule.comap f p


@[simp] lemma empty_add_empty (v w : Fin 0 → α) : v + w = ![]

{α : Type u_1}
[Add α]
(v w : Fin 0 → α)


@[simp]
theorem induce_self_verts : G'.induce G'.verts = G'

{V : Type u}
{G : SimpleGraph V}
{G' : G.Subgraph}


theorem unbot'_eq_iff {d y : α} {x : WithBot α} : unbot' d x = y ↔ x = y ∨ x = ⊥ ∧ y = d

{α : Type u_1}
{d y : α}
{x : WithBot α}

WithBot.unbot' d x = y ↔ x = ↑y ∨ x = ⊥ ∧ y = d


@[simp]
theorem SlashInvariantForm.toFun_eq_coe {f : SlashInvariantForm Γ k} : f.toFun = (f : ℍ → ℂ)

{Γ : outParam (Subgroup SL(2, ℤ))}
{k : outParam ℤ}
{f : SlashInvariantForm Γ k}


lemma IsRatCondKernelCDFAux.mono (hf : IsRatCondKernelCDFAux f κ ν) (a : α) :
    ∀ᵐ c ∂(ν a), Monotone (f (a, c))

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

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)


theorem mk_range_eq_of_injective {α : Type u} {β : Type v} {f : α → β} (hf : Injective f) :
    lift.{u} #(range f) = lift.{v} #α

{α : Type u}
{β : Type v}
{f : α → β}
(hf : Function.Injective f)

Cardinal.lift.{u, v} (Cardinal.mk ↑(Set.range f)) = Cardinal.lift.{v, u} (Cardinal.mk α)


@[simp]
theorem coe_toEquiv_trans : (e₁₂ : A ≃ B).trans e₂₃ = (e₁₂.trans e₂₃ : A ≃ C)

{R : Type u}
{A : Type v}
{B : Type w}
{C : Type u₁}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Semiring C]
[Algebra R A]
[Algebra R B]
[Algebra R C]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
[CoalgebraStruct R C]
{e₁₂ : A ≃ₐc[R] B}
{e₂₃ : B ≃ₐc[R] C}


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

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

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


theorem rank_lt_rank_dual' {V : Type u} [AddCommGroup V] [Module K V] (h : ℵ₀ ≤ Module.rank K V) :
    Module.rank K V < Module.rank Kᵐᵒᵖ (V →ₗ[K] K)

{K : Type u}
[DivisionRing K]
{V : Type u}
[AddCommGroup V]
[Module K V]
(h : ℵ₀ ≤ Module.rank K V)


theorem prod_dvd_prod_of_subset {ι M : Type*} [CommMonoid M] (s t : Finset ι) (f : ι → M)
    (h : s ⊆ t) : (∏ i ∈ s, f i) ∣ ∏ i ∈ t, f i

{ι : Type u_6}
{M : Type u_7}
[CommMonoid M]
(s t : Finset ι)
(f : ι → M)
(h : s ⊆ t)


theorem nonempty_coe_sort {s : Set α} : Nonempty (↥s) ↔ s.Nonempty


protected theorem not_lt_of_ge : ∀{a b : Nat}, b ≥ a → ¬(b < a)


lemma preconnected_iff_forall_exists_walk_subgraph (H : G.Subgraph) :
    H.Preconnected ↔ ∀ {u v}, u ∈ H.verts → v ∈ H.verts → ∃ p : G.Walk u v, p.toSubgraph ≤ H

{V : Type u}
{G : SimpleGraph V}
(H : G.Subgraph)

H.Preconnected ↔ ∀ {u v : V}, u ∈ H.verts → v ∈ H.verts → ∃ p, p.toSubgraph ≤ H


@[simp]
theorem mem_star_iff (S : NonUnitalSubalgebra R A) (x : A) : x ∈ star S ↔ star x ∈ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[StarModule R A]
(S : NonUnitalSubalgebra R A)
(x : A)


lemma surjectiveOnStalks_iff_forall_maximal' :
    f.SurjectiveOnStalks ↔ ∀ I : Ideal S, I.IsMaximal →
      ∀ s : S, ∃ x r : R, ∃ c ∉ I, f r ∉ I ∧ c * f r * s = c * f x

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
{f : R →+* S}

f.SurjectiveOnStalks ↔ ∀ (I : Ideal S), I.IsMaximal → ∀ (s : S), ∃ x r, ∃ c ∉ I, f r ∉ I ∧ c * f r * s = c * f x


private theorem DecEq_eq [DecidableEq α] :
    List.instBEq = @instBEqOfDecidableEq (List α) instDecidableEqList


theorem getLast_cons_cons (a₁ a₂ : α) (l : List α) :
    getLast (a₁ :: a₂ :: l) (cons_ne_nil _ _) = getLast (a₂ :: l) (cons_ne_nil a₂ l)

(a₁ :: a₂ :: l).getLast ⋯ = (a₂ :: l).getLast ⋯


theorem mem_iInf {ι : Sort*} {S : ι → NonUnitalSubalgebra R A} {x : A} :
    (x ∈ ⨅ i, S i) ↔ ∀ i, x ∈ S i

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{ι : Sort u_2}
{S : ι → NonUnitalSubalgebra R A}
{x : A}


@[simp]
theorem _root_.QuadraticMap.Isometry.tmul_apply
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂}
    {Q₃ : QuadraticForm R M₃} {Q₄ : QuadraticForm R M₄}
    (f : Q₁ →qᵢ Q₂) (g : Q₃ →qᵢ Q₄) (x : M₁ ⊗[R] M₃) :
    f.tmul g x = TensorProduct.map f.toLinearMap g.toLinearMap x

{R : Type uR}
{M₁ : Type uM₁}
{M₂ : Type uM₂}
{M₃ : Type uM₃}
{M₄ : Type uM₄}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[AddCommGroup M₃]
[AddCommGroup M₄]
[Module R M₁]
[Module R M₂]
[Module R M₃]
[Module R M₄]
[Invertible 2]
{Q₁ : QuadraticForm R M₁}
{Q₂ : QuadraticForm R M₂}
{Q₃ : QuadraticForm R M₃}
{Q₄ : QuadraticForm R M₄}
(f : Q₁ →qᵢ Q₂)
(g : Q₃ →qᵢ Q₄)
(x : M₁ ⊗[R] M₃)

(f.tmul g) x = (TensorProduct.map f.toLinearMap g.toLinearMap) x


@[to_additive]
theorem mul_le_of_mul_le_right [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b c d : α}
    (h : a * b ≤ c) (hle : d ≤ a) :
    d * b ≤ c

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


@[simp]
theorem inclusion_self (x : s) : inclusion Subset.rfl x = x


theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M]
    (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N

(R : Type u_1)
(M : Type u_2)
[Semiring R]
[AddCommMonoid M]
[Module R M]
(N : Submodule R M)
(h : IsNoetherian R M)


theorem extract_of_valid (l m r : List Char) :
    extract ⟨l ++ m ++ r⟩ ⟨utf8Len l⟩ ⟨utf8Len l + utf8Len m⟩ = ⟨m⟩

{ data := l ++ m ++ r }.extract { byteIdx := String.utf8Len l } { byteIdx := String.utf8Len l + String.utf8Len m } =
  { data := m }


@[simp]
theorem refl_apply (x : P₁) : refl k P₁ x = x

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


@[simp, deprecated (since := "2024-06-05")]
theorem tailings_succ (f : M × N →ₗ[R] M) (i : Injective f) (n : ℕ) :
    tailings f i (n + 1) = tailings f i n ⊔ tailing f i (n + 1)

{R : Type u}
{M : Type v}
[Ring R]
{N : Type u_3}
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(f : M × N →ₗ[R] M)
(i : Function.Injective ⇑f)
(n : ℕ)

f.tailings i (n + 1) = f.tailings i n ⊔ f.tailing i (n + 1)


/-- Converse to the mean value inequality: if `f` is differentiable at `x₀` and `C`-lipschitz
on a neighborhood of `x₀` then its derivative at `x₀` has norm bounded by `C`. This version
only assumes that `‖f x - f x₀‖ ≤ C * ‖x - x₀‖` in a neighborhood of `x`. -/
theorem HasFDerivAt.le_of_lip' {f : E → F} {f' : E →L[𝕜] F} {x₀ : E} (hf : HasFDerivAt f f' x₀)
    {C : ℝ} (hC₀ : 0 ≤ C) (hlip : ∀ᶠ x in 𝓝 x₀, ‖f x - f x₀‖ ≤ C * ‖x - x₀‖) : ‖f'‖ ≤ C

(hlip : ∀ᶠ (x : E) in 𝓝 x₀, ‖f x - f x₀‖ ≤ C * ‖x - x₀‖)


@[continuity]
theorem Continuous.matrix_transpose {A : X → Matrix m n R} (hA : Continuous A) :
    Continuous fun x => (A x)ᵀ

{X : Type u_1}
{m : Type u_4}
{n : Type u_5}
{R : Type u_8}
[TopologicalSpace X]
[TopologicalSpace R]
{A : X → Matrix m n R}
(hA : Continuous A)


theorem Affine.Simplex.span_eq_top [FiniteDimensional k V] {n : ℕ} (T : Affine.Simplex k V n)
    (hrank : finrank k V = n) : affineSpan k (Set.range T.points) = ⊤

(hrank : FiniteDimensional.finrank k V = n)


theorem sameRay_of_mem_segment [StrictOrderedCommRing 𝕜] [AddCommGroup E] [Module 𝕜 E] {x y z : E}
    (h : x ∈ [y -[𝕜] z]) : SameRay 𝕜 (x - y) (z - x)

{𝕜 : Type u_1}
{E : Type u_2}
[StrictOrderedCommRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{x y z : E}
(h : x ∈ [y-[𝕜]z])


theorem ceil_lt_add_one (a : α) : (⌈a⌉ : α) < a + 1

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


/--
Given `R`-module X and `S`-module Y and a map `g : (extendScalars f).obj X ⟶ Y`, i.e. `S`-linear
map `S ⨂ X → Y`, there is a `X ⟶ (restrictScalars f).obj Y`, i.e. `R`-linear map `X ⟶ Y` by
`x ↦ g (1 ⊗ x)`.
-/
@[simps apply]
def HomEquiv.toRestrictScalars {X Y} (g : (extendScalars f).obj X ⟶ Y) :
    X ⟶ (restrictScalars f).obj Y

(g : (ModuleCat.extendScalars f).obj X ⟶ Y)

(ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.toRestrictScalars f g) x = g (1 ⊗ₜ[R] x)


theorem bind_comm (p : PMF α) (q : PMF β) (f : α → β → PMF γ) :
    (p.bind fun a => q.bind (f a)) = q.bind fun b => p.bind fun a => f a b

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(p : PMF α)
(q : PMF β)
(f : α → β → PMF γ)


theorem isOpen_fold {t : TopologicalSpace X} : t.IsOpen s = IsOpen[t] s

{X : Type u}
{s : Set X}
{t : TopologicalSpace X}


@[simp]
lemma toKaroubiCompN₂IsoN₁_inv_app (X : SimplicialObject C) :
    (toKaroubiCompN₂IsoN₁.inv.app X).f = PInfty

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

(AlgebraicTopology.DoldKan.toKaroubiCompN₂IsoN₁.inv.app X).f = AlgebraicTopology.DoldKan.PInfty


/-- The equivalence `(X ≅ Y) ≃ (F.obj X ≅ F.obj Y)` given by `h : F.FullyFaithful`. -/
@[simps]
def isoEquiv {X Y : C} : (X ≅ Y) ≃ (F.obj X ≅ F.obj Y)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
(hF : F.FullyFaithful)
{X Y : C}
(e : F.obj X ≅ F.obj Y)


@[simp]
theorem mod_eq_zero {a b : R} : a % b = 0 ↔ b ∣ a

{R : Type u}
[EuclideanDomain R]
{a b : R}


theorem Subsingleton.infsep_zero (hs : s.Subsingleton) : s.infsep = 0

{α : Type u_1}
[EDist α]
{s : Set α}
(hs : s.Subsingleton)


theorem tangentMapWithin_prod_snd {s : Set (M × M')} {p : TangentBundle (I.prod I') (M × M')}
    (hs : UniqueMDiffWithinAt (I.prod I') s p.proj) :
    tangentMapWithin (I.prod I') I' Prod.snd s p = ⟨p.proj.2, p.2.2⟩

tangentMapWithin (I.prod I') I' Prod.snd s p = { proj := p.proj.2, snd := p.snd.2 }


/-- Multiplication in the colimit is well-defined in the left argument. -/
@[to_additive "Addition in the colimit is well-defined in the left argument."]
theorem colimitMulAux_eq_of_rel_left {x x' y : Σ j, F.obj j}
    (hxx' : Types.FilteredColimit.Rel (F ⋙ forget MonCat) x x') :
    colimitMulAux.{v, u} F x y = colimitMulAux.{v, u} F x' y

(hxx' : CategoryTheory.Limits.Types.FilteredColimit.Rel (F ⋙ CategoryTheory.forget AddMonCat) x x')

AddMonCat.FilteredColimits.colimitAddAux F x y = AddMonCat.FilteredColimits.colimitAddAux F x' y


/-- The `Pi.prod` of two morphisms is a morphism. -/
@[simps!]
def prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : A →ₐ[R] B × C

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[Semiring C]
[Algebra R C]
(f : A →ₐ[R] B)
(g : A →ₐ[R] C)
(x : A)


theorem continuous_iSup_rng {t₁ : TopologicalSpace α} {t₂ : ι → TopologicalSpace β} {i : ι}
    (h : Continuous[t₁, t₂ i] f) : Continuous[t₁, iSup t₂] f

{α : Type u}
{β : Type v}
{f : α → β}
{ι : Sort u_2}
{t₁ : TopologicalSpace α}
{t₂ : ι → TopologicalSpace β}
{i : ι}
(h : Continuous f)


@[to_additive]
nonrec theorem SmoothAt.inv {f : M → G} {x₀ : M} (hf : SmoothAt I' I f x₀) :
    SmoothAt I' I (fun x => (f x)⁻¹) x₀

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[TopologicalSpace G]
[ChartedSpace H G]
[Group G]
[LieGroup I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{f : M → G}
{x₀ : M}
(hf : SmoothAt I' I f x₀)


private theorem nat_ceil_pos [LinearOrderedSemiring α] [FloorSemiring α] {a : α} :
    0 < a → 0 < ⌈a⌉₊

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}


@[simp] lemma mul_div_cancel_right₀ (a : M₀) (hb : b ≠ 0) : a * b / b = a

{M₀ : Type u_1}
[MonoidWithZero M₀]
[Div M₀]
[MulDivCancelClass M₀]
{b : M₀}
(a : M₀)
(hb : b ≠ 0)


@[to_additive (attr := simp)]
theorem mrange_id : mrange (MonoidHom.id M) = ⊤


@[norm_cast]
theorem coe_neg : ((-f' : PowerSeries R') : LaurentSeries R') = -f'

{R' : Type u_2}
[Ring R']
(f' : PowerSeries R')

(HahnSeries.ofPowerSeries ℤ R') (-f') = -(HahnSeries.ofPowerSeries ℤ R') f'


/-- Given `c = lineMap a b r`, `a < c`, the point `(c, f c)` is strictly above the
segment `[(a, f a), (b, f b)]` if and only if `slope f a b < slope f a c`. -/
theorem lineMap_lt_map_iff_slope_lt_slope_left (h : 0 < r * (b - a)) :
    lineMap (f a) (f b) r < f c ↔ slope f a b < slope f a c

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{f : k → E}
{a b r : k}
(h : 0 < r * (b - a))

(AffineMap.lineMap (f a) (f b)) r < f ((AffineMap.lineMap a b) r) ↔ slope f a b < slope f a ((AffineMap.lineMap a b) r)


theorem qRight_one_right (t : I) : qRight (t, 1) = t


/-- A typeclass mixin for `MeasurableSpace`s such that all sets are measurable. -/
class DiscreteMeasurableSpace (α : Type*) [MeasurableSpace α] : Prop where
  /-- Do not use this. Use `measurableSet_discrete` instead. -/
  forall_measurableSet : ∀ s : Set α, MeasurableSet s

{α : Type u_7}
[MeasurableSpace α]
[self : DiscreteMeasurableSpace α]
(s : Set α)


theorem eventually_le_of_tendsto_lt {l : Filter γ} {f : γ → α} {u v : α} (hv : v < u)
    (h : Tendsto f l (𝓝 v)) : ∀ᶠ a in l, f a ≤ u

{α : Type u}
{γ : Type w}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{l : Filter γ}
{f : γ → α}
{u v : α}
(hv : v < u)
(h : Filter.Tendsto f l (𝓝 v))


/-- If `f : ℕ → M` is multipliable, then the partial products `∏ i ∈ range n, f i` converge
to `∏' i, f i`. -/
@[to_additive "If `f : ℕ → M` is summable, then the partial sums `∑ i ∈ range n, f i` converge
to `∑' i, f i`."]
theorem Multipliable.tendsto_prod_tprod_nat {f : ℕ → M} (h : Multipliable f) :
    Tendsto (fun n ↦ ∏ i ∈ range n, f i) atTop (𝓝 (∏' i, f i))

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
{f : ℕ → M}
(h : Summable f)

Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, f i) Filter.atTop (𝓝 (∑' (i : ℕ), f i))