/-- The equivalence `Karoubi (HomologicalComplex C c) ≌ HomologicalComplex (Karoubi C) c`. -/
@[simps]
def karoubiHomologicalComplexEquivalence :
    Karoubi (HomologicalComplex C c) ≌ HomologicalComplex (Karoubi C) c

(C : Type u_1)
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{ι : Type u_2}
(c : ComplexShape ι)

(CategoryTheory.Idempotents.karoubiHomologicalComplexEquivalence C c).counitIso =
  CategoryTheory.Idempotents.KaroubiHomologicalComplexEquivalence.counitIso


theorem uniformity_basis_edist_le' (ε' : ℝ≥0∞) (hε' : 0 < ε') :
    (𝓤 α).HasBasis (fun ε : ℝ≥0∞ => ε ∈ Ioo 0 ε') fun ε => { p : α × α | edist p.1 p.2 ≤ ε }

{α : Type u}
[PseudoEMetricSpace α]
(ε' : ℝ≥0∞)
(hε' : 0 < ε')

(𝓤 α).HasBasis (fun ε => ε ∈ Set.Ioo 0 ε') fun ε => {p | edist p.1 p.2 ≤ ε}


protected theorem Reachable.exists_walk_length_eq_dist (hr : G.Reachable u v) :
    ∃ p : G.Walk u v, p.length = G.dist u v

{V : Type u_1}
{G : SimpleGraph V}
{u v : V}
(hr : G.Reachable u v)


/-- Group homomorphisms preserve division. -/
@[to_additive "Additive group homomorphisms preserve subtraction."]
theorem map_mul_inv [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : F) (a b : G) :
    f (a * b⁻¹) = f a * (f b)⁻¹

{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[Group G]
[DivisionMonoid H]
[MonoidHomClass F G H]
(f : F)
(a b : G)


lemma eq_bot_of_eq_pointwise_smul_of_mem_jacobson_annihilator {r : R}
    {N : Submodule R M} (hN : FG N) (hrN : N = r • N)
    (hrJac : r ∈ N.annihilator.jacobson) : N = ⊥

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{r : R}
{N : Submodule R M}
(hN : N.FG)
(hrN : N = r • N)
(hrJac : r ∈ N.annihilator.jacobson)


/-- A variant of `lift` with `Z` an initial object. -/
@[simps!]
def liftToInitial {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsInitial Z) :
    WithInitial C ⥤ D

(hZ : CategoryTheory.Limits.IsInitial Z)

(CategoryTheory.WithInitial.liftToInitial F hZ).map f =
  match X, Y, f with
  | CategoryTheory.WithInitial.of x, CategoryTheory.WithInitial.of y, f => F.map (CategoryTheory.WithInitial.down f)
  | CategoryTheory.WithInitial.star, CategoryTheory.WithInitial.of x, x_1 => hZ.to (F.obj x)
  | CategoryTheory.WithInitial.star, CategoryTheory.WithInitial.star, x => CategoryTheory.CategoryStruct.id Z


private theorem poly_binom_aux3 (f : R[X]) (x y : R) :
    f.eval (x + y) =
      ((f.sum fun e a => a * x ^ e) + f.sum fun e a => a * e * x ^ (e - 1) * y) +
        f.sum fun e a => a * (polyBinomAux1 x y e a).val * y ^ 2

{R : Type u}
[CommRing R]
(f : Polynomial R)
(x y : R)

Polynomial.eval (x + y) f =
  ((f.sum fun e a => a * x ^ e) + f.sum fun e a => a * ↑e * x ^ (e - 1) * y) +
    f.sum fun e a => a * ↑(Polynomial.polyBinomAux1 x y e a) * y ^ 2


lemma ofNat_eq_zero [p.AtLeastTwo] : no_index (OfNat.ofNat p : R) = 0

(R : Type u_1)
[AddMonoidWithOne R]
(p : ℕ)
[CharP R p]
[p.AtLeastTwo]


/-- Commutative monoid objects in `C` are "just" braided lax monoidal functors from the trivial
braided monoidal category to `C`.
-/
@[simps]
def equivLaxBraidedFunctorPUnit : LaxBraidedFunctor (Discrete PUnit.{u + 1}) C ≌ CommMon_ C

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

(CommMon_.equivLaxBraidedFunctorPUnit C).unitIso = CommMon_.EquivLaxBraidedFunctorPUnit.unitIso C


theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S

{Γ : Type u_1}
[Inhabited Γ]
{Λ : Type u_2}
{σ : Type u_3}
[Inhabited Λ]
(M : Λ → Turing.TM1.Stmt Γ Λ σ)
{S : Finset Λ}
(ss : Turing.TM1.Supports M S)
{c c' : Turing.TM1.Cfg Γ Λ σ}

c' ∈ Turing.TM1.step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S


/-- `(φ i ⋆ g i) (k i)` tends to `z₀` as `i` tends to some filter `l` if
* `φ` is a sequence of normed bump functions
  such that `(φ i).rOut` tends to `0` as `i` tends to `l`;
* `g i` is `μ`-a.e. strongly measurable as `i` tends to `l`;
* `g i x` tends to `z₀` as `(i, x)` tends to `l ×ˢ 𝓝 x₀`;
* `k i` tends to `x₀`. -/
nonrec theorem convolution_tendsto_right {ι} {φ : ι → ContDiffBump (0 : G)} {g : ι → G → E'}
    {k : ι → G} {x₀ : G} {z₀ : E'} {l : Filter ι} (hφ : Tendsto (fun i => (φ i).rOut) l (𝓝 0))
    (hig : ∀ᶠ i in l, AEStronglyMeasurable (g i) μ) (hcg : Tendsto (uncurry g) (l ×ˢ 𝓝 x₀) (𝓝 z₀))
    (hk : Tendsto k l (𝓝 x₀)) :
    Tendsto (fun i => ((φ i).normed μ ⋆[lsmul ℝ ℝ, μ] g i) (k i)) l (𝓝 z₀)

(hφ : Filter.Tendsto (fun i => (φ i).rOut) l (𝓝 0))

(hig : ∀ᶠ (i : ι) in l, MeasureTheory.AEStronglyMeasurable (g i) μ)

(hcg : Filter.Tendsto (Function.uncurry g) (l ×ˢ 𝓝 x₀) (𝓝 z₀))

Filter.Tendsto (fun i => ((φ i).normed μ ⋆[ContinuousLinearMap.lsmul ℝ ℝ, μ] g i) (k i)) l (𝓝 z₀)


theorem Real.dist_eq (x y : ℝ) : dist x y = |x - y|


theorem HasFDerivAtFilter.add_const (hf : HasFDerivAtFilter f f' x L) (c : F) :
    HasFDerivAtFilter (fun y => f y + c) f' x L

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


theorem generate_has_subset_generate_measurable {C : Set (Set α)} {s : Set α}
    (hs : (generate C).Has s) : MeasurableSet[generateFrom C] s

(hs : (MeasurableSpace.DynkinSystem.generate C).Has s)


@[to_additive (attr := simp)]
theorem inv_comp (φ : N →* G) (ψ : M →* N) : φ⁻¹.comp ψ = (φ.comp ψ)⁻¹

{M : Type u_3}
{N : Type u_4}
{G : Type u_6}
[AddZeroClass M]
[AddZeroClass N]
[AddCommGroup G]
(φ : N →+ G)
(ψ : M →+ N)


/-- `AlgEquivClass F R A B` states that `F` is a type of algebra structure preserving
  equivalences. You should extend this class when you extend `AlgEquiv`. -/
class AlgEquivClass (F : Type*) (R A B : outParam Type*) [CommSemiring R] [Semiring A]
    [Semiring B] [Algebra R A] [Algebra R B] [EquivLike F A B]
    extends RingEquivClass F A B : Prop where
  /-- An equivalence of algebras commutes with the action of scalars. -/
  commutes : ∀ (f : F) (r : R), f (algebraMap R A r) = algebraMap R B r

{F : Type u_1}
{R : outParam (Type u_2)}
{A : outParam (Type u_3)}
{B : outParam (Type u_4)}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[EquivLike F A B]
[self : AlgEquivClass F R A B]
(f : F)
(r : R)

f ((algebraMap R A) r) = (algebraMap R B) r


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

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


@[simp]
theorem mem_biUnion : J ∈ π.biUnion πi ↔ ∃ J' ∈ π, J ∈ πi J'

{πi : (J : BoxIntegral.Box ι) → BoxIntegral.Prepartition J}


theorem ofVectorSpaceIndex.linearIndependent :
    LinearIndependent K ((↑) : ofVectorSpaceIndex K V → V)

(K : Type u_3)
(V : Type u_4)
[DivisionRing K]
[AddCommGroup V]
[Module K V]

LinearIndependent (ι := { x // x ∈ Basis.ofVectorSpaceIndex K V }) K Subtype.val


lemma prod_eq_zero (h : (0 : α) ∈ s) : s.prod = 0

{α : Type u_2}
[CommMonoidWithZero α]
{s : Multiset α}
(h : 0 ∈ s)


@[simp] lemma mem_finAntidiagonal {d : ℕ} {f : Fin d → μ} :
    f ∈ finAntidiagonal d n ↔ ∑ i, f i = n

{μ : Type u_2}
[AddCommMonoid μ]
[Finset.HasAntidiagonal μ]
[DecidableEq μ]
{n : μ}
{d : ℕ}
{f : Fin d → μ}

f ∈ Finset.finAntidiagonal d n ↔ ∑ i : Fin d, f i = n


theorem ContinuousAt.iterate {f : X → X} (hf : ContinuousAt f x) (hx : f x = x) (n : ℕ) :
    ContinuousAt f^[n] x

{X : Type u_1}
[TopologicalSpace X]
{x : X}
{f : X → X}
(hf : ContinuousAt f x)
(hx : f x = x)
(n : ℕ)


theorem openEmbedding_iff_comp_isIso {X Y Z : TopCat} (f : X ⟶ Y) (g : Y ⟶ Z) [IsIso g] :
    OpenEmbedding (f ≫ g) ↔ OpenEmbedding f

{X Y Z : TopCat}
(f : X ⟶ Y)
(g : Y ⟶ Z)
[CategoryTheory.IsIso g]

OpenEmbedding ⇑(f ≫ g) ↔ OpenEmbedding ⇑f


theorem Ideal.IsPrincipal.of_comap (f : R →+* S) (hf : Function.Surjective f) (I : Ideal S)
    [hI : IsPrincipal (I.comap f)] : IsPrincipal I

[hI : Submodule.IsPrincipal (Ideal.comap f I)]


@[simp]
theorem inv_right_iff₀ : SemiconjBy a x⁻¹ y⁻¹ ↔ SemiconjBy a x y

{G₀ : Type u_3}
[GroupWithZero G₀]
{a x y : G₀}


@[simp] theorem toBialgHom_id {M : HopfAlgebraCat.{v} R} :
    Hom.toBialgHom (𝟙 M) = BialgHom.id _ _

{R : Type u}
[CommRing R]
{M : HopfAlgebraCat R}

(𝟙 M).toBialgHom = BialgHom.id R ↑M.toBundled


theorem preimage_fract (s : Set α) :
    fract ⁻¹' s = ⋃ m : ℤ, (fun x => x - (m : α)) ⁻¹' (s ∩ Ico (0 : α) 1)

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

Int.fract ⁻¹' s = ⋃ m, (fun x => x - ↑m) ⁻¹' (s ∩ Set.Ico 0 1)


theorem cast_strictMono : StrictMono ((↑) : ℚ≥0 → K)

{K : Type u_5}
[LinearOrderedSemifield K]


protected theorem derivWithin_aeval (hxs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin (fun x => aeval x q) s x = aeval x (derivative q)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{s : Set 𝕜}
{R : Type u_1}
[CommSemiring R]
[Algebra R 𝕜]
(q : R[X])
(hxs : UniqueDiffWithinAt 𝕜 s x)

derivWithin (fun x => (Polynomial.aeval x) q) s x = (Polynomial.aeval x) (Polynomial.derivative q)


theorem epi_of_mono_of_epi_of_mono' (hR₁ : R₁.Exact) (hR₂ : R₂.map' 0 2 = 0)
    (hR₂' : Mono (R₂.map' 0 1)) (h₀ : Epi (app' φ 1)) (h₁ : Mono (app' φ 2)) :
    Epi (app' φ 0)

{R₁ R₂ : CategoryTheory.ComposableArrows C 2}

(hR₂' : CategoryTheory.Mono (R₂.map' 0 1 ⋯ ⋯))

(h₀ : CategoryTheory.Epi (CategoryTheory.ComposableArrows.app' φ 1 ⋯))

(h₁ : CategoryTheory.Mono (CategoryTheory.ComposableArrows.app' φ 2 ⋯))

CategoryTheory.Epi (CategoryTheory.ComposableArrows.app' φ 0 ⋯)


/-- Two n-simplices among cospherical points in an n-dimensional
subspace have the same circumsphere. -/
theorem circumsphere_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : Set P} (h : ps ⊆ s)
    [Nonempty s] {n : ℕ} [FiniteDimensional ℝ s.direction] (hd : finrank ℝ s.direction = n)
    (hc : Cospherical ps) {sx₁ sx₂ : Simplex ℝ P n} (hsx₁ : Set.range sx₁.points ⊆ ps)
    (hsx₂ : Set.range sx₂.points ⊆ ps) : sx₁.circumsphere = sx₂.circumsphere

(hd : FiniteDimensional.finrank ℝ ↥s.direction = n)


theorem radical_mul : radical (I * J) = radical I ⊓ radical J

{R : Type u}
[CommSemiring R]
(I J : Ideal R)


lemma tmul_mem_baseChange_of_mem (a : A) {m : M} (hm : m ∈ N) :
    a ⊗ₜ[R] m ∈ N.baseChange A

{R : Type u_1}
{A : Type u_2}
{L : Type u_3}
{M : Type u_4}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[CommRing A]
[Algebra R A]
{N : LieSubmodule R L M}
(a : A)
{m : M}
(hm : m ∈ N)


@[to_additive]
theorem prod_finset_sum_index [AddCommMonoid M] [CommMonoid N] {s : Finset ι} {g : ι → α →₀ M}
    {h : α → M → N} (h_zero : ∀ a, h a 0 = 1) (h_add : ∀ a b₁ b₂, h a (b₁ + b₂) = h a b₁ * h a b₂) :
    (∏ i ∈ s, (g i).prod h) = (∑ i ∈ s, g i).prod h

{g : ι → α →₀ M}

(h_add : ∀ (a : α) (b₁ b₂ : M), h a (b₁ + b₂) = h a b₁ + h a b₂)

∑ i ∈ s, (g i).sum h = (∑ i ∈ s, g i).sum h


@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b

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

OrderDual.ofDual (a ⇔ b) = OrderDual.ofDual a ∆ OrderDual.ofDual b


theorem toSubsemigroup_injective :
    Function.Injective (toSubsemigroup : NonUnitalSubsemiring R → Subsemigroup R)

{R : Type u}
[NonUnitalNonAssocSemiring R]


/-- The functor `Γ₀ : ChainComplex C ℕ ⥤ SimplicialObject C`, which is
the inverse functor of the Dold-Kan equivalence when `C` is an abelian
category, or more generally a pseudoabelian category. -/
@[simps!]
def Γ₀ : ChainComplex C ℕ ⥤ SimplicialObject C

∀ {X Y : ChainComplex C ℕ} (f : X ⟶ Y) (Δ : SimplexCategoryᵒᵖ),
  (AlgebraicTopology.DoldKan.Γ₀.map f).app Δ =
    (AlgebraicTopology.DoldKan.Γ₀.splitting X).desc Δ fun A =>
      f.f (Opposite.unop A.fst).len ≫ ((AlgebraicTopology.DoldKan.Γ₀.splitting Y).cofan Δ).inj A


theorem range_toLp [NormedField 𝕜] [NormedSpace 𝕜 E] :
    (LinearMap.range (toLp p μ 𝕜 : (α →ᵇ E) →L[𝕜] Lp E p μ)).toAddSubgroup =
      MeasureTheory.Lp.boundedContinuousFunction E p μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
(p : ℝ≥0∞)
(μ : MeasureTheory.Measure α)
[NormedAddCommGroup E]
[TopologicalSpace α]
[BorelSpace α]
[SecondCountableTopologyEither α E]
[MeasureTheory.IsFiniteMeasure μ]
{𝕜 : Type u_5}
[Fact (1 ≤ p)]
[NormedField 𝕜]
[NormedSpace 𝕜 E]

(LinearMap.range (BoundedContinuousFunction.toLp p μ 𝕜)).toAddSubgroup =
  MeasureTheory.Lp.boundedContinuousFunction E p μ


/-- The embedding `α → FreeSemigroup α`. -/
@[to_additive (attr := simps) "The embedding `α → FreeAddSemigroup α`."]
def of (x : α) : FreeSemigroup α


/-- Swap the `ᵐᵒᵖ` on an algebra hom to the opposite side. -/
@[simps!]
def opComm : (A →ₐ[R] Bᵐᵒᵖ) ≃ (Aᵐᵒᵖ →ₐ[R] B)

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]

∀ (a : Aᵐᵒᵖ →ₐ[R] B) (a_1 : A), (AlgHom.opComm.symm a) a_1 = MulOpposite.op (a (MulOpposite.op a_1))


theorem imp_eq_true_of_eq {a b : Prop} (h : a = b) : (a → b) = True


theorem le_isGLB_iff (h : IsGLB s a) : b ≤ a ↔ b ∈ lowerBounds s

{α : Type u}
[Preorder α]
{s : Set α}
{a b : α}
(h : IsGLB s a)


/-- Polarization identity: The real part of the inner product, in terms of the norm. -/
theorem re_inner_eq_norm_add_mul_self_sub_norm_sub_mul_self_div_four (x y : E) :
    re ⟪x, y⟫ = (‖x + y‖ * ‖x + y‖ - ‖x - y‖ * ‖x - y‖) / 4

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y : E)

RCLike.re ⟪x, y⟫_𝕜 = (‖x + y‖ * ‖x + y‖ - ‖x - y‖ * ‖x - y‖) / 4


theorem diam_ball {r : ℝ≥0∞} : diam (ball x r) ≤ 2 * r

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{r : ℝ≥0∞}


/-- The dependent version of `MultilinearMap.domDomCongrLinearEquiv`. -/
@[simps apply symm_apply]
def domDomCongrLinearEquiv' {ι' : Type*} (σ : ι ≃ ι') :
    MultilinearMap R M₁ M₂ ≃ₗ[S] MultilinearMap R (fun i => M₁ (σ.symm i)) M₂

(σ : ι ≃ ι')

(f : MultilinearMap R (fun i => M₁ (σ.symm i)) M₂)

(MultilinearMap.domDomCongrLinearEquiv' R S M₁ M₂ σ).symm f =
  { toFun := ⇑f ∘ ⇑(Equiv.piCongrLeft' M₁ σ), map_add' := ⋯, map_smul' := ⋯ }


theorem mem_top_iff_forall {s : Set α} : s ∈ (⊤ : Filter α) ↔ ∀ x, x ∈ s


theorem add_pos_left {a₁ : ℕ} (a₂) (h : 0 < a₁) : 0 < a₁ + a₂


@[simp] lemma mop_hom_associator (X Y Z : C) :
    (α_ X Y Z).hom.mop = (α_ (mop Z) (mop Y) (mop X)).inv

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

(CategoryTheory.MonoidalCategory.associator X Y Z).hom.mop =
  (CategoryTheory.MonoidalCategory.associator { unmop := Z } { unmop := Y } { unmop := X }).inv


/-- `rpow` version of `Finset.prod_pow` for `ℝ≥0`. -/
lemma finset_prod_rpow {ι} (s : Finset ι) (f : ι → ℝ≥0) (r : ℝ) :
    (∏ i ∈ s, f i ^ r) = (∏ i ∈ s, f i) ^ r

{ι : Type u_1}
(s : Finset ι)
(f : ι → ℝ≥0)
(r : ℝ)


lemma isRightDerivedFunctor_iff_of_iso (α' : F ⟶ L ⋙ RF') (W : MorphismProperty C)
    [L.IsLocalization W] (e : RF ≅ RF') (comm : α ≫ whiskerLeft L e.hom = α') :
    RF.IsRightDerivedFunctor α W ↔ RF'.IsRightDerivedFunctor α' W

(comm : CategoryTheory.CategoryStruct.comp α (CategoryTheory.whiskerLeft L e.hom) = α')


theorem Infinite.ncard (hs : s.Infinite) : s.ncard = 0

{α : Type u_1}
{s : Set α}
(hs : s.Infinite)


@[simp]
theorem inv_eq_zero {a : G₀} : a⁻¹ = 0 ↔ a = 0

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


theorem diff_ae_eq_left (h : AEDisjoint μ s t) : (s \ t : Set α) =ᵐ[μ] s

{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
(h : MeasureTheory.AEDisjoint μ s t)


lemma Indep.basis_of_subset_of_subset_closure (hI : M.Indep I) (hIX : I ⊆ X)
    (hXI : X ⊆ M.closure I) : M.Basis I X

{α : Type u_2}
{M : Matroid α}
{X I : Set α}
(hI : M.Indep I)
(hIX : I ⊆ X)
(hXI : X ⊆ M.closure I)


theorem and_le_right : ∀ x y : Bool, (x && y) ≤ y


@[simp]
theorem symm_symm (e : α ≃ᵐ β) : e.symm.symm = e

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(e : α ≃ᵐ β)


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

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

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


@[simp]
theorem id_comp (f : M₁ →SL[σ₁₂] M₂) : (id R₂ M₂).comp f = f

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

(ContinuousLinearMap.id R₂ M₂).comp f = f


@[to_additive (attr := simp)]
theorem prod_join [CommMonoid α] {S : Multiset (Multiset α)} :
    prod (join S) = prod (map prod S)

{α : Type u_1}
[CommMonoid α]
{S : Multiset (Multiset α)}

S.join.prod = (Multiset.map Multiset.prod S).prod


lemma IsWeaklyRegular.prototype_perm {rs : List R} (h : IsWeaklyRegular M rs)
    {rs'} (h'' : rs ~ rs') (h' : ∀ a b rs', (a :: b :: rs') <+~ rs →
      let K := torsionBy R (M ⧸ (Ideal.ofList rs' • ⊤ : Submodule R M)) b
      K = a • K → K = ⊥) : IsWeaklyRegular M rs'

(h' :
  ∀ (a b : R) (rs' : List R),
    (a :: b :: rs').Subperm rs →
      let K := Submodule.torsionBy R (M ⧸ Ideal.ofList rs' • ⊤) b;
      K = a • K → K = ⊥)

(h : RingTheory.Sequence.IsWeaklyRegular (M ⧸ Ideal.ofList rs₀ • ⊤) rs₁)

RingTheory.Sequence.IsWeaklyRegular (M ⧸ Ideal.ofList rs₀ • ⊤) rs₂


@[simp]
theorem mem_isPairSelfAdjointSubmodule (f : Module.End R M) :
    f ∈ isPairSelfAdjointSubmodule B₂ F₂ ↔ IsPairSelfAdjoint B₂ F₂ f

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(B₂ F₂ : LinearMap.BilinForm R M)
(f : Module.End R M)

f ∈ B₂.isPairSelfAdjointSubmodule F₂ ↔ B₂.IsPairSelfAdjoint F₂ f


lemma homMk'_comp (f : CostructuredArrow S T) (g : Y' ⟶ f.left) (g' : Y'' ⟶ Y') :
    homMk' f (g' ≫ g) = eqToHom (by simp) ≫ homMk' (mk (S.map g ≫ f.hom)) g' ≫ homMk' f g

(f : CategoryTheory.CostructuredArrow S T)

f.homMk' (CategoryTheory.CategoryStruct.comp g' g) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
    (CategoryTheory.CategoryStruct.comp
      ((CategoryTheory.CostructuredArrow.mk (CategoryTheory.CategoryStruct.comp (S.map g) f.hom)).homMk' g')
      (f.homMk' g))


@[simp] lemma prodComm_symm [Module R₁ M₂] : (prodComm R₁ M₁ M₂).symm = prodComm R₁ M₂ M₁

(R₁ : Type u_1)
[Semiring R₁]
(M₁ : Type u_4)
[TopologicalSpace M₁]
[AddCommMonoid M₁]
(M₂ : Type u_6)
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₁ M₂]

(ContinuousLinearEquiv.prodComm R₁ M₁ M₂).symm = ContinuousLinearEquiv.prodComm R₁ M₂ M₁


@[to_additive]
theorem MulEquiv.isGroupHom {G H : Type*} {_ : Group G} {_ : Group H} (h : G ≃* H) :
    IsGroupHom h

∀ {x : AddGroup G} {x_1 : AddGroup H} (h : G ≃+ H), IsAddGroupHom ⇑h


theorem comap_map (f : K →+* L) (s : Subfield K) : (s.map f).comap f = s

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


@[continuity]
theorem exp_continuous : Continuous (exp 𝕂 : 𝔸 → 𝔸)

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]


@[simp] theorem get_cons_succ' {as : List α} {i : Fin as.length} :
  (a :: as).get i.succ = as.get i

{α : Type u_1}
{a : α}
{as : List α}
{i : Fin as.length}


@[simp, norm_cast]
theorem const_inf [Inf β] (a b : β) : ↑(a ⊓ b) = (↑a ⊓ ↑b : Germ l β)

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
[Inf β]
(a b : β)


@[to_additive (attr := simp)]
theorem coe_comp : ⇑(p.comp f) = p ∘ f

{E : Type u_4}
{F : Type u_5}
[Group E]
[Group F]
(p : GroupSeminorm E)
(f : F →* E)


@[simp]
theorem toSet_image (f : ZFSet → ZFSet) [H : Definable 1 f] (x : ZFSet) :
    (image f x).toSet = f '' x.toSet

(f : ZFSet → ZFSet)
[H : PSet.Definable 1 f]
(x : ZFSet)


/-- A morphism in the arrow category is a commutative square connecting two objects of the arrow
    category. -/
@[simps]
def homMk {f g : Arrow T} {u : f.left ⟶ g.left} {v : f.right ⟶ g.right}
    (w : u ≫ g.hom = f.hom ≫ v) : f ⟶ g

(w : CategoryTheory.CategoryStruct.comp u g.hom = CategoryTheory.CategoryStruct.comp f.hom v)

(CategoryTheory.Arrow.homMk w).right = v


theorem outerMeasure_eq_iInf (A : Set G) :
    μ.outerMeasure A = ⨅ (U : Set G) (hU : IsOpen U) (_ : A ⊆ U), μ.innerContent ⟨U, hU⟩

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
[R1Space G]
(A : Set G)

μ.outerMeasure A = ⨅ U, ⨅ (hU : IsOpen U), ⨅ (_ : A ⊆ U), μ.innerContent { carrier := U, is_open' := hU }


theorem sublists'_eq_sublists'Aux (l : List α) :
    sublists' l = l.foldr (fun a r => sublists'Aux a r r) [[]]

l.sublists' = List.foldr (fun a r => List.sublists'Aux a r r) [[]] l


theorem iSup_singleton (a : α) (s : α → β) : ⨆ x ∈ ({a} : Finset α), s x = s a

{α : Type u_2}
{β : Type u_3}
[CompleteLattice β]
(a : α)
(s : α → β)


/-- The identity morphism between quivers. -/
@[simps]
def id (V : Type*) [Quiver V] : Prefunctor V V


theorem TendstoUniformlyOn.congr {F' : ι → α → β} (hf : TendstoUniformlyOn F f p s)
    (hff' : ∀ᶠ n in p, Set.EqOn (F n) (F' n) s) : TendstoUniformlyOn F' f p s

{F : ι → α → β}

{F' : ι → α → β}

(hff' : ∀ᶠ (n : ι) in p, Set.EqOn (F n) (F' n) s)


@[to_additive (attr := simp)]
theorem smul_swap : (a • x).swap = a • x.swap

{M : Type u_1}
{α : Type u_4}
{β : Type u_5}
[VAdd M α]
[VAdd M β]
(a : M)
(x : α ⊕ β)


theorem getElem?_zip_eq_some (l₁ : List α) (l₂ : List β) (z : α × β) (i : ℕ) :
    (zip l₁ l₂)[i]? = some z ↔ l₁[i]? = some z.1 ∧ l₂[i]? = some z.2

{α : Type u}
{β : Type u_1}
(l₁ : List α)
(l₂ : List β)
(z : α × β)
(i : ℕ)

(l₁.zip l₂)[i]? = some z ↔ l₁[i]? = some z.1 ∧ l₂[i]? = some z.2


theorem isComplement'_of_card_mul_and_disjoint [Finite G]
    (h1 : Nat.card H * Nat.card K = Nat.card G) (h2 : Disjoint H K) :
    IsComplement' H K

(h1 : Nat.card ↥H * Nat.card ↥K = Nat.card G)


@[to_additive] lemma leOnePart_mul_oneLePart (a : α) : a⁻ᵐ * a⁺ᵐ = |a|ₘ

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

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


@[higher_order tfst_id]
theorem id_tfst : ∀ {α β} (x : t α β), tfst (F := Id) pure x = pure x

{t : Type u → Type u → Type u}
[Bitraversable t]
[LawfulBitraversable t]
{α β : Type u}
(x : t α β)


/-- There is a natural equivalence when swapping the coefficients of a quaternion algebra. -/
@[simps]
def swapEquiv : ℍ[R,c₁,c₂] ≃ₐ[R] ℍ[R, c₂, c₁]

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

((QuaternionAlgebra.swapEquiv c₁ c₂).symm t).imK = -t.imK


theorem Monotone.isBoundedUnder_ge_comp_iff [Nonempty β] [LinearOrder β] [Preorder γ] [NoMinOrder γ]
    {g : β → γ} {f : α → β} {l : Filter α} (hg : Monotone g) (hg' : Tendsto g atBot atBot) :
    IsBoundedUnder (· ≥ ·) l (g ∘ f) ↔ IsBoundedUnder (· ≥ ·) l f

(hg' : Filter.Tendsto g Filter.atBot Filter.atBot)

Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) l (g ∘ f) ↔ Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) l f


theorem zneg_toZNum (n : Num) : -n.toZNum = n.toZNumNeg


@[simp]
theorem full_univ : full Set.univ = (⊤ : Subgroupoid C)

{C : Type u}
[CategoryTheory.Groupoid C]

CategoryTheory.Subgroupoid.full Set.univ = ⊤


@[simp]
theorem setOf_mem_eq {s : Set α} : { x | x ∈ s } = s


@[to_additive]
theorem subgroupOf_sup (A A' B : Subgroup G) (hA : A ≤ B) (hA' : A' ≤ B) :
    (A ⊔ A').subgroupOf B = A.subgroupOf B ⊔ A'.subgroupOf B

{G : Type u_1}
[Group G]
(A A' B : Subgroup G)
(hA : A ≤ B)
(hA' : A' ≤ B)


@[to_additive]
theorem zpow_comp [Group γ] [TopologicalGroup γ] (f : C(β, γ)) (z : ℤ) (g : C(α, β)) :
    (f ^ z).comp g = f.comp g ^ z

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[Group γ]
[TopologicalGroup γ]
(f : C(β, γ))
(z : ℤ)
(g : C(α, β))


@[reassoc (attr := simp)]
theorem Subpresheaf.lift_ι (f : F' ⟶ F) (hf : ∀ U x, f.app U x ∈ G.obj U) :
    G.lift f hf ≫ G.ι = f

(G : CategoryTheory.GrothendieckTopology.Subpresheaf F)

(hf : ∀ (U : Cᵒᵖ) (x : F'.obj U), f.app U x ∈ G.obj U)


lemma isSigmaCompact_iff_sigmaCompactSpace {s : Set X} :
    IsSigmaCompact s ↔ SigmaCompactSpace s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}


theorem gauge_of_subset_zero (h : s ⊆ 0) : gauge s = 0

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
(h : s ⊆ 0)


theorem surjective_stableUnderComposition : StableUnderComposition surjective

RingHom.StableUnderComposition fun {X Y} [CommRing X] [CommRing Y] f => Function.Surjective ⇑f


/-- A `G`-diffeomorphism between two charted spaces is a homeomorphism which, when read in the
charts, belongs to `G`. We avoid the word diffeomorph as it is too related to the smooth category,
and use structomorph instead. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure Structomorph (G : StructureGroupoid H) (M : Type*) (M' : Type*) [TopologicalSpace M]
  [TopologicalSpace M'] [ChartedSpace H M] [ChartedSpace H M'] extends Homeomorph M M' where
  mem_groupoid : ∀ c : PartialHomeomorph M H, ∀ c' : PartialHomeomorph M' H, c ∈ atlas H M →
    c' ∈ atlas H M' → c.symm ≫ₕ toHomeomorph.toPartialHomeomorph ≫ₕ c' ∈ G

{H : Type u}
[TopologicalSpace H]
{G : StructureGroupoid H}
{M : Type u_5}
{M' : Type u_6}
[TopologicalSpace M]
[TopologicalSpace M']
[ChartedSpace H M]
[ChartedSpace H M']
(self : Structomorph G M M')
(c : PartialHomeomorph M H)
(c' : PartialHomeomorph M' H)

c ∈ atlas H M → c' ∈ atlas H M' → c.symm ≫ₕ self.toPartialHomeomorph ≫ₕ c' ∈ G


/-- The Weierstrass curve over `R` induced by an admissible linear change of variables
$(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$. -/
@[simps]
def variableChange : WeierstrassCurve R

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(C : WeierstrassCurve.VariableChange R)

(W.variableChange C).a₂ = ↑C.u⁻¹ ^ 2 * (W.a₂ - C.s * W.a₁ + 3 * C.r - C.s ^ 2)


@[simp]
theorem coe_mulRight₀ (c : α) (hc : c ≠ 0) : ⇑(Homeomorph.mulRight₀ c hc) = (· * c)

{α : Type u_1}
[TopologicalSpace α]
[GroupWithZero α]
[ContinuousMul α]
(c : α)
(hc : c ≠ 0)

⇑(Homeomorph.mulRight₀ c hc) = fun x => x * c


theorem Filter.Tendsto.min_right {l : Filter β} {a : α} (h : Tendsto f l (𝓝 a)) :
    Tendsto (fun i => min a (f i)) l (𝓝 a)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{f : β → α}
{l : Filter β}
{a : α}
(h : Filter.Tendsto f l (𝓝 a))

Filter.Tendsto (fun i => min a (f i)) l (𝓝 a)


theorem cgf_neg : cgf (-X) μ t = cgf X μ (-t)

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{X : Ω → ℝ}
{μ : MeasureTheory.Measure Ω}
{t : ℝ}

ProbabilityTheory.cgf (-X) μ t = ProbabilityTheory.cgf X μ (-t)


@[simp] theorem limsup_bot (f : β → α) : limsup f ⊥ = ⊥

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
(f : β → α)


/-- The inverse of a `TransvectionStruct`, designed so that `t.inv.toMatrix` is the inverse of
`t.toMatrix`. -/
@[simps]
protected def inv (t : TransvectionStruct n R) : TransvectionStruct n R

{n : Type u_1}
{R : Type u₂}
[CommRing R]
(t : Matrix.TransvectionStruct n R)


theorem cauchy (f : CauSeq β abv) : ∀ {ε}, 0 < ε → ∃ i, ∀ j ≥ i, abv (f j - f i) < ε

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
(f : CauSeq β abv)
{ε : α}

0 < ε → ∃ i, ∀ j ≥ i, abv (↑f j - ↑f i) < ε


@[to_additive (attr := simp)]
theorem op_le_op_iff {S₁ S₂ : Submonoid M} : S₁.op ≤ S₂.op ↔ S₁ ≤ S₂

{M : Type u_2}
[AddZeroClass M]
{S₁ S₂ : AddSubmonoid M}


@[simp]
theorem normalizedFactors_one : normalizedFactors (1 : α) = 0

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
[UniqueFactorizationMonoid α]

UniqueFactorizationMonoid.normalizedFactors 1 = 0


/-- If `φ : S₁ ⟶ S₂` is a morphism of short complexes such that `φ.τ₁` is epi, `φ.τ₂` is an iso
and `φ.τ₃` is mono, then a left homology data for `S₂` induces a left homology data for `S₁` with
the same `K` and `H` fields. The inverse construction is `ofEpiOfIsIsoOfMono`. -/
@[simps]
noncomputable def ofEpiOfIsIsoOfMono' (φ : S₁ ⟶ S₂) (h : LeftHomologyData S₂)
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] : LeftHomologyData S₁

(CategoryTheory.ShortComplex.LeftHomologyData.ofEpiOfIsIsoOfMono' φ h).i =
  CategoryTheory.CategoryStruct.comp h.i (CategoryTheory.inv φ.τ₂)


theorem properDivisors_prime_pow {p : ℕ} (pp : p.Prime) (k : ℕ) :
    properDivisors (p ^ k) = (Finset.range k).map ⟨(p ^ ·), Nat.pow_right_injective pp.two_le⟩

(p ^ k).properDivisors = Finset.map { toFun := fun x => p ^ x, inj' := ⋯ } (Finset.range k)


theorem neLocus_eq_support_sub : f.neLocus g = (f - g).support

{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f g : Π₀ (a : α), N a)


theorem sups_subset_right : s₁ ⊆ s₂ → s₁ ⊻ t ⊆ s₂ ⊻ t

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
{s₁ s₂ t : Finset α}

s₁ ⊆ s₂ → s₁ ⊻ t ⊆ s₂ ⊻ t


nonrec theorem Fintype.prod_dite [Fintype α] {p : α → Prop} [DecidablePred p] [CommMonoid β]
    (f : ∀ a, p a → β) (g : ∀ a, ¬p a → β) :
    (∏ a, dite (p a) (f a) (g a)) =
    (∏ a : { a // p a }, f a a.2) * ∏ a : { a // ¬p a }, g a a.2

{α : Type u_1}
{β : Type u_2}
[Fintype α]
{p : α → Prop}
[DecidablePred p]
[CommMonoid β]
(f : (a : α) → p a → β)
(g : (a : α) → ¬p a → β)

∏ a : α, dite (p a) (f a) (g a) = (∏ a : { a // p a }, f ↑a ⋯) * ∏ a : { a // ¬p a }, g ↑a ⋯


theorem castAdd_castAdd {m n p : Nat} (i : Fin m) :
    castAdd p (castAdd n i) = cast (Nat.add_assoc ..).symm (castAdd (n + p) i)

Fin.castAdd p (Fin.castAdd n i) = Fin.cast ⋯ (Fin.castAdd (n + p) i)


theorem AntitoneOn.union [Preorder β] {f g : β → Set α} {s : Set β} (hf : AntitoneOn f s)
    (hg : AntitoneOn g s) : AntitoneOn (fun x => f x ∪ g x) s

{α : Type u_1}
{β : Type u_2}
[Preorder β]
{f g : β → Set α}
{s : Set β}
(hf : AntitoneOn f s)
(hg : AntitoneOn g s)


@[simp]
theorem Matrix.toBilin'Aux_eq (M : Matrix n n R₂) : Matrix.toBilin'Aux M = Matrix.toBilin' M

{R₂ : Type u_5}
[CommSemiring R₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(M : Matrix n n R₂)


theorem add_sub_of_lt {a b : ℕ+} : a < b → a + (b - a) = b


/-- This structure contains the information left for a local trivialization (which is implemented
below as `Trivialization F proj`) if the total space has not been given a topology, but we
have a topology on both the fiber and the base space. Through the construction
`topological_fiber_prebundle F proj` it will be possible to promote a
`Pretrivialization F proj` to a `Trivialization F proj`. -/
structure Pretrivialization (proj : Z → B) extends PartialEquiv Z (B × F) where
  open_target : IsOpen target
  baseSet : Set B
  open_baseSet : IsOpen baseSet
  source_eq : source = proj ⁻¹' baseSet
  target_eq : target = baseSet ×ˢ univ
  proj_toFun : ∀ p ∈ source, (toFun p).1 = proj p

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

p ∈ self.source → (↑self.toPartialEquiv p).1 = proj p


@[simp]
theorem sin_neg : sin (-x) = -sin x


theorem moveLeft_neg {x : PGame} (i) : (-x).moveLeft (toLeftMovesNeg i) = -x.moveRight i

{x : SetTheory.PGame}
(i : x.RightMoves)

(-x).moveLeft (SetTheory.PGame.toLeftMovesNeg i) = -x.moveRight i


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

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{b : α}
(h : StrictAntiOn f (Set.Iic b))

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


@[simp]
theorem isCycle_inv : IsCycle f⁻¹ ↔ IsCycle f


theorem disjoint_out' {H K : Subgroup G} {a b : Quotient H.1 K} :
    a ≠ b → Disjoint (doset a.out' H K) (doset b.out' (H : Set G) K)

{a b : Doset.Quotient ↑H.toSubmonoid ↑K}

a ≠ b → Disjoint (Doset.doset (Quotient.out' a) ↑H ↑K) (Doset.doset (Quotient.out' b) ↑H ↑K)


@[simp]
theorem addOrderOf_ofMul_eq_orderOf (x : G) : addOrderOf (Additive.ofMul x) = orderOf x


theorem sInf_mem_closure {s : Set α} (hs : s.Nonempty) : sInf s ∈ closure s

{α : Type u_1}
[CompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
{s : Set α}
(hs : s.Nonempty)


theorem inter_insert_of_mem (h : a ∈ s) : s ∩ insert a t = insert a (s ∩ t)

{α : Type u}
{a : α}
{s t : Set α}
(h : a ∈ s)


@[to_additive IsOpen.right_addCoset]
theorem IsOpen.rightCoset {U : Set G} (h : IsOpen U) (x : G) : IsOpen (op x • U)

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[ContinuousAdd G]
{U : Set G}
(h : IsOpen U)
(x : G)


lemma isLocallyInjective_iff_of_fac {φψ : F₁ ⟶ F₃} (fac : φ ≫ ψ = φψ) [IsLocallyInjective J ψ] :
    IsLocallyInjective J φψ ↔ IsLocallyInjective J φ

(J : CategoryTheory.GrothendieckTopology C)

{F₁ F₂ F₃ : CategoryTheory.Functor Cᵒᵖ D}

{φψ : F₁ ⟶ F₃}

(fac : CategoryTheory.CategoryStruct.comp φ ψ = φψ)

CategoryTheory.Presheaf.IsLocallyInjective J φψ ↔ CategoryTheory.Presheaf.IsLocallyInjective J φ


theorem IsCompact.sSup_lt_iff_of_continuous [ClosedIciTopology α] {f : β → α} {K : Set β}
    (hK : IsCompact K) (h0K : K.Nonempty) (hf : ContinuousOn f K) (y : α) :
    sSup (f '' K) < y ↔ ∀ x ∈ K, f x < y

{α : Type u_2}
{β : Type u_3}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIciTopology α]
{f : β → α}
{K : Set β}
(hK : IsCompact K)
(h0K : K.Nonempty)
(hf : ContinuousOn f K)
(y : α)


/-- The functor `HomologicalComplex C c ⥤ ShortComplex C` which sends a homological
complex `K` to the short complex `K.X i ⟶ K.X j ⟶ K.X k` for arbitrary indices `i`, `j` and `k`. -/
@[simps]
def shortComplexFunctor' (i j k : ι) : HomologicalComplex C c ⥤ ShortComplex C

∀ {X Y : HomologicalComplex C c} (f : X ⟶ Y), ((HomologicalComplex.shortComplexFunctor' C c i j k).map f).τ₃ = f.f k


/-- `IsLocalization.toLocalizationWithZeroMap M S` shows `S` is the monoid localization of
`R` at `M`. -/
@[simps]
def toLocalizationWithZeroMap : Submonoid.LocalizationWithZeroMap M S

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

(↑(IsLocalization.toLocalizationWithZeroMap M S).toMonoidHom).toFun a = (algebraMap R S) a


theorem natDegree_mul' (h : leadingCoeff p * leadingCoeff q ≠ 0) :
    natDegree (p * q) = natDegree p + natDegree q

(h : p.leadingCoeff * q.leadingCoeff ≠ 0)

(p * q).natDegree = p.natDegree + q.natDegree


@[simp] theorem length_append (s t : String) : (s ++ t).length = s.length + t.length


/-- The 1-hypercover of `D.glued` in the big Zariski site that is given by the
open cover `D.U` from the glue data `D`.
The "covering of the intersection of two such open subsets" is the trivial
covering given by `D.V`. -/
@[simps]
noncomputable def oneHypercover : Scheme.zariskiTopology.OneHypercover D.glued

(D : AlgebraicGeometry.Scheme.GlueData)
(i₁ i₂ : D.J)

∀ (x : PUnit.{u + 1}), D.oneHypercover.p₁ x = D.f i₁ i₂


@[to_additive (attr := simp)]
theorem measurePreserving_smul : MeasurePreserving (c • ·) μ μ

[MeasureTheory.SMulInvariantMeasure M α μ]

MeasureTheory.MeasurePreserving (fun x => c • x) μ μ


@[simp]
theorem polar_zero_right (y : M) : polar Q y 0 = 0

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(Q : QuadraticMap R M N)
(y : M)


/-- The function `x ^ (1 / x)` tends to `1` at `+∞`. -/
theorem tendsto_rpow_div : Tendsto (fun x => x ^ ((1 : ℝ) / x)) atTop (𝓝 1)

Filter.Tendsto (fun x => x ^ (1 / x)) Filter.atTop (𝓝 1)


@[simp] theorem getLast?_nil : @getLast? α [] = none


theorem commute_iff_lie_eq {x y : R} : Commute x y ↔ ⁅x, y⁆ = 0

{R : Type x}
[NonUnitalNonAssocRing R]
{x y : R}


theorem ne_cons_iff (a : α) (v : Vector α n.succ) (v' : Vector α n) :
    v ≠ a ::ᵥ v' ↔ v.head ≠ a ∨ v.tail ≠ v'

{n : ℕ}
{α : Type u_1}
(a : α)
(v : Mathlib.Vector α n.succ)
(v' : Mathlib.Vector α n)


theorem hasSum_zeta_two : HasSum (fun n : ℕ => (1 : ℝ) / (n : ℝ) ^ 2) (π ^ 2 / 6)


/-- For every prime `p` dividing the order of a finite group `G` there exists an element of order
`p` in `G`. This is known as Cauchy's theorem. -/
theorem _root_.exists_prime_orderOf_dvd_card {G : Type*} [Group G] [Fintype G] (p : ℕ)
    [hp : Fact p.Prime] (hdvd : p ∣ Fintype.card G) : ∃ x : G, orderOf x = p

{G : Type u_3}
[Group G]
[Fintype G]
(p : ℕ)
[hp : Fact (Nat.Prime p)]
(hdvd : p ∣ Fintype.card G)


theorem sup_sdiff_cancel_right (h : a ≤ b) : a ⊔ b \ a = b

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


theorem IicSnd_apply (r : ℝ) {s : Set α} (hs : MeasurableSet s) :
    ρ.IicSnd r s = ρ (s ×ˢ Iic r)

{α : Type u_1}
{mα : MeasurableSpace α}
(ρ : MeasureTheory.Measure (α × ℝ))
(r : ℝ)
{s : Set α}
(hs : MeasurableSet s)


/-- Given a natural transformation `α : F ⟶ G`, for `F G : C ⥤ Dᵒᵖ`,
taking `unop` of each component gives a natural transformation `G.leftOp ⟶ F.leftOp`.
-/
@[simps]
protected def leftOp (α : F ⟶ G) : G.leftOp ⟶ F.leftOp

{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.leftOp α).app X = (α.app (Opposite.unop X)).unop


/-- Out of three elements of a `LinearOrderedRing`, two must have the same sign. -/
theorem mul_nonneg_of_three [ExistsAddOfLE α] [MulPosStrictMono α] [PosMulStrictMono α]
    [CovariantClass α α (· + ·) (· ≤ ·)] [ContravariantClass α α (· + ·) (· ≤ ·)]
    (a b c : α) : 0 ≤ a * b ∨ 0 ≤ b * c ∨ 0 ≤ c * a

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

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


theorem div_zero_subset (s : Set α) : s / 0 ⊆ 0

{α : Type u_2}
[GroupWithZero α]
(s : Set α)


theorem num_den_mk {q : ℚ} {n d : ℤ} (hd : d ≠ 0) (qdf : q = n /. d) :
    ∃ c : ℤ, n = c * q.num ∧ d = c * q.den

{q : ℚ}
{n d : ℤ}
(hd : d ≠ 0)
(qdf : q = Rat.divInt n d)


theorem comp_apply_eq {x : R₁} : σ' (σ x) = x

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ : R₁ →+* R₂}
{σ' : R₂ →+* R₁}
[RingHomInvPair σ σ']
{x : R₁}


theorem Lex.wellFounded_of_finite [IsStrictTotalOrder α r] [Finite α]
    (hs : WellFounded s) : WellFounded (Finsupp.Lex r s)

{α : Type u_1}
{N : Type u_2}
[Zero N]
(r : α → α → Prop)
{s : N → N → Prop}
[IsStrictTotalOrder α r]
[Finite α]
(hs : WellFounded s)


@[simp]
theorem smul_polynomial (m : M) (p : Polynomial (FixedPoints.subfield M F)) : m • p = p

(p : Polynomial ↥(FixedPoints.subfield M F))


@[fun_prop]
theorem hasFDerivAt_apply (i : ι) (f : ∀ i, F' i) :
    HasFDerivAt (𝕜 := 𝕜) (fun f : ∀ i, F' i => f i) (proj i) f

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

HasFDerivAt (fun f => f i) (ContinuousLinearMap.proj i) f


@[simp] theorem map_none' (f : α → β) : none.map f = none

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


theorem IsPurelyInseparable.natSepDegree_eq_one [IsPurelyInseparable F E] (x : E) :
    (minpoly F x).natSepDegree = 1

(F : Type u)
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
[IsPurelyInseparable F E]
(x : E)


theorem DifferentiableOn.sinh (hc : DifferentiableOn ℝ f s) :
    DifferentiableOn ℝ (fun x => Real.sinh (f x)) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{s : Set E}
(hc : DifferentiableOn ℝ f s)


theorem finite_ofLocalizationSpan : RingHom.OfLocalizationSpan @RingHom.Finite


theorem zeta_mul_pow_eq_sigma {k : ℕ} : ζ * pow k = σ k

ArithmeticFunction.zeta * ArithmeticFunction.pow k = ArithmeticFunction.sigma k


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


theorem intervalIntegrable_iff_integrableOn_Icc_of_le {f : ℝ → E} {a b : ℝ} (hab : a ≤ b)
    {μ : Measure ℝ} [NoAtoms μ] : IntervalIntegrable f μ a b ↔ IntegrableOn f (Icc a b) μ

{E : Type u_3}
[NormedAddCommGroup E]
{f : ℝ → E}
{a b : ℝ}
(hab : a ≤ b)
{μ : MeasureTheory.Measure ℝ}
[MeasureTheory.NoAtoms μ]

IntervalIntegrable f μ a b ↔ MeasureTheory.IntegrableOn f (Set.Icc a b) μ


@[elab_as_elim]
theorem GCD.induction {P : R → R → Prop} (a b : R) (H0 : ∀ x, P 0 x)
    (H1 : ∀ a b, a ≠ 0 → P (b % a) a → P a b) : P a b

(H1 : ∀ (a b : R), a ≠ 0 → P (b % a) a → P a b)


lemma exists_enumeration : ∃ f : s ≃ Σ t : P.parts, Fin t.1.card,
    ∀ a b : s, P.part a = P.part b ↔ (f a).1 = (f b).1

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
(P : Finpartition s)

∃ f, ∀ (a b : { x // x ∈ s }), P.part ↑a = P.part ↑b ↔ (f a).fst = (f b).fst


theorem coordChange_apply (a : VectorPrebundle R F E) {e e' : Pretrivialization F (π F E)}
    (he : e ∈ a.pretrivializationAtlas) (he' : e' ∈ a.pretrivializationAtlas) {b : B}
    (hb : b ∈ e.baseSet ∩ e'.baseSet) (v : F) :
    a.coordChange he he' b v = (e' ⟨b, e.symm b v⟩).2

{e e' : Pretrivialization F Bundle.TotalSpace.proj}

(a.coordChange he he' b) v = (↑e' { proj := b, snd := e.symm b v }).2


theorem nndist_le_distortion_mul (I : Box ι) (i : ι) :
    nndist I.lower I.upper ≤ I.distortion * nndist (I.lower i) (I.upper i)

{ι : Type u_1}
[Fintype ι]
(I : BoxIntegral.Box ι)
(i : ι)


@[simp]
theorem mapMatrix_comp (f : β →+* γ) (g : α →+* β) :
    f.mapMatrix.comp g.mapMatrix = ((f.comp g).mapMatrix : Matrix m m α →+* _)

{m : Type u_2}
{α : Type v}
{β : Type w}
{γ : Type u_9}
[Fintype m]
[DecidableEq m]
[NonAssocSemiring α]
[NonAssocSemiring β]
[NonAssocSemiring γ]
(f : β →+* γ)
(g : α →+* β)

f.mapMatrix.comp g.mapMatrix = (f.comp g).mapMatrix


lemma preNormEDS_even (m : ℕ) : preNormEDS b c d (2 * (m + 3)) =
    preNormEDS b c d (m + 2) ^ 2 * preNormEDS b c d (m + 3) * preNormEDS b c d (m + 5) -
      preNormEDS b c d (m + 1) * preNormEDS b c d (m + 3) * preNormEDS b c d (m + 4) ^ 2

{R : Type u}
[CommRing R]
(b c d : R)
(m : ℕ)

preNormEDS b c d (2 * (↑m + 3)) =
  preNormEDS b c d (↑m + 2) ^ 2 * preNormEDS b c d (↑m + 3) * preNormEDS b c d (↑m + 5) -
    preNormEDS b c d (↑m + 1) * preNormEDS b c d (↑m + 3) * preNormEDS b c d (↑m + 4) ^ 2


lemma upperSet_le_upper {t₁ t₂ : TopologicalSpace α} [@Topology.IsUpperSet α t₁ _]
    [@Topology.IsUpper α t₂ _] : t₁ ≤ t₂

{α : Type u_1}
[Preorder α]
{t₁ t₂ : TopologicalSpace α}
[Topology.IsUpperSet α]
[Topology.IsUpper α]


theorem repr_self_apply (j) [Decidable (i = j)] : b.repr (b i) j = if i = j then 1 else 0

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(i j : ι)
[Decidable (i = j)]

(b.repr (b i)) j = if i = j then 1 else 0


/-- If `R → A → B` is an algebra tower with `A → B` injective,
then if the entire tower is an integral extension so is `R → A` -/
theorem IsIntegral.tower_bot (H : Function.Injective (algebraMap A B)) {x : A}
    (h : IsIntegral R (algebraMap A B x)) : IsIntegral R x

(H : Function.Injective ⇑(algebraMap A B))


/-- Given a family of `n` linearly independent vectors in a space of dimension `> n`, one may extend
the family by another vector while retaining linear independence. -/
theorem exists_linearIndependent_snoc_of_lt_rank [StrongRankCondition R] {n : ℕ} {v : Fin n → M}
    (hv : LinearIndependent R v) (h : n < Module.rank R M) :
    ∃ (x : M), LinearIndependent R (Fin.snoc v x)

{R : Type u_1}
{M : Type u}
[Ring R]
[AddCommGroup M]
[Module R M]
[HasRankNullity.{u, u_1} R]
[StrongRankCondition R]
{n : ℕ}
{v : Fin n → M}
(hv : LinearIndependent R v)
(h : ↑n < Module.rank R M)


theorem ne_of_mem_of_not_mem' (h : a ∈ s) : a ∉ t → s ≠ t

{α : Type u_1}
{β : Type u_2}
[Membership α β]
{s t : β}
{a : α}
(h : a ∈ s)

¬a ∈ t → s ≠ t


@[to_additive]
theorem prod_set :
    ∀ (L : List M) (n : ℕ) (a : M),
      (L.set n a).prod =
        ((L.take n).prod * if n < L.length then a else 1) * (L.drop (n + 1)).prod

{M : Type u_4}
[AddMonoid M]
(L : List M)
(n : ℕ)
(a : M)

(L.set n a).sum = ((List.take n L).sum + if n < L.length then a else 0) + (List.drop (n + 1) L).sum


/-- The functor `(S, F) ⥤ (G(S), F ⋙ G)`. -/
@[simps]
def post (S : C) (F : B ⥤ C) (G : C ⥤ D) :
    StructuredArrow S F ⥤ StructuredArrow (G.obj S) (F ⋙ G)

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

∀ {X Y : CategoryTheory.StructuredArrow S F} (f : X ⟶ Y),
  (CategoryTheory.StructuredArrow.post S F G).map f = CategoryTheory.StructuredArrow.homMk f.right ⋯


/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed

(a : ((pointedToPartialFun ⋙ partialFunToPointed).obj X).X)

(partialFunEquivPointed.counitIso.hom.app X).toFun a = Option.casesOn' a X.point Subtype.val


theorem ord_compl_dvd_ord_compl_iff_dvd (a b : ℕ) :
    (∀ p : ℕ, ord_compl[p] a ∣ ord_compl[p] b) ↔ a ∣ b

(∀ (p : ℕ), a / p ^ a.factorization p ∣ b / p ^ b.factorization p) ↔ a ∣ b


theorem cycleOf_mem_cycleFactorsFinset_iff {f : Perm α} {x : α} :
    cycleOf f x ∈ cycleFactorsFinset f ↔ x ∈ f.support

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{f : Equiv.Perm α}
{x : α}

f.cycleOf x ∈ f.cycleFactorsFinset ↔ x ∈ f.support


@[simp]
theorem toLin_toMatrix [Finite ι] [Fintype ι'] [DecidableEq ι'] (v : Basis ι' R M) :
    Matrix.toLin v e (e.toMatrix v) = LinearMap.id

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_5}
{M : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(e : Basis ι R M)
[Finite ι]
[Fintype ι']
[DecidableEq ι']
(v : Basis ι' R M)

(Matrix.toLin v e) (e.toMatrix ⇑v) = LinearMap.id


@[simp]
theorem wbtw_zero_one_iff {x : R} : Wbtw R 0 x 1 ↔ x ∈ Set.Icc (0 : R) 1


theorem toFun_eq_coe (p : MulRingNorm R) : p.toFun = p

{R : Type u_2}
[NonAssocRing R]
(p : MulRingNorm R)


@[to_additive (attr := simp)]
theorem mul_self_lt_one_iff : a * a < 1 ↔ a < 1

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


/-- The clifford algebras over `CliffordAlgebraComplex.Q` is isomorphic as an `ℝ`-algebra to `ℂ`. -/
@[simps!]
protected def equiv : CliffordAlgebra Q ≃ₐ[ℝ] ℂ

CliffordAlgebraComplex.equiv.symm a = CliffordAlgebraComplex.ofComplex a


theorem ndinter_subset_right (s t : Multiset α) : ndinter s t ⊆ t

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


theorem ne_zero_of_not_supDegree_le {b : B} (h : ¬ p.supDegree D ≤ b) : p ≠ 0

(h : ¬AddMonoidAlgebra.supDegree D p ≤ b)


@[to_additive]
theorem bot_eq_one : (⊥ : α) = 1

{α : Type u}
[CanonicallyOrderedAddCommMonoid α]


/-- Inversion `x ↦ x⁻¹` as an `IsometryEquiv`. -/
@[to_additive (attr := simps! apply toEquiv) "Negation `x ↦ -x` as an `IsometryEquiv`."]
def inv : G ≃ᵢ G

(G : Type v)
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul G G]
[IsometricSMul Gᵐᵒᵖ G]

(IsometryEquiv.inv G).toEquiv = Equiv.inv G


@[simp]
theorem coe_toSubalgebra : (S.toSubalgebra : Set L) = S

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


@[simp]
theorem inr_mem_disjSum : inr b ∈ s.disjSum t ↔ b ∈ t

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
{b : β}


@[to_additive (attr := measurability)]
theorem Measurable.const_smul (hg : Measurable g) (c : M) : Measurable (c • g)

{M : Type u_2}
{β : Type u_3}
{α : Type u_4}
[MeasurableSpace M]
[MeasurableSpace β]
[SMul M β]
{m : MeasurableSpace α}
{g : α → β}
[MeasurableSMul M β]
(hg : Measurable g)
(c : M)


theorem add_le_add_add_tsub : a + b ≤ a + c + (b - c)

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


@[simp] protected theorem min_zero (a) : min a 0 = 0


/-- The degree of a product of polynomials is equal to
the sum of the degrees, where the degree of the zero polynomial is ⊥.
-/
theorem degree_multiset_prod [Nontrivial R] : t.prod.degree = (t.map fun f => degree f).sum

{R : Type u}
[CommSemiring R]
[NoZeroDivisors R]
(t : Multiset R[X])
[Nontrivial R]

t.prod.degree = (Multiset.map (fun f => f.degree) t).sum


protected theorem one_mul : (1 : MvPowerSeries σ R) * φ = φ

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(φ : MvPowerSeries σ R)


theorem summable_comp_injective {β : Type*} {f : α → ℝ≥0} (hf : Summable f) {i : β → α}
    (hi : Function.Injective i) : Summable (f ∘ i)

{α : Type u_1}
{β : Type u_2}
{f : α → NNReal}
(hf : Summable f)
{i : β → α}
(hi : Function.Injective i)


@[to_additive]
theorem index_iInf_ne_zero {ι : Type*} [Finite ι] {f : ι → Subgroup G}
    (hf : ∀ i, (f i).index ≠ 0) : (⨅ i, f i).index ≠ 0

{G : Type u_1}
[Group G]
{ι : Type u_3}
[Finite ι]
{f : ι → Subgroup G}
(hf : ∀ (i : ι), (f i).index ≠ 0)


/-- The type of `1`-hypercovers of an object `S : C` in a category equipped with a
Grothendieck topology `J`. This can be constructed from a covering of `S` and
a covering of the fibre products of the objects in this covering (see `OneHypercover.mk'`). -/
structure OneHypercover (S : C) extends PreOneHypercover.{w} S where
  mem₀ : toPreOneHypercover.sieve₀ ∈ J S
  mem₁ (i₁ i₂ : I₀) ⦃W : C⦄ (p₁ : W ⟶ X i₁) (p₂ : W ⟶ X i₂) (w : p₁ ≫ f i₁ = p₂ ≫ f i₂) :
    toPreOneHypercover.sieve₁ p₁ p₂ ∈ J W

{J : CategoryTheory.GrothendieckTopology C}

(w : CategoryTheory.CategoryStruct.comp p₁ (self.f i₁) = CategoryTheory.CategoryStruct.comp p₂ (self.f i₂))


/-- The associator isomorphism which associates a binary biproduct. -/
@[simps]
def biprod.associator (P Q R : C) : (P ⊞ Q) ⊞ R ≅ P ⊞ (Q ⊞ R)

(CategoryTheory.Limits.biprod.associator P Q R).hom =
  CategoryTheory.Limits.biprod.lift (CategoryTheory.Limits.biprod.fst ≫ CategoryTheory.Limits.biprod.fst)
    (CategoryTheory.Limits.biprod.lift (CategoryTheory.Limits.biprod.fst ≫ CategoryTheory.Limits.biprod.snd)
      CategoryTheory.Limits.biprod.snd)


@[simp]
theorem linearMap_apply (r : R) : Algebra.linearMap R A r = algebraMap R A r

(R : Type u)
(A : Type w)
[CommSemiring R]
[Semiring A]
[Algebra R A]
(r : R)

(Algebra.linearMap R A) r = (algebraMap R A) r


@[simp]
theorem equivRealProd_symm_apply (p : ℝ × ℝ) : equivRealProd.symm p = p.1 + p.2 * I

Complex.equivRealProd.symm p = ↑p.1 + ↑p.2 * Complex.I


theorem isBlock_singleton (a : X) : IsBlock G ({a} : Set X)

{G : Type u_1}
{X : Type u_2}
[SMul G X]
(a : X)


/-- A positive cone in a ring consists of a positive cone in underlying `AddCommGroup`,
which contains `1` and such that the positive elements are closed under multiplication. -/
structure PositiveCone (α : Type*) [Ring α] extends AddCommGroup.PositiveCone α where
  /-- In a positive cone, `1` is `nonneg` -/
  one_nonneg : nonneg 1
  /-- In a positive cone, if `a` and `b` are `pos` then so is `a * b` -/
  mul_pos : ∀ a b, pos a → pos b → pos (a * b)

{α : Type u_2}
[Ring α]
(self : Ring.PositiveCone α)
(a b : α)

self.pos a → self.pos b → self.pos (a * b)


@[to_additive]
theorem extend_inv [Inv γ] (f : α → β) (g : α → γ) (e : β → γ) :
    Function.extend f g⁻¹ e⁻¹ = (Function.extend f g e)⁻¹

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Inv γ]
(f : α → β)
(g : α → γ)
(e : β → γ)


@[csimp] theorem eraseIdx_eq_eraseIdxTR : @eraseIdx = @eraseIdxTR


theorem exists_nat_eq_of_le_nat {c : Cardinal} {n : ℕ} (h : c ≤ n) : ∃ m, m ≤ n ∧ c = m

{c : Cardinal.{u_1}}
{n : ℕ}
(h : c ≤ ↑n)


@[ext]
lemma Triangle.hom_ext {A B : Triangle C} (f g : A ⟶ B)
    (h₁ : f.hom₁ = g.hom₁) (h₂ : f.hom₂ = g.hom₂) (h₃ : f.hom₃ = g.hom₃) : f = g

{A B : CategoryTheory.Pretriangulated.Triangle C}


theorem differentiable_sin : Differentiable ℂ sin


/-- Not an instance since `𝕜` can't be inferred. See `NormedSpace.toLocallyConvexSpace` for a
slightly weaker instance version. -/
theorem NormedSpace.toLocallyConvexSpace' [NormedSpace 𝕜 E] [Module ℝ E] [IsScalarTower ℝ 𝕜 E] :
    LocallyConvexSpace ℝ E

(𝕜 : Type u_1)
{E : Type u_5}
[NormedField 𝕜]
[NormedSpace ℝ 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
[Module ℝ E]
[IsScalarTower ℝ 𝕜 E]


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

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


theorem not_le_of_lt {x y : Int} (h : y < x) : ¬ (x ≤ y)


lemma iCondIndepSet_iff (s : ι → Set Ω) (hs : ∀ i, MeasurableSet (s i))
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSet m' hm' s μ ↔
      ∀ S : Finset ι, μ⟦⋂ i ∈ S, s i | m'⟧ =ᵐ[μ] ∏ i ∈ S, μ⟦s i | m'⟧

{Ω : Type u_1}
{ι : Type u_2}
(m' : MeasurableSpace Ω)
{mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
(hm' : m' ≤ mΩ)
(s : ι → Set Ω)
(hs : ∀ (i : ι), MeasurableSet (s i))
(μ : MeasureTheory.Measure Ω)
[MeasureTheory.IsFiniteMeasure μ]

ProbabilityTheory.iCondIndepSet m' hm' s μ ↔
  ∀ (S : Finset ι), μ[(⋂ i ∈ S, s i).indicator fun ω => 1|m'] =ᵐ[μ] ∏ i ∈ S, μ[(s i).indicator fun ω => 1|m']


@[simp] lemma mk_coe (f : α →*₀ β) (h1 hmul) : mk f h1 hmul = f

(hmul : ∀ (x y : α), (↑f).toFun (x * y) = (↑f).toFun x * (↑f).toFun y)

{ toZeroHom := ↑f, map_one' := h1, map_mul' := hmul } = f


@[to_additive]
theorem smul_set_subset_iff : a • s ⊆ t ↔ ∀ ⦃b⦄, b ∈ s → a • b ∈ t

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

a • s ⊆ t ↔ ∀ ⦃b : β⦄, b ∈ s → a • b ∈ t


/-- Relabels a term's variables along a bijection. -/
@[simps]
def relabelEquiv (g : α ≃ β) : L.Term α ≃ L.Term β

{L : FirstOrder.Language}
{α : Type u'}
{β : Type v'}
(g : α ≃ β)

∀ (a : L.Term α), (FirstOrder.Language.Term.relabelEquiv g) a = FirstOrder.Language.Term.relabel (⇑g) a


/-- `Pi.mulSingle i x` is continuous in `x`. -/
-- Porting note (#11215): TODO: restore @[continuity]
@[to_additive "`Pi.single i x` is continuous in `x`."]
theorem continuous_mulSingle [∀ i, One (π i)] [DecidableEq ι] (i : ι) :
    Continuous fun x => (Pi.mulSingle i x : ∀ i, π i)

{ι : Type u_5}
{π : ι → Type u_6}
[T : (i : ι) → TopologicalSpace (π i)]
[(i : ι) → Zero (π i)]
[DecidableEq ι]
(i : ι)


theorem restrict_union_add_inter' (hs : MeasurableSet s) (t : Set α) :
    μ.restrict (s ∪ t) + μ.restrict (s ∩ t) = μ.restrict s + μ.restrict t

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


@[simp]
theorem support_inf : (f ⊓ g).support = f.support ∩ g.support

[(i : ι) → CanonicallyLinearOrderedAddCommMonoid (α i)]


@[to_additive]
theorem exponent_eq_iSup_orderOf (h : ∀ g : G, 0 < orderOf g) :
    exponent G = ⨆ g : G, orderOf g

{G : Type u}
[AddCommMonoid G]
(h : ∀ (g : G), 0 < addOrderOf g)

AddMonoid.exponent G = ⨆ g, addOrderOf g


theorem C_dvd_iff_dvd_coeff (r : R) (φ : R[X]) : C r ∣ φ ↔ ∀ i, r ∣ φ.coeff i

{R : Type u}
[Semiring R]
(r : R)
(φ : R[X])

Polynomial.C r ∣ φ ↔ ∀ (i : ℕ), r ∣ φ.coeff i


@[simp]
theorem subtype_comp_inclusion {S₁ S₂ : StarSubalgebra R A} (h : S₁ ≤ S₂) :
    S₂.subtype.comp (inclusion h) = S₁.subtype

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

S₂.subtype.comp (StarSubalgebra.inclusion h) = S₁.subtype


/-- If we single out one member of an affine-independent family of points and affinely transport
all others along the line joining them to this member, the resulting new family of points is affine-
independent.

This is the affine version of `LinearIndependent.units_smul`. -/
theorem AffineIndependent.units_lineMap {p : ι → P} (hp : AffineIndependent k p) (j : ι)
    (w : ι → Units k) : AffineIndependent k fun i => AffineMap.lineMap (p j) (p i) (w i : k)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
{p : ι → P}
(hp : AffineIndependent k p)
(j : ι)
(w : ι → kˣ)

AffineIndependent k fun i => (AffineMap.lineMap (p j) (p i)) ↑(w i)


@[mono]
theorem log_mono_right {b : ℕ} {r₁ r₂ : R} (h₀ : 0 < r₁) (h : r₁ ≤ r₂) : log b r₁ ≤ log b r₂

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
{b : ℕ}
{r₁ r₂ : R}
(h₀ : 0 < r₁)
(h : r₁ ≤ r₂)


@[to_additive two_smul_mem_of_index_two]
theorem sq_mem_of_index_two (h : H.index = 2) (a : G) : a ^ 2 ∈ H

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
(h : H.index = 2)
(a : G)


@[simp]
theorem inf_Prop_eq : (· ⊓ ·) = (· ∧ ·)

(fun x x_1 => x ⊓ x_1) = fun x x_1 => x ∧ x_1


@[to_additive]
theorem iIndepFun.indepFun_finset_prod_of_not_mem (hf_Indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) {s : Finset ι} {i : ι} (hi : i ∉ s) :
    IndepFun (∏ j ∈ s, f j) (f i) κ μ

{f : ι → Ω → β}

(hf_Indep : ProbabilityTheory.Kernel.iIndepFun (fun x => m) f κ μ)

ProbabilityTheory.Kernel.IndepFun (∑ j ∈ s, f j) (f i) κ μ


/-- The canonical bijection between objects in a category and its
localization with respect to a morphism_property `W` -/
@[simps]
def objEquiv : C ≃ W.Localization

{C : Type uC}
[CategoryTheory.Category.{uC', uC} C]
(W : CategoryTheory.MorphismProperty C)

∀ (a : C), (CategoryTheory.Localization.Construction.objEquiv W) a = W.Q.obj a


theorem vadd_mem_fundamentalDomain [Fintype ι] (y : span ℤ (Set.range b)) (x : E) :
    y +ᵥ x ∈ fundamentalDomain b ↔ y = -floor b x

(y : ↥(Submodule.span ℤ (Set.range ⇑b)))

y +ᵥ x ∈ Zspan.fundamentalDomain b ↔ y = -Zspan.floor b x


@[to_additive (attr := simp)]
theorem op_top : (⊤ : Subgroup G).op = ⊤


@[simp]
theorem derivedSeries_zero : derivedSeries G 0 = ⊤


theorem not_eq_key {a} {l : List (Sigma β)} : a ∉ l.keys ↔ ∀ s : Sigma β, s ∈ l → a ≠ s.1

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


@[simp]
theorem ofLEMk_comp {B A : C} {X : Subobject B} {f : A ⟶ B} [Mono f] (h : X ≤ mk f) :
    ofLEMk X f h ≫ f = X.arrow

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{B A : C}
{X : CategoryTheory.Subobject B}
{f : A ⟶ B}
[CategoryTheory.Mono f]
(h : X ≤ CategoryTheory.Subobject.mk f)

CategoryTheory.CategoryStruct.comp (X.ofLEMk f h) f = X.arrow


@[to_additive]
protected theorem bijective (e : M ≃* N) : Function.Bijective e

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(e : M ≃* N)


theorem support_toPOUFun_subset (i : ι) : support (f.toPOUFun i) ⊆ support (f i)

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(f : BumpCovering ι X s)
(i : ι)

Function.support (f.toPOUFun i) ⊆ Function.support ⇑(f i)


/-- If a function is analytic on a set `s`, so are its successive Fréchet derivative. -/
theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n : ℕ) :
    AnalyticOn 𝕜 (iteratedFDeriv 𝕜 n f) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
[CompleteSpace F]
(h : AnalyticOn 𝕜 f s)
(n : ℕ)


@[simp] theorem div_pos_iff : 0 < a / b ↔ a ≠ 0 ∧ b ≠ ∞


protected theorem wellFounded [RelHomClass F r s] (f : F) : WellFounded s → WellFounded r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
{F : Type u_5}
[FunLike F α β]
[RelHomClass F r s]
(f : F)


private theorem someExistsOneDivLT_spec (hi : ¬s ≤[i] 0) :
    someExistsOneDivLT s i ⊆ i ∧
      MeasurableSet (someExistsOneDivLT s i) ∧
        (1 / (findExistsOneDivLT s i + 1) : ℝ) < s (someExistsOneDivLT s i)

(hi : ¬MeasureTheory.VectorMeasure.restrict s i ≤ MeasureTheory.VectorMeasure.restrict 0 i)

MeasureTheory.SignedMeasure.someExistsOneDivLT s i ⊆ i ∧
  MeasurableSet (MeasureTheory.SignedMeasure.someExistsOneDivLT s i) ∧
    1 / (↑(MeasureTheory.SignedMeasure.findExistsOneDivLT s i) + 1) <
      ↑s (MeasureTheory.SignedMeasure.someExistsOneDivLT s i)


lemma eventually_ne_cobounded (a : α) : ∀ᶠ x in cobounded α, x ≠ a

∀ᶠ (x : α) in Bornology.cobounded α, x ≠ a


theorem mem_closure_iff {s : Set R} {x} :
    x ∈ closure s ↔ x ∈ AddSubgroup.closure (Subsemigroup.closure s : Set R)

{R : Type u}
[NonUnitalNonAssocRing R]
{s : Set R}
{x : R}

x ∈ NonUnitalSubring.closure s ↔ x ∈ AddSubgroup.closure ↑(Subsemigroup.closure s)


/-- An element `x` lies in the span of `v` iff it can be written as sum `∑ cᵢ • vᵢ = x`.
-/
theorem mem_ideal_span_range_iff_exists_fun [Fintype α] {x : R} {v : α → R} :
    x ∈ Ideal.span (Set.range v) ↔ ∃ c : α → R, ∑ i, c i * v i = x

{α : Type u_1}
{R : Type u_2}
[Semiring R]
[Fintype α]
{x : R}
{v : α → R}

x ∈ Ideal.span (Set.range v) ↔ ∃ c, ∑ i : α, c i * v i = x


theorem det_of_lowerTriangular [LinearOrder m] (M : Matrix m m R) (h : M.BlockTriangular toDual) :
    M.det = ∏ i : m, M i i

(h : M.BlockTriangular ⇑OrderDual.toDual)


theorem closure_iSup_closure (f : ι → α) : u (l (⨆ i, u (l (f i)))) = u (l (⨆ i, f i))

{α : Type u_1}
{ι : Sort u_2}
{β : Type u_4}
[CompleteLattice α]
[Preorder β]
{u : β → α}
(l : LowerAdjoint u)
(f : ι → α)

u (l.toFun (⨆ i, u (l.toFun (f i)))) = u (l.toFun (⨆ i, f i))


theorem not_summable_iff_tendsto_nat_atTop {f : ℕ → ℝ≥0} :
    ¬Summable f ↔ Tendsto (fun n : ℕ => ∑ i ∈ Finset.range n, f i) atTop atTop

¬Summable f ↔ Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, f i) Filter.atTop Filter.atTop


@[simp]
protected theorem map_smul [DecidableEq ι] (m : ∀ i, M₁ i) (i : ι) (c : R) (x : M₁ i) :
    f (update m i (c • x)) = c • f (update m i x)

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)
[DecidableEq ι]
(m : (i : ι) → M₁ i)
(i : ι)
(c : R)
(x : M₁ i)

f (Function.update m i (c • x)) = c • f (Function.update m i x)


@[simp]
theorem toIcoDiv_zsmul_sub_toIcoMod (a b : α) : toIcoDiv hp a b • p + toIcoMod hp a b = b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a b : α)


theorem ker_eq_bot' {f : F} : ker f = ⊥ ↔ ∀ m, f m = 0 → m = 0

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_6}
{M₂ : Type u_8}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_12}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
{f : F}

LinearMap.ker f = ⊥ ↔ ∀ (m : M), f m = 0 → m = 0


theorem toReal_add {x y : EReal} (hx : x ≠ ⊤) (h'x : x ≠ ⊥) (hy : y ≠ ⊤) (h'y : y ≠ ⊥) :
    toReal (x + y) = toReal x + toReal y


@[simp]
theorem singleMapHomologicalComplex_hom_app_ne {i j : ι} (h : i ≠ j) (X : W₁) :
    ((singleMapHomologicalComplex F c j).hom.app X).f i = 0

((HomologicalComplex.singleMapHomologicalComplex F c j).hom.app X).f i = 0


theorem map_def {f : α → γ} {g : β → δ} : Prod.map f g = fun p : α × β ↦ (f p.1, g p.2)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{f : α → γ}
{g : β → δ}


@[simp, norm_cast]
theorem coe_sub {a b : α} : (↑(a - b) : WithTop α) = ↑a - ↑b

{α : Type u_1}
[Sub α]
[Bot α]
{a b : α}


theorem lookupFinsupp_eq_iff_of_ne_zero [DecidableEq α] {l : AList fun _x : α => M} {a : α} {x : M}
    (hx : x ≠ 0) : l.lookupFinsupp a = x ↔ x ∈ l.lookup a

{α : Type u_1}
{M : Type u_2}
[Zero M]
[DecidableEq α]
{l : AList fun _x => M}
{a : α}
{x : M}
(hx : x ≠ 0)

l.lookupFinsupp a = x ↔ x ∈ AList.lookup a l


theorem dist_eq_zero {n m : ℕ} (h : n = m) : dist n m = 0


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


theorem isAcyclic_iff_path_unique : G.IsAcyclic ↔ ∀ ⦃v w : V⦄ (p q : G.Path v w), p = q


/-- Intermediate stage of assembling the unit. -/
@[simps]
def unitAuxAuxAux {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X : C) :
    YonedaCollection (restrictedYonedaObj η) X ≅ F.obj (op X)

{A F : CategoryTheory.Functor Cᵒᵖ (Type v)}

∀ (a : CategoryTheory.OverPresheafAux.YonedaCollection (CategoryTheory.OverPresheafAux.restrictedYonedaObj η) X),
  (CategoryTheory.OverPresheafAux.unitAuxAuxAux η X).hom a = CategoryTheory.OverPresheafAux.unitForward η X a


theorem Nat.mul_divisors_filter_prime_pow {a b : ℕ} (hab : a.Coprime b) :
    (a * b).divisors.filter IsPrimePow = (a.divisors ∪ b.divisors).filter IsPrimePow

Finset.filter IsPrimePow (a * b).divisors = Finset.filter IsPrimePow (a.divisors ∪ b.divisors)


theorem IsIntegral.mem_intermediateField_of_minpoly_splits {x : L} (int : IsIntegral K x)
    {F : IntermediateField K L} (h : Splits (algebraMap K F) (minpoly K x)) : x ∈ F

(h : Polynomial.Splits (algebraMap K ↥F) (minpoly K x))


protected theorem lt_succ_iff {r : α → α → Prop} [wo : IsWellOrder α r] {x : α} (h : ∃ y, r x y)
    (y : α) : r y (wo.wf.succ x) ↔ r y x ∨ y = x

{α : Type u_1}
{r : α → α → Prop}
[wo : IsWellOrder α r]
{x : α}
(h : ∃ y, r x y)
(y : α)


theorem mem_span_insert' {x y} {s : Set M} :
    x ∈ span R (insert y s) ↔ ∃ a : R, x + a • y ∈ span R s

{R : Type u_1}
{M : Type u_4}
[Ring R]
[AddCommGroup M]
[Module R M]
{x y : M}
{s : Set M}

x ∈ Submodule.span R (insert y s) ↔ ∃ a, x + a • y ∈ Submodule.span R s


@[simp] theorem matPolyEquiv_map_C (M : Matrix n n R) : matPolyEquiv (M.map C) = C M

{R : Type u_1}
[CommSemiring R]
{n : Type w}
[DecidableEq n]
[Fintype n]
(M : Matrix n n R)

matPolyEquiv (M.map ⇑Polynomial.C) = Polynomial.C M


theorem essSup_congr_ae {f g : α → β} (hfg : f =ᵐ[μ] g) : essSup f μ = essSup g μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[ConditionallyCompleteLattice β]
{f g : α → β}
(hfg : f =ᵐ[μ] g)


theorem roots_expand_image_frobenius [DecidableEq R] :
    (expand R p f).roots.toFinset.image (frobenius R p) = f.roots.toFinset

{R : Type u_1}
[CommRing R]
[IsDomain R]
{p : ℕ}
[ExpChar R p]
{f : R[X]}
[PerfectRing R p]
[DecidableEq R]

Finset.image (⇑(frobenius R p)) ((Polynomial.expand R p) f).roots.toFinset = f.roots.toFinset


theorem union_comm (s t : Multiset α) : s ∪ t = t ∪ s

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


theorem hpath_hext {p₁ : Path x₀ x₁} {p₂ : Path x₂ x₃} (hp : ∀ t, p₁ t = p₂ t) :
    @HEq (Path.Homotopic.Quotient _ _) ⟦p₁⟧ (Path.Homotopic.Quotient _ _) ⟦p₂⟧

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ x₂ x₃ : X}
{p₁ : Path x₀ x₁}
{p₂ : Path x₂ x₃}
(hp : ∀ (t : ↑I), p₁ t = p₂ t)

HEq ⟦p₁⟧ ⟦p₂⟧


theorem Icc_ssubset_Icc_right (hI : a₂ ≤ b₂) (ha : a₂ ≤ a₁) (hb : b₁ < b₂) :
    Icc a₁ b₁ ⊂ Icc a₂ b₂

{α : Type u_1}
[Preorder α]
{a₁ a₂ b₁ b₂ : α}
(hI : a₂ ≤ b₂)
(ha : a₂ ≤ a₁)
(hb : b₁ < b₂)


/-- The sum of weighted homogeneous polynomials of degree `n` is weighted homogeneous of
  weighted degree `n`. -/
theorem sum {ι : Type*} (s : Finset ι) (φ : ι → MvPolynomial σ R) (n : M) {w : σ → M}
    (h : ∀ i ∈ s, IsWeightedHomogeneous w (φ i) n) : IsWeightedHomogeneous w (∑ i ∈ s, φ i) n

(h : ∀ i ∈ s, MvPolynomial.IsWeightedHomogeneous w (φ i) n)

MvPolynomial.IsWeightedHomogeneous w (∑ i ∈ s, φ i) n


/-- Equality of sigma types is sufficient (but not necessary) to show equality of `DFinsupp`s. -/
theorem single_eq_of_sigma_eq {i j} {xi : β i} {xj : β j} (h : (⟨i, xi⟩ : Sigma β) = ⟨j, xj⟩) :
    DFinsupp.single i xi = DFinsupp.single j xj

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
{i j : ι}
{xi : β i}
{xj : β j}
(h : ⟨i, xi⟩ = ⟨j, xj⟩)


/-- If `m ⊗ n ≅ 𝟙_M` and `n ⊗ m ≅ 𝟙_M` (subject to some commuting constraints),
  then `F.obj m` and `F.obj n` forms a self-equivalence of `C`. -/
@[simps]
noncomputable def equivOfTensorIsoUnit (m n : M) (h₁ : m ⊗ n ≅ 𝟙_ M) (h₂ : n ⊗ m ≅ 𝟙_ M)
    (H : h₁.hom ▷ m ≫ (λ_ m).hom = (α_ m n m).hom ≫ m ◁ h₂.hom ≫ (ρ_ m).hom) : C ≌ C

(F : CategoryTheory.MonoidalFunctor M (CategoryTheory.Functor C C))

(h₁ : CategoryTheory.MonoidalCategory.tensorObj m n ≅ 𝟙_ M)

(h₂ : CategoryTheory.MonoidalCategory.tensorObj n m ≅ 𝟙_ M)

(H :
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerRight h₁.hom m)
      (CategoryTheory.MonoidalCategory.leftUnitor m).hom =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator m n m).hom
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft m h₂.hom)
        (CategoryTheory.MonoidalCategory.rightUnitor m).hom))

(CategoryTheory.equivOfTensorIsoUnit F m n h₁ h₂ H).inverse = F.obj n


theorem preimage_eq_empty_iff {s : Set β} : f ⁻¹' s = ∅ ↔ Disjoint s (range f)

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


theorem ofConjAct_zero : ofConjAct (0 : ConjAct G₀) = 0


/-- A graph embedding induces an embedding of edge sets. -/
@[simps]
def mapEdgeSet : G.edgeSet ↪ G'.edgeSet

{V : Type u_1}
{W : Type u_2}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G ↪g G')
(e : ↑G.edgeSet)

f.mapEdgeSet e = SimpleGraph.Hom.mapEdgeSet (RelEmbedding.toRelHom f) e


/-- A cone on `F` with cone point `X` is the same as an element of `lim Hom(X, F·)`,
    naturally in `F` and `X`. -/
@[simps!]
noncomputable def whiskeringLimYonedaIsoCones : whiskeringLeft _ _ _ ⋙
    (whiskeringRight _ _ _).obj lim ⋙ (whiskeringLeft _ _ _).obj coyoneda ≅ cones J C

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

∀ (X_1 : Cᵒᵖ)
  (a :
    (CategoryTheory.coyoneda ⋙ (CategoryTheory.whiskeringLeft J C (Type v)).obj X ⋙ CategoryTheory.Limits.lim).obj X_1)
  (j : J),
  (((CategoryTheory.Limits.whiskeringLimYonedaIsoCones J C).hom.app X).app X_1 a).app j =
    CategoryTheory.Limits.limit.π (X ⋙ CategoryTheory.coyoneda.obj X_1) j a


@[simp]
theorem ofLeftInverse_apply {g : S → R} {f : R →+* S} (h : Function.LeftInverse g f) (x : R) :
    ↑(ofLeftInverse h x) = f x

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
{g : S → R}
{f : R →+* S}
(h : Function.LeftInverse g ⇑f)
(x : R)


theorem self_mem_adjoin_singleton (x : A) : x ∈ adjoin R ({x} : Set A)

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


theorem infinitePos_iff_infinite_and_pos {x : ℝ*} : InfinitePos x ↔ Infinite x ∧ 0 < x


¬a → ¬b ↔ b → a


@[simp, norm_cast]
lemma coe_intCast (Γ : Subgroup SL(2, ℤ)) (z : ℤ) :
    ⇑(z : ModularForm Γ 0) = z


theorem hasSum_one_div_nat_pow_mul_fourier {k : ℕ} (hk : 2 ≤ k) {x : ℝ} (hx : x ∈ Icc (0 : ℝ) 1) :
    HasSum
      (fun n : ℕ =>
        (1 : ℂ) / (n : ℂ) ^ k * (fourier n (x : 𝕌) + (-1 : ℂ) ^ k * fourier (-n) (x : 𝕌)))
      (-(2 * π * I) ^ k / k ! * bernoulliFun k x)

{k : ℕ}
(hk : 2 ≤ k)
{x : ℝ}
(hx : x ∈ Set.Icc 0 1)

HasSum (fun n => 1 / ↑n ^ k * ((fourier ↑n) ↑x + (-1) ^ k * (fourier (-↑n)) ↑x))
  (-(2 * ↑π * Complex.I) ^ k / ↑k ! * ↑(bernoulliFun k x))


@[simp]
theorem csSup_Icc (h : a ≤ b) : sSup (Icc a b) = b

{α : Type u_1}
[ConditionallyCompleteLattice α]
{a b : α}
(h : a ≤ b)


theorem strictMono_mul_right_of_pos [MulPosStrictMono α]
    (ha : 0 < a) : StrictMono fun x => x * a

{α : Type u}
[Semiring α]
[PartialOrder α]
{a : α}
[MulPosStrictMono α]
(ha : 0 < a)


/-- If `f` is monic, the powers of `h.root` form a basis. -/
@[simps! gen dim basis]
def powerBasis (h : IsAdjoinRootMonic S f) : PowerBasis R S

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)


@[to_additive]
theorem SemiconjBy.function_semiconj_mul_left (h : SemiconjBy a b c) :
    Function.Semiconj (a * ·) (b * ·) (c * ·)

{G : Type u_3}
[AddSemigroup G]
{a b c : G}
(h : AddSemiconjBy a b c)

Function.Semiconj (fun x => a + x) (fun x => b + x) fun x => c + x


theorem lcm_mul_right {m n k : ℕ} : (m * n).lcm (k * n) = m.lcm k * n


theorem closure_preimage_le (f : F) (s : Set S) :
    closure ((f : R → S) ⁻¹' s) ≤ (closure s).comap f

{F : Type w}
{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
[FunLike F R S]
[NonUnitalRingHomClass F R S]
(f : F)
(s : Set S)

NonUnitalSubring.closure (⇑f ⁻¹' s) ≤ NonUnitalSubring.comap f (NonUnitalSubring.closure s)


theorem mapsTo_gaugeRescale_interior (h₀ : t ∈ 𝓝 0) (hc : Convex ℝ t) :
    MapsTo (gaugeRescale s t) (interior s) (interior t)

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
{s t : Set E}
(h₀ : t ∈ 𝓝 0)
(hc : Convex ℝ t)

Set.MapsTo (gaugeRescale s t) (interior s) (interior t)


/-- A polynomial of weightedTotalDegree `⊥` is weighted_homogeneous of degree `⊥`. -/
theorem isWeightedHomogeneous_of_total_degree_zero [SemilatticeSup M] [OrderBot M] (w : σ → M)
    {p : MvPolynomial σ R} (hp : weightedTotalDegree w p = (⊥ : M)) :
    IsWeightedHomogeneous w p (⊥ : M)

(hp : MvPolynomial.weightedTotalDegree w p = ⊥)

MvPolynomial.IsWeightedHomogeneous w p ⊥


theorem cpow_add {x : ℂ} (y z : ℂ) (hx : x ≠ 0) : x ^ (y + z) = x ^ y * x ^ z


theorem symplectic_det (hA : A ∈ symplecticGroup l R) : IsUnit <| det A

{l : Type u_1}
{R : Type u_2}
[DecidableEq l]
[Fintype l]
[CommRing R]
{A : Matrix (l ⊕ l) (l ⊕ l) R}
(hA : A ∈ Matrix.symplecticGroup l R)


theorem quotientInfEquivSupQuotient_symm_apply_right (p p' : Submodule R M) {x : ↥(p ⊔ p')}
    (hx : (x : M) ∈ p') : (quotientInfEquivSupQuotient p p').symm (Submodule.Quotient.mk x)
    = 0

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p p' : Submodule R M)
{x : ↥(p ⊔ p')}
(hx : ↑x ∈ p')

(LinearMap.quotientInfEquivSupQuotient p p').symm (Submodule.Quotient.mk x) = 0


/-- The functor `C ⥤ Triangle C` which sends `X` to `contractibleTriangle X`. -/
@[simps]
def contractibleTriangleFunctor [HasZeroObject C] [HasZeroMorphisms C] : C ⥤ Triangle C

∀ {X Y : C} (f : X ⟶ Y), ((CategoryTheory.Pretriangulated.contractibleTriangleFunctor C).map f).hom₁ = f


@[to_additive (attr := simp)]
theorem prod_univ_two [CommMonoid β] (f : Fin 2 → β) : ∏ i, f i = f 0 * f 1

{β : Type u_2}
[CommMonoid β]
(f : Fin 2 → β)


/-- The equivalence `Square C ≌ Arrow (Arrow C)` which sends a
commutative square `sq` to the obvious arrow from the left morphism of `sq`
to the right morphism of `sq`. -/
@[simps]
def arrowArrowEquivalence : Square C ≌ Arrow (Arrow C)

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


@[to_additive (attr := mono)]
theorem toSubmonoid_mono : Monotone (toSubmonoid : Subgroup G → Submonoid G)


theorem arrow_mk_iso_iff (P : MorphismProperty C) [RespectsIso P] {W X Y Z : C}
    {f : W ⟶ X} {g : Y ⟶ Z} (e : Arrow.mk f ≅ Arrow.mk g) : P f ↔ P g

(e : CategoryTheory.Arrow.mk f ≅ CategoryTheory.Arrow.mk g)


theorem exists_reduced_fraction (x : K) :
    ∃ (a : A) (b : nonZeroDivisors A), IsRelPrime a b ∧ mk' K a b = x

(A : Type u_4)
[CommRing A]
[IsDomain A]
[UniqueFactorizationMonoid A]
{K : Type u_5}
[Field K]
[Algebra A K]
[IsFractionRing A K]
(x : K)

∃ a b, IsRelPrime a ↑b ∧ IsLocalization.mk' K a b = x


theorem abs_div_tendsto_atTop_of_degree_gt (hdeg : Q.degree < P.degree) (hQ : Q ≠ 0) :
    Tendsto (fun x => |eval x P / eval x Q|) atTop atTop

{𝕜 : Type u_1}
[NormedLinearOrderedField 𝕜]
(P Q : 𝕜[X])
[OrderTopology 𝕜]
(hdeg : Q.degree < P.degree)
(hQ : Q ≠ 0)

Filter.Tendsto (fun x => |Polynomial.eval x P / Polynomial.eval x Q|) Filter.atTop Filter.atTop


@[to_additive]
theorem lift_of_eq_id (α) : lift of = MonoidHom.id (FreeGroup α)

FreeAddGroup.lift FreeAddGroup.of = AddMonoidHom.id (FreeAddGroup α)


lemma leftHomology_ext_iff {A : C} (f₁ f₂ : S.leftHomology ⟶ A) :
    f₁ = f₂ ↔ S.leftHomologyπ ≫ f₁ = S.leftHomologyπ ≫ f₂

f₁ = f₂ ↔ CategoryTheory.CategoryStruct.comp S.leftHomologyπ f₁ = CategoryTheory.CategoryStruct.comp S.leftHomologyπ f₂


/-- The power function `x ↦ x^s` is integrable on `(0, t)` iff `-1 < s`. -/
lemma integrableOn_Ioo_rpow_iff {s t : ℝ} (ht : 0 < t) :
    IntegrableOn (fun x ↦ x ^ s) (Ioo (0 : ℝ) t) ↔ -1 < s

MeasureTheory.IntegrableOn (fun x => x ^ s) (Set.Ioo 0 t) MeasureTheory.volume ↔ -1 < s


@[simp] theorem sigmaCongrRight_refl {α} {β : α → Sort _} :
    (sigmaCongrRight fun a => Equiv.refl (β a)) = Equiv.refl (Σ a, β a)

(Equiv.Perm.sigmaCongrRight fun a => Equiv.refl (β a)) = Equiv.refl ((a : α) × β a)


theorem roots_mem_integralClosure {f : R[X]} (hf : f.Monic) {a : S}
    (ha : a ∈ f.aroots S) : a ∈ integralClosure R S

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
[IsDomain S]
[Algebra R S]
{f : R[X]}
(hf : f.Monic)
{a : S}
(ha : a ∈ f.aroots S)


lemma exists_mem_toTriangle {x y : α ⊕ β ⊕ γ} (hxy : (graph t).Adj x y) :
    ∃ z ∈ t, x ∈ toTriangle z ∧ y ∈ toTriangle z

{x y : α ⊕ β ⊕ γ}

(hxy : (SimpleGraph.TripartiteFromTriangles.graph t).Adj x y)

∃ z ∈ t, x ∈ SimpleGraph.TripartiteFromTriangles.toTriangle z ∧ y ∈ SimpleGraph.TripartiteFromTriangles.toTriangle z


@[simp]
theorem translationNumber_one : τ 1 = 0


@[simp]
theorem birthday_add : ∀ x y : PGame.{u}, (x + y).birthday = x.birthday ♯ y.birthday

(x + y).birthday = x.birthday.nadd y.birthday


@[simp]
lemma equiv_mkInv (L : C ⥤ D) [L.IsLocalization W] {X Y : C} (f : Y ⟶ X) (hf : W f)
    [HasSmallLocalizedHom.{w} W X Y] :
    equiv.{w} W L (mkInv f hf) = (Localization.isoOfHom L W f hf).inv

[CategoryTheory.Localization.HasSmallLocalizedHom W X Y]

(CategoryTheory.Localization.SmallHom.equiv W L) (CategoryTheory.Localization.SmallHom.mkInv f hf) =
  (CategoryTheory.Localization.isoOfHom L W f hf).inv


@[simp]
theorem card_le_ofNat {o} {n : ℕ} [n.AtLeastTwo] :
    card o ≤ (no_index (OfNat.ofNat n)) ↔ o ≤ OfNat.ofNat n

{o : Ordinal.{u_3}}
{n : ℕ}
[n.AtLeastTwo]

o.card ≤ OfNat.ofNat n ↔ o ≤ OfNat.ofNat n


theorem cosh_add : cosh (x + y) = cosh x * cosh y + sinh x * sinh y

Complex.cosh (x + y) = Complex.cosh x * Complex.cosh y + Complex.sinh x * Complex.sinh y


@[simp] theorem dual_id : LatticeHom.dual (LatticeHom.id α) = LatticeHom.id _

LatticeHom.dual (LatticeHom.id α) = LatticeHom.id αᵒᵈ


@[simp]
theorem ofFn_eq_nil_iff {n : ℕ} {f : Fin n → α} : ofFn f = [] ↔ n = 0


@[simp]
theorem aleph'_nat : ∀ n : ℕ, aleph' n = n


theorem thickenedIndicator_subset {δ : ℝ} (δ_pos : 0 < δ) {E₁ E₂ : Set α} (subset : E₁ ⊆ E₂) :
    ⇑(thickenedIndicator δ_pos E₁) ≤ thickenedIndicator δ_pos E₂

{α : Type u_1}
[PseudoEMetricSpace α]
{δ : ℝ}
(δ_pos : 0 < δ)
{E₁ E₂ : Set α}
(subset : E₁ ⊆ E₂)

⇑(thickenedIndicator δ_pos E₁) ≤ ⇑(thickenedIndicator δ_pos E₂)


lemma le_add_one_iff : m ≤ n + 1 ↔ m ≤ n ∨ m = n + 1


/-- An omega-complete partial order is a partial order with a supremum
operation on increasing sequences indexed by natural numbers (which we
call `ωSup`). In this sense, it is strictly weaker than join complete
semi-lattices as only ω-sized totally ordered sets have a supremum.

See the definition on page 114 of [gunter1992]. -/
class OmegaCompletePartialOrder (α : Type*) extends PartialOrder α where
  /-- The supremum of an increasing sequence -/
  ωSup : Chain α → α
  /-- `ωSup` is an upper bound of the increasing sequence -/
  le_ωSup : ∀ c : Chain α, ∀ i, c i ≤ ωSup c
  /-- `ωSup` is a lower bound of the set of upper bounds of the increasing sequence -/
  ωSup_le : ∀ (c : Chain α) (x), (∀ i, c i ≤ x) → ωSup c ≤ x

{α : Type u_1}
[self : OmegaCompletePartialOrder α]
(c : OmegaCompletePartialOrder.Chain α)
(x : α)

(∀ (i : ℕ), c i ≤ x) → OmegaCompletePartialOrder.ωSup c ≤ x


@[simp]
lemma equivShrink_sub [Sub α] [Small α] (x y : α) :
    equivShrink α (x - y) = equivShrink α x - equivShrink α y

{α : Type u_1}
[Sub α]
[Small.{u_2, u_1} α]
(x y : α)

(equivShrink α) (x - y) = (equivShrink α) x - (equivShrink α) y


private theorem testBit_limit {x i : Nat} (x_lt_succ : x < 2^(i+1)) :
    testBit x i = decide (x ≥ 2^i)


@[csimp] theorem repeat_eq_repeatTR : @repeat = @repeatTR


theorem of_unique_nonzero_prime (h : ∃! P : Ideal R, P ≠ ⊥ ∧ Ideal.IsPrime P) : LocalRing R

{R : Type u_1}
[CommSemiring R]
(h : ∃! P, P ≠ ⊥ ∧ P.IsPrime)


lemma toNNReal_mul_add_neg_mul_add_mul_neg_eq (f g : C(X, ℝ)₀) :
    ((f * g).toNNReal + (-f).toNNReal * g.toNNReal + f.toNNReal * (-g).toNNReal) =
    ((-(f * g)).toNNReal + f.toNNReal * g.toNNReal + (-f).toNNReal * (-g).toNNReal)

{X : Type u_1}
[TopologicalSpace X]
[Zero X]
(f g : ContinuousMapZero X ℝ)

(f * g).toNNReal + (-f).toNNReal * g.toNNReal + f.toNNReal * (-g).toNNReal =
  (-(f * g)).toNNReal + f.toNNReal * g.toNNReal + (-f).toNNReal * (-g).toNNReal


@[reassoc]
lemma leftHomologyMap_comp [HasLeftHomology S₁] [HasLeftHomology S₂] [HasLeftHomology S₃]
    (φ₁ : S₁ ⟶ S₂) (φ₂ : S₂ ⟶ S₃) :
    leftHomologyMap (φ₁ ≫ φ₂) = leftHomologyMap φ₁ ≫ leftHomologyMap φ₂

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

(φ₁ : S₁ ⟶ S₂)

(φ₂ : S₂ ⟶ S₃)

CategoryTheory.ShortComplex.leftHomologyMap (CategoryTheory.CategoryStruct.comp φ₁ φ₂) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.leftHomologyMap φ₁)
    (CategoryTheory.ShortComplex.leftHomologyMap φ₂)


/-- **Rearrangement Inequality**: Pointwise scalar multiplication of `f` and `g` is minimized when
`f` and `g` antivary together. Stated by permuting the entries of `f`. -/
theorem Antivary.sum_smul_le_sum_comp_perm_smul (hfg : Antivary f g) :
    ∑ i, f i • g i ≤ ∑ i, f (σ i) • g i

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{σ : Equiv.Perm ι}
{f : ι → α}
{g : ι → β}
[Fintype ι]
(hfg : Antivary f g)

∑ i : ι, f i • g i ≤ ∑ i : ι, f (σ i) • g i


theorem isClosedMap_smul_left (c : E) : IsClosedMap fun x : 𝕜 => x • c

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[T2Space E]
[TopologicalAddGroup E]
[Module 𝕜 E]
[ContinuousSMul 𝕜 E]
(c : E)


@[reassoc (attr := simp)]
lemma germ_stalkIso_hom {X : Scheme.{u}} (U : X.Opens)
    {V : U.toScheme.Opens} (x : V) :
      U.toScheme.presheaf.germ x ≫ (U.stalkIso x.1).hom =
        X.presheaf.germ ⟨x.1.1, show x.1.1 ∈ U.ι ''ᵁ V from ⟨x.1, x.2, rfl⟩⟩

{X : AlgebraicGeometry.Scheme}
(U : X.Opens)
{V : (↑U).Opens}
(x : ↥V)

(↑U).presheaf.germ x ≫ (U.stalkIso ↑x).hom = X.presheaf.germ ⟨↑↑x, ⋯⟩


lemma isIso_of_isIso_map (hF : F.FullyFaithful) {X Y : C} (f : X ⟶ Y) [IsIso (F.map f)] :
    IsIso f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
(hF : F.FullyFaithful)
{X Y : C}
(f : X ⟶ Y)
[CategoryTheory.IsIso (F.map f)]


@[to_additive] lemma mabs_mul_eq_mul_mabs_iff (a b : α) :
    |a * b|ₘ = |a|ₘ * |b|ₘ ↔ 1 ≤ a ∧ 1 ≤ b ∨ a ≤ 1 ∧ b ≤ 1

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

|a + b| = |a| + |b| ↔ 0 ≤ a ∧ 0 ≤ b ∨ a ≤ 0 ∧ b ≤ 0


theorem getLsb_intMax_eq (w : Nat) : (intMax w).getLsb i = decide (i < w)

(BitVec.intMax w).getLsb i = decide (i < w)


protected theorem MonotoneOn.Ici (hf : MonotoneOn f s) : AntitoneOn (fun x => Ici (f x)) s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : α → β}
{s : Set α}
(hf : MonotoneOn f s)


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

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

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

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


@[simp]
theorem sum_hom_add_index [AddZeroClass M] [AddCommMonoid N] {f g : α →₀ M} (h : α → M →+ N) :
    ((f + g).sum fun x => h x) = (f.sum fun x => h x) + g.sum fun x => h x

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[AddZeroClass M]
[AddCommMonoid N]
{f g : α →₀ M}
(h : α → M →+ N)

((f + g).sum fun x => ⇑(h x)) = (f.sum fun x => ⇑(h x)) + g.sum fun x => ⇑(h x)


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


/-- Another way to coerce a `Multiset` to a type is to go through `m.toEnumFinset` and coerce
that `Finset` to a type. -/
@[simps]
def Multiset.coeEquiv (m : Multiset α) : m ≃ m.toEnumFinset

{α : Type u_1}
[DecidableEq α]
(m : Multiset α)
(x : m.ToType)


/-- The linear map version of `Function.Surjective.injective_comp_right` -/
lemma _root_.Function.Surjective.injective_linearMapComp_right (hg : Surjective g) :
    Injective fun f : M₂ →ₛₗ[σ₂₃] M₃ ↦ f.comp g

{R₁ : Type u_2}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M₁ : Type u_10}
{M₂ : Type u_11}
{M₃ : Type u_12}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
{module_M₁ : Module R₁ M₁}
{module_M₂ : Module R₂ M₂}
{module_M₃ : Module R₃ M₃}
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
{g : M₁ →ₛₗ[σ₁₂] M₂}
(hg : Function.Surjective ⇑g)


theorem balance_sz_dual {l r}
    (H : (∃ l', Raised (@size α l) l' ∧ BalancedSz l' (@size α r)) ∨
        ∃ r', Raised r' (size r) ∧ BalancedSz (size l) r') :
    (∃ l', Raised l' (size (dual r)) ∧ BalancedSz l' (size (dual l))) ∨
      ∃ r', Raised (size (dual l)) r' ∧ BalancedSz (size (dual r)) r'

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

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


lemma eventually_deriv_rpow_p_mul_one_sub_smoothingFn (p : ℝ) :
    deriv (fun z => z ^ p * (1 - ε z))
      =ᶠ[atTop] fun z => p * z ^ (p-1) * (1 - ε z) + z ^ (p-1) / (log z ^ 2)

(deriv fun z => z ^ p * (1 - AkraBazziRecurrence.smoothingFn z)) =ᶠ[Filter.atTop] fun z =>
  p * z ^ (p - 1) * (1 - AkraBazziRecurrence.smoothingFn z) + z ^ (p - 1) / Real.log z ^ 2


theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) :
    ContDiff ℝ n fun x => ⟪f x, g x⟫

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f g : G → E}
{n : ℕ∞}
(hf : ContDiff ℝ n f)
(hg : ContDiff ℝ n g)


lemma Pi.map'_eq {f : α → C} {g : β → C} [HasProduct f] [HasProduct g] {p p' : β → α}
    {q : ∀ (b : β), f (p b) ⟶ g b} {q' : ∀ (b : β), f (p' b) ⟶ g b} (hp : p = p')
    (hq : ∀ (b : β), eqToHom (hp ▸ rfl) ≫ q b = q' b) : Pi.map' p q = Pi.map' p' q'

(hq : ∀ (b : β), CategoryTheory.eqToHom ⋯ ≫ q b = q' b)

CategoryTheory.Limits.Pi.map' p q = CategoryTheory.Limits.Pi.map' p' q'


@[simp]
theorem leftInv_coeff_one (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) :
    p.leftInv i 1 = (continuousMultilinearCurryFin1 𝕜 F E).symm i.symm

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
(i : E ≃L[𝕜] F)

p.leftInv i 1 = (continuousMultilinearCurryFin1 𝕜 F E).symm ↑i.symm


theorem mul_eq_mul_left_iff {a b c : Int} (h : c ≠ 0) : c * a = c * b ↔ a = b


@[simp] theorem zero_toReal : (0 : ℝ≥0∞).toReal = 0


@[simp]
theorem append_assoc (s t u : WSeq α) : append (append s t) u = append s (append t u)

(s.append t).append u = s.append (t.append u)


protected theorem bijective (e : α ≃ᵐ β) : Bijective e

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(e : α ≃ᵐ β)


/-- If a unit `u` is congruent to an integer modulo `λ ^ 2`, then `u = 1` or `u = -1`.

This is a special case of the so-called *Kummer's lemma*. -/
theorem eq_one_or_neg_one_of_unit_of_congruent (hcong : ∃ n : ℤ, λ ^ 2 ∣ (u - n : 𝓞 K)) :
    u = 1 ∨ u = -1

(hcong : ∃ n, (hζ.toInteger - 1) ^ 2 ∣ ↑u - ↑n)


/-- `G.sheafPushforwardCocontinuous A J K : Sheaf J A ⥤ Sheaf K A` is induced
by the right Kan extension functor `G.op.ran` on presheaves. -/
@[simps! hom inv]
def Functor.sheafPushforwardCocontinuousCompSheafToPresheafIso :
    G.sheafPushforwardCocontinuous A J K ⋙ sheafToPresheaf K A ≅
      sheafToPresheaf J A ⋙ G.op.ran

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[∀ (F : Cᵒᵖ ⥤ A), G.op.HasPointwiseRightKanExtension F]

(G.sheafPushforwardCocontinuousCompSheafToPresheafIso A J K).hom =
  𝟙 (G.sheafPushforwardCocontinuous A J K ⋙ CategoryTheory.sheafToPresheaf K A)


theorem mul_right (x₀ : R) {U : Set R} (hU : U ∈ B) : ∃ V ∈ B, V ⊆ (fun x ↦ x * x₀) ⁻¹' U

{R : Type u}
[Ring R]
(B : RingFilterBasis R)
(x₀ : R)
{U : Set R}
(hU : U ∈ B)


lemma _root_.LinearEquiv.isWeaklyRegular_congr (e : M ≃ₗ[R] M₂) (rs : List R) :
    IsWeaklyRegular M rs ↔ IsWeaklyRegular M₂ rs

{R : Type u_1}
{M : Type u_3}
{M₂ : Type u_4}
[CommRing R]
[AddCommGroup M]
[AddCommGroup M₂]
[Module R M]
[Module R M₂]
(e : M ≃ₗ[R] M₂)
(rs : List R)

RingTheory.Sequence.IsWeaklyRegular M rs ↔ RingTheory.Sequence.IsWeaklyRegular M₂ rs


/-- The canonical isomorphism
`F ⋙ Functor.const J ≅ Functor.const F ⋙ (whiskeringRight J _ _).obj L`. -/
@[simps!]
def compConstIso (F : C ⥤ D) :
    F ⋙ Functor.const J ≅ Functor.const J ⋙ (whiskeringRight J C D).obj F

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

∀ (X_1 : J), ((CategoryTheory.Functor.compConstIso J F).hom.app X).app X_1 = 𝟙 (F.obj X)


theorem extract_loop_eq (as bs : Array α) (size start : Nat) (h : start + size ≤ as.size) :
  extract.loop as size start bs = bs ++ as.extract start (start + size)

{α : Type u_1}
(as bs : Array α)
(size start : Nat)
(h : start + size ≤ as.size)

Array.extract.loop as size start bs = bs ++ as.extract start (start + size)


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

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

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


@[simp]
theorem attach_eq_nil (l : List α) : l.attach = [] ↔ l = []


theorem Multiset.prod_primes_dvd [CancelCommMonoidWithZero α]
    [∀ a : α, DecidablePred (Associated a)] {s : Multiset α} (n : α) (h : ∀ a ∈ s, Prime a)
    (div : ∀ a ∈ s, a ∣ n) (uniq : ∀ a, s.countP (Associated a) ≤ 1) : s.prod ∣ n

[(a : α) → DecidablePred (Associated a)]

(uniq : ∀ (a : α), Multiset.countP (Associated a) s ≤ 1)


theorem normalize_associated_iff {x y : α} : Associated (normalize x) y ↔ Associated x y

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
{x y : α}


theorem abs_lt_real_iff_infinitesimal {x : ℝ*} : Infinitesimal x ↔ ∀ r : ℝ, r ≠ 0 → |x| < |↑r|

x.Infinitesimal ↔ ∀ (r : ℝ), r ≠ 0 → |x| < |↑r|


@[simp]
theorem normSq_ofNat (n : ℕ) [n.AtLeastTwo] :
    normSq (no_index (OfNat.ofNat n : ℂ)) = OfNat.ofNat n * OfNat.ofNat n

Complex.normSq (OfNat.ofNat n) = OfNat.ofNat n * OfNat.ofNat n


@[simp high]
theorem singleton_vsub_singleton : ({b} : Set β) -ᵥ {c} = {b -ᵥ c}

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{b c : β}


theorem Convex.sub (hs : Convex 𝕜 s) (ht : Convex 𝕜 t) : Convex 𝕜 (s - t)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s t : Set E}
(hs : Convex 𝕜 s)
(ht : Convex 𝕜 t)


@[to_additive (attr := simp)]
theorem inv_inv_symm_iff : SemiconjBy a⁻¹ x⁻¹ y⁻¹ ↔ SemiconjBy a y x

{G : Type u_1}
[DivisionMonoid G]
{a x y : G}


/-- A preadditive category has a coequalizer for `f` and `g` if it has a cokernel for `f - g`. -/
theorem hasCoequalizer_of_hasCokernel [HasCokernel (f - g)] : HasCoequalizer f g

[CategoryTheory.Limits.HasCokernel (f - g)]


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

(hf' : HasProd (fun n => if n = b then 1 else f n) a')


theorem vars_eq_support_biUnion_support [DecidableEq σ] :
    p.vars = p.support.biUnion Finsupp.support

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(p : MvPolynomial σ R)
[DecidableEq σ]


/-- Isomorphic objects have equivalent `MonoOver` categories.
-/
@[simps]
def mapIso {A B : C} (e : A ≅ B) : MonoOver A ≌ MonoOver B

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{A B : C}
(e : A ≅ B)

(CategoryTheory.MonoOver.mapIso e).unitIso =
  ((CategoryTheory.MonoOver.mapComp e.hom e.inv).symm ≪≫
      CategoryTheory.eqToIso ⋯ ≪≫ CategoryTheory.MonoOver.mapId A).symm


/-- We construct an open cover from another, by providing the needed fields and showing that the
provided fields are isomorphic with the original open cover. -/
@[simps J obj map]
def OpenCover.copy {X : Scheme.{u}} (𝒰 : OpenCover X) (J : Type*) (obj : J → Scheme)
    (map : ∀ i, obj i ⟶ X) (e₁ : J ≃ 𝒰.J) (e₂ : ∀ i, obj i ≅ 𝒰.obj (e₁ i))
    (e₂ : ∀ i, map i = (e₂ i).hom ≫ 𝒰.map (e₁ i)) : OpenCover X

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(J : Type u_1)
(obj : J → AlgebraicGeometry.Scheme)
(map : (i : J) → obj i ⟶ X)
(e₁ : J ≃ 𝒰.J)
(e₂ : (i : J) → obj i ≅ 𝒰.obj (e₁ i))

∀ (e₂_1 : ∀ (i : J), map i = (e₂ i).hom ≫ 𝒰.map (e₁ i)) (i : J), (𝒰.copy J obj map e₁ e₂ e₂_1).map i = map i


@[simp] -- Porting note: new attr
theorem lcm_cycleType (σ : Perm α) : σ.cycleType.lcm = orderOf σ

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


theorem inf_sdiff : (x ⊓ y) \ z = x \ z ⊓ y \ z

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]


protected theorem add_le_add_right {n m : Nat} (h : n ≤ m) (k : Nat) : n + k ≤ m + k


@[simp]
theorem coe_fst : ⇑(fst R S) = Prod.fst

{R : Type u_3}
{S : Type u_5}
[NonAssocSemiring R]
[NonAssocSemiring S]


lemma congr_left_φH {γ₁ γ₂ : HomologyMapData φ h₁ h₂} (eq : γ₁ = γ₂) :
    γ₁.left.φH = γ₂.left.φH

{γ₁ γ₂ : CategoryTheory.ShortComplex.HomologyMapData φ h₁ h₂}


theorem mul_eq_mul_left {a b c : ℝ≥0} (h : a ≠ 0) : a * b = a * c ↔ b = c


@[simp]
lemma map₁_comp {G H : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G) (μ : G ⟶ H) :
    YonedaCollection.map₁ (η ≫ μ) (X := X) =
      YonedaCollection.map₁ μ (X := X) ∘ YonedaCollection.map₁ η (X := X)

{A : CategoryTheory.Functor Cᵒᵖ (Type v)}

{F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

{G H : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

CategoryTheory.OverPresheafAux.YonedaCollection.map₁ (CategoryTheory.CategoryStruct.comp η μ) =
  CategoryTheory.OverPresheafAux.YonedaCollection.map₁ μ ∘ CategoryTheory.OverPresheafAux.YonedaCollection.map₁ η


lemma toColex_le_toColex :
    toColex s ≤ toColex t ↔ ∀ ⦃a⦄, a ∈ s → a ∉ t → ∃ b, b ∈ t ∧ b ∉ s ∧ a ≤ b

{α : Type u_1}
[PartialOrder α]
{s t : Finset α}

{ ofColex := s } ≤ { ofColex := t } ↔ ∀ ⦃a : α⦄, a ∈ s → a ∉ t → ∃ b ∈ t, b ∉ s ∧ a ≤ b


/-- Symmetric statement to `Set.image_image2_right_anticomm`. -/
theorem image_image2_antidistrib_right {g : γ → δ} {f' : β → α' → δ} {g' : α → α'}
    (h_antidistrib : ∀ a b, g (f a b) = f' b (g' a)) :
    (image2 f s t).image g = image2 f' t (s.image g')

{f : α → β → γ}

(h_antidistrib : ∀ (a : α) (b : β), g (f a b) = f' b (g' a))

g '' Set.image2 f s t = Set.image2 f' t (g' '' s)


@[fun_prop]
theorem differentiableWithinAt_pi'' (hφ : ∀ i, DifferentiableWithinAt 𝕜 (fun x => Φ x i) s x) :
    DifferentiableWithinAt 𝕜 Φ s x

(hφ : ∀ (i : ι), DifferentiableWithinAt 𝕜 (fun x => Φ x i) s x)


@[simp]
theorem mk_arrow (P : Subobject X) : mk P.arrow = P

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : C}
(P : CategoryTheory.Subobject X)


protected theorem Differentiable.inversion (hc : Differentiable ℝ c)
    (hR : Differentiable ℝ R) (hx : Differentiable ℝ x) (hne : ∀ a, x a ≠ c a) :
    Differentiable ℝ (fun a ↦ inversion (c a) (R a) (x a))

{E : Type u_1}
{F : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{c x : E → F}
{R : E → ℝ}
(hc : Differentiable ℝ c)
(hR : Differentiable ℝ R)
(hx : Differentiable ℝ x)
(hne : ∀ (a : E), x a ≠ c a)

Differentiable ℝ fun a => EuclideanGeometry.inversion (c a) (R a) (x a)


@[to_additive prod_comp_prodMap]
theorem prod_comp_prodMap (f : P →ₙ* M) (g : P →ₙ* N) (f' : M →ₙ* M') (g' : N →ₙ* N') :
    (f'.prodMap g').comp (f.prod g) = (f'.comp f).prod (g'.comp g)

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
{M' : Type u_8}
{N' : Type u_9}
[Add M]
[Add N]
[Add M']
[Add N']
[Add P]
(f : AddHom P M)
(g : AddHom P N)
(f' : AddHom M M')
(g' : AddHom N N')