/-- Let `X` be a topological space, `𝔖` a family of compact subsets of `X`, `α` a uniform space,
and `F : ι → (X → α)` a family which is equicontinuous on each `K ∈ 𝔖`. Then, the uniform
structures of uniform convergence on `𝔖` and pointwise convergence on `⋃₀ 𝔖` induce the same
uniform structure on `ι`.

In particular, pointwise convergence and compact convergence coincide on an equicontinuous
subset of `X → α`.

Consider using `EquicontinuousOn.uniformInducing_uniformOnFun_iff_pi'` and
`EquicontinuousOn.inducing_uniformOnFun_iff_pi'` instead to avoid rewriting instances,
as well as their unprimed versions in case `𝔖` covers `X`. -/
theorem EquicontinuousOn.comap_uniformOnFun_eq {𝔖 : Set (Set X)} (𝔖_compact : ∀ K ∈ 𝔖, IsCompact K)
    (F_eqcont : ∀ K ∈ 𝔖, EquicontinuousOn F K) :
    (UniformOnFun.uniformSpace X α 𝔖).comap F =
    (Pi.uniformSpace _).comap ((⋃₀ 𝔖).restrict ∘ F)

UniformSpace.comap F (UniformOnFun.uniformSpace X α 𝔖) =
  UniformSpace.comap ((⋃₀ 𝔖).restrict ∘ F) (Pi.uniformSpace fun i => α)


/-- The functor `Opens X ⥤ Opens X` given by taking preimages under the identity function
is naturally isomorphic to the identity functor.
-/
@[simps]
def mapId : map (𝟙 X) ≅ 𝟭 (Opens X)

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

(TopologicalSpace.Opens.mapId X).hom.app U = CategoryTheory.eqToHom ⋯


@[norm_cast]
theorem coe_fn_coe' (f : A →ₑ+[φ] B) : ⇑(f : A →ₑ[φ] B) = f

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{A : Type u_4}
[AddMonoid A]
[DistribMulAction M A]
{B : Type u_5}
[AddMonoid B]
[DistribMulAction N B]
(f : A →ₑ+[φ] B)


theorem Injective.comp {g : β → φ} {f : α → β} (hg : Injective g) (hf : Injective f) :
    Injective (g ∘ f)

{α : Sort u₁}
{β : Sort u₂}
{φ : Sort u₃}
{g : β → φ}
{f : α → β}
(hg : Function.Injective g)
(hf : Function.Injective f)


lemma Odd.strictMono_pow (hn : Odd n) : StrictMono fun a : R => a ^ n

{R : Type u_3}
[LinearOrderedSemiring R]
{n : ℕ}
[ExistsAddOfLE R]
(hn : Odd n)


@[simp]
theorem Matrix.toLin'_submatrix [Fintype l] [DecidableEq l] (f₁ : m → k) (e₂ : n ≃ l)
    (M : Matrix k l R) :
    Matrix.toLin' (M.submatrix f₁ e₂) =
      funLeft R R f₁ ∘ₗ (Matrix.toLin' M) ∘ₗ funLeft _ _ e₂.symm

{R : Type u_1}
[CommSemiring R]
{k : Type u_2}
{l : Type u_3}
{m : Type u_4}
{n : Type u_5}
[DecidableEq n]
[Fintype n]
[Fintype l]
[DecidableEq l]
(f₁ : m → k)
(e₂ : n ≃ l)
(M : Matrix k l R)

Matrix.toLin' (M.submatrix f₁ ⇑e₂) = LinearMap.funLeft R R f₁ ∘ₗ Matrix.toLin' M ∘ₗ LinearMap.funLeft R R ⇑e₂.symm


lemma le_smul_ceilDiv (ha : 0 < a) : b ≤ a • (b ⌈/⌉ a)

{α : Type u_2}
{β : Type u_3}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMulZeroClass α β]
[CeilDiv α β]
{a : α}
{b : β}
(ha : 0 < a)


/-- Reinterpret `α →* Multiplicative β` as `Additive α →+ β`. -/
@[simps!]
def MonoidHom.toAdditive' [MulOneClass α] [AddZeroClass β] :
    (α →* Multiplicative β) ≃ (Additive α →+ β)

{α : Type u}
{β : Type v}
[MulOneClass α]
[AddZeroClass β]

∀ (a : α →* Multiplicative β) (a_1 : Additive α),
  (MonoidHom.toAdditive' a) a_1 = Multiplicative.toAdd (a (Additive.toMul a_1))


theorem prod_range_natCast_sub (n k : ℕ) :
    ∏ i ∈ range k, (n - i : α) = (∏ i ∈ range k, (n - i) : ℕ)

∏ i ∈ Finset.range k, (↑n - ↑i) = ↑(∏ i ∈ Finset.range k, (n - i))


theorem coe_lt_iff {x : WithTop α} : ↑a < x ↔ ∀ b : α, x = ↑b → a < b

{α : Type u_1}
[LT α]
{a : α}
{x : WithTop α}


theorem iUnion_compactCovering : ⋃ n, compactCovering X n = univ

(X : Type u_1)
[TopologicalSpace X]
[SigmaCompactSpace X]


lemma sinZeta_neg (a : UnitAddCircle) (s : ℂ) :
    sinZeta (-a) s = -sinZeta a s

HurwitzZeta.sinZeta (-a) s = -HurwitzZeta.sinZeta a s


theorem image_subset_sups_left : b ∈ t → (fun a => a ⊔ b) '' s ⊆ s ⊻ t

{α : Type u_2}
[SemilatticeSup α]
{s t : Set α}
{b : α}


@[simp]
theorem rpow_le_rpow_left_iff_of_base_lt_one (hx0 : 0 < x) (hx1 : x < 1) :
    x ^ y ≤ x ^ z ↔ z ≤ y


theorem liftRel_flatten {R : α → β → Prop} {c1 : Computation (WSeq α)} {c2 : Computation (WSeq β)}
    (h : c1.LiftRel (LiftRel R) c2) : LiftRel R (flatten c1) (flatten c2)

(h : Computation.LiftRel (Stream'.WSeq.LiftRel R) c1 c2)

Stream'.WSeq.LiftRel R (Stream'.WSeq.flatten c1) (Stream'.WSeq.flatten c2)


theorem natDegree_hasseDeriv [NoZeroSMulDivisors ℕ R] (p : R[X]) (n : ℕ) :
    natDegree (hasseDeriv n p) = natDegree p - n

{R : Type u_1}
[Semiring R]
[NoZeroSMulDivisors ℕ R]
(p : Polynomial R)
(n : ℕ)

((Polynomial.hasseDeriv n) p).natDegree = p.natDegree - n


lemma smul_zpow (g : G) (a : H) (n : ℤ) : (g • a) ^ n = g ^ n • a ^ n

{G : Type u_3}
{H : Type u_4}
[Group G]
[Group H]
[MulAction G H]
[SMulCommClass G H H]
[IsScalarTower G H H]
(g : G)
(a : H)
(n : ℤ)


@[simp] lemma toNat_eq_zero : ∀ {n : ℤ}, n.toNat = 0 ↔ n ≤ 0


@[simp]
theorem ofDual_apply_bot : WithBot.ofDual (⊥ : WithBot α) = ⊤


lemma Injective.dite (p : α → Prop) [DecidablePred p]
    {f : {a : α // p a} → β} {f' : {a : α // ¬ p a} → β}
    (hf : Injective f) (hf' : Injective f')
    (im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬ p x'}, f ⟨x, hx⟩ ≠ f' ⟨x', hx'⟩) :
    Function.Injective (fun x ↦ if h : p x then f ⟨x, h⟩ else f' ⟨x, h⟩)

(im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f ⟨x, hx⟩ ≠ f' ⟨x', hx'⟩)

Function.Injective fun x => if h : p x then f ⟨x, h⟩ else f' ⟨x, h⟩


theorem GrothendieckTopology.sheafify_isSheaf (P : Cᵒᵖ ⥤ D) : Presheaf.IsSheaf J (J.sheafify P)

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Category.{max v u, w} D]

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ (CategoryTheory.forget D)]

CategoryTheory.Presheaf.IsSheaf J (J.sheafify P)


/-- We construct the (candidate) limit of a functor `F : J ⥤ Mon_ C`
by interpreting it as a functor `Mon_ (J ⥤ C)`,
and noting that taking limits is a lax monoidal functor,
and hence sends monoid objects to monoid objects.
-/
@[simps!]
def limit (F : J ⥤ Mon_ C) : Mon_ C

(Mon_.limit F).one =
  CategoryTheory.Limits.limit.lift (F ⋙ Mon_.forget C)
    ((CategoryTheory.Limits.Cones.postcompose
          (CategoryTheory.Monoidal.MonFunctorCategoryEquivalence.inverseObj F).one).obj
      { pt := 𝟙_ C, π := { app := fun j => 𝟙 (𝟙_ C), naturality := ⋯ } })


@[simp]
lemma preΨ_neg (n : ℤ) : W.preΨ (-n) = -W.preΨ n

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


theorem choose_property (hp : ∃ a, a ∈ l ∧ p a) : p (choose p l hp)

{α : Type u}
(p : α → Prop)
[DecidablePred p]
(l : List α)
(hp : ∃ a, a ∈ l ∧ p a)


theorem normSq_apply (z : K) : normSq z = re z * re z + im z * im z

RCLike.normSq z = RCLike.re z * RCLike.re z + RCLike.im z * RCLike.im z


lemma Set.MapsTo.lipschitzOnWith_iff_restrict {t : Set β} (h : MapsTo f s t) :
    LipschitzOnWith K f s ↔ LipschitzWith K (h.restrict f s t)

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{s : Set α}
{f : α → β}
{t : Set β}
(h : Set.MapsTo f s t)

LipschitzOnWith K f s ↔ LipschitzWith K (Set.MapsTo.restrict f s t h)


theorem not_irreducible_C (x : R) : ¬Irreducible (C x)


/-- Let `X` be a topological space, and suppose that for all distinct `x,y ∈ X`, there
  is some clopen set `U` such that `x ∈ U` and `y ∉ U`. Then `X` is totally disconnected. -/
theorem isTotallyDisconnected_of_isClopen_set {X : Type*} [TopologicalSpace X]
    (hX : Pairwise fun x y => ∃ (U : Set X), IsClopen U ∧ x ∈ U ∧ y ∉ U) :
    IsTotallyDisconnected (Set.univ : Set X)

(hX : Pairwise fun x y => ∃ U, IsClopen U ∧ x ∈ U ∧ y ∉ U)


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


@[simp]
theorem coe_nsmul (r : ℕ) (f : NormedAddGroupHom V₁ V₂) : ⇑(r • f) = r • ⇑f

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


theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegral K x) :
    norm K (AdjoinSimple.gen K x) = 1

{K : Type u_4}
{L : Type u_5}
[Field K]
[Field L]
[Algebra K L]
{x : L}
(hx : ¬IsIntegral K x)

(Algebra.norm K) (IntermediateField.AdjoinSimple.gen K x) = 1


/-- Reorder a product.

The difference with `Finset.prod_bij` is that the bijection is specified with an inverse, rather
than as a surjective injection.

The difference with `Finset.prod_nbij'` is that the bijection and its inverse are allowed to use
membership of the domains of the products, rather than being non-dependent functions. -/
@[to_additive "Reorder a sum.

The difference with `Finset.sum_bij` is that the bijection is specified with an inverse, rather than
as a surjective injection.

The difference with `Finset.sum_nbij'` is that the bijection and its inverse are allowed to use
membership of the domains of the sums, rather than being non-dependent functions."]
theorem prod_bij' (i : ∀ a ∈ s, κ) (j : ∀ a ∈ t, ι) (hi : ∀ a ha, i a ha ∈ t)
    (hj : ∀ a ha, j a ha ∈ s) (left_inv : ∀ a ha, j (i a ha) (hi a ha) = a)
    (right_inv : ∀ a ha, i (j a ha) (hj a ha) = a) (h : ∀ a ha, f a = g (i a ha)) :
    ∏ x ∈ s, f x = ∏ x ∈ t, g x

(hi : ∀ (a : ι) (ha : a ∈ s), i a ha ∈ t)

(hj : ∀ (a : κ) (ha : a ∈ t), j a ha ∈ s)

(left_inv : ∀ (a : ι) (ha : a ∈ s), j (i a ha) ⋯ = a)

(right_inv : ∀ (a : κ) (ha : a ∈ t), i (j a ha) ⋯ = a)

(h : ∀ (a : ι) (ha : a ∈ s), f a = g (i a ha))


/--
Let `α` be a normed commutative group equipped with a partial order covariant with addition, with
respect which `α` forms a lattice. Suppose that `α` is *solid*, that is to say, for `a` and `b` in
`α`, with absolute values `|a|` and `|b|` respectively, `|a| ≤ |b|` implies `‖a‖ ≤ ‖b‖`. Then `α` is
said to be a normed lattice ordered group.
-/
class NormedLatticeAddCommGroup (α : Type*) extends
    NormedAddCommGroup α, Lattice α, HasSolidNorm α where
  add_le_add_left : ∀ a b : α, a ≤ b → ∀ c : α, c + a ≤ c + b

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


@[simp] theorem bijOn_empty_iff_left : BijOn f s ∅ ↔ s = ∅

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


/-- The opposite of a natural transformation. -/
@[simps]
protected def op (α : F ⟶ G) : G.op ⟶ F.op

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

(CategoryTheory.NatTrans.op α).app X = (α.app (Opposite.unop X)).op


theorem integral_trim (hm : m ≤ m0) {f : β → G} (hf : StronglyMeasurable[m] f) :
    ∫ x, f x ∂μ = ∫ x, f x ∂μ.trim hm

(hf : MeasureTheory.StronglyMeasurable f)

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


private theorem add_le_add_iff_left' {s t u : Multiset α} : s + t ≤ s + u ↔ t ≤ u


theorem map_bind {α β} (m : β → γ) (f : Filter α) (g : α → Filter β) :
    map m (bind f g) = bind f (map m ∘ g)

{γ : Type w}
{α : Type u_2}
{β : Type u_3}
(m : β → γ)
(f : Filter α)
(g : α → Filter β)

Filter.map m (f.bind g) = f.bind (Filter.map m ∘ g)


/-- In a codirected order, the union of two sets is bounded below if and only if both sets are. -/
theorem bddBelow_union [IsDirected α (· ≥ ·)] {s t : Set α} :
    BddBelow (s ∪ t) ↔ BddBelow s ∧ BddBelow t

{α : Type u}
[Preorder α]
[IsDirected α fun x x_1 => x ≥ x_1]
{s t : Set α}


/-- Ring homomorphisms map one to one. -/
protected theorem map_one (f : α →+* β) : f 1 = 1

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), f 1 = 1


@[to_additive]
theorem smulAntidiagonal_mono_left {a : P} {hs : s.IsPWO} {ht : t.IsPWO} (h : u ⊆ s) :
    SMulAntidiagonal hu ht a ⊆ SMulAntidiagonal hs ht a

{G : Type u_1}
{P : Type u_2}
[PartialOrder G]
[PartialOrder P]
[SMul G P]
[IsOrderedCancelSMul G P]
{s : Set G}
{t : Set P}
{u : Set G}
{hu : u.IsPWO}
{a : P}
{hs : s.IsPWO}
{ht : t.IsPWO}
(h : u ⊆ s)

Finset.SMulAntidiagonal hu ht a ⊆ Finset.SMulAntidiagonal hs ht a


/-- If the range of `v : ι → M` generates the whole module and linear maps `f`, `g` are equal at
each `v i`, then they are equal. -/
theorem ext_on_range {ι : Sort*} {v : ι → M} {f g : F} (hv : span R (Set.range v) = ⊤)
    (h : ∀ i, f (v i) = g (v i)) : f = g

(hv : Submodule.span R (Set.range v) = ⊤)


lemma smul_lt_smul_of_lt_of_le' [PosSMulMono α β] [SMulPosStrictMono α β] (ha : a₁ < a₂)
    (hb : b₁ ≤ b₂) (h₂ : 0 ≤ a₂) (h₁ : 0 < b₁) : a₁ • b₁ < a₂ • b₂

{α : Type u_1}
{β : Type u_2}
{a₁ a₂ : α}
{b₁ b₂ : β}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[Zero β]
[PosSMulMono α β]
[SMulPosStrictMono α β]
(ha : a₁ < a₂)
(hb : b₁ ≤ b₂)
(h₂ : 0 ≤ a₂)
(h₁ : 0 < b₁)

a₁ • b₁ < a₂ • b₂


theorem toBilin_apply (Q : QuadraticMap R M N) (bm : Basis ι R M) (i j : ι) :
    Q.toBilin bm (bm i) (bm j) =
      if i = j then Q (bm i) else if i < j then polar Q (bm i) (bm j) else 0

{ι : Type u_4}
{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[LinearOrder ι]
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(Q : QuadraticMap R M N)
(bm : Basis ι R M)
(i j : ι)

((Q.toBilin bm) (bm i)) (bm j) = if i = j then Q (bm i) else if i < j then QuadraticMap.polar (⇑Q) (bm i) (bm j) else 0


theorem HasDerivWithinAt.csin (hf : HasDerivWithinAt f f' s x) :
    HasDerivWithinAt (fun x => Complex.sin (f x)) (Complex.cos (f x) * f') s x

{f : ℂ → ℂ}
{f' x : ℂ}
{s : Set ℂ}
(hf : HasDerivWithinAt f f' s x)


@[reassoc]
theorem yang_baxter (X Y Z : C) :
    (α_ X Y Z).inv ≫ (β_ X Y).hom ▷ Z ≫ (α_ Y X Z).hom ≫
    Y ◁ (β_ X Z).hom ≫ (α_ Y Z X).inv ≫ (β_ Y Z).hom ▷ X ≫ (α_ Z Y X).hom =
      X ◁ (β_ Y Z).hom ≫ (α_ X Z Y).inv ≫ (β_ X Z).hom ▷ Y ≫
      (α_ Z X Y).hom ≫ Z ◁ (β_ X Y).hom

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


@[simp] theorem coe_lTensor : lTensor M f = (f : N →ₗ[R] P).lTensor M

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

↑(LinearEquiv.lTensor M f) = LinearMap.lTensor M ↑f


@[simp]
theorem pmap_some (f : ∀ a : α, p a → β) {x : α} (h : p x) :
    pmap f (some x) = fun _ ↦ some (f x h)

{α : Type u_1}
{β : Type u_2}
{p : α → Prop}
(f : (a : α) → p a → β)
{x : α}
(h : p x)

Option.pmap f (some x) = fun x_1 => some (f x h)


/-- In a preconnected space, any finite disjoint cover by non-empty closed subsets has at most one
element. -/
lemma subsingleton_of_disjoint_isClosed_iUnion_eq_univ [Finite ι]
    (h_closed : ∀ i, IsClosed (s i)) (h_Union : ⋃ i, s i = univ) :
    Subsingleton ι

(h_nonempty : ∀ (i : ι), (s i).Nonempty)


theorem trans_apply (F : HomotopyRel f₀ f₁ S) (G : HomotopyRel f₁ f₂ S) (x : I × X) :
    (F.trans G) x =
      if h : (x.1 : ℝ) ≤ 1 / 2 then
        F (⟨2 * x.1, (unitInterval.mul_pos_mem_iff zero_lt_two).2 ⟨x.1.2.1, h⟩⟩, x.2)
      else
        G (⟨2 * x.1 - 1, unitInterval.two_mul_sub_one_mem_iff.2 ⟨(not_le.1 h).le, x.1.2.2⟩⟩, x.2)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ f₂ : C(X, Y)}
{S : Set X}
(F : f₀.HomotopyRel f₁ S)
(G : f₁.HomotopyRel f₂ S)
(x : ↑I × X)

(F.trans G) x = if h : ↑x.1 ≤ 1 / 2 then F (⟨2 * ↑x.1, ⋯⟩, x.2) else G (⟨2 * ↑x.1 - 1, ⋯⟩, x.2)


lemma natDegree_Ψ₃_pos (h : (3 : R) ≠ 0) : 0 < W.Ψ₃.natDegree

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(h : 3 ≠ 0)


{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


protected theorem toFinset_range [DecidableEq α] [Fintype β] (f : β → α) (h : (range f).Finite) :
    h.toFinset = Finset.univ.image f

{α : Type u}
{β : Type v}
[DecidableEq α]
[Fintype β]
(f : β → α)
(h : (Set.range f).Finite)


/-- We can rebracket `x ++ (l₁ ++ x) ++ (l₂ ++ x) ++ ... ++ (lₙ ++ x)` to
`(x ++ l₁) ++ (x ++ l₂) ++ ... ++ (x ++ lₙ) ++ x` where `L = [l₁, l₂, ..., lₙ]`. -/
theorem append_join_map_append (L : List (List α)) (x : List α) :
    x ++ (L.map (· ++ x)).join = (L.map (x ++ ·)).join ++ x

{α : Type u_1}
(L : List (List α))
(x : List α)

x ++ (List.map (fun x_1 => x_1 ++ x) L).join = (List.map (fun x_1 => x ++ x_1) L).join ++ x


lemma inductionOn'_add_one (hz : b ≤ z) :
    (z + 1).inductionOn' b H0 Hs Hp = Hs z hz (z.inductionOn' b H0 Hs Hp)

{Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)}

{Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)}


theorem mul_swap_eq_swap_mul (f : Perm α) (x y : α) : f * swap x y = swap (f x) (f y) * f

{α : Type u}
[DecidableEq α]
(f : Equiv.Perm α)
(x y : α)

f * Equiv.swap x y = Equiv.swap (f x) (f y) * f


theorem takeD_left' {l₁ l₂ : List α} {n} {a} (h : length l₁ = n) : takeD n (l₁ ++ l₂) a = l₁

{α : Type u}
{l₁ l₂ : List α}
{n : ℕ}
{a : α}
(h : l₁.length = n)


@[reassoc (attr := simp)]
theorem coimage_image_factorisation : coimage.π f ≫ coimageImageComparison f ≫ image.ι f = f

CategoryTheory.Abelian.coimage.π f ≫
    CategoryTheory.Abelian.coimageImageComparison f ≫ CategoryTheory.Abelian.image.ι f =
  f


/-- This bootstraps `nonempty_sections_of_finite_inverse_system`. In this version,
the `F` functor is between categories of the same universe, and it is an easy
corollary to `TopCat.nonempty_limitCone_of_compact_t2_cofiltered_system`. -/
theorem nonempty_sections_of_finite_cofiltered_system.init {J : Type u} [SmallCategory J]
    [IsCofilteredOrEmpty J] (F : J ⥤ Type u) [hf : ∀ j, Finite (F.obj j)]
    [hne : ∀ j, Nonempty (F.obj j)] : F.sections.Nonempty

{J : Type u}
[CategoryTheory.SmallCategory J]
[CategoryTheory.IsCofilteredOrEmpty J]
(F : J ⥤ Type u)
[hf : ∀ (j : J), Finite (F.obj j)]
[hne : ∀ (j : J), Nonempty (F.obj j)]


/-- Assumes right covariance.
The lemma assuming left covariance is `Left.one_le_mul`. -/
@[to_additive Right.add_nonneg "Assumes right covariance.
The lemma assuming left covariance is `Left.add_nonneg`."]
theorem Right.one_le_mul [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α} (ha : 1 ≤ a)
    (hb : 1 ≤ b) :
    1 ≤ a * b

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


theorem tan_add_int_mul_pi (x : ℝ) (n : ℤ) : tan (x + n * π) = tan x

Real.tan (x + ↑n * Real.pi) = Real.tan x


theorem dense_image (di : DenseInducing i) {s : Set α} : Dense (i '' s) ↔ Dense s

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{i : α → β}
(di : DenseInducing i)
{s : Set α}


@[csimp] theorem replaceF_eq_replaceFTR : @replaceF = @replaceFTR


theorem truncateFun_sub (x y : 𝕎 R) :
    truncateFun n (x - y) = truncateFun n x - truncateFun n y

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(n : ℕ)
{R : Type u_1}
[CommRing R]
(x y : 𝕎 R)

WittVector.truncateFun n (x - y) = WittVector.truncateFun n x - WittVector.truncateFun n y


@[to_additive]
theorem tendsto_prod [Monoid α] [ContinuousMul α] {l : List α} :
    Tendsto List.prod (𝓝 l) (𝓝 l.prod)

{α : Type u_1}
[TopologicalSpace α]
[AddMonoid α]
[ContinuousAdd α]
{l : List α}


theorem cotangentEquivIdeal_symm_apply (x : R) (hx : x ∈ I) :
    -- Note: #8386 had to specify `(R₂ := R)` because `I.toCotangent` suggested `R ⧸ I^2` instead
    I.cotangentEquivIdeal.symm ⟨(I ^ 2).mkQ x, Submodule.mem_map_of_mem (R₂ := R) hx⟩ =
      I.toCotangent ⟨x, hx⟩

{R : Type u}
[CommRing R]
(I : Ideal R)
(x : R)
(hx : x ∈ I)

I.cotangentEquivIdeal.symm ⟨(Submodule.mkQ (I ^ 2)) x, ⋯⟩ = I.toCotangent ⟨x, hx⟩


/-- Homotopy between morphisms of short complexes is compatible with substraction. -/
@[simps]
def sub (h : Homotopy φ₁ φ₂) (h' : Homotopy φ₃ φ₄) : Homotopy (φ₁ - φ₃) (φ₂ - φ₄)

{φ₁ φ₂ φ₃ φ₄ : S₁ ⟶ S₂}

(h : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)

(h' : CategoryTheory.ShortComplex.Homotopy φ₃ φ₄)


@[simp]
theorem sSup_adj {s : Set G.Subgraph} : (sSup s).Adj a b ↔ ∃ G ∈ s, Adj G a b

{V : Type u}
{G : SimpleGraph V}
{a b : V}
{s : Set G.Subgraph}

(sSup s).Adj a b ↔ ∃ G_1 ∈ s, G_1.Adj a b


@[simp]
theorem natCast_get {x : PartENat} (h : x.Dom) : (x.get h : PartENat) = x


lemma hasRightDerivedFunctor_iff :
    F.HasRightDerivedFunctor W ↔ HasLeftKanExtension L F

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

F.HasRightDerivedFunctor W ↔ L.HasLeftKanExtension F


/-- Composition by continuous linear maps on the right preserves `C^n` functions at a point on
a domain. -/
theorem ContDiffWithinAt.comp_continuousLinearMap {x : G} (g : G →L[𝕜] E)
    (hf : ContDiffWithinAt 𝕜 n f s (g x)) : ContDiffWithinAt 𝕜 n (f ∘ g) (g ⁻¹' s) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{s : Set E}
{f : E → F}
{n : ℕ∞}
{x : G}
(g : G →L[𝕜] E)
(hf : ContDiffWithinAt 𝕜 n f s (g x))

ContDiffWithinAt 𝕜 n (f ∘ ⇑g) (⇑g ⁻¹' s) x


/-- If
```
(f 0)
(0 g)
```
is invertible, then `f` is invertible.
-/
theorem isIso_left_of_isIso_biprod_map {W X Y Z : C} (f : W ⟶ Y) (g : X ⟶ Z)
    [IsIso (biprod.map f g)] : IsIso f

[CategoryTheory.IsIso (CategoryTheory.Limits.biprod.map f g)]


theorem left_hom_inv_right [IsIso sq] : sq.left ≫ g.hom ≫ inv sq.right = f.hom

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{f g : CategoryTheory.Arrow T}
(sq : f ⟶ g)
[CategoryTheory.IsIso sq]

CategoryTheory.CategoryStruct.comp sq.left (CategoryTheory.CategoryStruct.comp g.hom (CategoryTheory.inv sq.right)) =
  f.hom


lemma ker_ne_bot_of_finrank_lt [FiniteDimensional K V] [FiniteDimensional K V₂] {f : V →ₗ[K] V₂}
    (h : finrank K V₂ < finrank K V) :
    LinearMap.ker f ≠ ⊥

(h : FiniteDimensional.finrank K V₂ < FiniteDimensional.finrank K V)


lemma differentiable_fourierIntegral
    [MeasurableSpace V] [BorelSpace V] [SecondCountableTopology V] {μ : Measure V}
    (hf : Integrable f μ) (hf' : Integrable (fun v : V ↦ ‖v‖ * ‖f v‖) μ) :
    Differentiable ℝ (fourierIntegral 𝐞 μ L.toLinearMap₂ f)

(hf' : MeasureTheory.Integrable (fun v => ‖v‖ * ‖f v‖) μ)

Differentiable ℝ (VectorFourier.fourierIntegral 𝐞 μ L.toLinearMap₂ f)


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


@[to_additive]
theorem Normal.map {H : Subgroup G} (h : H.Normal) (f : G →* N) (hf : Function.Surjective f) :
    (H.map f).Normal

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


lemma eq_iff {p : ℕ} : ringChar R = p ↔ CharP R p

{R : Type u_1}
[NonAssocSemiring R]
{p : ℕ}


@[to_additive]
protected theorem mul_le_mul_iff_right [Mul α] [i : IsSymmOp α α (· * ·)]
    [CovariantClass α α (· * ·) (· ≤ ·)] {a b c : α} (ha : MulLECancellable a) :
    b * a ≤ c * a ↔ b ≤ c

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


theorem Duplicate.duplicate_cons (h : x ∈+ l) (y : α) : x ∈+ y :: l

{α : Type u_1}
{l : List α}
{x : α}
(h : List.Duplicate x l)
(y : α)


/-- `C₀(α, β)` is the type of continuous functions `α → β` which vanish at infinity from a
topological space to a metric space with a zero element.

When possible, instead of parametrizing results over `(f : C₀(α, β))`,
you should parametrize over `(F : Type*) [ZeroAtInftyContinuousMapClass F α β] (f : F)`.

When you extend this structure, make sure to extend `ZeroAtInftyContinuousMapClass`. -/
structure ZeroAtInftyContinuousMap (α : Type u) (β : Type v) [TopologicalSpace α] [Zero β]
    [TopologicalSpace β] extends ContinuousMap α β : Type max u v where
  /-- The function tends to zero along the `cocompact` filter. -/
  zero_at_infty' : Tendsto toFun (cocompact α) (𝓝 0)

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

Filter.Tendsto self.toFun (Filter.cocompact α) (𝓝 0)


@[to_additive le_mul_norm_sub]
theorem le_mul_norm_div {f : E → F} (hf : AntilipschitzWith K f) (x y : E) :
    ‖x / y‖ ≤ K * ‖f x / f y‖

{F : Type u_4}
[SeminormedAddCommGroup F]
{E : Type u_6}
[SeminormedAddCommGroup E]
{K : ℝ≥0}
{f : E → F}
(hf : AntilipschitzWith K f)
(x y : E)


@[to_additive]
theorem conj_mem' (nH : H.Normal) (n : G) (hn : n ∈ H) (g : G) :
    g⁻¹ * n * g ∈ H

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
(nH : H.Normal)
(n : G)
(hn : n ∈ H)
(g : G)


/-- If a finset `u` is contained in the product of two sets `s * t`, we can find two finsets `s'`,
`t'` such that `s' ⊆ s`, `t' ⊆ t` and `u ⊆ s' * t'`. -/
@[to_additive
      "If a finset `u` is contained in the sum of two sets `s + t`, we can find two finsets
      `s'`, `t'` such that `s' ⊆ s`, `t' ⊆ t` and `u ⊆ s' + t'`."]
theorem subset_mul {s t : Set α} :
    ↑u ⊆ s * t → ∃ s' t' : Finset α, ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' * t'

{α : Type u_2}
[DecidableEq α]
[Mul α]
{u : Finset α}
{s t : Set α}

↑u ⊆ s * t → ∃ s' t', ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' * t'


theorem det_of_mem_unitary {A : Matrix n n α} (hA : A ∈ Matrix.unitaryGroup n α) :
    A.det ∈ unitary α

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


@[simp]
theorem val_intCast (n : ℤ) : (n : HomogeneousLocalization 𝒜 x).val = n

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


lemma growsPolynomially_rpow (p : ℝ) : GrowsPolynomially fun x => x ^ p

AkraBazziRecurrence.GrowsPolynomially fun x => x ^ p


@[to_additive]
lemma ofUnits_right_inverse :
    Function.RightInverse (ofUnits (M := M)) (Submonoid.units (M := M))


/-- The preimage of the normalizer is contained in the normalizer of the preimage. -/
@[to_additive "The preimage of the normalizer is contained in the normalizer of the preimage."]
theorem le_normalizer_comap (f : N →* G) :
    H.normalizer.comap f ≤ (H.comap f).normalizer

{G : Type u_1}
[Group G]
{H : Subgroup G}
{N : Type u_5}
[Group N]
(f : N →* G)

Subgroup.comap f H.normalizer ≤ (Subgroup.comap f H).normalizer


/-- In a trichotomous irreflexive order, every element is determined by the set of predecessors. -/
theorem extensional_of_trichotomous_of_irrefl (r : α → α → Prop) [IsTrichotomous α r] [IsIrrefl α r]
    {a b : α} (H : ∀ x, r x a ↔ r x b) : a = b

{α : Type u}
(r : α → α → Prop)
[IsTrichotomous α r]
[IsIrrefl α r]
{a b : α}
(H : ∀ (x : α), r x a ↔ r x b)


theorem condCount_self (hs : s.Finite) (hs' : s.Nonempty) : condCount s s = 1

{Ω : Type u_1}
[MeasurableSpace Ω]
[MeasurableSingletonClass Ω]
{s : Set Ω}
(hs : s.Finite)
(hs' : s.Nonempty)


@[simp]
theorem sumArrowLequivProdArrow_apply_snd {α β} (f : α ⊕ β → M) (b : β) :
    (sumArrowLequivProdArrow α β R M f).2 b = f (Sum.inr b)

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_5}
{β : Type u_6}
(f : α ⊕ β → M)
(b : β)

((LinearEquiv.sumArrowLequivProdArrow α β R M) f).2 b = f (Sum.inr b)


@[simp, bv_toNat] theorem toNat_ushiftRight (x : BitVec n) (i : Nat) :
    (x >>> i).toNat = x.toNat >>> i


lemma piCongrLeft_apply_eq_cast {P : β → Sort v} {e : α ≃ β}
    (f : (a : α) → P (e a)) (b : β) :
    piCongrLeft P e f b = cast (congr_arg P (e.apply_symm_apply b)) (f (e.symm b))

{β : Sort u_2}
{α : Sort u_1}
{P : β → Sort v}
{e : α ≃ β}
(f : (a : α) → P (e a))
(b : β)

(Equiv.piCongrLeft P e) f b = cast ⋯ (f (e.symm b))


@[to_additive (attr := simp)]
theorem infEdist_smul {M} [SMul M α] [IsometricSMul M α] (c : M) (x : α) (s : Set α) :
    infEdist (c • x) (c • s) = infEdist x s

{α : Type u}
[PseudoEMetricSpace α]
{M : Type u_2}
[VAdd M α]
[IsometricVAdd M α]
(c : M)
(x : α)
(s : Set α)

EMetric.infEdist (c +ᵥ x) (c +ᵥ s) = EMetric.infEdist x s


@[to_additive]
private theorem smul'_char (r₁ : R) (r₂ : X) (s₁ s₂ : S) (u : S) (v : R) (huv : u * r₁ = v * s₂) :
    OreLocalization.smul' r₁ s₁ r₂ s₂ = v • r₂ /ₒ (u * s₁)

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
{X : Type u_2}
[AddAction R X]
(r₁ : R)
(r₂ : X)
(s₁ s₂ u : ↥S)
(v : R)
(huv : ↑u + r₁ = v + ↑s₂)

OreLocalization.vadd' r₁ s₁ r₂ s₂ = v +ᵥ r₂ -ₒ (u + s₁)


/-- If `u₁` and `u₂` are two uniform structures on `γ` and `u₁ ≤ u₂`, then
`𝒰(α, γ, u₁) ≤ 𝒰(α, γ, u₂)`. -/
protected theorem mono : Monotone (@UniformFun.uniformSpace α γ)


theorem mem_cylinder_iff_le_firstDiff {x y : ∀ n, E n} (hne : x ≠ y) (i : ℕ) :
    x ∈ cylinder y i ↔ i ≤ firstDiff x y

{E : ℕ → Type u_1}
{x y : (n : ℕ) → E n}
(hne : x ≠ y)
(i : ℕ)

x ∈ PiNat.cylinder y i ↔ i ≤ PiNat.firstDiff x y


@[simp] theorem toNat_cons (b : Bool) (x : BitVec w) :
    (cons b x).toNat = (b.toNat <<< w) ||| x.toNat

(BitVec.cons b x).toNat = b.toNat <<< w ||| x.toNat


/-- Two measures which are finite on closed-open intervals are equal if they agree on all
closed-open intervals. -/
theorem ext_of_Ico' {α : Type*} [TopologicalSpace α] {m : MeasurableSpace α}
    [SecondCountableTopology α] [LinearOrder α] [OrderTopology α] [BorelSpace α] [NoMaxOrder α]
    (μ ν : Measure α) (hμ : ∀ ⦃a b⦄, a < b → μ (Ico a b) ≠ ∞)
    (h : ∀ ⦃a b⦄, a < b → μ (Ico a b) = ν (Ico a b)) : μ = ν

(hμ : ∀ ⦃a b : α⦄, a < b → μ (Set.Ico a b) ≠ ⊤)

(h : ∀ ⦃a b : α⦄, a < b → μ (Set.Ico a b) = ν (Set.Ico a b))


@[simp] lemma mapEquiv_basis_iff {α β : Type*} {M : Matroid α} (f : α ≃ β) {I X : Set β} :
    (M.mapEquiv f).Basis I X ↔ M.Basis (f.symm '' I) (f.symm '' X)

{α : Type u_3}
{β : Type u_4}
{M : Matroid α}
(f : α ≃ β)
{I X : Set β}

(M.mapEquiv f).Basis I X ↔ M.Basis (⇑f.symm '' I) (⇑f.symm '' X)


private theorem ghostFun_one : ghostFun (1 : 𝕎 R) = 1

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]


lemma neg_def (P : W.Point) : -P = P.neg

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
(P : W.Point)


@[to_additive (attr := simp)]
theorem unbot_one' (d : α) : (1 : WithBot α).unbot' d = 1


lemma natTrans_app_yoneda_obj (X : C) : (natTrans φ).app (yoneda.obj X) =
    (compYonedaIsoYonedaCompLan F).inv.app X ≫ φ.app X

[∀ (P : CategoryTheory.Functor Cᵒᵖ (Type v₁)), F.op.HasLeftKanExtension P]

{G : CategoryTheory.Functor (CategoryTheory.Functor Cᵒᵖ (Type v₁)) (CategoryTheory.Functor Dᵒᵖ (Type v₁))}

(φ : F.comp CategoryTheory.yoneda ⟶ CategoryTheory.yoneda.comp G)

(CategoryTheory.Presheaf.compYonedaIsoYonedaCompLan.natTrans φ).app (CategoryTheory.yoneda.obj X) =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.Presheaf.compYonedaIsoYonedaCompLan F).inv.app X) (φ.app X)


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

{f : ℝ → ℝ}
{f' x : ℝ}
{s : Set ℝ}
(hf : HasDerivWithinAt f f' s x)


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


theorem StarConvex.is_linear_image (hs : StarConvex 𝕜 x s) {f : E → F} (hf : IsLinearMap 𝕜 f) :
    StarConvex 𝕜 (f x) (f '' s)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
{x : E}
{s : Set E}
(hs : StarConvex 𝕜 x s)
{f : E → F}
(hf : IsLinearMap 𝕜 f)


/-- **The second Borel-Cantelli lemma**: Given a sequence of independent sets `(sₙ)` such that
`∑ n, μ sₙ = ∞`, `limsup sₙ` has measure 1. -/
theorem measure_limsup_eq_one {s : ℕ → Set Ω} (hsm : ∀ n, MeasurableSet (s n)) (hs : iIndepSet s μ)
    (hs' : (∑' n, μ (s n)) = ∞) : μ (limsup s atTop) = 1

{Ω : Type u_1}
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsProbabilityMeasure μ]
{s : ℕ → Set Ω}
(hsm : ∀ (n : ℕ), MeasurableSet (s n))
(hs : ProbabilityTheory.iIndepSet s μ)
(hs' : ∑' (n : ℕ), μ (s n) = ⊤)


theorem span_pow_eq_top (s : Set α) (hs : span s = ⊤) (n : ℕ) :
    span ((fun (x : α) => x ^ n) '' s) = ⊤

{α : Type u}
[CommSemiring α]
(s : Set α)
(hs : Ideal.span s = ⊤)
(n : ℕ)


/-- When a function has a limit at infinity `l`, and its derivative is nonpositive, then the
integral of the derivative on `(a, +∞)` is `l - g a` (and the derivative is integrable, see
`integrable_on_Ioi_deriv_of_nonneg'`). Version assuming differentiability on `[a, +∞)`. -/
theorem integral_Ioi_of_hasDerivAt_of_nonpos' (hderiv : ∀ x ∈ Ici a, HasDerivAt g (g' x) x)
    (g'neg : ∀ x ∈ Ioi a, g' x ≤ 0) (hg : Tendsto g atTop (𝓝 l)) : ∫ x in Ioi a, g' x = l - g a

(hderiv : ∀ x ∈ Set.Ici a, HasDerivAt g (g' x) x)

(hg : Filter.Tendsto g Filter.atTop (𝓝 l))


/-- **Von Neumann Mean Ergodic Theorem**, a version for a normed space.

Let `f : E → E` be a contracting linear self-map of a normed space.
Let `S` be the subspace of fixed points of `f`.
Let `g : E → S` be a continuous linear projection, `g|_S=id`.
If the range of `f - id` is dense in the kernel of `g`,
then for each `x`, the Birkhoff averages
```
birkhoffAverage 𝕜 f id N x = (N : 𝕜)⁻¹ • ∑ n ∈ Finset.range N, f^[n] x
```
converge to `g x` as `N → ∞`.

Usually, this fact is not formulated as a separate lemma.
I chose to do it in order to isolate parts of the proof that do not rely
on the inner product space structure.
-/
theorem LinearMap.tendsto_birkhoffAverage_of_ker_subset_closure [NormedSpace 𝕜 E]
    (f : E →ₗ[𝕜] E) (hf : LipschitzWith 1 f) (g : E →L[𝕜] LinearMap.eqLocus f 1)
    (hg_proj : ∀ x : LinearMap.eqLocus f 1, g x = x)
    (hg_ker : (LinearMap.ker g : Set E) ⊆ closure (LinearMap.range (f - 1))) (x : E) :
    Tendsto (birkhoffAverage 𝕜 f _root_.id · x) atTop (𝓝 (g x))

(hg_proj : ∀ (x : ↥(LinearMap.eqLocus f 1)), g ↑x = x)

(hg_ker : ↑(LinearMap.ker g) ⊆ closure ↑(LinearMap.range (f - 1)))

Filter.Tendsto (fun x_1 => birkhoffAverage 𝕜 (⇑f) id x_1 x) Filter.atTop (𝓝 ↑(g x))


theorem val_cast_eq_val_of_lt {m n : ℕ} [nzm : NeZero m] {a : ZMod m}
    (h : a.val < n) : (a.cast : ZMod n).val = a.val


@[to_additive (attr := simp)]
theorem mul_self_le_one_iff : a * a ≤ 1 ↔ a ≤ 1

{α : Type u_1}
[LinearOrderedAddCommMonoid α]
{a : α}


lemma one_lt_two [CovariantClass α α (·+·) (·<·)] : (1 : α) < 2

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


private theorem rexp_neg_injOn_aux : univ.InjOn (rexp ∘ Neg.neg)


@[fun_prop]
protected nonrec theorem HasFDerivWithinAt.fst (h : HasFDerivWithinAt f₂ f₂' s x) :
    HasFDerivWithinAt (fun x => (f₂ x).1) ((fst 𝕜 F G).comp f₂') s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : E}
{s : Set E}
{f₂ : E → F × G}
{f₂' : E →L[𝕜] F × G}
(h : HasFDerivWithinAt f₂ f₂' s x)

HasFDerivWithinAt (fun x => (f₂ x).1) ((ContinuousLinearMap.fst 𝕜 F G).comp f₂') s x


theorem coe_toAddMonoidHom_injective : Injective ((↑) : CentroidHom α → α →+ α)

{α : Type u_5}
[NonUnitalNonAssocSemiring α]


@[simp]
theorem conjTranspose_eq_zero [AddMonoid α] [StarAddMonoid α] {M : Matrix m n α} :
    Mᴴ = 0 ↔ M = 0

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[AddMonoid α]
[StarAddMonoid α]
{M : Matrix m n α}


@[simp]
theorem isBounded_union : IsBounded (s ∪ t) ↔ IsBounded s ∧ IsBounded t

∀ {x : Bornology α} {s t : Set α}, Bornology.IsBounded (s ∪ t) ↔ Bornology.IsBounded s ∧ Bornology.IsBounded t


/-- Shrinking lemma. A point-finite open cover of a closed subset of a normal space can be "shrunk"
to a new closed cover so that each of the new closed sets is contained in the corresponding
original open set. See also `exists_iUnion_eq_closure_subset` for a stronger statement. -/
theorem exists_iUnion_eq_closed_subset (uo : ∀ i, IsOpen (u i)) (uf : ∀ x, { i | x ∈ u i }.Finite)
    (uU : ⋃ i, u i = univ) :
    ∃ v : ι → Set X, iUnion v = univ ∧ (∀ i, IsClosed (v i)) ∧ ∀ i, v i ⊆ u i

{ι : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
[NormalSpace X]
{u : ι → Set X}
(uo : ∀ (i : ι), IsOpen (u i))
(uf : ∀ (x : X), {i | x ∈ u i}.Finite)
(uU : ⋃ i, u i = Set.univ)

∃ v, Set.iUnion v = Set.univ ∧ (∀ (i : ι), IsClosed (v i)) ∧ ∀ (i : ι), v i ⊆ u i


@[to_additive]
theorem multipliable_iff_nat_tprod_vanishing {f : ℕ → G} : Multipliable f ↔
    ∀ e ∈ 𝓝 1, ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∏' n : t, f n) ∈ e

{G : Type u_2}
[CommGroup G]
[UniformSpace G]
[UniformGroup G]
[CompleteSpace G]
{f : ℕ → G}

Multipliable f ↔ ∀ e ∈ 𝓝 1, ∃ N, ∀ t ⊆ {n | N ≤ n}, ∏' (n : ↑t), f ↑n ∈ e


/-- `val_v(∏_{w ≠ v} w^{exps w}) = 0`. -/
theorem count_finprod_coprime (exps : HeightOneSpectrum R → ℤ) :
    count K v (∏ᶠ (w : HeightOneSpectrum R) (_ : w ≠ v),
      (w.asIdeal : (FractionalIdeal R⁰ K)) ^ exps w) = 0

(v : IsDedekindDomain.HeightOneSpectrum R)

(exps : IsDedekindDomain.HeightOneSpectrum R → ℤ)

FractionalIdeal.count K v (∏ᶠ (w : IsDedekindDomain.HeightOneSpectrum R) (_ : w ≠ v), ↑w.asIdeal ^ exps w) = 0


lemma toEnd_pow_apply_mem {χ₁ χ₂ : H → R} {x : L} {m : M}
    (hx : x ∈ rootSpace H χ₁) (hm : m ∈ weightSpace M χ₂) (n) :
    (toEnd R L M x ^ n : Module.End R M) m ∈ weightSpace M (n • χ₁ + χ₂)

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{H : LieSubalgebra R L}
[LieAlgebra.IsNilpotent R ↥H]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{χ₁ χ₂ : ↥H → R}
{x : L}
{m : M}
(hx : x ∈ LieAlgebra.rootSpace H χ₁)
(hm : m ∈ LieModule.weightSpace M χ₂)
(n : ℕ)

((LieModule.toEnd R L M) x ^ n) m ∈ LieModule.weightSpace M (n • χ₁ + χ₂)


theorem sub_right_inj {a b c : ℝ≥0∞} (ha : a ≠ ∞) (hb : b ≤ a) (hc : c ≤ a) :
    a - b = a - c ↔ b = c

{a b c : ℝ≥0∞}
(ha : a ≠ ⊤)
(hb : b ≤ a)
(hc : c ≤ a)


/-- The homeomorphism between `AddCircle (2 * π)` and `circle`. -/
@[simps] noncomputable def homeomorphCircle' : AddCircle (2 * π) ≃ₜ circle

AddCircle.homeomorphCircle'.symm x = ↑(↑x).arg


theorem le_trailingDegree_C : (0 : ℕ∞) ≤ trailingDegree (C a)


/-- Construct a lax prefunctor from a map on objects, and prefunctors between the corresponding
hom types. -/
@[simps]
def mkOfHomPrefunctors (F : B → C) (F' : (a : B) → (b : B) → Prefunctor (a ⟶ b) (F a ⟶ F b)) :
    PrelaxFunctorStruct B C

(F' : (a b : B) → (a ⟶ b) ⥤q (F a ⟶ F b))

∀ {f g : a ⟶ b} (a_1 : f ⟶ g), (CategoryTheory.PrelaxFunctorStruct.mkOfHomPrefunctors F F').map₂ a_1 = (F' a b).map a_1


@[simp]
theorem nnnorm_conjTranspose [StarAddMonoid α] [NormedStarGroup α] (A : Matrix m n α) :
    ‖Aᴴ‖₊ = ‖A‖₊

{m : Type u_3}
{n : Type u_4}
{α : Type u_5}
[Fintype m]
[Fintype n]
[SeminormedAddCommGroup α]
[StarAddMonoid α]
[NormedStarGroup α]
(A : Matrix m n α)

‖Aᴴ‖₊ = ‖A‖₊


theorem to_maximal_ideal [CommRing R] [IsDomain R] [IsPrincipalIdealRing R] {S : Ideal R}
    [hpi : IsPrime S] (hS : S ≠ ⊥) : IsMaximal S

{R : Type u}
[CommRing R]
[IsDomain R]
[IsPrincipalIdealRing R]
{S : Ideal R}
[hpi : S.IsPrime]
(hS : S ≠ ⊥)


/-- The canonical (semi)ring isomorphism from `Rᵐᵒᵖ` to `Module.End R R` induced by the right
multiplication. -/
@[simps]
def moduleEndSelf : Rᵐᵒᵖ ≃+* Module.End R R

(Module.moduleEndSelf R) s = DistribMulAction.toLinearMap R R s


theorem iSup_sum {f : β ⊕ γ → α} : ⨆ x, f x = (⨆ i, f (Sum.inl i)) ⊔ ⨆ j, f (Sum.inr j)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_4}
[CompleteLattice α]
{f : β ⊕ γ → α}


/-- An element of a monoid is in the set of that element's natural number powers. -/
@[to_additive
      "An element of an `AddMonoid` is in the set of that element's natural number multiples."]
theorem powers.self_mem {x : M} : x ∈ powers x


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

{α : Type u_2}
{β : Type u_5}
[LinearOrder α]
[LinearOrder β]
{a b : α}
{c d : β}


theorem Memℒp.integrable {q : ℝ≥0∞} (hq1 : 1 ≤ q) {f : α → β} [IsFiniteMeasure μ]
    (hfq : Memℒp f q μ) : Integrable f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{q : ℝ≥0∞}
(hq1 : 1 ≤ q)
{f : α → β}
[MeasureTheory.IsFiniteMeasure μ]
(hfq : MeasureTheory.Memℒp f q μ)


@[to_additive Ici_add_Ici_subset]
theorem Ici_mul_Ici_subset' [LocallyFiniteOrderTop α] (a b : α) : Ici a * Ici b ⊆ Ici (a * b)

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

[CovariantClass α α (Function.swap HAdd.hAdd) LE.le]

Finset.Ici a + Finset.Ici b ⊆ Finset.Ici (a + b)


theorem eventuallyConst_iff_exists_eventuallyEq [Nonempty β] :
    EventuallyConst f l ↔ ∃ c, f =ᶠ[l] fun _ ↦ c

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{f : α → β}
[Nonempty β]

Filter.EventuallyConst f l ↔ ∃ c, f =ᶠ[l] fun x => c


nonrec theorem continuousAt_const_smul_iff (hc : IsUnit c) :
    ContinuousAt (fun x => c • f x) b ↔ ContinuousAt f b

{M : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Monoid M]
[TopologicalSpace α]
[MulAction M α]
[ContinuousConstSMul M α]
[TopologicalSpace β]
{f : β → α}
{b : β}
{c : M}
(hc : IsUnit c)


/-- Note that this lemma exists more generally as the global `smul_inv` -/
@[to_additive (attr := simp)]
lemma smul_inv [Group G] [Monoid M] [MulAction G M] [SMulCommClass G M M] [IsScalarTower G M M]
    (g : G) (m : Mˣ) : (g • m)⁻¹ = g⁻¹ • m⁻¹

{G : Type u_1}
{M : Type u_3}
[AddGroup G]
[AddMonoid M]
[AddAction G M]
[VAddCommClass G M M]
[VAddAssocClass G M M]
(g : G)
(m : AddUnits M)


/-- Precompose a partial equivalence with an equivalence.
We modify the source and target to have better definitional behavior. -/
@[simps!]
def transPartialEquiv (e : α ≃ β) (f' : PartialEquiv β γ) : PartialEquiv α γ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : α ≃ β)
(f' : PartialEquiv β γ)

(e.transPartialEquiv f').target = f'.target


theorem any_iff_exists {P : α → Prop} : ∀ {t}, Any P t ↔ ∃ x, Emem x t ∧ P x

{α : Type u_1}
{P : α → Prop}
{t : Ordnode α}

Ordnode.Any P t ↔ ∃ x, Ordnode.Emem x t ∧ P x


@[simp low] theorem false_eq (b : Bool) : (false = b) = (b = false)


theorem lt_of_nth_lt_nth_of_lt_card (hf : (setOf p).Finite) {m n : ℕ} (h : nth p m < nth p n)
    (hm : m < hf.toFinset.card) : m < n

{p : ℕ → Prop}
(hf : (setOf p).Finite)
{m n : ℕ}
(h : Nat.nth p m < Nat.nth p n)
(hm : m < hf.toFinset.card)


@[simp]
theorem trunc_C_mul_T (n : ℤ) (r : R) : trunc (C r * T n) = ite (0 ≤ n) (monomial n.toNat r) 0

{R : Type u_1}
[Semiring R]
(n : ℤ)
(r : R)

LaurentPolynomial.trunc (LaurentPolynomial.C r * LaurentPolynomial.T n) =
  if 0 ≤ n then (Polynomial.monomial n.toNat) r else 0


@[simp] theorem uniqueBaseOn_empty (I : Set α) : uniqueBaseOn ∅ I = loopyOn I

Matroid.uniqueBaseOn ∅ I = Matroid.loopyOn I


theorem eraseIdx_sublist : ∀ (l : List α) (k : Nat), eraseIdx l k <+ l


theorem of_isLocalization : FormallySmooth R Rₘ

{R Rₘ : Type u}
[CommRing R]
[CommRing Rₘ]
(M : Submonoid R)
[Algebra R Rₘ]
[IsLocalization M Rₘ]


/-- If `‖φ‖` is eventually bounded by `c`, and `u =ᶠ[l] φ * v`, then we have `IsBigOWith c u v l`.
    This does not require any assumptions on `c`, which is why we keep this version along with
    `IsBigOWith_iff_exists_eq_mul`. -/
theorem isBigOWith_of_eq_mul {u v : α → R} (φ : α → R) (hφ : ∀ᶠ x in l, ‖φ x‖ ≤ c)
    (h : u =ᶠ[l] φ * v) :
    IsBigOWith c l u v

{α : Type u_1}
{R : Type u_13}
[SeminormedRing R]
{c : ℝ}
{l : Filter α}
{u v : α → R}
(φ : α → R)
(hφ : ∀ᶠ (x : α) in l, ‖φ x‖ ≤ c)
(h : u =ᶠ[l] φ * v)


theorem inverse_one_sub (t : R) (h : ‖t‖ < 1) : inverse (1 - t) = ↑(Units.oneSub t h)⁻¹

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]
(t : R)
(h : ‖t‖ < 1)

Ring.inverse (1 - t) = ↑(Units.oneSub t h)⁻¹


theorem two_mul_count_bool_le_length_add_one (hl : Chain' (· ≠ ·) l) (b : Bool) :
    2 * count b l ≤ length l + 1

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


theorem prod_eq_biUnion_right : s ×ˢ t = ⋃ b ∈ t, (fun a => (a, b)) '' s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}


protected theorem LeftInverse.id {g : β → α} {f : α → β} (h : LeftInverse g f) : g ∘ f = id

{α : Type u₁}
{β : Type u₂}
{g : β → α}
{f : α → β}
(h : Function.LeftInverse g f)


lemma valuation_eq_intValuationDef (r : R) : v.valuation (r : K) = v.intValuationDef r

(v : IsDedekindDomain.HeightOneSpectrum R)


theorem revAtFun_invol {N i : ℕ} : revAtFun N (revAtFun N i) = i

Polynomial.revAtFun N (Polynomial.revAtFun N i) = i


theorem closedEmbedding_coe_real : ClosedEmbedding ((↑) : ℕ → ℝ)


theorem einfsep_lt_iff {d} :
    s.einfsep < d ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y < d

{α : Type u_1}
[EDist α]
{s : Set α}
{d : ENNReal}


@[simp, norm_cast]
theorem const_ofNat [NatCast M] (n : ℕ) [n.AtLeastTwo] :
    ((no_index (OfNat.ofNat n : M)) : Germ l M) = OfNat.ofNat n

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
[NatCast M]
(n : ℕ)
[n.AtLeastTwo]


/-- Given `F : C ⥤ D ⥤ D`, `X : C`, `e : F.obj X ≅ 𝟭 D` and `Y : GradedObject J D`,
this is the isomorphism `((mapBifunctor F I J).obj ((single₀ I).obj X)).obj Y a ≅ Y a.2`
when `a : I × J` is such that `a.1 = 0`. -/
@[simps!]
noncomputable def mapBifunctorObjSingle₀ObjIso (a : I × J) (ha : a.1 = 0) :
    ((mapBifunctor F I J).obj ((single₀ I).obj X)).obj Y a ≅ Y a.2

(F : CategoryTheory.Functor C (CategoryTheory.Functor D D))

(e : F.obj X ≅ CategoryTheory.Functor.id D)

(CategoryTheory.GradedObject.mapBifunctorObjSingle₀ObjIso F X e Y a ha).hom =
  CategoryTheory.CategoryStruct.comp
    ((F.map (CategoryTheory.GradedObject.singleObjApplyIsoOfEq 0 X a.1 ha).hom).app (Y a.2)) (e.hom.app (Y a.2))


@[simp]
theorem coe_mk' (l u : ι → ℝ) : (mk' l u : Set (ι → ℝ)) = pi univ fun i ↦ Ioc (l i) (u i)

↑(BoxIntegral.Box.mk' l u) = Set.univ.pi fun i => Set.Ioc (l i) (u i)


protected theorem beq_eq [BEq α] [BEq β] {l m : AssocList α β} :
    (l == m) = (l.toList == m.toList)

{α : Type u_1}
{β : Type u_2}
[BEq α]
[BEq β]
{l m : Batteries.AssocList α β}


@[simp]
theorem dist_center_homothety (p₁ p₂ : P) (c : 𝕜) :
    dist p₁ (homothety p₁ c p₂) = ‖c‖ * dist p₁ p₂

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

dist p₁ ((AffineMap.homothety p₁ c) p₂) = ‖c‖ * dist p₁ p₂


theorem Filter.EventuallyEq.hasFDerivAtFilter_iff (h₀ : f₀ =ᶠ[L] f₁) (hx : f₀ x = f₁ x)
    (h₁ : ∀ x, f₀' x = f₁' x) : HasFDerivAtFilter f₀ f₀' x L ↔ HasFDerivAtFilter f₁ f₁' x L

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f₀ f₁ : E → F}
{f₀' f₁' : E →L[𝕜] F}
{x : E}
{L : Filter E}
(h₀ : f₀ =ᶠ[L] f₁)
(hx : f₀ x = f₁ x)
(h₁ : ∀ (x : E), f₀' x = f₁' x)


/-- The degree of a product of polynomials is equal to
the sum of the degrees, provided that the product of leading coefficients is nonzero.

See `Polynomial.natDegree_prod` (without the `'`) for a version for integral domains,
where this condition is automatically satisfied.
-/
theorem natDegree_prod' (h : (∏ i ∈ s, (f i).leadingCoeff) ≠ 0) :
    (∏ i ∈ s, f i).natDegree = ∑ i ∈ s, (f i).natDegree

{R : Type u}
{ι : Type w}
(s : Finset ι)
[CommSemiring R]
(f : ι → R[X])
(h : ∏ i ∈ s, (f i).leadingCoeff ≠ 0)


/-- `mapAlg` is the morphism induced by `R → S`. -/
theorem mapAlg_eq_map (p : R[X]) : mapAlg R S p = map (algebraMap R S) p

{R : Type u}
[CommSemiring R]
{S : Type v}
[Semiring S]
[Algebra R S]
(p : R[X])

(Polynomial.mapAlg R S) p = Polynomial.map (algebraMap R S) p


theorem mem_eventualRange_iff {x : F.obj j} :
    x ∈ F.eventualRange j ↔ ∀ ⦃i⦄ (f : i ⟶ j), x ∈ range (F.map f)

{J : Type u}
[CategoryTheory.Category.{u_1, u} J]
(F : J ⥤ Type v)
{j : J}
{x : F.obj j}

x ∈ F.eventualRange j ↔ ∀ ⦃i : J⦄ (f : i ⟶ j), x ∈ Set.range (F.map f)


theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) :
    count x l = Multiplicative.ofAdd (List.count x l)

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

(FreeMonoid.count x) l = Multiplicative.ofAdd (List.count x l)


theorem strictMono_rpow_of_pos {z : ℝ} (h : 0 < z) : StrictMono fun x : ℝ≥0∞ => x ^ z


/-- The `p`-adic value of an integer `z ≠ 0` is its `p`-adic_value as a rational. -/
@[simp]
theorem of_int {z : ℤ} : padicValRat p z = padicValInt p z


theorem arcsin_eq_arccos {x : ℝ} (h : 0 ≤ x) : arcsin x = arccos (√(1 - x ^ 2))

Real.arcsin x = Real.arccos √(1 - x ^ 2)


@[to_additive (attr := simp)]
lemma UniformOnFun.ofFun_mul [Mul β] (f g : α → β) : ofFun 𝔖 (f * g) = ofFun 𝔖 f * ofFun 𝔖 g

{α : Type u_1}
{β : Type u_2}
{𝔖 : Set (Set α)}
[Add β]
(f g : α → β)

(UniformOnFun.ofFun 𝔖) (f + g) = (UniformOnFun.ofFun 𝔖) f + (UniformOnFun.ofFun 𝔖) g


theorem lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C]
    (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B)
    (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂

{R : Type u}
[CommSemiring R]
{A : Type u}
[Semiring A]
[Algebra R A]
{B : Type u}
[CommRing B]
[Algebra R B]
[Algebra.FormallyUnramified R A]
{C : Type u}
[CommRing C]
(f : B →+* C)
(hf : IsNilpotent (RingHom.ker f))
(g₁ g₂ : A →ₐ[R] B)
(h : f.comp ↑g₁ = f.comp ↑g₂)


/-- The functor `(F ⋙ L, R) ⥤ (L, R)` -/
@[simps]
def preRight (L : A ⥤ T) (F : C ⥤ B) (R : B ⥤ T) : Comma L (F ⋙ R) ⥤ Comma L R

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{C : Type u₄}
[CategoryTheory.Category.{v₄, u₄} C]
(L : CategoryTheory.Functor A T)
(F : CategoryTheory.Functor C B)
(R : CategoryTheory.Functor B T)
(X : CategoryTheory.Comma L (F.comp R))

((CategoryTheory.Comma.preRight L F R).obj X).left = X.left


/-- The canonical isomorphism `(𝟭 C).mapTriangle ≅ 𝟭 (Triangle C)`. -/
@[simps!]
def mapTriangleIdIso : (𝟭 C).mapTriangle ≅ 𝟭 _

(X : CategoryTheory.Pretriangulated.Triangle C)

((CategoryTheory.Functor.mapTriangleIdIso C).inv.app X).hom₁ = CategoryTheory.CategoryStruct.id X.obj₁


theorem copy_eq (S : Subfield K) (s : Set K) (hs : s = ↑S) : S.copy s hs = S

{K : Type u}
[DivisionRing K]
(S : Subfield K)
(s : Set K)
(hs : s = ↑S)


@[to_additive]
protected theorem mul_inv (hab : Commute a b) : (a * b)⁻¹ = a⁻¹ * b⁻¹

{G : Type u_1}
[DivisionMonoid G]
{a b : G}
(hab : Commute a b)


@[to_additive]
theorem mulIndicator_mulIndicator (s t : Set α) (f : α → M) :
    mulIndicator s (mulIndicator t f) = mulIndicator (s ∩ t) f

{α : Type u_1}
{M : Type u_4}
[Zero M]
(s t : Set α)
(f : α → M)

s.indicator (t.indicator f) = (s ∩ t).indicator f


lemma exists_ne_mem_inter_of_not_pairwiseDisjoint
    {f : ι → Set α} (h : ¬ s.PairwiseDisjoint f) :
    ∃ i ∈ s, ∃ j ∈ s, i ≠ j ∧ ∃ x : α, x ∈ f i ∩ f j

{α : Type u_1}
{ι : Type u_4}
{s : Set ι}
{f : ι → Set α}
(h : ¬s.PairwiseDisjoint f)

∃ i ∈ s, ∃ j ∈ s, i ≠ j ∧ ∃ x, x ∈ f i ∩ f j


/-- In principle this could be an instance, but in practice it causes performance issues. -/
@[to_additive]
theorem Subsingleton.of_oneHomClass [Subsingleton M] [OneHomClass F M N] :
    Subsingleton F

{M : Type u_4}
{N : Type u_5}
{F : Type u_9}
[One M]
[One N]
[FunLike F M N]
[Subsingleton M]
[OneHomClass F M N]


theorem Base.not_base_of_ssubset {X : Set α} (hB : M.Base B) (hX : X ⊂ B) : ¬ M.Base X

{α : Type u_1}
{M : Matroid α}
{B X : Set α}
(hB : M.Base B)
(hX : X ⊂ B)


/-- `DFinsupp.mapRange.addMonoidHom` as an `AddEquiv`. -/
@[simps apply]
def mapRange.addEquiv (e : ∀ i, β₁ i ≃+ β₂ i) : (Π₀ i, β₁ i) ≃+ Π₀ i, β₂ i

{ι : Type u}
{β₁ : ι → Type v₁}
{β₂ : ι → Type v₂}
[(i : ι) → AddZeroClass (β₁ i)]
[(i : ι) → AddZeroClass (β₂ i)]
(e : (i : ι) → β₁ i ≃+ β₂ i)
(x : Π₀ (i : ι), β₁ i)

(DFinsupp.mapRange.addEquiv e) x = DFinsupp.mapRange (fun i x => (e i) x) ⋯ x


/-- A geometric series in a complete normed ring is summable.
Proved above (same name, different namespace) for not-necessarily-complete normed fields. -/
theorem NormedRing.summable_geometric_of_norm_lt_one (x : R) (h : ‖x‖ < 1) :
    Summable fun n : ℕ ↦ x ^ n

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


@[to_additive]
theorem rank_closure_finite_le_nat_card (s : Set G) [Finite s] :
    Group.rank (closure s) ≤ Nat.card s

{G : Type u_3}
[AddGroup G]
(s : Set G)
[Finite ↑s]

AddGroup.rank ↥(AddSubgroup.closure s) ≤ Nat.card ↑s


@[simp] lemma posFittingComp_eq_bot_of_isNilpotent
    [IsNilpotent R L M] :
    posFittingComp R L M = ⊥

(R : Type u_2)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieModule.IsNilpotent R L M]


@[to_additive]
theorem div_mem_div [Div α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
    ma / mb ∈ a / b

{α : Type u_1}
[Div α]
(a b : Part α)
(ma mb : α)
(ha : ma ∈ a)
(hb : mb ∈ b)


@[simp]
theorem id_comp (f : α →o β) : comp id f = f

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(f : α →o β)


/-- If the angle between two vectors is `-π / 2`, the second vector is nonzero. -/
theorem right_ne_zero_of_oangle_eq_neg_pi_div_two {x y : V} (h : o.oangle x y = (-π / 2 : ℝ)) :
    y ≠ 0

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


theorem iff_true_left  (ha : a) : (a ↔ b) ↔ b


theorem NFBelow.lt {e n a b} (h : NFBelow (ONote.oadd e n a) b) : repr e < b

{e : ONote}
{n : ℕ+}
{a : ONote}
{b : Ordinal.{0}}
(h : (e.oadd n a).NFBelow b)


theorem monotoneOn_of_rightInvOn_of_mapsTo {α β : Type*} [PartialOrder α] [LinearOrder β]
    {φ : β → α} {ψ : α → β} {t : Set β} {s : Set α} (hφ : MonotoneOn φ t)
    (φψs : Set.RightInvOn ψ φ s) (ψts : Set.MapsTo ψ s t) : MonotoneOn ψ s

{α : Type u_6}
{β : Type u_7}
[PartialOrder α]
[LinearOrder β]
{φ : β → α}
{ψ : α → β}
{t : Set β}
{s : Set α}
(hφ : MonotoneOn φ t)
(φψs : Set.RightInvOn ψ φ s)
(ψts : Set.MapsTo ψ s t)


theorem Iio_toDual (a : α) : Iio (toDual a) = (Ioi a).map toDual.toEmbedding

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrderTop α]
(a : α)

Finset.Iio (OrderDual.toDual a) = Finset.map OrderDual.toDual.toEmbedding (Finset.Ioi a)


/-- To give an isomorphism between cocones, it suffices to give an
  isomorphism between their vertices which commutes with the cocone
  maps. -/
-- Porting note: `@[ext]` used to accept lemmas like this. Now we add an aesop rule
@[aesop apply safe (rule_sets := [CategoryTheory]), simps]
def ext {c c' : Cocone F} (φ : c.pt ≅ c'.pt)
    (w : ∀ j, c.ι.app j ≫ φ.hom = c'.ι.app j := by aesop_cat) : c ≅ c'

(w : ∀ (j : J), c.ι.app j ≫ φ.hom = c'.ι.app j := by aesop_cat)

(CategoryTheory.Limits.Cocones.ext φ w).hom.hom = φ.hom


theorem UInt32.toNat_mul (x y : UInt32) : (x * y).toNat = (x.toNat * y.toNat) % UInt32.size

(x * y).toNat = x.toNat * y.toNat % UInt32.size


lemma nextCoeff_ne_zero : p.nextCoeff ≠ 0 ↔ p.natDegree ≠ 0 ∧ p.coeff (p.natDegree - 1) ≠ 0


protected theorem oldMapIdx_append : ∀ (f : ℕ → α → β) (l : List α) (e : α),
    List.oldMapIdx f (l ++ [e]) = List.oldMapIdx f l ++ [f l.length e]

{α : Type u}
{β : Type v}
(f : ℕ → α → β)
(l : List α)
(e : α)


@[simp, norm_cast]
theorem coe_div_unitSphere [NormedDivisionRing 𝕜] (x y : sphere (0 : 𝕜) 1) :
    ↑(x / y) = (x / y : 𝕜)

{𝕜 : Type u_1}
[NormedDivisionRing 𝕜]
(x y : ↑(Metric.sphere 0 1))


@[simp]
theorem cos_neg (θ : Angle) : cos (-θ) = cos θ


@[simp, fun_prop]
protected theorem ContinuousLinearMap.differentiableAt : DifferentiableAt 𝕜 e x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(e : E →L[𝕜] F)
{x : E}


@[simp]
lemma leftUnitor_hom_app_apply (K : SSet.{u}) {Δ : SimplexCategoryᵒᵖ} (x : (𝟙_ _ ⊗ K).obj Δ) :
    (λ_ K).hom.app Δ x = x.2

(K : SSet)
{Δ : SimplexCategoryᵒᵖ}
(x : (𝟙_ SSet ⊗ K).obj Δ)


protected theorem t2Space [T2Space X] (h : X ≃ₜ Y) : T2Space Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T2Space X]
(h : X ≃ₜ Y)


@[to_additive (attr := simp) abs_zsmul_eq_zero]
lemma zpow_abs_eq_one (a : G) (n : ℤ) : a ^ |n| = 1 ↔ a ^ n = 1

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


theorem Or.imp_right (f : b → c) : a ∨ b → a ∨ c


@[simp]
theorem coe_comap (f : C(α, β)) (U : Opens β) : ↑(comap f U) = f ⁻¹' U

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
(f : C(α, β))
(U : TopologicalSpace.Opens β)

↑((TopologicalSpace.Opens.comap f) U) = ⇑f ⁻¹' ↑U


@[to_additive (attr := simp)]
theorem prod_singleton (a : α) : prod {a} = a


@[simp]
theorem toHamming_ofHamming (x : Hamming β) : toHamming (ofHamming x) = x

{ι : Type u_2}
{β : ι → Type u_3}
(x : Hamming β)

Hamming.toHamming (Hamming.ofHamming x) = x


theorem KaehlerDifferential.map_surjective_of_surjective
    (h : Function.Surjective (algebraMap A B)) :
    Function.Surjective (KaehlerDifferential.map R S A B)

(h : Function.Surjective ⇑(algebraMap A B))

Function.Surjective ⇑(KaehlerDifferential.map R S A B)


@[ext high]
theorem ext_ring_op {σ : Rᵐᵒᵖ →+* S} {f g : R →ₛₗ[σ] M₃} (h : f (1 : R) = g (1 : R)) :
    f = g

{R : Type u_1}
{S : Type u_6}
{M₃ : Type u_12}
[Semiring R]
[Semiring S]
[AddCommMonoid M₃]
[Module S M₃]
{σ : Rᵐᵒᵖ →+* S}
{f g : R →ₛₗ[σ] M₃}
(h : f 1 = g 1)


protected theorem isAlgebraic : Algebra.IsAlgebraic ℚ K

(K : Type u_1)
[Field K]
[nf : NumberField K]


theorem interleave_tail_tail (s₁ s₂ : Stream' α) : tail s₁ ⋈ tail s₂ = tail (tail (s₁ ⋈ s₂))


@[to_additive]
theorem update_mul [∀ i, Mul (f i)] [DecidableEq I] (f₁ f₂ : ∀ i, f i) (i : I) (x₁ : f i)
    (x₂ : f i) : update (f₁ * f₂) i (x₁ * x₂) = update f₁ i x₁ * update f₂ i x₂

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

Function.update (f₁ * f₂) i (x₁ * x₂) = Function.update f₁ i x₁ * Function.update f₂ i x₂


@[simp]
theorem TotalSpace.exists {p : TotalSpace F E → Prop} : (∃ x, p x) ↔ ∃ b y, p ⟨b, y⟩

{B : Type u_1}
{F : Type u_2}
{E : B → Type u_3}
{p : Bundle.TotalSpace F E → Prop}

(∃ x, p x) ↔ ∃ b y, p { proj := b, snd := y }


/-- A measure `μ` is outer regular if `μ(A) = inf {μ(U) | A ⊆ U open}` for a measurable set `A`.

This definition implies the same equality for any (not necessarily measurable) set, see
`Set.measure_eq_iInf_isOpen`. -/
class OuterRegular (μ : Measure α) : Prop where
  protected outerRegular :
    ∀ ⦃A : Set α⦄, MeasurableSet A → ∀ r > μ A, ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U < r

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[self : μ.OuterRegular]
⦃A : Set α⦄

MeasurableSet A → ∀ r > μ A, ∃ U ⊇ A, IsOpen U ∧ μ U < r


theorem const_nil {β} (x : β) (α : TypeVec 0) : TypeVec.const x α = nilFun

{β : Type u_1}
(x : β)
(α : TypeVec.{u_2} 0)


@[simp]
theorem sym_union (s t : Finset α) (n : ℕ) : s.sym n ∪ t.sym n ⊆ (s ∪ t).sym n

{α : Type u_1}
[DecidableEq α]
(s t : Finset α)
(n : ℕ)


theorem exists_lt_of_gauge_lt (absorbs : Absorbent ℝ s) (h : gauge s x < a) :
    ∃ b, 0 < b ∧ b < a ∧ x ∈ b • s

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
{x : E}
{a : ℝ}
(absorbs : Absorbent ℝ s)
(h : gauge s x < a)


/-- Affine map from a smaller to a larger subspace of the same space.

This is the affine version of `Submodule.inclusion`. -/
@[simps linear]
def inclusion (h : S₁ ≤ S₂) : S₁ →ᵃ[k] S₂

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
{S₁ S₂ : AffineSubspace k P₁}
[Nonempty ↥S₁]
[Nonempty ↥S₂]
(h : S₁ ≤ S₂)

(AffineSubspace.inclusion h).linear = Submodule.inclusion ⋯


theorem MetricSpace.replaceTopology_eq {γ} [U : TopologicalSpace γ] (m : MetricSpace γ)
    (H : U = m.toPseudoMetricSpace.toUniformSpace.toTopologicalSpace) :
    m.replaceTopology H = m

(H : U = UniformSpace.toTopologicalSpace)


@[simp] lemma reverse_add_C (p : R[X]) (t : R) :
    reverse (p + C t) = reverse p + C t * X ^ p.natDegree

{R : Type u_1}
[Semiring R]
(p : Polynomial R)
(t : R)

(p + Polynomial.C t).reverse = p.reverse + Polynomial.C t * Polynomial.X ^ p.natDegree


@[reassoc (attr := simp)]
theorem cokernelComparison_map_desc [HasCokernel f] [HasCokernel (G.map f)] {Z : C} {h : Y ⟶ Z}
    (w : f ≫ h = 0) :
    cokernelComparison f G ≫ G.map (cokernel.desc _ h w) =
      cokernel.desc _ (G.map h) (by simp only [← G.map_comp, w, Functor.map_zero])

CategoryTheory.Limits.cokernelComparison f G ≫ G.map (CategoryTheory.Limits.cokernel.desc f h w) =
  CategoryTheory.Limits.cokernel.desc (G.map f) (G.map h) ⋯


theorem subtype_eq_val : (SubMulAction.subtype p : p → M) = Subtype.val

{R : Type u}
{M : Type v}
[SMul R M]
(p : SubMulAction R M)


protected theorem div_lt_iff (h0 : b ≠ 0 ∨ c ≠ 0) (ht : b ≠ ∞ ∨ c ≠ ∞) : c / b < a ↔ c < a * b

{a b c : ENNReal}
(h0 : b ≠ 0 ∨ c ≠ 0)
(ht : b ≠ ⊤ ∨ c ≠ ⊤)


/-- The identity function as bundled monotone function. -/
@[simps (config := .asFn)]
def id : α →o α


lemma map_inf_le (L M : Sublattice α) (f : LatticeHom α β) : map f (L ⊓ M) ≤ map f L ⊓ map f M

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

Sublattice.map f (L ⊓ M) ≤ Sublattice.map f L ⊓ Sublattice.map f M


theorem MeasureTheory.volume_sum_rpow_lt_one :
    volume {x : ι → ℝ | ∑ i, |x i| ^ p < 1} =
      .ofReal ((2 * Gamma (1 / p + 1)) ^ card ι / Gamma (card ι / p + 1))

(ι : Type u_1)
[Fintype ι]
{p : ℝ}
(hp : 1 ≤ p)

MeasureTheory.volume {x | ∑ i : ι, |x i| ^ p < 1} =
  ENNReal.ofReal ((2 * Real.Gamma (1 / p + 1)) ^ Fintype.card ι / Real.Gamma (↑(Fintype.card ι) / p + 1))


/-- A locally uniform limit of continuous functions is continuous. -/
protected theorem TendstoLocallyUniformly.continuous (h : TendstoLocallyUniformly F f p)
    (hc : ∀ᶠ n in p, Continuous (F n)) [NeBot p] : Continuous f

{F : ι → α → β}

(hc : ∀ᶠ (n : ι) in p, Continuous (F n))


theorem map_toAddSubmonoid' (f : M →ₛₗ[σ₁₂] M₂) (p : Submodule R M) :
    (p.map f).toAddSubmonoid = p.toAddSubmonoid.map f

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
[RingHomSurjective σ₁₂]
(f : M →ₛₗ[σ₁₂] M₂)
(p : Submodule R M)

(Submodule.map f p).toAddSubmonoid = AddSubmonoid.map f p.toAddSubmonoid


@[simp]
theorem surjective_mk' : Function.Surjective (mk' N)

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


@[to_additive]
lemma map_comp_mul_inv [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : F) (g h : ι → G) :
    f ∘ (g * h⁻¹) = f ∘ g * (f ∘ h)⁻¹

{ι : Type u_1}
{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[AddGroup G]
[SubtractionMonoid H]
[AddMonoidHomClass F G H]
(f : F)
(g h : ι → G)


theorem lt_top_iff_ne_top : a < ⊤ ↔ a ≠ ⊤

{α : Type u}
[PartialOrder α]
[OrderTop α]
{a : α}

a < ⊤ ↔ a ≠ ⊤


/-- The condition for two points on a line to be equidistant from
another point. -/
theorem dist_smul_vadd_eq_dist {v : V} (p₁ p₂ : P) (hv : v ≠ 0) (r : ℝ) :
    dist (r • v +ᵥ p₁) p₂ = dist p₁ p₂ ↔ r = 0 ∨ r = -2 * ⟪v, p₁ -ᵥ p₂⟫ / ⟪v, v⟫

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{v : V}
(p₁ p₂ : P)
(hv : v ≠ 0)
(r : ℝ)

dist (r • v +ᵥ p₁) p₂ = dist p₁ p₂ ↔ r = 0 ∨ r = -2 * ⟪v, p₁ -ᵥ p₂⟫_ℝ / ⟪v, v⟫_ℝ


theorem mem_factorSet_top {p : Associates α} {hp : Irreducible p} : p ∈ (⊤ : FactorSet α)

{α : Type u_1}
[CancelCommMonoidWithZero α]
{p : Associates α}
{hp : Irreducible p}


/-- If the coequalizer of two morphisms is a monomorphism, then the two morphisms are equal. -/
theorem eq_of_mono_coequalizer [HasCoequalizer f g] [Mono (coequalizer.π f g)] : f = g

[CategoryTheory.Mono (CategoryTheory.Limits.coequalizer.π f g)]


/-- In the case of the manifold structure on a vector space, the extended charts are just the
identity. -/
theorem extChartAt_model_space_eq_id (x : E) : extChartAt 𝓘(𝕜, E) x = PartialEquiv.refl E

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


theorem _root_.QuotientGroup.out'_conj_pow_minimalPeriod_mem (a : α) (q : α ⧸ H) :
    q.out'⁻¹ * a ^ Function.minimalPeriod (a • ·) q * q.out' ∈ H

{α : Type u}
[Group α]
(H : Subgroup α)
(a : α)
(q : α ⧸ H)

(Quotient.out' q)⁻¹ * a ^ Function.minimalPeriod (fun x => a • x) q * Quotient.out' q ∈ H


theorem ae_eq_zero_of_forall_setIntegral_eq_of_finStronglyMeasurable_trim (hm : m ≤ m0) {f : α → E}
    (hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn f s μ)
    (hf_zero : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, f x ∂μ = 0)
    (hf : FinStronglyMeasurable f (μ.trim hm)) : f =ᵐ[μ] 0

(hf_int_finite : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → MeasureTheory.IntegrableOn f s μ)

(hf_zero : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∫ (x : α) in s, f x ∂μ = 0)

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


@[simp]
theorem coe_sup : ↑(s ⊔ t) = { x | ∃ a ∈ s, ∃ b ∈ t, x ≤ a ⊔ b }

{P : Type u_1}
[SemilatticeSup P]
[IsDirected P fun x x_1 => x ≥ x_1]
{s t : Order.Ideal P}

↑(s ⊔ t) = {x | ∃ a ∈ s, ∃ b ∈ t, x ≤ a ⊔ b}


/-- For a linear map `f` from `M` to `N`,
`ExteriorAlgebra.map g` is a retraction of `ExteriorAlgebra.map f` iff
`g` is a retraction of `f`. -/
@[simp]
lemma leftInverse_map_iff {f : M →ₗ[R] N} {g : N →ₗ[R] M} :
    LeftInverse (map g) (map f) ↔ LeftInverse g f

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{N : Type u4}
[AddCommGroup N]
[Module R N]
{f : M →ₗ[R] N}
{g : N →ₗ[R] M}

Function.LeftInverse ⇑(ExteriorAlgebra.map g) ⇑(ExteriorAlgebra.map f) ↔ Function.LeftInverse ⇑g ⇑f


/-- Every equalizer of `(f, g)`, where `f = g`, is an isomorphism. -/
theorem isIso_limit_cone_parallelPair_of_eq (h₀ : f = g) {c : Fork f g} (h : IsLimit c) :
    IsIso c.ι

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f g : X ⟶ Y}
(h₀ : f = g)
{c : CategoryTheory.Limits.Fork f g}
(h : CategoryTheory.Limits.IsLimit c)


theorem data_takeWhile (p) : ∀ {s}, Valid s →
    (s.takeWhile p).toString.1 = s.toString.1.takeWhile p

s.Valid → (s.takeWhile p).toString.data = List.takeWhile p s.toString.data


@[to_additive]
lemma smul_left_injective' [SMul M α] [FaithfulSMul M α] : Injective ((· • ·) : M → α → α)

{M : Type u_1}
{α : Type u_7}
[VAdd M α]
[FaithfulVAdd M α]

Function.Injective fun x x_1 => x +ᵥ x_1


theorem sqrt_nonneg (n : ℤ) : 0 ≤ sqrt n


theorem epi_iff_epi_left [HasPushouts C] {f g : Over X} (h : f ⟶ g) : Epi h ↔ Epi h.left

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

CategoryTheory.Epi h ↔ CategoryTheory.Epi h.left


/-- The canonical linear map `S.X₁ →ₗ[R] LinearMap.ker S.g` induced by `S.f`. -/
@[simps]
def moduleCatToCycles : S.X₁ →ₗ[R] LinearMap.ker S.g

(S : CategoryTheory.ShortComplex (ModuleCat R))


lemma Set.finite_diff_iUnion_Ioo (s : Set α) : (s \ ⋃ (x ∈ s) (y ∈ s), Ioo x y).Finite

{α : Type u}
[LinearOrder α]
(s : Set α)

(s \ ⋃ x ∈ s, ⋃ y ∈ s, Set.Ioo x y).Finite


theorem antidiagonal_coe (l : List α) : @antidiagonal α l = revzip (powersetAux l)

(↑l).antidiagonal = ↑(Multiset.powersetAux l).revzip


@[simp]
theorem embDomain_add (f : α ↪ β) (v w : α →₀ M) :
    embDomain f (v + w) = embDomain f v + embDomain f w

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddZeroClass M]
(f : α ↪ β)
(v w : α →₀ M)

Finsupp.embDomain f (v + w) = Finsupp.embDomain f v + Finsupp.embDomain f w


theorem bounds_bddBelow {f : E →SL[σ₁₂] F} : BddBelow { c | 0 ≤ c ∧ ∀ x, ‖f x‖ ≤ c * ‖x‖ }

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{f : E →SL[σ₁₂] F}

BddBelow {c | 0 ≤ c ∧ ∀ (x : E), ‖f x‖ ≤ c * ‖x‖}


@[simp]
theorem tendsto_neg_atBot_iff : Tendsto (fun x => -f x) l atBot ↔ Tendsto f l atTop

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommGroup β]
{l : Filter α}
{f : α → β}

Filter.Tendsto (fun x => -f x) l Filter.atBot ↔ Filter.Tendsto f l Filter.atTop


theorem length_permsOfList : ∀ l : List α, length (permsOfList l) = l.length !

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


@[simp] theorem map_comp_map (f : α → β) (g : β → γ) :
    Option.map g ∘ Option.map f = Option.map (g ∘ f)

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


theorem measure_Iic {l : ℝ} (hf : Tendsto f atBot (𝓝 l)) (x : ℝ) :
    f.measure (Iic x) = ofReal (f x - l)

(hf : Filter.Tendsto (↑f) Filter.atBot (𝓝 l))

f.measure (Set.Iic x) = ENNReal.ofReal (↑f x - l)


@[simp]
lemma map_cobounded (e : F) : map e (cobounded X) = cobounded Y

{X : Type u_1}
{Y : Type u_2}
{F : Type u_3}
[PseudoMetricSpace X]
[PseudoMetricSpace Y]
[EquivLike F X Y]
[DilationEquivClass F X Y]
(e : F)

Filter.map (⇑e) (Bornology.cobounded X) = Bornology.cobounded Y


theorem rank_add_rank_le_rank_prod [Nontrivial R] :
    Module.rank R M + Module.rank R M₁ ≤ Module.rank R (M × M₁)

(R : Type u)
(M : Type v)
{M₁ : Type v}
[Ring R]
[AddCommGroup M]
[AddCommGroup M₁]
[Module R M]
[Module R M₁]
[Nontrivial R]


@[to_additive]
theorem pow_le_one_iff {x : M} {n : ℕ} (hn : n ≠ 0) : x ^ n ≤ 1 ↔ x ≤ 1

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


private lemma ringChar_ne : ringChar ℂ ≠ ringChar F


@[simp]
theorem U_neg_one : U R (-1) = 0


/-- A binary bicone morphism between two binary bicones for the same diagram is a morphism of the
binary bicone points which commutes with the cone and cocone legs. -/
structure BinaryBiconeMorphism {P Q : C} (A B : BinaryBicone P Q) where
  /-- A morphism between the two vertex objects of the bicones -/
  hom : A.pt ⟶ B.pt
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  wfst : hom ≫ B.fst = A.fst := by aesop_cat
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  wsnd : hom ≫ B.snd = A.snd := by aesop_cat
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  winl : A.inl ≫ hom = B.inl := by aesop_cat
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  winr : A.inr ≫ hom = B.inr := by aesop_cat

{A B : CategoryTheory.Limits.BinaryBicone P Q}

(self : CategoryTheory.Limits.BinaryBiconeMorphism A B)


/-- **Structure theorem of finitely generated modules over a PID** : A finitely generated
  module over a PID is isomorphic to the product of a free module and a direct sum of some
  `R ⧸ R ∙ (p i ^ e i)` where the `p i ^ e i` are prime powers. -/
theorem equiv_free_prod_directSum [h' : Module.Finite R N] :
    ∃ (n : ℕ) (ι : Type u) (_ : Fintype ι) (p : ι → R) (_ : ∀ i, Irreducible <| p i) (e : ι → ℕ),
      Nonempty <| N ≃ₗ[R] (Fin n →₀ R) × ⨁ i : ι, R ⧸ R ∙ p i ^ e i

{R : Type u}
[CommRing R]
[IsDomain R]
[IsPrincipalIdealRing R]
{N : Type (max u v)}
[AddCommGroup N]
[Module R N]
[h' : Module.Finite R N]

∃ n ι x p,
  ∃ (_ : ∀ (i : ι), Irreducible (p i)),
    ∃ e, Nonempty (N ≃ₗ[R] (Fin n →₀ R) × ⨁ (i : ι), R ⧸ Submodule.span R {p i ^ e i})


@[simp]
lemma piecewise'_apply_left {C₀ C₁ C₂ : Set X} (h₀ : C₀ ⊆ C₁ ∪ C₂) (h₁ : IsClosed C₁)
    (h₂ : IsClosed C₂) (f₁ : LocallyConstant C₁ Z) (f₂ : LocallyConstant C₂ Z)
    [DecidablePred (· ∈ C₁)] (hf : ∀ x (hx : x ∈ C₁ ∩ C₂), f₁ ⟨x, hx.1⟩ = f₂ ⟨x, hx.2⟩)
    (x : C₀) (hx : x.val ∈ C₁) :
    piecewise' h₀ h₁ h₂ f₁ f₂ hf x = f₁ ⟨x.val, hx⟩

(hf : ∀ (x : X) (hx : x ∈ C₁ ∩ C₂), f₁ ⟨x, ⋯⟩ = f₂ ⟨x, ⋯⟩)

(LocallyConstant.piecewise' h₀ h₁ h₂ f₁ f₂ hf) x = f₁ ⟨↑x, hx⟩


theorem hasLineDerivAt_iff_tendsto_slope_zero :
    HasLineDerivAt 𝕜 f f' x v ↔
      Tendsto (fun (t : 𝕜) ↦ t⁻¹ • (f (x + t • v) - f x)) (𝓝[≠] 0) (𝓝 f')

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f : E → F}
{f' : F}
{x v : E}

HasLineDerivAt 𝕜 f f' x v ↔ Filter.Tendsto (fun t => t⁻¹ • (f (x + t • v) - f x)) (𝓝[≠] 0) (𝓝 f')


theorem l_csSup (gc : GaloisConnection l u) {s : Set α} (hne : s.Nonempty) (hbdd : BddAbove s) :
    l (sSup s) = ⨆ x : s, l x

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
[ConditionallyCompleteLattice β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{s : Set α}
(hne : s.Nonempty)
(hbdd : BddAbove s)


theorem iSup₂_mono {f g : ∀ i, κ i → α} (h : ∀ i j, f i j ≤ g i j) :
    ⨆ (i) (j), f i j ≤ ⨆ (i) (j), g i j

(h : ∀ (i : ι) (j : κ i), f i j ≤ g i j)


@[simp]
theorem closure_iUnion_of_finite [Finite ι] (f : ι → Set X) :
    closure (⋃ i, f i) = ⋃ i, closure (f i)

{X : Type u}
{ι : Sort w}
[TopologicalSpace X]
[Finite ι]
(f : ι → Set X)


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

(c : CategoryTheory.Limits.Cocone F.unop)

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


lemma pow_eq_one_iff_of_ne_zero (hn : n ≠ 0) : a ^ n = 1 ↔ a = 1 ∨ a = -1 ∧ Even n

{R : Type u_2}
[LinearOrderedRing R]
{a : R}
{n : ℕ}
(hn : n ≠ 0)


theorem untrop_monotone [Preorder R] : Monotone (untrop : Tropical R → R)


theorem argmax_eq_some_iff :
    argmax f l = some m ↔
      m ∈ l ∧ (∀ a ∈ l, f a ≤ f m) ∧ ∀ a ∈ l, f m ≤ f a → l.indexOf m ≤ l.indexOf a

{α : Type u_1}
{β : Type u_2}
[LinearOrder β]
{f : α → β}
{l : List α}
{m : α}
[DecidableEq α]

List.argmax f l = some m ↔
  m ∈ l ∧ (∀ (a : α), a ∈ l → f a ≤ f m) ∧ ∀ (a : α), a ∈ l → f m ≤ f a → List.indexOf m l ≤ List.indexOf a l


theorem symm_map_nhds_eq (e : M₁ ≃SL[σ₁₂] M₂) (x : M₁) : map e.symm (𝓝 (e x)) = 𝓝 x

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(e : M₁ ≃SL[σ₁₂] M₂)
(x : M₁)


@[simp] lemma restrictSubtype_dual : (M.restrictSubtype M.E)✶ = M✶.restrictSubtype M.E


protected theorem add_le_add_iff_right : a ≠ ∞ → (b + a ≤ c + a ↔ b ≤ c)


@[to_additive]
protected theorem MulLECancellable.isLeftRegular [PartialOrder R] {a : R}
    (ha : MulLECancellable a) : IsLeftRegular a

{R : Type u_1}
[Mul R]
[PartialOrder R]
{a : R}
(ha : MulLECancellable a)


theorem factorization_eq_primeFactorsList_multiset (n : ℕ) :
    n.factorization = Multiset.toFinsupp (n.primeFactorsList : Multiset ℕ)

n.factorization = Multiset.toFinsupp ↑n.primeFactorsList


/-- Given a right homology map data `ψ : RightHomologyMapData φ h₁ h₂` such that
both right homology data `h₁` and `h₂` are preserved by a functor `F`, this is
the induced right homology map data for the morphism `F.mapShortComplex.map φ`. -/
@[simps]
def RightHomologyMapData.map {φ : S₁ ⟶ S₂} {h₁ : S₁.RightHomologyData}
    {h₂ : S₂.RightHomologyData} (ψ : RightHomologyMapData φ h₁ h₂) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [h₁.IsPreservedBy F] [h₂.IsPreservedBy F] :
    RightHomologyMapData (F.mapShortComplex.map φ) (h₁.map F) (h₂.map F)

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


theorem iUnion_eq_univ_iff {f : ι → Set α} : ⋃ i, f i = univ ↔ ∀ x, ∃ i, x ∈ f i

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

⋃ i, f i = Set.univ ↔ ∀ (x : α), ∃ i, x ∈ f i


theorem formPerm_apply_getElem_zero (l : List α) (h : Nodup l) (hl : 1 < l.length) :
    formPerm l l[0] = l[1]

{α : Type u_1}
[DecidableEq α]
(l : List α)
(h : l.Nodup)
(hl : 1 < l.length)


@[simp, norm_cast]
lemma coe_inf [∀ i, SemilatticeInf (α i)] (f g : Π₀ i, α i) : f ⊓ g = ⇑f ⊓ g

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Zero (α i)]
[(i : ι) → SemilatticeInf (α i)]
(f g : Π₀ (i : ι), α i)


theorem Filter.EventuallyEq.lineDerivWithin_eq_nhds (h : f₁ =ᶠ[𝓝 x] f) :
    lineDerivWithin 𝕜 f₁ s x v = lineDerivWithin 𝕜 f s x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f f₁ : E → F}
{s : Set E}
{x v : E}
(h : f₁ =ᶠ[𝓝 x] f)


@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
(I : FractionalIdeal S P)

FractionalIdeal.map (AlgHom.id R P) I = I


/-- Fixed points of sup of submonoids is intersection -/
theorem fixedPoints_submonoid_sup {P Q : Submonoid M} :
    fixedPoints (↥(P ⊔ Q)) α = fixedPoints P α ∩ fixedPoints Q α

(M : Type u_1)
(α : Type u_2)
[Monoid M]
[MulAction M α]
{P Q : Submonoid M}

MulAction.fixedPoints (↥(P ⊔ Q)) α = MulAction.fixedPoints (↥P) α ∩ MulAction.fixedPoints (↥Q) α


/-- Forward direction of Vitali's convergnece theorem, with a.e. instead of InMeasure convergence.-/
theorem tendsto_Lp_of_tendsto_ae (hp : 1 ≤ p) (hp' : p ≠ ∞)
    {f : ℕ → α → β} {g : α → β} (haef : ∀ n, AEStronglyMeasurable (f n) μ)
    (hg' : Memℒp g p μ) (hui : UnifIntegrable f p μ) (hut : UnifTight f p μ)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
    Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0)

{f : ℕ → α → β}

(haef : ∀ (n : ℕ), MeasureTheory.AEStronglyMeasurable (f n) μ)

(hui : MeasureTheory.UnifIntegrable f p μ)

(hfg : ∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => f n x) Filter.atTop (nhds (g x)))

Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - g) p μ) Filter.atTop (nhds 0)


/-- If `f` has formal power series `∑ n, pₙ` at `x`, then
`f y - f z - p 1 (fun _ ↦ y - z) = O(‖(y, z) - (x, x)‖ * ‖y - z‖)` as `(y, z) → (x, x)`.
In particular, `f` is strictly differentiable at `x`. -/
theorem HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub (hf : HasFPowerSeriesAt f p x) :
    (fun y : E × E => f y.1 - f y.2 - p 1 fun _ => y.1 - y.2) =O[𝓝 (x, x)] fun y =>
      ‖y - (x, x)‖ * ‖y.1 - y.2‖

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


theorem mem_ball_zero : y ∈ ball p 0 r ↔ p y < r

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
(p : Seminorm 𝕜 E)
{y : E}
{r : ℝ}


{α : Type u_1}
[Semifield α]
[LinearOrder α]
[PosMulReflectLT α]
[ZeroLEOneClass α]
{a : α}


theorem mem_Ico_of_Ioo (h : x ∈ Ioo a b) : x ∈ Ico a b

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


theorem vsub_inter_subset : s -ᵥ t₁ ∩ t₂ ⊆ (s -ᵥ t₁) ∩ (s -ᵥ t₂)

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{s t₁ t₂ : Set β}


private lemma aux_sub (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) :
    a * (f x - m / (2 : ℝ) * ‖x‖ ^ 2) + b * (f y - m / (2 : ℝ) * ‖y‖ ^ 2) +
      m / (2 : ℝ) * ‖a • x + b • y‖ ^ 2
      = a * f x + b * f y - m / (2 : ℝ) * a * b * ‖x - y‖ ^ 2

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{a b m : ℝ}
{x y : E}
{f : E → ℝ}
(ha : 0 ≤ a)
(hb : 0 ≤ b)
(hab : a + b = 1)


theorem indepSets_singleton_iff {s t : Set Ω} {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} :
    IndepSets {s} {t} κ μ ↔ ∀ᵐ a ∂μ, κ a (s ∩ t) = κ a s * κ a t

{α : Type u_1}
{Ω : Type u_2}
{_mα : MeasurableSpace α}
{s t : Set Ω}
{_mΩ : MeasurableSpace Ω}
{κ : ProbabilityTheory.Kernel α Ω}
{μ : MeasureTheory.Measure α}

ProbabilityTheory.Kernel.IndepSets {s} {t} κ μ ↔ ∀ᵐ (a : α) ∂μ, (κ a) (s ∩ t) = (κ a) s * (κ a) t


/-- Given `S : Solution`, we have that `2 ≤ S.multiplicity`. -/
lemma Solution.two_le_multiplicity : 2 ≤ S.multiplicity

(S : FermatLastTheoremForThreeGen.Solution hζ)


/-- The forgetful functor from the Eilenberg-Moore category, forgetting the coalgebraic
structure. -/
@[simps]
def forget : Coalgebra G ⥤ C

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(G : CategoryTheory.Comonad C)
(A : G.Coalgebra)


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

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


@[simp]
theorem List.dProdIndex_cons (a : α) (l : List α) (fι : α → ι) :
    (a :: l).dProdIndex fι = fι a + l.dProdIndex fι

{ι : Type u_1}
{α : Type u_2}
[AddMonoid ι]
(a : α)
(l : List α)
(fι : α → ι)


theorem last_ofFn_succ {n : ℕ} (f : Fin n.succ → α)
    (h : ofFn f ≠ [] := mt ofFn_eq_nil_iff.mp (Nat.succ_ne_zero _)) :
    getLast (ofFn f) h = f (Fin.last _)

{α : Type u}
{n : ℕ}
(f : Fin n.succ → α)
(h : List.ofFn f ≠ [] := ⋯)

(List.ofFn f).getLast h = f (Fin.last n)


/-- The object in `SimplicialObject.Split C` attached to a splitting `s : Splitting X`
of a simplicial object `X`. -/
@[simps]
def mk' {X : SimplicialObject C} (s : Splitting X) : Split C

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


theorem le_iff_subset {s t : Multiset α} : Nodup s → (s ≤ t ↔ s ⊆ t)


@[simp]
theorem log_ofNat (b : ℕ) (n : ℕ) [n.AtLeastTwo] :
    log b (no_index (OfNat.ofNat n : R)) = Nat.log b (OfNat.ofNat n)

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
(b n : ℕ)
[n.AtLeastTwo]

Int.log b (OfNat.ofNat n) = ↑(Nat.log b (OfNat.ofNat n))


@[simp]
theorem zero_modByMonic (p : R[X]) : 0 %ₘ p = 0


theorem support_eq [MeasurableSpace α] [Zero β] (f : α →ₛ β) :
    support f = ⋃ y ∈ f.range.filter fun y => y ≠ 0, f ⁻¹' {y}

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Zero β]
(f : MeasureTheory.SimpleFunc α β)

Function.support ↑f = ⋃ y ∈ Finset.filter (fun y => y ≠ 0) f.range, ↑f ⁻¹' {y}


@[simp]
theorem sinh_le_sinh : sinh x ≤ sinh y ↔ x ≤ y


/-- The quadratic character as a multiplicative character. -/
@[simps]
def quadraticChar : MulChar F ℤ

(F : Type u_1)
[Field F]
[Fintype F]
[DecidableEq F]
(a : F)

(quadraticChar F) a = quadraticCharFun F a


lemma gcd_neg [NormalizedGCDMonoid α] {a b : α} : gcd a (-b) = gcd a b

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


@[to_additive (attr := simp)]
theorem prod_take_succ :
    ∀ (L : List M) (i : ℕ) (p : i < L.length), (L.take (i + 1)).prod = (L.take i).prod * L[i]

{M : Type u_4}
[AddMonoid M]
(L : List M)
(i : ℕ)
(p : i < L.length)

(List.take (i + 1) L).sum = (List.take i L).sum + L[i]


theorem exists_succ_iterate_or : (∃ n, succ^[n] a = b) ∨ ∃ n, succ^[n] b = a

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

(∃ n, Order.succ^[n] a = b) ∨ ∃ n, Order.succ^[n] b = a


{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(D : Derivation R A M)


theorem orthogonal_le (h : N ≤ L) : B.orthogonal L ≤ B.orthogonal N

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
{N L : Submodule R M}
(h : N ≤ L)


theorem curry {f : α × β → σ} : Primrec₂ (Function.curry f) ↔ Primrec f

{α : Type u_1}
{β : Type u_2}
{σ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α × β → σ}


/-- The rank of the direct sum is the sum of the ranks. -/
@[simp]
theorem rank_directSum {ι : Type v} (M : ι → Type w) [∀ i : ι, AddCommGroup (M i)]
    [∀ i : ι, Module R (M i)] [∀ i : ι, Module.Free R (M i)] :
    Module.rank R (⨁ i, M i) = Cardinal.sum fun i => Module.rank R (M i)

(R : Type u)
[Ring R]
[StrongRankCondition R]
{ι : Type v}
(M : ι → Type w)
[(i : ι) → AddCommGroup (M i)]
[(i : ι) → Module R (M i)]
[∀ (i : ι), Module.Free R (M i)]

Module.rank R (⨁ (i : ι), M i) = Cardinal.sum fun i => Module.rank R (M i)


/-- If `s` is bounded, then so is `s ∩ t` -/
theorem BddBelow.inter_of_left (h : BddBelow s) : BddBelow (s ∩ t)

{α : Type u}
[Preorder α]
{s t : Set α}
(h : BddBelow s)


@[to_additive]
theorem mem_zpowers_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p : ℕ} [hp : Fact p.Prime]
    (h : Fintype.card G = p) {g g' : G} (hg : g ≠ 1) : g' ∈ zpowers g

∀ {x : Fintype G} {p : ℕ} [hp : Fact (Nat.Prime p)],
  Fintype.card G = p → ∀ {g g' : G}, g ≠ 0 → g' ∈ AddSubgroup.zmultiples g


theorem exists_mulVec_eq_zero_iff {A : Type*} [DecidableEq n] [CommRing A] [IsDomain A]
    {M : Matrix n n A} : (∃ v ≠ 0, M *ᵥ v = 0) ↔ M.det = 0

{n : Type u_1}
[Fintype n]
{A : Type u_4}
[DecidableEq n]
[CommRing A]
[IsDomain A]
{M : Matrix n n A}

(∃ v, v ≠ 0 ∧ M.mulVec v = 0) ↔ M.det = 0


protected theorem le_add_of_neg_le_sub_right {a b c : Int} (h : -b ≤ a - c) : c ≤ a + b


theorem χ₈_nat_eq_if_mod_eight (n : ℕ) :
    χ₈ n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 7 then 1 else -1

ZMod.χ₈ ↑n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 7 then 1 else -1


theorem sequence_mono_nat {r : β → β → Prop} {f : α → β} (hf : Directed r f) (n : ℕ) :
    r (f (hf.sequence f n)) (f (hf.sequence f (n + 1)))

{α : Type u_1}
{β : Type u_2}
[Encodable α]
[Inhabited α]
{r : β → β → Prop}
{f : α → β}
(hf : Directed r f)
(n : ℕ)

r (f (Directed.sequence f hf n)) (f (Directed.sequence f hf (n + 1)))


@[to_additive (attr := simp)]
theorem inv_iInf {ι : Sort*} (S : ι → Submonoid G) : (⨅ i, S i)⁻¹ = ⨅ i, (S i)⁻¹

{G : Type u_2}
[Group G]
{ι : Sort u_6}
(S : ι → Submonoid G)


@[reassoc (attr := simp)]
lemma homologyπ_comp_leftHomologyIso_inv :
    S.homologyπ ≫ S.leftHomologyIso.inv = S.leftHomologyπ

CategoryTheory.CategoryStruct.comp S.homologyπ S.leftHomologyIso.inv = S.leftHomologyπ


/-- The top submodule is linearly equivalent to the module.

This is the module version of `AddSubmonoid.topEquiv`. -/
@[simps]
def topEquiv : (⊤ : Submodule R M) ≃ₗ[R] M

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(x : M)


/-- The degree of a product of polynomials is equal to
the sum of the degrees, where the degree of the zero polynomial is ⊥.
`[Nontrivial R]` is needed, otherwise for `l = []` we have `⊥` in the LHS and `0` in the RHS.
-/
theorem degree_list_prod [Nontrivial R] (l : List R[X]) : l.prod.degree = (l.map degree).sum

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
[Nontrivial R]
(l : List R[X])

l.prod.degree = (List.map Polynomial.degree l).sum


theorem ncard_inter_le_ncard_right (s t : Set α) (ht : t.Finite := by toFinite_tac) :
    (s ∩ t).ncard ≤ t.ncard

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


theorem dvd_ord_proj_of_dvd {n p : ℕ} (hn : n ≠ 0) (pp : p.Prime) (h : p ∣ n) : p ∣ ord_proj[p] n

{n p : ℕ}
(hn : n ≠ 0)
(pp : Nat.Prime p)
(h : p ∣ n)


theorem coprime_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : Coprime p (ord_compl[p] n)

{n p : ℕ}
(hp : Nat.Prime p)
(hn : n ≠ 0)


theorem sub_comp {X Y Z : C} (f g : X ⟶ Y) (h : Y ⟶ Z) : (f - g) ≫ h = f ≫ h - g ≫ h


theorem le_of_ge {x y : Int} (h : x ≥ y) : y ≤ x


@[reassoc]
lemma mapComp_assoc_left_inv {c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) :
    (F.mapComp f g).inv ▷ F.map h ≫ (F.mapComp (f ≫ g) h).inv =
    (α_ (F.map f) (F.map g) (F.map h)).hom ≫ F.map f ◁ (F.mapComp g h).inv ≫
    (F.mapComp f (g ≫ h)).inv ≫ F.map₂ (α_ f g h).inv

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (F.mapComp f g).inv (F.map h))
    (F.mapComp (CategoryTheory.CategoryStruct.comp f g) h).inv =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (F.map f) (F.map g) (F.map h)).hom
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft (F.map f) (F.mapComp g h).inv)
      (CategoryTheory.CategoryStruct.comp (F.mapComp f (CategoryTheory.CategoryStruct.comp g h)).inv
        (F.map₂ (CategoryTheory.Bicategory.associator f g h).inv)))


theorem normalize_sat {s x v} (w : s.sat' x v) :
    (normalizeConstraint s x).sat' (normalizeCoeffs s x) v

{s : Lean.Omega.Constraint}
{x v : Lean.Omega.Coeffs}
(w : s.sat' x v = true)

(Lean.Omega.normalizeConstraint s x).sat' (Lean.Omega.normalizeCoeffs s x) v = true


@[to_additive] lemma le_prod_of_mem (ha : a ∈ m) : a ≤ m.prod

{α : Type u_2}
[CanonicallyOrderedAddCommMonoid α]
{m : Multiset α}
{a : α}
(ha : a ∈ m)


theorem nonpos_of_mul_nonneg_right [MulPosStrictMono α]
    (h : 0 ≤ a * b) (ha : a < 0) : b ≤ 0

{α : Type u}
[Semiring α]
[LinearOrder α]
{a b : α}
[MulPosStrictMono α]
(h : 0 ≤ a * b)
(ha : a < 0)


@[reassoc (attr := simp)]
lemma liftCycles_i : S.liftCycles k hk ≫ S.iCycles = k

(hk : CategoryTheory.CategoryStruct.comp k S.g = 0)

CategoryTheory.CategoryStruct.comp (S.liftCycles k hk) S.iCycles = k


theorem GameAdd.fix_eq {C : α → α → Sort*} (hr : WellFounded rα)
    (IH : ∀ a₁ b₁, (∀ a₂ b₂, Sym2.GameAdd rα s(a₂, b₂) s(a₁, b₁) → C a₂ b₂) → C a₁ b₁) (a b : α) :
    GameAdd.fix hr IH a b = IH a b fun a' b' _ => GameAdd.fix hr IH a' b'

(IH : (a₁ b₁ : α) → ((a₂ b₂ : α) → Sym2.GameAdd rα s(a₂, b₂) s(a₁, b₁) → C a₂ b₂) → C a₁ b₁)

Sym2.GameAdd.fix hr IH a b = IH a b fun a' b' x => Sym2.GameAdd.fix hr IH a' b'


/-- The product of a list of positive natural numbers is positive,
and likewise for any nontrivial ordered semiring. -/
lemma prod_pos [StrictOrderedSemiring R] (l : List R) (h : ∀ a ∈ l, (0 : R) < a) :
    0 < l.prod

{R : Type u_1}
[StrictOrderedSemiring R]
(l : List R)
(h : ∀ a ∈ l, 0 < a)


theorem disjoint_left_iff (h : IsCompl y z) : Disjoint x y ↔ x ≤ z

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{x y z : α}
(h : IsCompl y z)


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

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

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


/-- The order of a formal power series is at least `n` if
the `i`th coefficient is `0` for all `i < n`. -/
theorem nat_le_order (φ : R⟦X⟧) (n : ℕ) (h : ∀ i < n, coeff R i φ = 0) : ↑n ≤ order φ

(h : ∀ i < n, (PowerSeries.coeff R i) φ = 0)


protected theorem mul_one (k : Fin (n + 1)) : k * 1 = k


theorem Algebra.trace_surjective [FiniteDimensional K L] [Algebra.IsSeparable K L] :
    Function.Surjective (Algebra.trace K L)

(K : Type u_4)
(L : Type u_5)
[Field K]
[Field L]
[Algebra K L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]

Function.Surjective ⇑(Algebra.trace K L)


theorem iff_congr {p₁ p₂ q₁ q₂ : Prop} (h₁ : p₁ ↔ p₂) (h₂ : q₁ ↔ q₂) : (p₁ ↔ q₁) ↔ (p₂ ↔ q₂)


@[simp]
theorem id_comp (f : A →⋆ₙₐ[R] B) : (NonUnitalStarAlgHom.id _ _).comp f = f

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]
(f : A →⋆ₙₐ[R] B)


@[simp]
theorem tendsto_lift_nhds_mk {f : X → α} {hf : ∀ x y, (x ~ᵢ y) → f x = f y} {l : Filter α} :
    Tendsto (lift f hf) (𝓝 <| mk x) l ↔ Tendsto f (𝓝 x) l

{hf : ∀ (x y : X), (x ~ᵢ y) → f x = f y}

Filter.Tendsto (SeparationQuotient.lift f hf) (𝓝 (SeparationQuotient.mk x)) l ↔ Filter.Tendsto f (𝓝 x) l


@[simp]
theorem mk_π_app_one {W : C} (fst : W ⟶ X) (snd : W ⟶ Y) (eq : fst ≫ f = snd ≫ g) :
    (mk fst snd eq).π.app WalkingCospan.one = fst ≫ f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z : C}
{f : X ⟶ Z}
{g : Y ⟶ Z}
{W : C}
(fst : W ⟶ X)
(snd : W ⟶ Y)
(eq : fst ≫ f = snd ≫ g)

(CategoryTheory.Limits.PullbackCone.mk fst snd eq).π.app CategoryTheory.Limits.WalkingCospan.one = fst ≫ f


theorem le_nadd_left {a b c} (h : a ≤ c) : a ≤ b ♯ c


@[simp]
theorem mem_top {s : Set α} : s ∈ (⊤ : Filter α) ↔ s = univ


@[simp]
private lemma mk_mem_triangleIndices : (a, b, c) ∈ triangleIndices A ↔ (a, b) ∈ A ∧ c = a + b

{G : Type u_1}
[AddCommGroup G]
{A : Finset (G × G)}
{a b c : G}

(a, b, c) ∈ Corners.triangleIndices A ↔ (a, b) ∈ A ∧ c = a + b


theorem card_support_eq_one_of_eraseLead_eq_zero (h₀ : f ≠ 0) (h₁ : f.eraseLead = 0) :
    f.support.card = 1

{R : Type u_1}
[Semiring R]
{f : R[X]}
(h₀ : f ≠ 0)
(h₁ : f.eraseLead = 0)


theorem congr_fun {f g : M →ₗ⁅R,L⁆ N} (h : f = g) (x : M) : f x = g x

{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 : f = g)
(x : M)


/-- A version of `measurable_div_const` that assumes `MeasurableMul` instead of
  `MeasurableDiv`. This can be nice to avoid unnecessary type-class assumptions. -/
@[to_additive " A version of `measurable_sub_const` that assumes `MeasurableAdd` instead of
  `MeasurableSub`. This can be nice to avoid unnecessary type-class assumptions. "]
theorem measurable_div_const' {G : Type*} [DivInvMonoid G] [MeasurableSpace G] [MeasurableMul G]
    (g : G) : Measurable fun h => h / g

{G : Type u_2}
[DivInvMonoid G]
[MeasurableSpace G]
[MeasurableMul G]
(g : G)


/-- A characterization lemma for the multiplication on the Ore localization, allowing for a choice
of Ore numerator and Ore denominator. -/
@[to_additive "A characterization lemma for the addition on the Ore localization,
allowing for a choice of Ore minuend and Ore subtrahend."]
theorem oreDiv_mul_char (r₁ r₂ : R) (s₁ s₂ : S) (r' : R) (s' : S) (huv : s' * r₁ = r' * s₂) :
    r₁ /ₒ s₁ * (r₂ /ₒ s₂) = r' * r₂ /ₒ (s' * s₁)

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
(r₁ r₂ : R)
(s₁ s₂ : ↥S)
(r' : R)
(s' : ↥S)
(huv : ↑s' * r₁ = r' * ↑s₂)


/-- The unit isomorphism for `functorProdFunctorEquiv` -/
@[simps!]
def functorProdFunctorEquivUnitIso :
    𝟭 _ ≅ prodFunctorToFunctorProd A B C ⋙ functorProdToProdFunctor A B C

(X : CategoryTheory.Functor A B × CategoryTheory.Functor A C)

(CategoryTheory.functorProdFunctorEquivUnitIso A B C).inv.app X =
  ((X.1.prod'CompFst X.2).hom, (X.1.prod'CompSnd X.2).hom)


@[simp] theorem associator_inv_apply_1_1 {X Y Z : Type u} {x} :
    (((α_ X Y Z).inv : X ⊗ Y ⊗ Z → (X ⊗ Y) ⊗ Z) x).1.1 = x.1


/-- Flip a complex of complexes over the diagonal,
exchanging the horizontal and vertical directions.
-/
@[simps]
def flip (K : HomologicalComplex₂ C c₁ c₂) : HomologicalComplex₂ C c₂ c₁


/-- Lifts a magma homomorphism `α → β` to a semigroup homomorphism `Magma.AssocQuotient α → β`
given a semigroup `β`. -/
@[to_additive (attr := simps symm_apply) "Lifts an additive magma homomorphism `α → β` to an
additive semigroup homomorphism `AddMagma.AssocQuotient α → β` given an additive semigroup `β`."]
def lift : (α →ₙ* β) ≃ (AssocQuotient α →ₙ* β)

{α : Type u}
[Mul α]
{β : Type v}
[Semigroup β]
(f : Magma.AssocQuotient α →ₙ* β)

Magma.AssocQuotient.lift.symm f = f.comp Magma.AssocQuotient.of


theorem Real.uniformContinuous_neg : UniformContinuous (@Neg.neg ℝ _)


@[simp] theorem refl_trans (e : X ≃ᵈ Y) : (refl X).trans e = e

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
(e : X ≃ᵈ Y)


/-- The "identity" functor from `ObjAsType α` to `AsType α`. -/
@[simps]
noncomputable def objAsTypeToAsType : ObjAsType α ⥤ AsType α

{X Y : CategoryTheory.FinCategory.ObjAsType α}

(CategoryTheory.FinCategory.objAsTypeToAsType α).map a = (Fintype.equivFin (X ⟶ Y)) a


theorem LeftLift.IsKan.hasLeftKanLift {t : LeftLift f g} (H : IsKan t) : HasLeftKanLift f g

{t : CategoryTheory.Bicategory.LeftLift f g}


@[simp]
theorem subsingleton_reverse_iff {s : Cycle α} : s.reverse.Subsingleton ↔ s.Subsingleton


@[simp]
theorem preimage_const_of_mem {b : β} {s : Set β} (h : b ∈ s) : (fun _ : α => b) ⁻¹' s = univ

{α : Type u_1}
{β : Type u_2}
{b : β}
{s : Set β}
(h : b ∈ s)


@[gcongr]
theorem inter_subset_inter_left (h : t ⊆ u) : s ∩ t ⊆ s ∩ u

{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}
(h : t ⊆ u)


theorem any_of_mem {p : α → Bool} (h₁ : a ∈ l) (h₂ : p a) : any l p

{α : Type u_1}
{l : List α}
{a : α}
{p : α → Bool}
(h₁ : a ∈ l)
(h₂ : p a = true)


theorem isOrthoᵢ_def {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] M} {v : n → M₁} :
    B.IsOrthoᵢ v ↔ ∀ i j : n, i ≠ j → B (v i) (v j) = 0

{R : Type u_1}
{R₁ : Type u_2}
{M : Type u_5}
{M₁ : Type u_6}
{n : Type u_19}
[CommSemiring R]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[AddCommMonoid M]
[Module R M]
{I₁ I₁' : R₁ →+* R}
{B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] M}
{v : n → M₁}

B.IsOrthoᵢ v ↔ ∀ (i j : n), i ≠ j → (B (v i)) (v j) = 0


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


@[simp]
theorem unzip_enum_eq_prod (l : List α) : l.enum.unzip = (range l.length, l)


theorem isSeparated_of_isSheaf (P : Cᵒᵖ ⥤ Type w) (h : IsSheaf J P) : IsSeparated J P

(J : CategoryTheory.GrothendieckTopology C)

(P : CategoryTheory.Functor Cᵒᵖ (Type w))

(h : CategoryTheory.Presieve.IsSheaf J P)


/-- The rotation of a vector by `θ` has an angle of `-θ` from that vector. -/
@[simp]
theorem oangle_rotation_self_left {x : V} (hx : x ≠ 0) (θ : Real.Angle) :
    o.oangle (o.rotation θ x) x = -θ

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


theorem Submodule.topologicalClosure_mono {s : Submodule R M} {t : Submodule R M} (h : s ≤ t) :
    s.topologicalClosure ≤ t.topologicalClosure

{R : Type u}
{M : Type v}
[Semiring R]
[TopologicalSpace M]
[AddCommMonoid M]
[Module R M]
[ContinuousConstSMul R M]
[ContinuousAdd M]
{s t : Submodule R M}
(h : s ≤ t)


@[simp] lemma den_pow (q : ℚ≥0) (n : ℕ) : (q ^ n).den = q.den ^ n


theorem compl_mem_coprod {s : Set (α × β)} {la : Filter α} {lb : Filter β} :
    sᶜ ∈ la.coprod lb ↔ (Prod.fst '' s)ᶜ ∈ la ∧ (Prod.snd '' s)ᶜ ∈ lb

{α : Type u_1}
{β : Type u_2}
{s : Set (α × β)}
{la : Filter α}
{lb : Filter β}


/-- A strong monomorphism `f` is a monomorphism which has the right lifting property
with respect to epimorphisms. -/
class StrongMono (f : P ⟶ Q) : Prop where
  /-- The monomorphism condition on `f` -/
  mono : Mono f
  /-- The right lifting property with respect to all epimorphisms -/
  rlp : ∀ ⦃X Y : C⦄ (z : X ⟶ Y) [Epi z], HasLiftingProperty z f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P Q : C}
{f : P ⟶ Q}
[self : CategoryTheory.StrongMono f]
⦃X Y : C⦄
(z : X ⟶ Y)
[CategoryTheory.Epi z]


@[simp]
theorem biUnion_Ico_eq_Iio_self_iff {p : ι → Prop} {f : ∀ i, p i → α} {a : α} :
    ⋃ (i) (hi : p i), Ico (f i hi) a = Iio a ↔ ∀ x < a, ∃ i hi, f i hi ≤ x

{ι : Sort u}
{α : Type v}
[LinearOrder α]
{p : ι → Prop}
{f : (i : ι) → p i → α}
{a : α}

⋃ i, ⋃ (hi : p i), Set.Ico (f i hi) a = Set.Iio a ↔ ∀ x < a, ∃ i, ∃ (hi : p i), f i hi ≤ x


/-- A union indexed by a finite set is totally bounded
if and only if each set of the family is totally bounded. -/
lemma totallyBounded_biUnion {ι : Type*} {I : Set ι} (hI : I.Finite) {s : ι → Set α} :
    TotallyBounded (⋃ i ∈ I, s i) ↔ ∀ i ∈ I, TotallyBounded (s i)

{α : Type u}
[uniformSpace : UniformSpace α]
{ι : Type u_1}
{I : Set ι}
(hI : I.Finite)
{s : ι → Set α}


@[simp]
theorem aroots_smul_nonzero [CommRing S] [IsDomain S] [Algebra T S]
    [NoZeroSMulDivisors T S] {a : T} (p : T[X]) (ha : a ≠ 0) :
    (a • p).aroots S = p.aroots S

{S : Type v}
{T : Type w}
[CommRing T]
[CommRing S]
[IsDomain S]
[Algebra T S]
[NoZeroSMulDivisors T S]
{a : T}
(p : Polynomial T)
(ha : a ≠ 0)


protected theorem Bijective.injective {f : α → β} (hf : Bijective f) : Injective f

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
(hf : Function.Bijective f)


/-- If two elements are pseudo-equal, then their composition with a morphism is, too. -/
theorem pseudoApply_aux {P Q : C} (f : P ⟶ Q) (a b : Over P) : a ≈ b → app f a ≈ app f b

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

a ≈ b → CategoryTheory.Abelian.app f a ≈ CategoryTheory.Abelian.app f b


/-- If `f (g y) = y` for `y` in some neighborhood of `a`, `g` is continuous at `a`, and `f` has an
invertible derivative `f'` at `g a`, then `g` has the derivative `f'⁻¹` at `a`.

This is one of the easy parts of the inverse function theorem: it assumes that we already have
an inverse function. -/
theorem HasDerivAt.of_local_left_inverse {f g : 𝕜 → 𝕜} {f' a : 𝕜} (hg : ContinuousAt g a)
    (hf : HasDerivAt f f' (g a)) (hf' : f' ≠ 0) (hfg : ∀ᶠ y in 𝓝 a, f (g y) = y) :
    HasDerivAt g f'⁻¹ a

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{f g : 𝕜 → 𝕜}
{f' a : 𝕜}
(hg : ContinuousAt g a)
(hf : HasDerivAt f f' (g a))
(hf' : f' ≠ 0)
(hfg : ∀ᶠ (y : 𝕜) in 𝓝 a, f (g y) = y)


theorem scaleRoots_aeval_eq_zero_of_aeval_mk'_eq_zero {p : A[X]} {r : A} {s : M}
    (hr : aeval (mk' S r s) p = 0) : aeval (algebraMap A S r) (scaleRoots p s) = 0

(hr : (Polynomial.aeval (IsLocalization.mk' S r s)) p = 0)

(Polynomial.aeval ((algebraMap A S) r)) (p.scaleRoots ↑s) = 0


theorem mk_ord_out (c : Cardinal) : #c.ord.out.α = c


@[to_additive]
theorem le_inv_iff_mul_le_one_left : a ≤ b⁻¹ ↔ b * a ≤ 1

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


theorem nodup_enum_map_fst (l : List α) : (l.enum.map Prod.fst).Nodup