lemma isLeftKanExtension_iff_of_iso₂ {F₁' F₂' : D ⥤ H} (α₁ : F₁ ⟶ L ⋙ F₁') (α₂ : F₂ ⟶ L ⋙ F₂')
    (e : F₁ ≅ F₂) (e' : F₁' ≅ F₂') (h : α₁ ≫ whiskerLeft L e'.hom = e.hom ≫ α₂) :
    F₁'.IsLeftKanExtension α₁ ↔ F₂'.IsLeftKanExtension α₂

(h :
  CategoryTheory.CategoryStruct.comp α₁ (CategoryTheory.whiskerLeft L e'.hom) =
    CategoryTheory.CategoryStruct.comp e.hom α₂)


theorem lt_mul_of_le_of_one_lt' [PosMulStrictMono α] [MulPosMono α] (bc : b ≤ c) (ha : 1 < a)
    (a0 : 0 ≤ a) (b0 : 0 < b) : b < c * a

{α : Type u_1}
{a b c : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[PosMulStrictMono α]
[MulPosMono α]
(bc : b ≤ c)
(ha : 1 < a)
(a0 : 0 ≤ a)
(b0 : 0 < b)


/-- The groupoid of `0`-times continuously differentiable maps is just the groupoid of all
partial homeomorphisms -/
theorem contDiffGroupoid_zero_eq : contDiffGroupoid 0 I = continuousGroupoid H

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)


@[simp]
theorem eval₂_at_ofNat {S : Type*} [Semiring S] (f : R →+* S) (n : ℕ) [n.AtLeastTwo] :
    p.eval₂ f (no_index (OfNat.ofNat n)) = f (p.eval (OfNat.ofNat n))

{R : Type u}
[Semiring R]
{p : R[X]}
{S : Type u_1}
[Semiring S]
(f : R →+* S)
(n : ℕ)
[n.AtLeastTwo]

Polynomial.eval₂ f (OfNat.ofNat n) p = f (Polynomial.eval (OfNat.ofNat n) p)


/-- The constant-function embedding, as a multiplicative monoid hom. -/
@[to_additive (attr := simps) "The constant-function embedding, as an additive monoid hom."]
def constMonoidHom [MulOneClass Y] : Y →* LocallyConstant X Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[AddZeroClass Y]
(y : Y)

LocallyConstant.constAddMonoidHom y = LocallyConstant.const X y


theorem symmAt_indep {i} (j) (f : Ω^ N X x) :
    (⟦symmAt i f⟧ : HomotopyGroup N X x) = ⟦symmAt j f⟧

{N : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
{x : X}
[DecidableEq N]
{i : N}
(j : N)
(f : ↑(Ω^ N X x))

⟦GenLoop.symmAt i f⟧ = ⟦GenLoop.symmAt j f⟧


/-- A complemented bounded lattice is one where every element has a (not necessarily unique)
complement. -/
class ComplementedLattice (α) [Lattice α] [BoundedOrder α] : Prop where
  /-- In a `ComplementedLattice`, every element admits a complement. -/
  exists_isCompl : ∀ a : α, ∃ b : α, IsCompl a b

{α : Type u_2}
[Lattice α]
[BoundedOrder α]
[self : ComplementedLattice α]
(a : α)


theorem AbsolutelyContinuous.prod [SFinite ν'] (h1 : μ ≪ μ') (h2 : ν ≪ ν') :
    μ.prod ν ≪ μ'.prod ν'

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ μ' : MeasureTheory.Measure α}
{ν ν' : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite ν']
(h1 : μ ≪ μ')
(h2 : ν ≪ ν')


lemma lintegral_toKernel_mem [IsFiniteKernel κ] (hf : IsCondKernelCDF f κ ν)
    (a : α) {s : Set (β × ℝ)} (hs : MeasurableSet s) :
    ∫⁻ b, hf.toKernel f (a, b) {y | (b, y) ∈ s} ∂(ν a) = κ a s

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

(hf : ProbabilityTheory.IsCondKernelCDF f κ ν)

∫⁻ (b : β), ((ProbabilityTheory.IsCondKernelCDF.toKernel f hf) (a, b)) {y | (b, y) ∈ s} ∂ν a = (κ a) s


@[ext] theorem ext_of {X Y : Type u} [Semiring X] [Semiring Y] (f g : X →+* Y)
    (h : ∀ x, f x = g x) :
    @Eq (SemiRingCat.of X ⟶ SemiRingCat.of Y) f g

{X Y : Type u}
[Semiring X]
[Semiring Y]
(f g : X →+* Y)
(h : ∀ (x : X), f x = g x)


@[reassoc (attr := simp)] lemma p_g' : h.p ≫ h.g' = S.g

CategoryTheory.CategoryStruct.comp h.p h.g' = S.g


theorem symm_comp_eq {α : Type*} (f : α → M₁) (g : α → M₂) : e₁₂.symm ∘ g = f ↔ g = e₁₂ ∘ f

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


@[simp]
theorem extentClosure_union (t₁ t₂ : Set β) :
    extentClosure r (t₁ ∪ t₂) = extentClosure r t₁ ∩ extentClosure r t₂

{α : Type u_2}
{β : Type u_3}
(r : α → β → Prop)
(t₁ t₂ : Set β)


theorem eq_false_of_not_eq_true {b : Bool} : ¬b = true → b = false


@[to_additive]
theorem mem_nhds_one : (U : Set G) ∈ 𝓝 (1 : G)

{G : Type u_1}
[Group G]
[TopologicalSpace G]
(U : OpenSubgroup G)


theorem modifyLast.go_append_one (f : α → α) (a : α) (tl : List α) (r : Array α) :
    modifyLast.go f (tl ++ [a]) r = (r.toListAppend <| modifyLast.go f (tl ++ [a]) #[])

{α : Type u}
(f : α → α)
(a : α)
(tl : List α)
(r : Array α)

List.modifyLast.go f (tl ++ [a]) r = r.toListAppend (List.modifyLast.go f (tl ++ [a]) #[])


theorem ExistsUnique.elim {α : Sort u} {p : α → Prop} {b : Prop}
    (h₂ : ∃! x, p x) (h₁ : ∀ x, p x → (∀ y, p y → y = x) → b) : b

(h₁ : ∀ (x : α), p x → (∀ (y : α), p y → y = x) → b)


@[simp]
theorem deriv_char_self (a : α) : deriv (char a) a = 1

{α : Type u_1}
[dec : DecidableEq α]
(a : α)


theorem frobenius_add : frobenius R p (x + y) = frobenius R p x + frobenius R p y

(R : Type u)
[CommSemiring R]
(p : ℕ)
[ExpChar R p]
(x y : R)

(frobenius R p) (x + y) = (frobenius R p) x + (frobenius R p) y


theorem ge_of_not_lt {n m : Nat} (h : ¬ n < m) : n ≥ m


@[simp]
theorem tail_cons : tail (cons y s) = s

{n : ℕ}
{M : Type u_1}
[Zero M]
(y : M)
(s : Fin n →₀ M)


/-- If all grades are the same type and themselves form a monoid, then there is a trivial grading
structure. -/
@[simps gnpow]
instance Monoid.gMonoid [AddMonoid ι] [Monoid R] : GradedMonoid.GMonoid fun _ : ι => R

(ι : Type u_1)
{R : Type u_2}
[AddMonoid ι]
[Monoid R]
(n : ℕ)

∀ (x : ι) (a : R), GradedMonoid.GMonoid.gnpow n a = a ^ n


theorem nhds_iInf {ι : Sort*} {t : ι → TopologicalSpace α} {a : α} :
    @nhds α (iInf t) a = ⨅ i, @nhds α (t i) a

{α : Type u}
{ι : Sort u_1}
{t : ι → TopologicalSpace α}
{a : α}


theorem hasBasis_iInf {ι : Type*} {ι' : ι → Type*} {l : ι → Filter α} {p : ∀ i, ι' i → Prop}
    {s : ∀ i, ι' i → Set α} (hl : ∀ i, (l i).HasBasis (p i) (s i)) :
    (⨅ i, l i).HasBasis
      (fun If : Σ I : Set ι, ∀ i : I, ι' i => If.1.Finite ∧ ∀ i : If.1, p i (If.2 i)) fun If =>
      ⋂ i : If.1, s i (If.2 i)

(hl : ∀ (i : ι), (l i).HasBasis (p i) (s i))

(⨅ i, l i).HasBasis (fun If => If.fst.Finite ∧ ∀ (i : ↑If.fst), p (↑i) (If.snd i)) fun If => ⋂ i, s (↑i) (If.snd i)


theorem exists_mem_basis {ι' : Sort*} (hf : LocallyFinite f) {p : ι' → Prop} {s : ι' → Set X}
    {x : X} (hb : (𝓝 x).HasBasis p s) : ∃ i, p i ∧ { j | (f j ∩ s i).Nonempty }.Finite

{ι : Type u_1}
{X : Type u_4}
[TopologicalSpace X]
{f : ι → Set X}
{ι' : Sort u_6}
(hf : LocallyFinite f)
{p : ι' → Prop}
{s : ι' → Set X}
{x : X}
(hb : (𝓝 x).HasBasis p s)

∃ i, p i ∧ {j | (f j ∩ s i).Nonempty}.Finite


theorem natAbs_euclideanDomain_gcd (a b : ℤ) :
    Int.natAbs (EuclideanDomain.gcd a b) = Int.gcd a b

(EuclideanDomain.gcd a b).natAbs = a.gcd b


/-- For a fixed function `x₀ : {a // p a} → β` defined on a subtype of `α`,
the subtype of functions `x : α → β` that agree with `x₀` on the subtype `{a // p a}`
is naturally equivalent to the type of functions `{a // ¬ p a} → β`. -/
@[simps]
def subtypePreimage : { x : α → β // x ∘ Subtype.val = x₀ } ≃ ({ a // ¬p a } → β)

{α : Sort u_1}
{β : Sort u_2}
(p : α → Prop)
[DecidablePred p]
(x₀ : { a // p a } → β)
(x : { x // x ∘ Subtype.val = x₀ })
(a : { a // ¬p a })

(Equiv.subtypePreimage p x₀) x a = ↑x ↑a


@[to_additive (attr := simp)]
-- Porting note: removed dot notation
theorem mrange_mk' : MonoidHom.mrange c.mk' = ⊤

{M : Type u_1}
[MulOneClass M]
{c : Con M}


lemma mul_conj' (z : ℂ) : z * conj z = ‖z‖ ^ 2


theorem smul {U : Set M} (hU : U ∈ B) : ∃ V ∈ 𝓝 (0 : R), ∃ W ∈ B, V • W ⊆ U

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[TopologicalSpace R]
[AddCommGroup M]
[Module R M]
(B : ModuleFilterBasis R M)
{U : Set M}
(hU : U ∈ B)


@[reassoc (attr := simp)]
theorem ι_comp_sigmaComparison [HasCoproduct f] [HasCoproduct fun b => G.obj (f b)] (b : β) :
    Sigma.ι _ b ≫ sigmaComparison G f = G.map (Sigma.ι f b)

[CategoryTheory.Limits.HasCoproduct fun b => G.obj (f b)]

CategoryTheory.Limits.Sigma.ι (fun b => G.obj (f b)) b ≫ CategoryTheory.Limits.sigmaComparison G f =
  G.map (CategoryTheory.Limits.Sigma.ι f b)


protected theorem nonneg (x : R) : 0 ≤ abv x

{R : Type u_5}
{S : Type u_6}
[Semiring R]
[OrderedSemiring S]
(abv : AbsoluteValue R S)
(x : R)


@[to_additive]
theorem lt_div_comm : a < b / c ↔ c < b / a

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


@[simp]
lemma star_neg_iff {x : R} : star x < 0 ↔ x < 0

{R : Type u}
[NonUnitalSemiring R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
{x : R}


theorem mul_le : M * N ≤ P ↔ ∀ m ∈ M, ∀ n ∈ N, m * n ∈ P

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
{M N P : Submodule R A}


@[to_additive (attr := simp)]
theorem mul_lt_mul_iff_right [CovariantClass α α (swap (· * ·)) (· < ·)]
    [ContravariantClass α α (swap (· * ·)) (· < ·)] (a : α) {b c : α} :
    b * a < c * a ↔ b < c

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

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


protected theorem sup_comm (a b : CauSeq α abs) : a ⊔ b = b ⊔ a

{α : Type u_1}
[LinearOrderedField α]
(a b : CauSeq α abs)


/-- If `μ` is a weakly regular measure, then any open set can be approximated by a closed subset. -/
theorem _root_.IsOpen.exists_lt_isClosed [WeaklyRegular μ] ⦃U : Set α⦄ (hU : IsOpen U) {r : ℝ≥0∞}
    (hr : r < μ U) : ∃ F, F ⊆ U ∧ IsClosed F ∧ r < μ F

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[μ.WeaklyRegular]
⦃U : Set α⦄
(hU : IsOpen U)
{r : ℝ≥0∞}
(hr : r < μ U)


lemma dvd_smul_of_dvd {M : Type*} [SMul M R] [Semigroup R] [SMulCommClass M R R] {x y : R}
    (m : M) (h : x ∣ y) : x ∣ m • y

{R : Type u_1}
{M : Type u_2}
[SMul M R]
[Semigroup R]
[SMulCommClass M R R]
{x y : R}
(m : M)
(h : x ∣ y)


/-- A normal closure is always normal. -/
lemma IsNormalClosure.normal [h : IsNormalClosure F K L] : Normal F L

{F : Type u_1}
{K : Type u_2}
{L : Type u_3}
[Field F]
[Field K]
[Field L]
[Algebra F K]
[Algebra F L]
[h : IsNormalClosure F K L]


@[simp]
theorem Int.castRingHom_int : Int.castRingHom ℤ = RingHom.id ℤ


/-- The distance between two points in a set is controlled by the diameter of the set. -/
theorem dist_le_diam_of_mem (h : IsBounded s) (hx : x ∈ s) (hy : y ∈ s) : dist x y ≤ diam s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x y : α}
(h : Bornology.IsBounded s)
(hx : x ∈ s)
(hy : y ∈ s)


theorem iIndepFun.indep_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f i))
    (hfi : iIndepFun (fun _ => mβ) f μ) (hij : i < j) :
    Indep (MeasurableSpace.comap (f j) mβ) (Filtration.natural f hf i) μ

{f : ι → Ω → β}

(hf : ∀ (i : ι), MeasureTheory.StronglyMeasurable (f i))

(hfi : ProbabilityTheory.iIndepFun (fun x => mβ) f μ)

ProbabilityTheory.Indep (MeasurableSpace.comap (f j) mβ) (↑(MeasureTheory.Filtration.natural f hf) i) μ


/-- Typeclass for multiplicative actions on additive structures. This generalizes group modules. -/
@[ext]
class DistribMulAction (M A : Type*) [Monoid M] [AddMonoid A] extends MulAction M A where
  /-- Multiplying `0` by a scalar gives `0` -/
  smul_zero : ∀ a : M, a • (0 : A) = 0
  /-- Scalar multiplication distributes across addition -/
  smul_add : ∀ (a : M) (x y : A), a • (x + y) = a • x + a • y

{M : Type u_10}
{A : Type u_11}
[Monoid M]
[AddMonoid A]
[self : DistribMulAction M A]
(a : M)
(x y : A)


/-- The cofree functor from the Eilenberg-Moore category, constructing a coalgebra for any
object. -/
@[simps]
def cofree : C ⥤ Coalgebra G

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


theorem IsFiniteKernel.bound_ne_top (κ : Kernel α β) [IsFiniteKernel κ] :
    IsFiniteKernel.bound κ ≠ ∞

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(κ : ProbabilityTheory.Kernel α β)
[ProbabilityTheory.IsFiniteKernel κ]

ProbabilityTheory.IsFiniteKernel.bound κ ≠ ⊤


@[simp]
theorem id_toRingHom : (AlgHom.id R A : A →+* A) = RingHom.id _

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


@[simp]
theorem locallyRingedSpace_toLocallyRingedSpace {X Y : LocallyRingedSpace} (f : X ⟶ Y)
    [LocallyRingedSpace.IsOpenImmersion f] : toLocallyRingedSpace Y f.1 = X

{X Y : AlgebraicGeometry.LocallyRingedSpace}

AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toLocallyRingedSpace Y f.val = X


@[simp] theorem getLsb_xor {x y : BitVec v} :
    (x ^^^ y).getLsb i = (xor (x.getLsb i) (y.getLsb i))

(x ^^^ y).getLsb i = xor (x.getLsb i) (y.getLsb i)


theorem contDiffWithinAt_euclidean {n : ℕ∞} :
    ContDiffWithinAt 𝕜 n f t y ↔ ∀ i, ContDiffWithinAt 𝕜 n (fun x => f x i) t y

{𝕜 : Type u_1}
{ι : Type u_2}
{H : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
[Fintype ι]
{f : H → EuclideanSpace 𝕜 ι}
{t : Set H}
{y : H}
{n : ℕ∞}

ContDiffWithinAt 𝕜 n f t y ↔ ∀ (i : ι), ContDiffWithinAt 𝕜 n (fun x => f x i) t y


@[simp]
theorem coe_id : ⇑(HeytingHom.id α) = id


theorem BlockTriangular.toBlock_inverse_mul_toBlock_eq_one [LinearOrder α] [Invertible M]
    (hM : BlockTriangular M b) (k : α) :
    ((M⁻¹.toBlock (fun i => b i < k) fun i => b i < k) *
        M.toBlock (fun i => b i < k) fun i => b i < k) =
      1

{α : Type u_1}
{m : Type u_3}
{R : Type v}
[CommRing R]
{M : Matrix m m R}
{b : m → α}
[DecidableEq m]
[Fintype m]
[LinearOrder α]
[Invertible M]
(hM : M.BlockTriangular b)
(k : α)


lemma fullyFaithful_preimage {X Y : C} (f : yoneda.obj X ⟶ yoneda.obj Y) :
    fullyFaithful.preimage f = f.app (op X) (𝟙 X)

(f : CategoryTheory.yoneda.obj X ⟶ CategoryTheory.yoneda.obj Y)

CategoryTheory.Yoneda.fullyFaithful.preimage f = f.app (Opposite.op X) (CategoryTheory.CategoryStruct.id X)


theorem Ioo.infinite : Infinite (Ioo a b)

{α : Type u_1}
[Preorder α]
[DenselyOrdered α]
{a b : α}
(h : a < b)


@[simp]
nonrec theorem Ioi_top [OrderTop α] : Ioi (⊤ : α) = ⊤

{α : Type u_1}
[Preorder α]
[OrderTop α]


@[simp]
theorem embeddingCongr_refl {α β : Sort*} :
    embeddingCongr (Equiv.refl α) (Equiv.refl β) = Equiv.refl (α ↪ β)

(Equiv.refl α).embeddingCongr (Equiv.refl β) = Equiv.refl (α ↪ β)


@[reassoc (attr := simp)]
theorem ι_biproductComparison' (j : J) :
    biproduct.ι _ j ≫ biproductComparison' F f = F.map (biproduct.ι f j)

[CategoryTheory.Limits.HasBiproduct (F.obj ∘ f)]

CategoryTheory.Limits.biproduct.ι (F.obj ∘ f) j ≫ F.biproductComparison' f =
  F.map (CategoryTheory.Limits.biproduct.ι f j)


@[simp]
theorem get_zero (h : (0 : PartENat).Dom) : (0 : PartENat).get h = 0


/-- An induction principle for elements of `⨆ i, S i`.
If `C` holds for `1` and all elements of `S i` for all `i`, and is preserved under multiplication,
then it holds for all elements of the supremum of `S`. -/
@[to_additive (attr := elab_as_elim) " An induction principle for elements of `⨆ i, S i`.
If `C` holds for `0` and all elements of `S i` for all `i`, and is preserved under addition,
then it holds for all elements of the supremum of `S`. "]
theorem iSup_induction {ι : Sort*} (S : ι → Subgroup G) {C : G → Prop} {x : G} (hx : x ∈ ⨆ i, S i)
    (mem : ∀ (i), ∀ x ∈ S i, C x) (one : C 1) (mul : ∀ x y, C x → C y → C (x * y)) : C x

(mul : ∀ (x y : G), C x → C y → C (x + y))


@[deprecated (since := "2024-04-26")]
theorem LinearMap.toBilin_symm :
    (LinearMap.toBilin.symm : BilinForm R M ≃ₗ[R] _) = BilinForm.toLin

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


@[reassoc (attr := simp)]
theorem pullback_diagonal_map_snd_snd_fst :
    (pullback.snd (diagonal f)
      (map (i₁ ≫ snd f i) (i₂ ≫ snd f i) f f (i₁ ≫ fst f i) (i₂ ≫ fst f i) i
        (by simp [condition]) (by simp [condition]))) ≫
      snd _ _ ≫ i₂ ≫ fst _ _ =
      pullback.fst _ _

(i₁ : V₁ ⟶ CategoryTheory.Limits.pullback f i)

(i₂ : V₂ ⟶ CategoryTheory.Limits.pullback f i)

CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.diagonal f)
      (CategoryTheory.Limits.pullback.map (i₁ ≫ CategoryTheory.Limits.pullback.snd f i)
        (i₂ ≫ CategoryTheory.Limits.pullback.snd f i) f f (i₁ ≫ CategoryTheory.Limits.pullback.fst f i)
        (i₂ ≫ CategoryTheory.Limits.pullback.fst f i) i ⋯ ⋯) ≫
    CategoryTheory.Limits.pullback.snd (i₁ ≫ CategoryTheory.Limits.pullback.snd f i)
        (i₂ ≫ CategoryTheory.Limits.pullback.snd f i) ≫
      i₂ ≫ CategoryTheory.Limits.pullback.fst f i =
  CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.diagonal f)
    (CategoryTheory.Limits.pullback.map (i₁ ≫ CategoryTheory.Limits.pullback.snd f i)
      (i₂ ≫ CategoryTheory.Limits.pullback.snd f i) f f (i₁ ≫ CategoryTheory.Limits.pullback.fst f i)
      (i₂ ≫ CategoryTheory.Limits.pullback.fst f i) i ⋯ ⋯)


@[to_additive] lemma smul_def (g : S) (m : α) : g • m = (g : G) • m

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
{S : Subgroup G}
(g : ↥S)
(m : α)


/-- The functor `Comma L R₁ ⥤ Comma L R₃` induced by the composition of the natural transformations
    `r : R₁ ⟶ R₂` and `r' : R₂ ⟶ R₃` is naturally isomorphic to the composition of the functors
    induced by these natural transformations. -/
@[simps!]
def mapRightComp (r : R₁ ⟶ R₂) (r' : R₂ ⟶ R₃) :
    mapRight L (r ≫ r') ≅ mapRight L r ⋙ mapRight L r'

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

((CategoryTheory.Comma.mapRightComp L r r').hom.app X).left = CategoryTheory.CategoryStruct.id X.left


@[to_additive]
theorem card_bot {_ : Fintype (⊥ : Submonoid M)} : card (⊥ : Submonoid M) = 1


@[simp]
theorem Matrix.toLinAlgEquiv'_toMatrixAlgEquiv' (f : (n → R) →ₗ[R] n → R) :
    Matrix.toLinAlgEquiv' (LinearMap.toMatrixAlgEquiv' f) = f

{R : Type u_1}
[CommSemiring R]
{n : Type u_5}
[DecidableEq n]
[Fintype n]
(f : (n → R) →ₗ[R] n → R)


theorem continuousOn_congr {f g : α → β} {s : Set α} (h' : EqOn g f s) :
    ContinuousOn g s ↔ ContinuousOn f s

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f g : α → β}
{s : Set α}
(h' : Set.EqOn g f s)


theorem isProbabilityMeasure {X : Ω → E} {s : Set E} (hns : μ s ≠ 0) (hnt : μ s ≠ ∞)
    (hu : IsUniform X s ℙ μ) : IsProbabilityMeasure ℙ

{E : Type u_1}
[MeasurableSpace E]
{μ : MeasureTheory.Measure E}
{Ω : Type u_2}

∀ {x : MeasurableSpace Ω} {ℙ : MeasureTheory.Measure Ω} {X : Ω → E} {s : Set E},
  μ s ≠ 0 → μ s ≠ ⊤ → MeasureTheory.pdf.IsUniform X s ℙ μ → MeasureTheory.IsProbabilityMeasure ℙ


theorem cos_nat_mul_two_pi_sub (x : ℂ) (n : ℕ) : cos (n * (2 * π) - x) = cos x

Complex.cos (↑n * (2 * ↑Real.pi) - x) = Complex.cos x


theorem of_eq {n} {f g : Vector ℕ n →. ℕ} (hf : Partrec' f) (H : ∀ i, f i = g i) : Partrec' g

(H : ∀ (i : Mathlib.Vector ℕ n), f i = g i)


/-- The composition of `C^n` functions at points in domains is `C^n`,
  with a weaker condition on `s` and `t`. -/
theorem ContDiffWithinAt.comp_of_mem {s : Set E} {t : Set F} {g : F → G} {f : E → F} (x : E)
    (hg : ContDiffWithinAt 𝕜 n g t (f x)) (hf : ContDiffWithinAt 𝕜 n f s x)
    (hs : t ∈ 𝓝[f '' s] f x) : ContDiffWithinAt 𝕜 n (g ∘ f) s x

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


lemma cfc_nonpos_iff (f : R → R) (a : A) (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)
    (ha : p a := by cfc_tac) : cfc f a ≤ 0 ↔ ∀ x ∈ spectrum R a, f x ≤ 0

[∀ (α : Type u_1) [inst : TopologicalSpace α], StarOrderedRing C(α, R)]


theorem isBounded_preimage (hf : AntilipschitzWith K f) {s : Set β} (hs : IsBounded s) :
    IsBounded (f ⁻¹' s)

{α : Type u_1}
{β : Type u_2}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : AntilipschitzWith K f)
{s : Set β}
(hs : Bornology.IsBounded s)


/-- If `A : S → T.obj B` is a structured arrow for `S : D` and `T : C ⥤ D`, then we can explicitly
    describe the subobjects of `A` as the subobjects `P` of `B` in `C` for which `A.hom` factors
    through the image of `P` under `T`. -/
@[simps!]
def subobjectEquiv [HasLimits C] [PreservesLimits T] (A : StructuredArrow S T) :
    Subobject A ≃o { P : Subobject A.right // ∃ q, q ≫ T.map P.arrow = A.hom }

(A : CategoryTheory.StructuredArrow S T)

↑(A.subobjectEquiv P) = CategoryTheory.StructuredArrow.projectSubobject P


lemma d₂_eq (i₁ : I₁) {i₂ i₂' : I₂} (h : c₂.Rel i₂ i₂') (i₁₂ : I₁₂)
    (h' : ComplexShape.π c₁ c₂ c₁₂ ⟨i₁, i₂'⟩ = i₁₂) :
    K.d₂ c₁₂ i₁ i₂ i₁₂ = ComplexShape.ε₂ c₁ c₂ c₁₂ ⟨i₁, i₂⟩ • ((K.X i₁).d i₂ i₂' ≫
    K.ιTotal c₁₂ i₁ i₂' i₁₂ h')

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{I₁ : Type u_2}
{I₂ : Type u_3}
{I₁₂ : Type u_4}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c₁₂ : ComplexShape I₁₂)
[DecidableEq I₁₂]
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]
(i₁ : I₁)
{i₂ i₂' : I₂}
(h : c₂.Rel i₂ i₂')
(i₁₂ : I₁₂)
(h' : c₁.π c₂ c₁₂ (i₁, i₂') = i₁₂)

K.d₂ c₁₂ i₁ i₂ i₁₂ = c₁.ε₂ c₂ c₁₂ (i₁, i₂) • (K.X i₁).d i₂ i₂' ≫ K.ιTotal c₁₂ i₁ i₂' i₁₂ h'


@[to_additive]
theorem prod_sum {α : Type*} {ι : Type*} [CommMonoid α] (f : ι → Multiset α) (s : Finset ι) :
    (∑ x ∈ s, f x).prod = ∏ x ∈ s, (f x).prod

{α : Type u_6}
{ι : Type u_7}
[AddCommMonoid α]
(f : ι → Multiset α)
(s : Finset ι)


/-- The forgetful functor `SheafOfModules.{v} R ⥤ PresheafOfModules R.val`. -/
@[simps]
def forget : SheafOfModules.{v} R ⥤ PresheafOfModules R.val

{J : CategoryTheory.GrothendieckTopology C}

∀ {X Y : SheafOfModules R} (φ : X ⟶ Y), (SheafOfModules.forget R).map φ = φ.val


@[simp]
theorem getElem?_drop (L : List α) (i j : Nat) : (L.drop i)[j]? = L[i + j]?


theorem StableUnderCobaseChange.inl {P : MorphismProperty C} (hP : StableUnderCobaseChange P)
    {A B A' : C} (f : A ⟶ A') (g : A ⟶ B) [HasPushout f g] (H : P g) :
    P (pushout.inl f g)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P : CategoryTheory.MorphismProperty C}
(hP : P.StableUnderCobaseChange)
{A B A' : C}
(f : A ⟶ A')
(g : A ⟶ B)
[CategoryTheory.Limits.HasPushout f g]
(H : P g)

P (CategoryTheory.Limits.pushout.inl f g)


theorem convex_Ioc (r s : β) : Convex 𝕜 (Ioc r s)

{𝕜 : Type u_1}
{β : Type u_4}
[OrderedSemiring 𝕜]
[OrderedCancelAddCommMonoid β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
(r s : β)


@[reassoc]
lemma naturality_φ₁ (f : S₁ ⟶ S₂) : S₁.φ₁ ≫ f.f₂.τ₁ = functorP.map f ≫ S₂.φ₁

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

CategoryTheory.CategoryStruct.comp S₁.φ₁ f.f₂.τ₁ =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.SnakeInput.functorP.map f) S₂.φ₁


@[to_additive]
theorem abs_sub_map_le_div [Group α] [LinearOrderedAddCommGroup β] [GroupSeminormClass F α β]
    (f : F) (x y : α) : |f x - f y| ≤ f (x / y)

{F : Type u_2}
{α : Type u_3}
{β : Type u_4}
[FunLike F α β]
[Group α]
[LinearOrderedAddCommGroup β]
[GroupSeminormClass F α β]
(f : F)
(x y : α)


theorem encard_le_encard_iff_encard_diff_le_encard_diff (h : (s ∩ t).Finite) :
    s.encard ≤ t.encard ↔ (s \ t).encard ≤ (t \ s).encard

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


theorem rpow_pos {p : ℝ} {x : ℝ≥0} (hx_pos : 0 < x) : 0 < x ^ p


/-- In a Fréchet-Urysohn space, a point belongs to the closure of a set iff it is a limit
of a sequence taking values in this set. -/
theorem mem_closure_iff_seq_limit [FrechetUrysohnSpace X] {s : Set X} {a : X} :
    a ∈ closure s ↔ ∃ x : ℕ → X, (∀ n : ℕ, x n ∈ s) ∧ Tendsto x atTop (𝓝 a)

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

a ∈ closure s ↔ ∃ x, (∀ (n : ℕ), x n ∈ s) ∧ Filter.Tendsto x Filter.atTop (𝓝 a)


nonrec theorem SmoothOn.prod_mk_space {f : M → E'} {g : M → F'} (hf : SmoothOn I 𝓘(𝕜, E') f s)
    (hg : SmoothOn I 𝓘(𝕜, F') g s) : SmoothOn I 𝓘(𝕜, E' × F') (fun x => (f x, g x)) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{s : Set M}
{f : M → E'}
{g : M → F'}
(hf : SmoothOn I 𝓘(𝕜, E') f s)
(hg : SmoothOn I 𝓘(𝕜, F') g s)


/-- When the first map `S.f` is zero, this is the right homology data on `S` given
by any limit kernel fork of `S.g` -/
@[simps]
def ofIsLimitKernelFork (hf : S.f = 0) (c : KernelFork S.g) (hc : IsLimit c) :
    S.RightHomologyData

(c : CategoryTheory.Limits.KernelFork S.g)

(CategoryTheory.ShortComplex.RightHomologyData.ofIsLimitKernelFork S hf c hc).H = c.pt


theorem le_ofFunction {μ : OuterMeasure α} :
    μ ≤ OuterMeasure.ofFunction m m_empty ↔ ∀ s, μ s ≤ m s

{α : Type u_1}
{m : Set α → ℝ≥0∞}
{m_empty : m ∅ = 0}
{μ : MeasureTheory.OuterMeasure α}

μ ≤ MeasureTheory.OuterMeasure.ofFunction m m_empty ↔ ∀ (s : Set α), μ s ≤ m s


/-- Given a family of opens `U` and an open `Y` equal to the union of opens in `U`, we may
    take the presieve on `Y` associated to `U` and the sieve generated by it, and form the
    full subcategory (subposet) of opens contained in `Y` (`over Y`) consisting of arrows
    in the sieve. This full subcategory is equivalent to `OpensLeCover U`, the (poset)
    category of opens contained in some `U i`. -/
@[simps]
def generateEquivalenceOpensLe_functor' :
    (FullSubcategory fun f : Over Y => (Sieve.generate (presieveOfCoveringAux U Y)).arrows f.hom) ⥤
    OpensLeCover U

{X : TopCat}
{ι : Type w}
(U : ι → TopologicalSpace.Opens ↑X)
{Y : TopologicalSpace.Opens ↑X}
(hY : Y = iSup U)

∀
  {x x_1 :
    CategoryTheory.FullSubcategory fun f =>
      (CategoryTheory.Sieve.generate (TopCat.Presheaf.presieveOfCoveringAux U Y)).arrows f.hom}
  (g : x ⟶ x_1), (TopCat.Presheaf.generateEquivalenceOpensLe_functor' U hY).map g = g.left


theorem exists_nonlinearRightInverse_of_surjective (f : E →SL[σ] F)
    (hsurj : LinearMap.range f = ⊤) :
    ∃ fsymm : NonlinearRightInverse f, 0 < fsymm.nnnorm

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{σ' : 𝕜' →+* 𝕜}
[RingHomInvPair σ σ']
[RingHomIsometric σ]
[RingHomIsometric σ']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
[CompleteSpace F]
[CompleteSpace E]
(f : E →SL[σ] F)
(hsurj : LinearMap.range f = ⊤)


@[simp] theorem coe_sub : ⇑(f - g) = ⇑f - ⇑g

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Ring R]
[AddCommGroup M]
[Module R M]
[TopologicalSpace M]
[AddCommGroup N]
[Module R N]
[TopologicalSpace N]
(f g : M [⋀^ι]→L[R] N)
[TopologicalAddGroup N]


@[simp]
theorem free_obj_coe {α : Type u} : (free.obj α : Type u) = FreeAbelianGroup α

↑(AddCommGrp.free.obj α) = FreeAbelianGroup α


theorem sq_le_one_iff {a : R} (ha : 0 ≤ a) : a ^ 2 ≤ 1 ↔ a ≤ 1

{R : Type u_3}
[LinearOrderedSemiring R]
{a : R}
(ha : 0 ≤ a)


@[simp]
theorem comp.get_mk (x : P (fun i => Q i α)) : comp.get (comp.mk x) = x

{n m : ℕ}
{P : MvPFunctor.{u} n}
{Q : Fin2 n → MvPFunctor.{u} m}
{α : TypeVec.{u} m}
(x : ↑P fun i => ↑(Q i) α)

MvPFunctor.comp.get (MvPFunctor.comp.mk x) = x


@[simp]
theorem toDual_inf' [SemilatticeInf α] {s : Finset ι} (hs : s.Nonempty) (f : ι → α) :
    toDual (s.inf' hs f) = s.sup' hs (toDual ∘ f)

{α : Type u_2}
{ι : Type u_5}
[SemilatticeInf α]
{s : Finset ι}
(hs : s.Nonempty)
(f : ι → α)

OrderDual.toDual (s.inf' hs f) = s.sup' hs (⇑OrderDual.toDual ∘ f)


nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (‖f ·‖ ^ 2) 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 → E}
{x : G}
{n : ℕ∞}
(hf : ContDiffAt ℝ n f x)


/-- The canonical map `Φ.LeftResolution X₂ → Φ.op.RightResolution (Opposite.op X₂)`. -/
@[simps]
def LeftResolution.op {X₂ : C₂} (L : Φ.LeftResolution X₂) :
    Φ.op.RightResolution (Opposite.op X₂)

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

{Φ : CategoryTheory.LocalizerMorphism W₁ W₂}


@[reassoc]
lemma isoShift_hom_naturality (n : M) {X Y : C} (f : X ⟶ Y) :
    F.map (f⟦n⟧') ≫ (F.isoShift n).hom.app Y =
      (F.isoShift n).hom.app X ≫ (F.shift n).map f

{C : Type u_1}
{A : Type u_2}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Category.{u_6, u_2} A]
(F : C ⥤ A)
{M : Type u_3}
[AddMonoid M]
[CategoryTheory.HasShift C M]
[F.ShiftSequence M]
(n : M)
{X Y : C}
(f : X ⟶ Y)

F.map ((CategoryTheory.shiftFunctor C n).map f) ≫ (F.isoShift n).hom.app Y =
  (F.isoShift n).hom.app X ≫ (F.shift n).map f


@[simp]
lemma graphOn_union (f : α → β) (s t : Set α) : graphOn f (s ∪ t) = graphOn f s ∪ graphOn f t

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

Set.graphOn f (s ∪ t) = Set.graphOn f s ∪ Set.graphOn f t


/-- If the natural number `n` is a sum of two squares of coprime natural numbers, then
`-1` is a square modulo `n`. -/
theorem ZMod.isSquare_neg_one_of_eq_sq_add_sq_of_coprime {n x y : ℕ} (h : n = x ^ 2 + y ^ 2)
    (hc : x.Coprime y) : IsSquare (-1 : ZMod n)


theorem iso_isometry_of_normNoninc {V W : SemiNormedGrp} (i : V ≅ W) (h1 : i.hom.NormNoninc)
    (h2 : i.inv.NormNoninc) : Isometry i.hom

(h1 : NormedAddGroupHom.NormNoninc i.hom)

(h2 : NormedAddGroupHom.NormNoninc i.inv)


@[simp]
theorem isCoatom_dual_iff_isAtom [OrderBot α] {a : α} :
    IsCoatom (OrderDual.toDual a) ↔ IsAtom a

{α : Type u_2}
[Preorder α]
[OrderBot α]
{a : α}


@[reassoc (attr := simp)]
theorem inr_isoPushout_hom (h : IsPushout f g inl inr) [HasPushout f g] :
    inr ≫ h.isoPushout.hom = pushout.inr _ _

(h : CategoryTheory.IsPushout f g inl inr)

inr ≫ h.isoPushout.hom = CategoryTheory.Limits.pushout.inr f g


theorem h_apply_fromCoset' (x : B) (b : B) (hb : b ∈ f.range) :
    h x (fromCoset ⟨b • f.range, b, rfl⟩) = fromCoset ⟨b • ↑f.range, b, rfl⟩

{A B : Grp}
(f : A ⟶ B)
(x b : ↑B)
(hb : b ∈ MonoidHom.range f)

((Grp.SurjectiveOfEpiAuxs.h f) x) (Grp.SurjectiveOfEpiAuxs.XWithInfinity.fromCoset ⟨b • ↑(MonoidHom.range f), ⋯⟩) =
  Grp.SurjectiveOfEpiAuxs.XWithInfinity.fromCoset ⟨b • ↑(MonoidHom.range f), ⋯⟩


@[simp]
theorem basis_repr (s : ∀ j, Basis (ιs j) R (Ms j)) (x) (ji) :
    (Pi.basis s).repr x ji = (s ji.1).repr (x ji.1) ji.2

{R : Type u_1}
{η : Type u_2}
{ιs : η → Type u_3}
{Ms : η → Type u_4}
[Semiring R]
[(i : η) → AddCommMonoid (Ms i)]
[(i : η) → Module R (Ms i)]
[Fintype η]
(s : (j : η) → Basis (ιs j) R (Ms j))
(x : (j : η) → Ms j)
(ji : (j : η) × ιs j)

((Pi.basis s).repr x) ji = ((s ji.fst).repr (x ji.fst)) ji.snd


theorem isCompact_iff_finite [DiscreteTopology X] : IsCompact s ↔ s.Finite

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


protected theorem locallyFinite : LocallyFinite fun i => support (f i)

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(f : SmoothPartitionOfUnity ι I M s)

LocallyFinite fun i => Function.support ⇑(f i)


theorem log2_terminates : ∀ n, n ≥ 2 → n / 2 < n


@[to_additive (attr := simp)]
theorem coe_ne_one {a : α} : (a : WithOne α) ≠ (1 : WithOne α)


protected theorem le_of_not_lt {i j : Fin n} (h : ¬ i < j) : j ≤ i


/-- If `f` is a non-strictly contracting map (i.e., it is Lipschitz with constant `1`)
and `g` is a uniformly continuous, then the Birkhoff averages of `g` along orbits of `f`
is a uniformly equicontinuous family of functions. -/
theorem uniformEquicontinuous_birkhoffAverage (hf : LipschitzWith 1 f) (hg : UniformContinuous g) :
    UniformEquicontinuous (birkhoffAverage 𝕜 f g)

(𝕜 : Type u_1)
{X : Type u_2}
{E : Type u_3}
[PseudoEMetricSpace X]
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : X → X}
{g : X → E}
(hf : LipschitzWith 1 f)
(hg : UniformContinuous g)


theorem diff_diff_right {s t u : Set α} : s \ (t \ u) = s \ t ∪ s ∩ u


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

{K : CategoryTheory.GrothendieckTopology D}

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

∀ (a : ℱ'.val.obj X),
  (CategoryTheory.Functor.IsCoverDense.Types.presheafIso i).inv.app X a =
    CategoryTheory.Functor.IsCoverDense.Types.appHom i.inv (Opposite.unop X) a


theorem suffixLevenshtein_nil' (ys : List β) :
    (suffixLevenshtein C [] ys).1 = [levenshtein C [] ys]

{α : Type u_1}
{β : Type u_2}
{δ : Type u_3}
[AddZeroClass δ]
[Min δ]
{C : Levenshtein.Cost α β δ}
(ys : List β)

(suffixLevenshtein C [] ys).val = [levenshtein C [] ys]


@[to_additive]
theorem mul_lt_mul_iff_of_le_of_le [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} (ha : a₁ ≤ a₂)
    (hb : b₁ ≤ b₂) : a₁ * b₁ < a₂ * b₂ ↔ a₁ < a₂ ∨ b₁ < b₂

[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]

[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]


/-- The product of `f y` over `y ∈ g '' s` equals the product of `f (g i)` over `s` provided that
`g` is injective on `s`. -/
@[to_additive
      "The sum of `f y` over `y ∈ g '' s` equals the sum of `f (g i)` over `s` provided that
      `g` is injective on `s`."]
theorem finprod_mem_image {s : Set β} {g : β → α} (hg : s.InjOn g) :
    ∏ᶠ i ∈ g '' s, f i = ∏ᶠ j ∈ s, f (g j)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddCommMonoid M]
{f : α → M}
{s : Set β}
{g : β → α}
(hg : Set.InjOn g s)


/-- `inducedMap` as an `OrderRingHom`. -/
@[simps!]
def inducedOrderRingHom : α →+*o β

∀ (a : α), (LinearOrderedField.inducedOrderRingHom α β) a = (LinearOrderedField.inducedAddHom α β) a


/-- This is used as the ext lemma instead of `MonoidHom.functions_ext` for reasons explained in
note [partially-applied ext lemmas]. -/
@[to_additive (attr := ext)
      "\nThis is used as the ext lemma instead of `AddMonoidHom.functions_ext` for reasons
      explained in note [partially-applied ext lemmas]."]
theorem MonoidHom.functions_ext' [Finite I] (M : Type*) [CommMonoid M] (g h : (∀ i, Z i) →* M)
    (H : ∀ i, g.comp (MonoidHom.mulSingle Z i) = h.comp (MonoidHom.mulSingle Z i)) : g = h

(H : ∀ (i : I), g.comp (AddMonoidHom.single Z i) = h.comp (AddMonoidHom.single Z i))


/-- If a function `f` is `1` outside of a finite set `s`, then it `HasProd` `∏ b ∈ s, f b`. -/
@[to_additive "If a function `f` vanishes outside of a finite set `s`, then it `HasSum`
`∑ b ∈ s, f b`."]
theorem hasProd_prod_of_ne_finset_one (hf : ∀ b ∉ s, f b = 1) :
    HasProd f (∏ b ∈ s, f b)

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{s : Finset β}
(hf : ∀ b ∉ s, f b = 0)


/-- The definition of the congruence relation defined by a monoid homomorphism's kernel. -/
@[to_additive (attr := simp) "The definition of the additive congruence relation defined by an
`AddMonoid` homomorphism's kernel."]
theorem ker_rel (f : M →* P) {x y} : ker f x y ↔ f x = f y

{M : Type u_1}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass P]
(f : M →+ P)
{x y : M}


@[to_additive]
theorem finprod_mem_inter_mul_diff (t : Set α) (h : s.Finite) :
    ((∏ᶠ i ∈ s ∩ t, f i) * ∏ᶠ i ∈ s \ t, f i) = ∏ᶠ i ∈ s, f i

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
{f : α → M}
{s : Set α}
(t : Set α)
(h : s.Finite)

(∏ᶠ (i : α) (_ : i ∈ s ∩ t), f i) * ∏ᶠ (i : α) (_ : i ∈ s \ t), f i = ∏ᶠ (i : α) (_ : i ∈ s), f i


@[simp]
theorem ofPiFork_π_app_left (c : Fork I.fstPiMap I.sndPiMap) (a) :
    (ofPiFork I c).ι a = c.ι ≫ Pi.π _ _

(I : CategoryTheory.Limits.MulticospanIndex C)

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

(CategoryTheory.Limits.Multifork.ofPiFork I c).ι a =
  CategoryTheory.CategoryStruct.comp c.ι (CategoryTheory.Limits.Pi.π I.left a)


@[to_additive (attr := simp,norm_cast)]
theorem coe_mul (s t : LowerSet α) : (↑(s * t) : Set α) = s * t

{α : Type u_1}
[OrderedAddCommGroup α]
(s t : LowerSet α)


theorem bsup_le {o : Ordinal} {f : ∀ b < o, Ordinal} {a} :
    (∀ i h, f i h ≤ a) → bsup.{u, v} o f ≤ a

{f : (b : Ordinal.{u}) → b < o → Ordinal.{max u v}}

(∀ (i : Ordinal.{u}) (h : i < o), f i h ≤ a) → o.bsup f ≤ a


@[simp, norm_cast]
theorem coe_nnreal_ennreal_nndist (x y : α) : ↑(nndist x y) = edist x y

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


/-- A dependent version of `Subsemigroup.iSup_induction`. -/
@[to_additive (attr := elab_as_elim)
"A dependent version of `AddSubsemigroup.iSup_induction`."]
theorem iSup_induction' (S : ι → Subsemigroup M) {C : ∀ x, (x ∈ ⨆ i, S i) → Prop}
    (mem : ∀ (i) (x) (hxS : x ∈ S i), C x (mem_iSup_of_mem i ‹_›))
    (mul : ∀ x y hx hy, C x hx → C y hy → C (x * y) (mul_mem ‹_› ‹_›)) {x₁ : M}
    (hx₁ : x₁ ∈ ⨆ i, S i) : C x₁ hx₁

(mem : ∀ (i : ι) (x : M) (hxS : x ∈ S i), C x ⋯)

(mul : ∀ (x y : M) (hx : x ∈ ⨆ i, S i) (hy : y ∈ ⨆ i, S i), C x hx → C y hy → C (x * y) ⋯)


/-- Morphisms from an `ℕ`-indexed chain complex `C`
to a single object chain complex with `X` concentrated in degree 0
are the same as morphisms `f : C.X 0 ⟶ X` such that `C.d 1 0 ≫ f = 0`.
-/
@[simps apply_coe]
noncomputable def toSingle₀Equiv (C : ChainComplex V ℕ) (X : V) :
    (C ⟶ (single₀ V).obj X) ≃ { f : C.X 0 ⟶ X // C.d 1 0 ≫ f = 0 }

(φ : C ⟶ (ChainComplex.single₀ V).obj X)


theorem omegaLimit_image_eq {α' : Type*} (ϕ : τ → α' → β) (f : Filter τ) (g : α → α') :
    ω f ϕ (g '' s) = ω f (fun t x ↦ ϕ t (g x)) s

{τ : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace β]
(s : Set α)
{α' : Type u_5}
(ϕ : τ → α' → β)
(f : Filter τ)
(g : α → α')

omegaLimit f ϕ (g '' s) = omegaLimit f (fun t x => ϕ t (g x)) s


/-- The `n`-th Chebyshev polynomial of the second kind evaluates on `cos θ` to the
value `sin ((n + 1) * θ) / sin θ`. -/
@[simp]
theorem U_complex_cos (n : ℤ) : (U ℂ n).eval (cos θ) * sin θ = sin ((n + 1) * θ)

Polynomial.eval (Complex.cos θ) (Polynomial.Chebyshev.U ℂ n) * Complex.sin θ = Complex.sin ((↑n + 1) * θ)


/-- A single function is uniformly integrable. -/
theorem unifIntegrable_subsingleton [Subsingleton ι] (hp_one : 1 ≤ p) (hp_top : p ≠ ∞)
    {f : ι → α → β} (hf : ∀ i, Memℒp (f i) p μ) : UnifIntegrable f p μ

{f : ι → α → β}

(hf : ∀ (i : ι), MeasureTheory.Memℒp (f i) p μ)


@[simp]
theorem subtypePerm_apply (f : Perm α) (h : ∀ x, p x ↔ p (f x)) (x : { x // p x }) :
    subtypePerm f h x = ⟨f x, (h _).1 x.2⟩

{α : Type u}
{p : α → Prop}
(f : Equiv.Perm α)
(h : ∀ (x : α), p x ↔ p (f x))
(x : { x // p x })


@[continuity]
theorem Continuous.matrix_row {ι : Type*} {A : X → n → R} (hA : Continuous A) :
    Continuous fun x => row ι (A x)

{X : Type u_1}
{n : Type u_5}
{R : Type u_8}
[TopologicalSpace X]
[TopologicalSpace R]
{ι : Type u_11}
{A : X → n → R}
(hA : Continuous A)


theorem trans_target'' : (e.trans e').target = e' '' (e'.source ∩ e.target)

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(e : PartialHomeomorph X Y)
(e' : PartialHomeomorph Y Z)

(e.trans e').target = ↑e' '' (e'.source ∩ e.target)


@[simp]
theorem map_comp (f : T →+* R) (g : R →+* S) :
    map (g.comp f) = (map g).comp (map (n := n) f)

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{S : Type u_1}
{T : Type u_2}
[CommRing S]
[CommRing T]
(f : T →+* R)
(g : R →+* S)

Matrix.GeneralLinearGroup.map (g.comp f) = (Matrix.GeneralLinearGroup.map g).comp (Matrix.GeneralLinearGroup.map f)


theorem translationNumber_translate (x : ℝ) : τ (translate <| Multiplicative.ofAdd x) = x

(↑(CircleDeg1Lift.translate (Multiplicative.ofAdd x))).translationNumber = x


theorem mem_bind {f : Part α} {g : α → Part β} : ∀ {a b}, a ∈ f → b ∈ g a → b ∈ f.bind g

{α : Type u_1}
{β : Type u_2}
{f : Part α}
{g : α → Part β}
{a : α}
{b : β}


@[simp]
protected theorem inf_apply {C : β → Type*} [∀ b : β, SemilatticeInf (C b)]
    [∀ b : β, OrderTop (C b)] (s : Finset α) (f : α → ∀ b : β, C b) (b : β) :
    s.inf f b = s.inf fun a => f a b

{α : Type u_2}
{β : Type u_3}
{C : β → Type u_7}
[(b : β) → SemilatticeInf (C b)]
[(b : β) → OrderTop (C b)]
(s : Finset α)
(f : α → (b : β) → C b)
(b : β)


/-- An angle in a non-degenerate right-angled triangle is less than `π / 2`. -/
theorem angle_add_lt_pi_div_two_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) (h0 : x ≠ 0) :
    angle x (x + y) < π / 2

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)
(h0 : x ≠ 0)

InnerProductGeometry.angle x (x + y) < π / 2


@[simp]
theorem two_le_card_support_cycleOf_iff [DecidableEq α] [Fintype α] :
    2 ≤ card (cycleOf f x).support ↔ f x ≠ x

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

2 ≤ (f.cycleOf x).support.card ↔ f x ≠ x


lemma continuous_lift {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] [T2Space Y]
    {f : X → Y} (hf : Continuous f) : Continuous (t2Quotient.lift hf)

{X : Type u_3}
{Y : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[T2Space Y]
{f : X → Y}
(hf : Continuous f)


@[symm]
theorem SemanticallyEquivalent.symm {φ ψ : L.BoundedFormula α n}
    (h : T.SemanticallyEquivalent φ ψ) : T.SemanticallyEquivalent ψ φ

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
{n : ℕ}
{φ ψ : L.BoundedFormula α n}
(h : T.SemanticallyEquivalent φ ψ)


theorem lift_map_liftStar {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, F.obj x ⟶ Z)
    (hM : ∀ (x y : C) (f : x ⟶ y), F.map f ≫ M y = M x) (x : C) :
    (lift F M hM).map (starTerminal.from (incl.obj x)) ≫ (liftStar F M hM).hom =
      (inclLift F M hM).hom.app x ≫ M x

(hM : ∀ (x y : C) (f : x ⟶ y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x)

CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.WithTerminal.lift F M hM).map
      (CategoryTheory.WithTerminal.starTerminal.from (CategoryTheory.WithTerminal.incl.obj x)))
    (CategoryTheory.WithTerminal.liftStar F M hM).hom =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.WithTerminal.inclLift F M hM).hom.app x) (M x)


lemma aleph0_le_mk_iff : ℵ₀ ≤ #α ↔ Infinite α

Cardinal.aleph0 ≤ Cardinal.mk α ↔ Infinite α


@[simp]
theorem coeff_sub (p q : R[X]) (n : ℕ) : coeff (p - q) n = coeff p n - coeff q n

{R : Type u}
[Ring R]
(p q : R[X])
(n : ℕ)


theorem IsLUB.exists_seq_monotone_tendsto {t : Set α} {x : α} [IsCountablyGenerated (𝓝 x)]
    (htx : IsLUB t x) (ht : t.Nonempty) :
    ∃ u : ℕ → α, Monotone u ∧ (∀ n, u n ≤ x) ∧ Tendsto u atTop (𝓝 x) ∧ ∀ n, u n ∈ t

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{t : Set α}
{x : α}
[(𝓝 x).IsCountablyGenerated]
(htx : IsLUB t x)
(ht : t.Nonempty)

∃ u, Monotone u ∧ (∀ (n : ℕ), u n ≤ x) ∧ Filter.Tendsto u Filter.atTop (𝓝 x) ∧ ∀ (n : ℕ), u n ∈ t


theorem isZero_of_subsingleton (V : SemiNormedGrp) [Subsingleton V] : Limits.IsZero V


/-- Continuity from above: the measure of the intersection of a decreasing sequence of measurable
sets is the infimum of the measures. -/
theorem measure_iInter_eq_iInf [Countable ι] {s : ι → Set α} (h : ∀ i, MeasurableSet (s i))
    (hd : Directed (· ⊇ ·) s) (hfin : ∃ i, μ (s i) ≠ ∞) : μ (⋂ i, s i) = ⨅ i, μ (s i)

(hd : Directed (fun x x_1 => x ⊇ x_1) s)


theorem map_restrict_ae_le_map_indicator_ae [Zero β] (hs : MeasurableSet s) :
    Filter.map f (ae <| μ.restrict s) ≤ Filter.map (s.indicator f) (ae μ)

{α : Type u_2}
{β : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → β}
[Zero β]
(hs : MeasurableSet s)

Filter.map f (MeasureTheory.ae (μ.restrict s)) ≤ Filter.map (s.indicator f) (MeasureTheory.ae μ)


/-- Any morphism between terminal objects is an isomorphism. -/
lemma isIso_of_isTerminal {X Y : C} (hX : IsTerminal X) (hY : IsTerminal Y) (f : X ⟶ Y) :
    IsIso f

(hX : CategoryTheory.Limits.IsTerminal X)

(hY : CategoryTheory.Limits.IsTerminal Y)


@[simp]
theorem π_f_succ (n : ℕ) : P.π.f (n + 1) = 0

(P : CategoryTheory.ProjectiveResolution Z)


@[to_additive]
theorem continuousSMul_iInf {ts' : ι → TopologicalSpace X}
    (h : ∀ i, @ContinuousSMul M X _ _ (ts' i)) : @ContinuousSMul M X _ _ (⨅ i, ts' i)

{ι : Sort u_1}
{M : Type u_2}
{X : Type u_3}
[TopologicalSpace M]
[SMul M X]
{ts' : ι → TopologicalSpace X}
(h : ∀ (i : ι), ContinuousSMul M X)


theorem measurable_of_finite [Finite α] [MeasurableSingletonClass α] (f : α → β) : Measurable f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
[Finite α]
[MeasurableSingletonClass α]
(f : α → β)


@[simp]
theorem sumAssoc_apply_inr : sumAssoc α β γ (inr c) = inr (inr c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[LE α]
[LE β]
[LE γ]
(c : γ)

(OrderIso.sumAssoc α β γ) (Sum.inr c) = Sum.inr (Sum.inr c)


@[to_additive (attr := simp)]
theorem ofDual_inv [Inv α] (a : αᵒᵈ) : ofDual a⁻¹ = (ofDual a)⁻¹

OrderDual.ofDual a⁻¹ = (OrderDual.ofDual a)⁻¹


/-- The category of differential graded objects in `V` is equivalent
to the category of homological complexes in `V`.
-/
@[simps]
def dgoEquivHomologicalComplex :
    DifferentialObject ℤ (GradedObjectWithShift b V) ≌
      HomologicalComplex V (ComplexShape.up' b)

(HomologicalComplex.dgoEquivHomologicalComplex b V).counitIso =
  HomologicalComplex.dgoEquivHomologicalComplexCounitIso b V


@[to_additive Filter.Tendsto.nnnorm]
theorem Filter.Tendsto.nnnorm' (h : Tendsto f l (𝓝 a)) : Tendsto (fun x => ‖f x‖₊) l (𝓝 ‖a‖₊)

{α : Type u_3}
{E : Type u_6}
[SeminormedGroup E]
{a : E}
{l : Filter α}
{f : α → E}
(h : Filter.Tendsto f l (𝓝 a))

Filter.Tendsto (fun x => ‖f x‖₊) l (𝓝 ‖a‖₊)


theorem nodup_iff_injective_get {l : List α} :
    Nodup l ↔ Function.Injective l.get


theorem lt_mul_ediv_self_add {x k : Int} (h : 0 < k) : x < k * (x / k) + k


theorem pNilradical_eq_bot' {R : Type*} [CommSemiring R] {p : ℕ} (hp : p ≤ 1) :
    pNilradical R p = ⊥

{R : Type u_1}
[CommSemiring R]
{p : ℕ}
(hp : p ≤ 1)


@[simp]
theorem ediam_Ico (a b : ℝ) : EMetric.diam (Ico a b) = ENNReal.ofReal (b - a)

EMetric.diam (Set.Ico a b) = ENNReal.ofReal (b - a)


lemma ext_of_iso {F G : C ⥤ D} (e : F ≅ G) (hobj : ∀ X, F.obj X = G.obj X)
    (happ : ∀ X, e.hom.app X = eqToHom (hobj X)) : F = G

(happ : ∀ (X : C), e.hom.app X = CategoryTheory.eqToHom ⋯)


@[simp] lemma isSublattice_singleton : IsSublattice ({a} : Set α)


@[simp]
theorem piCongrRight_symm {R ι : Type*} {A₁ A₂ : ι → Type*} [CommSemiring R]
    [∀ i, Semiring (A₁ i)] [∀ i, Semiring (A₂ i)] [∀ i, Algebra R (A₁ i)] [∀ i, Algebra R (A₂ i)]
    (e : ∀ i, A₁ i ≃ₐ[R] A₂ i) : (piCongrRight e).symm = piCongrRight fun i => (e i).symm

{R : Type u_1}
{ι : Type u_2}
{A₁ : ι → Type u_3}
{A₂ : ι → Type u_4}
[CommSemiring R]
[(i : ι) → Semiring (A₁ i)]
[(i : ι) → Semiring (A₂ i)]
[(i : ι) → Algebra R (A₁ i)]
[(i : ι) → Algebra R (A₂ i)]
(e : (i : ι) → A₁ i ≃ₐ[R] A₂ i)

(AlgEquiv.piCongrRight e).symm = AlgEquiv.piCongrRight fun i => (e i).symm


@[simp]
theorem primeFactorsList_two : primeFactorsList 2 = [2]


theorem toSet_injective : Function.Injective toSet


theorem zpow_le_max_iff_min_le {x : α} (hx : 1 < x) {a b c : ℤ} :
    x ^ (-c) ≤ max (x ^ (-a)) (x ^ (-b)) ↔ min a b ≤ c

{α : Type u_1}
[LinearOrderedSemifield α]
{x : α}
(hx : 1 < x)
{a b c : ℤ}


/-- The empty list lifts the element `0` of `⨂[R] i, s i`.
-/
lemma lifts_zero : 0 ∈ lifts (0 : ⨂[R] i, s i)

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]


theorem ex_semanticallyEquivalent_not_all_not (φ : L.BoundedFormula α (n + 1)) :
    T.SemanticallyEquivalent φ.ex φ.not.all.not

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
{n : ℕ}
(φ : L.BoundedFormula α (n + 1))


theorem contMDiffAt_extChartAt' {x' : M} (h : x' ∈ (chartAt H x).source) :
    ContMDiffAt I 𝓘(𝕜, E) n (extChartAt I x) x'

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{x : M}
{n : ℕ∞}
{x' : M}
(h : x' ∈ (chartAt H x).source)

ContMDiffAt I 𝓘(𝕜, E) n (↑(extChartAt I x)) x'


lemma CompactIccSpace.mk' [TopologicalSpace α] [Preorder α]
    (h : ∀ {a b : α}, a ≤ b → IsCompact (Icc a b)) : CompactIccSpace α

(h : ∀ {a b : α}, a ≤ b → IsCompact (Set.Icc a b))


@[simp, norm_cast]
theorem coe_inf (s t : Closeds α) : (↑(s ⊓ t) : Set α) = ↑s ∩ ↑t

{α : Type u_2}
[TopologicalSpace α]
(s t : TopologicalSpace.Closeds α)


@[simp]
theorem coe_toSubalgebra (S : StarSubalgebra R A) : (S.toSubalgebra : Set A) = S

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


/-- If `p` is a prime in the Dedekind domain `R`, `S` an extension of `R` and `Sₚ` the localization
of `S` at `p`, then all primes in `Sₚ` are factors of the image of `p` in `Sₚ`. -/
theorem IsLocalization.OverPrime.mem_normalizedFactors_of_isPrime [IsDomain S]
    {P : Ideal Sₚ} (hP : IsPrime P) (hP0 : P ≠ ⊥) :
    P ∈ normalizedFactors (Ideal.map (algebraMap R Sₚ) p)

[IsLocalization (Algebra.algebraMapSubmonoid S p.primeCompl) Sₚ]

P ∈ UniqueFactorizationMonoid.normalizedFactors (Ideal.map (algebraMap R Sₚ) p)


@[simp]
theorem continuous_IccExtend_iff {f : Icc a b → β} : Continuous (IccExtend h f) ↔ Continuous f

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
{a b : α}
{h : a ≤ b}
[TopologicalSpace α]
[OrderTopology α]
[TopologicalSpace β]
{f : ↑(Set.Icc a b) → β}

Continuous (Set.IccExtend h f) ↔ Continuous f


theorem genericPoint_specializes [QuasiSober α] [IrreducibleSpace α] (x : α) : genericPoint α ⤳ x

{α : Type u_1}
[TopologicalSpace α]
[QuasiSober α]
[IrreducibleSpace α]
(x : α)


/-- If `u₁` and `u₂` are two uniform structures on `γ`, then
`𝒰(α, γ, u₁ ⊓ u₂) = 𝒰(α, γ, u₁) ⊓ 𝒰(α, γ, u₂)`. -/
protected theorem inf_eq {u₁ u₂ : UniformSpace γ} :
    𝒰(α, γ, u₁ ⊓ u₂) = 𝒰(α, γ, u₁) ⊓ 𝒰(α, γ, u₂)

{α : Type u_1}
{γ : Type u_3}
{u₁ u₂ : UniformSpace γ}

UniformFun.uniformSpace α γ = UniformFun.uniformSpace α γ ⊓ UniformFun.uniformSpace α γ


/-- If a function `f` is `Periodic` with positive period `c`, then for all `x` there exists some
  `y ∈ Ico 0 c` such that `f x = f y`. -/
theorem Periodic.exists_mem_Ico₀ [LinearOrderedAddCommGroup α] [Archimedean α] (h : Periodic f c)
    (hc : 0 < c) (x) : ∃ y ∈ Ico 0 c, f x = f y

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[LinearOrderedAddCommGroup α]
[Archimedean α]
(h : Function.Periodic f c)
(hc : 0 < c)
(x : α)


@[to_additive]
theorem lipschitz_with_lipschitz_const_mul :
    ∀ p q : β × β, dist (p.1 * p.2) (q.1 * q.2) ≤ LipschitzMul.C β * dist p q

{β : Type u_2}
[PseudoMetricSpace β]
[AddMonoid β]
[LipschitzAdd β]
(p q : β × β)

dist (p.1 + p.2) (q.1 + q.2) ≤ ↑(LipschitzAdd.C β) * dist p q


theorem subtype_coe (s : Set α) : AntilipschitzWith 1 ((↑) : s → α)

{α : Type u_1}
[PseudoEMetricSpace α]
(s : Set α)


lemma IsLowerSet.infClosed (hs : IsLowerSet s) : InfClosed s

{α : Type u_2}
[SemilatticeInf α]
{s : Set α}
(hs : IsLowerSet s)


@[simp, norm_cast]
theorem toEnd_intCast (z : ℤ) : (z : CentroidHom α).toEnd = ↑z

{α : Type u_5}
[NonUnitalNonAssocRing α]
(z : ℤ)


theorem diag_insert : (insert a s).diag = insert (a, a) s.diag

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


lemma coeff_divByMonic_X_sub_C_rec (p : R[X]) (a : R) (n : ℕ) :
    (p /ₘ (X - C a)).coeff n = coeff p (n + 1) + a * (p /ₘ (X - C a)).coeff (n + 1)

{R : Type u}
[Ring R]
(p : R[X])
(a : R)
(n : ℕ)

(p /ₘ (Polynomial.X - Polynomial.C a)).coeff n =
  p.coeff (n + 1) + a * (p /ₘ (Polynomial.X - Polynomial.C a)).coeff (n + 1)


theorem comap_map_eq_of_injective (S : L.Substructure M) : (S.map f).comap f = S

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{f : L.Hom M N}
(hf : Function.Injective ⇑f)
(S : L.Substructure M)

FirstOrder.Language.Substructure.comap f (FirstOrder.Language.Substructure.map f S) = S


@[to_additive]
nonrec theorem SmoothWithinAt.div_const (hf : SmoothWithinAt I' I f s x) :
  SmoothWithinAt I' I (fun x ↦ f x / c) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[DivInvMonoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f : M → G}
{s : Set M}
{x : M}
(c : G)
(hf : SmoothWithinAt I' I f s x)

SmoothWithinAt I' I (fun x => f x / c) s x


lemma isQuasiregular_iff_isUnit {R : Type*} [Ring R] {x : R} :
    IsQuasiregular x ↔ IsUnit (1 + x)


@[to_additive relindex_mul_relindex]
theorem relindex_mul_relindex (hHK : H ≤ K) (hKL : K ≤ L) :
    H.relindex K * K.relindex L = H.relindex L

{G : Type u_1}
[AddGroup G]
(H K L : AddSubgroup G)
(hHK : H ≤ K)
(hKL : K ≤ L)


theorem det_updateRow_sum_aux (M : Matrix n n R) {j : n} (s : Finset n) (hj : j ∉ s) (c : n → R)
    (a : R) :
    (M.updateRow j (a • M j + ∑ k ∈ s, (c k) • M k)).det = a • M.det

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(M : Matrix n n R)
{j : n}
(s : Finset n)
(hj : j ∉ s)
(c : n → R)
(a : R)

(M.updateRow j (a • M j + ∑ k ∈ s, c k • M k)).det = a • M.det


/-- A morphism of homological complexes `f : K ⟶ L` is a quasi-isomorphism in degree `i`
when it induces a quasi-isomorphism of short complexes `K.sc i ⟶ L.sc i`. -/
class QuasiIsoAt (f : K ⟶ L) (i : ι) [K.HasHomology i] [L.HasHomology i] : Prop where
  quasiIso : ShortComplex.QuasiIso ((shortComplexFunctor C c i).map f)

CategoryTheory.ShortComplex.QuasiIso ((HomologicalComplex.shortComplexFunctor C c i).map f)


@[simp]
theorem sinh_lt_sinh : sinh x < sinh y ↔ x < y


/-- **Summation by parts** for ranges -/
theorem sum_range_by_parts :
    ∑ i ∈ range n, f i • g i =
      f (n - 1) • G n - ∑ i ∈ range (n - 1), (f (i + 1) - f i) • G (i + 1)

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(f : ℕ → R)
(g : ℕ → M)
(n : ℕ)

∑ i ∈ Finset.range n, f i • g i =
  f (n - 1) • ∑ i ∈ Finset.range n, g i -
    ∑ i ∈ Finset.range (n - 1), (f (i + 1) - f i) • ∑ i ∈ Finset.range (i + 1), g i


theorem prod_fst_snd : Pi.prod (Prod.fst : α × β → α) (Prod.snd : α × β → β) = id


@[simp]
theorem conjTranspose_rat_smul [AddCommGroup α] [StarAddMonoid α] [Module ℚ α] (c : ℚ)
    (M : Matrix m n α) : (c • M)ᴴ = c • Mᴴ

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[AddCommGroup α]
[StarAddMonoid α]
[Module ℚ α]
(c : ℚ)
(M : Matrix m n α)


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

{m : Type u_2}
{n : Type u_3}
{R : Type u_7}
{α : Type v}
{β : Type w}
{γ : Type u_9}
[Semiring R]
[AddCommMonoid α]
[AddCommMonoid β]
[AddCommMonoid γ]
[Module R α]
[Module R β]
[Module R γ]
(f : β →ₗ[R] γ)
(g : α →ₗ[R] β)

f.mapMatrix ∘ₗ g.mapMatrix = (f ∘ₗ g).mapMatrix


theorem Prod.lexLt_def [LT α] [LT β] (s t : α × β) : (Prod.lexLt s t) = (s.1 < t.1 ∨ (s.1 = t.1 ∧ s.2 < t.2))

{α : Type u_1}
{β : Type u_2}
[LT α]
[LT β]
(s t : α × β)

s.lexLt t = (s.fst < t.fst ∨ s.fst = t.fst ∧ s.snd < t.snd)


theorem gameAdd_iff : ∀ {x y : α × α},
    GameAdd rα (Sym2.mk x) (Sym2.mk y) ↔ Prod.GameAdd rα rα x y ∨ Prod.GameAdd rα rα x.swap y

{α : Type u_1}
{rα : α → α → Prop}
{x y : α × α}

Sym2.GameAdd rα (Sym2.mk x) (Sym2.mk y) ↔ Prod.GameAdd rα rα x y ∨ Prod.GameAdd rα rα x.swap y


@[to_additive (attr := gcongr) add_lt_add_right]
theorem mul_lt_mul_right' [i : CovariantClass α α (swap (· * ·)) (· < ·)] {b c : α} (bc : b < c)
    (a : α) :
    b * a < c * a

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


/-- See `rank_zero_iff` for a stronger version with `NoZeroSMulDivisor R M`. -/
lemma rank_eq_zero_iff :
    Module.rank R M = 0 ↔ ∀ x : M, ∃ a : R, a ≠ 0 ∧ a • x = 0

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]

Module.rank R M = 0 ↔ ∀ (x : M), ∃ a, a ≠ 0 ∧ a • x = 0


/-- The **Gagliardo-Nirenberg-Sobolev inequality**.  Let `u` be a continuously differentiable
function `u` supported in a bounded set `s` in a normed space `E` of finite dimension
`n`, equipped with Haar measure, and let `1 < p < n` and `0 < q ≤ (p⁻¹ - (finrank ℝ E : ℝ)⁻¹)⁻¹`.
Then the `L^q` norm of `u` is bounded above by a constant times the `Lᵖ` norm of
the Fréchet derivative of `u`.

Note: The codomain of `u` needs to be a finite dimensional normed space.
-/
theorem eLpNorm_le_eLpNorm_fderiv_of_le [FiniteDimensional ℝ F]
    {u : E → F} {s : Set E} (hu : ContDiff ℝ 1 u) (h2u : u.support ⊆ s)
    {p q : ℝ≥0} (hp : 1 ≤ p) (h2p : p < finrank ℝ E)
    (hpq : p⁻¹ - (finrank ℝ E : ℝ)⁻¹ ≤ (q : ℝ)⁻¹)
    (hs : Bornology.IsBounded s) :
    eLpNorm u q μ ≤ eLpNormLESNormFDerivOfLeConst F μ s p q * eLpNorm (fderiv ℝ u) p μ

(h2p : p < ↑(FiniteDimensional.finrank ℝ E))

(hpq : ↑p⁻¹ - (↑(FiniteDimensional.finrank ℝ E))⁻¹ ≤ (↑q)⁻¹)

MeasureTheory.eLpNorm u (↑q) μ ≤
  ↑(MeasureTheory.eLpNormLESNormFDerivOfLeConst F μ s p q) * MeasureTheory.eLpNorm (fderiv ℝ u) (↑p) μ


theorem measurable_apply₂ [MeasurableSpace E] [OpensMeasurableSpace E]
    [SecondCountableTopologyEither (E →L[𝕜] F) E]
    [MeasurableSpace F] [BorelSpace F] : Measurable fun p : (E →L[𝕜] F) × E => p.1 p.2


@[simp default+1]
lemma disjoint_singleton_left : Disjoint {a} s ↔ a ∉ s


@[simp] lemma abs_arg_inv (x : ℂ) : |x⁻¹.arg| = |x.arg|


@[simp]
lemma toUniformOnFun_toFun [TopologicalSpace F] (f : ContinuousMultilinearMap 𝕜 E F) :
    UniformOnFun.toFun _ f.toUniformOnFun = f

{𝕜 : Type u_1}
{ι : Type u_2}
{E : ι → Type u_3}
{F : Type u_4}
[NormedField 𝕜]
[(i : ι) → TopologicalSpace (E i)]
[(i : ι) → AddCommGroup (E i)]
[(i : ι) → Module 𝕜 (E i)]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
(f : ContinuousMultilinearMap 𝕜 E F)

(UniformOnFun.toFun {s | Bornology.IsVonNBounded 𝕜 s}) f.toUniformOnFun = ⇑f


@[to_additive coe_prod]
theorem coe_prod (H : Subgroup G) (K : Subgroup N) :
    (H.prod K : Set (G × N)) = (H : Set G) ×ˢ (K : Set N)

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(H : Subgroup G)
(K : Subgroup N)


@[reassoc (attr := simp)]
lemma inlX_sndX (i j : ι) (hij : c.Rel j i) :
    inlX φ i j hij ≫ sndX φ j = 0

HomologicalComplex.homotopyCofiber.inlX φ i j hij ≫ HomologicalComplex.homotopyCofiber.sndX φ j = 0


theorem Antitone.strictAnti_iff_injective (hf : Antitone f) : StrictAnti f ↔ Injective f

{α : Type u}
{β : Type v}
[LinearOrder α]
[PartialOrder β]
{f : α → β}
(hf : Antitone f)


theorem RingHom.charZero (ϕ : R →+* S) [CharZero S] : CharZero R

{R : Type u_1}
{S : Type u_2}
[NonAssocSemiring R]
[NonAssocSemiring S]
(ϕ : R →+* S)
[CharZero S]


protected theorem IsVonNBounded.neg (hs : IsVonNBounded 𝕜 s) : IsVonNBounded 𝕜 (-s)

{𝕜 : Type u_1}
{E : Type u_3}
[SeminormedRing 𝕜]
[AddGroup E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[DistribMulAction 𝕜 E]
{s : Set E}
(hs : Bornology.IsVonNBounded 𝕜 s)


@[simp]
theorem biprod.isoProd_hom {X Y : C} [HasBinaryBiproduct X Y] :
    (biprod.isoProd X Y).hom = prod.lift biprod.fst biprod.snd

(CategoryTheory.Limits.biprod.isoProd X Y).hom =
  CategoryTheory.Limits.prod.lift CategoryTheory.Limits.biprod.fst CategoryTheory.Limits.biprod.snd


/-- The categorical equivalence between `C` and `ShrinkHoms C`, when `C` is locally small.
-/
@[simps!]
noncomputable def equivalence : C ≌ ShrinkHoms C

[CategoryTheory.LocallySmall.{w, v, u} C]

(CategoryTheory.ShrinkHoms.equivalence C).unitIso.inv.app X = 𝟙 X


/-- If the distance between any two points in a set is bounded by some non-negative constant,
this constant bounds the diameter. -/
theorem diam_le_of_forall_dist_le {C : ℝ} (h₀ : 0 ≤ C) (h : ∀ x ∈ s, ∀ y ∈ s, dist x y ≤ C) :
    diam s ≤ C

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{C : ℝ}
(h₀ : 0 ≤ C)
(h : ∀ x ∈ s, ∀ y ∈ s, dist x y ≤ C)


@[ext] theorem ext {f g : α ≃. β} (h : ∀ x, f x = g x) : f = g

{α : Type u}
{β : Type v}
{f g : α ≃. β}
(h : ∀ (x : α), f x = g x)


@[simp]
theorem inter_sdiff_self (s₁ s₂ : Finset α) : s₁ ∩ (s₂ \ s₁) = ∅

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


lemma succAbove_lt_iff_succ_le (p : Fin (n + 1)) (i : Fin n) :
    p.succAbove i < p ↔ succ i ≤ p


lemma trans {γ₁ γ₂ γ₃ : OneCochain G U} {α β : ZeroCochain G U}
    (h₁₂ : OneCohomologyRelation γ₁ γ₂ α) (h₂₃ : OneCohomologyRelation γ₂ γ₃ β) :
    OneCohomologyRelation γ₁ γ₃ (β * α)

{γ₁ γ₂ γ₃ : CategoryTheory.PresheafOfGroups.OneCochain G U}

{α β : CategoryTheory.PresheafOfGroups.ZeroCochain G U}

(h₁₂ : CategoryTheory.PresheafOfGroups.OneCohomologyRelation γ₁ γ₂ α)

(h₂₃ : CategoryTheory.PresheafOfGroups.OneCohomologyRelation γ₂ γ₃ β)

CategoryTheory.PresheafOfGroups.OneCohomologyRelation γ₁ γ₃ (β * α)


theorem pred_injective : Injective (pred : α → α)

{α : Type u_1}
[PartialOrder α]
[PredOrder α]
[NoMinOrder α]


theorem coordinate_eval_3 :
    (coordinate 3).eval (.ofList (a0 :: a1 :: a2 :: a3 :: t)) = a3

(Lean.Omega.LinearCombo.coordinate 3).eval (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: a3 :: t)) = a3


theorem Monoid.fg_def : Monoid.FG M ↔ (⊤ : Submonoid M).FG


@[to_additive]
protected lemma div_left_inj (h : IsUnit c) : a / c = b / c ↔ a = b

{α : Type u}
[DivisionMonoid α]
{a b c : α}
(h : IsUnit c)


/-- The red and the blue arrows in ![this diagram](https://i.imgur.com/q6X1GJ9.png) commute. -/
@[simp, reassoc]
theorem snd_invApp_t_app (i j k : D.J) (U : Opens (pullback (D.f i j) (D.f i k)).carrier) :
    (π₂⁻¹ i, j, k) U ≫ (D.t k i).c.app _ =
      (D.t' k i j).c.app _ ≫
        (π₁⁻¹ k, j, i) (unop _) ≫
          (D.V (k, i)).presheaf.map (eqToHom (D.snd_invApp_t_app' i j k U).choose.symm)

(D : AlgebraicGeometry.PresheafedSpace.GlueData C)

(U : TopologicalSpace.Opens ↑↑(CategoryTheory.Limits.pullback (D.f i j) (D.f i k)))

AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k)) U ≫
    (D.t k i).c.app
      (Opposite.op
        ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor
              (CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k))).obj
          U)) =
  (D.t' k i j).c.app (Opposite.op U) ≫
    AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.fst (D.f k i) (D.f k j))
        (Opposite.unop
          (Opposite.op { carrier := ⇑(D.t' k i j).base ⁻¹' ↑(Opposite.unop (Opposite.op U)), is_open' := ⋯ })) ≫
      (D.V (k, i)).presheaf.map (CategoryTheory.eqToHom ⋯)


/-- See `Submodule.span_smul_eq` (in `RingTheory.Ideal.Operations`) for
`span R (r • s) = r • span R s` that holds for arbitrary `r` in a `CommSemiring`. -/
theorem span_smul_eq_of_isUnit (s : Set M) (r : R) (hr : IsUnit r) : span R (r • s) = span R s

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(s : Set M)
(r : R)
(hr : IsUnit r)

Submodule.span R (r • s) = Submodule.span R s


@[to_additive]
protected theorem UniformGroup.comap {γ : Type*} [Group γ] {u : UniformSpace γ} [UniformGroup γ]
    {F : Type*} [FunLike F β γ] [MonoidHomClass F β γ] (f : F) : @UniformGroup β (u.comap f) _

{β : Type u_2}
[Group β]
{γ : Type u_3}
[Group γ]
{u : UniformSpace γ}
[UniformGroup γ]
{F : Type u_4}
[FunLike F β γ]
[MonoidHomClass F β γ]
(f : F)


theorem join_pmap_eq_pmap_join {f : ∀ a, p a → β} {x : Option (Option α)} (H) :
    (pmap (pmap f) x H).join = pmap f x.join fun a h ↦ H (some a) (mem_of_mem_join h) _ rfl

(H : ∀ (a : Option α), a ∈ x → ∀ (a_2 : α), a_2 ∈ a → p a_2)

(Option.pmap (Option.pmap f) x H).join = Option.pmap f x.join ⋯


@[simp]
theorem comap_apply {S : Type*} [Ring S] (f : S →+* R) (v : Valuation R Γ₀) (s : S) :
    v.comap f s = v (f s)

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
{S : Type u_7}
[Ring S]
(f : S →+* R)
(v : Valuation R Γ₀)
(s : S)


lemma mem_uIcc : a ∈ [[b, c]] ↔ b ≤ a ∧ a ≤ c ∨ c ≤ a ∧ a ≤ b

{α : Type u_1}
[LinearOrder α]
{a b c : α}

a ∈ Set.uIcc b c ↔ b ≤ a ∧ a ≤ c ∨ c ≤ a ∧ a ≤ b


@[to_additive]
theorem NullMeasurableSet.smul {s} (hs : NullMeasurableSet s μ) (c : G) :
    NullMeasurableSet (c • s) μ

[MeasureTheory.VAddInvariantMeasure G α μ]

(hs : MeasureTheory.NullMeasurableSet s μ)

MeasureTheory.NullMeasurableSet (c +ᵥ s) μ


/-- `NonarchAddGroupSeminormClass F α` states that `F` is a type of nonarchimedean seminorms on
the additive group `α`.

You should extend this class when you extend `NonarchAddGroupSeminorm`. -/
class NonarchAddGroupSeminormClass (F : Type*) (α : outParam Type*) [AddGroup α] [FunLike F α ℝ]
    extends NonarchimedeanHomClass F α ℝ : Prop where
  /-- The image of zero is zero. -/
  protected map_zero (f : F) : f 0 = 0
  /-- The seminorm is invariant under negation. -/
  protected map_neg_eq_map' (f : F) (a : α) : f (-a) = f a

[self : NonarchAddGroupSeminormClass F α]


@[to_additive]
theorem comp_left (hf : HasCompactMulSupport f) (hg : g 1 = 1) :
    HasCompactMulSupport (g ∘ f)

{α : Type u_2}
{β : Type u_4}
{γ : Type u_5}
[TopologicalSpace α]
[One β]
[One γ]
{g : β → γ}
{f : α → β}
(hf : HasCompactMulSupport f)
(hg : g 1 = 1)


@[simp]
theorem comp_left (a b c : Over X) (f : a ⟶ b) (g : b ⟶ c) : (f ≫ g).left = f.left ≫ g.left

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
(a b c : CategoryTheory.Over X)
(f : a ⟶ b)
(g : b ⟶ c)

(CategoryTheory.CategoryStruct.comp f g).left = CategoryTheory.CategoryStruct.comp f.left g.left


@[to_additive (attr := simp)]
lemma div_mul_cancel_right (a b : G) : a / (b * a) = b⁻¹


private theorem sInf_le' {S : Set (Submodule R M)} {p} : p ∈ S → sInf S ≤ p

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{S : Set (Submodule R M)}
{p : Submodule R M}


theorem sSup_coe_toSubmodule' (S : Set (LieSubmodule R L M)) :
    (↑(sSup S) : Submodule R M) = ⨆ N ∈ S, (N : Submodule R M)

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


lemma intCast_eq_intCast : (a : R) = b ↔ a ≡ b [ZMOD p]

(R : Type u_1)
[AddGroupWithOne R]
(p : ℕ)
[CharP R p]
{a b : ℤ}


/-- `Set.projIcc` is a contraction. -/
lemma _root_.Set.abs_projIcc_sub_projIcc : (|projIcc a b h c - projIcc a b h d| : α) ≤ |c - d|

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

|↑(Set.projIcc a b h c) - ↑(Set.projIcc a b h d)| ≤ |c - d|


/-- Joining a reverse is the same as reversing all parts and reversing the joined result. -/
theorem join_reverse (L : List (List α)) :
    L.reverse.join = (L.map reverse).join.reverse

L.reverse.join = (List.map List.reverse L).join.reverse


@[to_additive]
theorem map_div_left_ae (μ : Measure G) [IsMulLeftInvariant μ] [IsInvInvariant μ] (x : G) :
    Filter.map (fun t => x / t) (ae μ) = ae μ

{G : Type u_2}
[MeasurableSpace G]
[Group G]
[MeasurableMul G]
[MeasurableInv G]
(μ : MeasureTheory.Measure G)
[μ.IsMulLeftInvariant]
[μ.IsInvInvariant]
(x : G)

Filter.map (fun t => x / t) (MeasureTheory.ae μ) = MeasureTheory.ae μ


@[simp] lemma rec_one {C : ℕ → Sort*} (h0 : C 0) (h : ∀ n, C n → C (n + 1)) :
    Nat.rec (motive := C) h0 h 1 = h 0 h0


/-- The equivalence from coalgebras for the product comonad to the over category. -/
@[simps]
def coalgebraEquivOver : Coalgebra (prodComonad X) ≌ Over X

(CategoryTheory.coalgebraEquivOver X).inverse = CategoryTheory.overToCoalgebra X


theorem setToL1S_mono_left {T T' : Set α → E →L[ℝ] G''} (hTT' : ∀ s x, T s x ≤ T' s x)
    (f : α →₁ₛ[μ] E) : setToL1S T f ≤ setToL1S T' f

(hTT' : ∀ (s : Set α) (x : E), (T s) x ≤ (T' s) x)

(f : ↥(MeasureTheory.Lp.simpleFunc E 1 μ))

MeasureTheory.L1.SimpleFunc.setToL1S T f ≤ MeasureTheory.L1.SimpleFunc.setToL1S T' f


@[simp]
theorem LinearMap.toMatrix₂'_apply (B : (n → S₁) →ₗ[S₁] (m → S₂) →ₗ[S₂] N₂) (i : n) (j : m) :
    LinearMap.toMatrix₂' R B i j =
      B (stdBasis S₁ (fun _ => S₁) i 1) (stdBasis S₂ (fun _ => S₂) j 1)

(LinearMap.toMatrix₂' R) B i j =
  (B ((LinearMap.stdBasis S₁ (fun x => S₁) i) 1)) ((LinearMap.stdBasis S₂ (fun x => S₂) j) 1)


/-- (Impl) Establish an equivalence between the category of cones for `F` and for the "grown" `F`.
-/
@[simps]
def conesEquiv (B : C) (F : Discrete J ⥤ Over B) :
    Cone (widePullbackDiagramOfDiagramOver B F) ≌ Cone F

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

(CategoryTheory.Over.ConstructProducts.conesEquiv B F).functor =
  CategoryTheory.Over.ConstructProducts.conesEquivFunctor B F


/-- Given an open cover `{ Uᵢ }` of `X`, and for each `Uᵢ` an open cover, we may combine these
open covers to form an open cover of `X`.  -/
@[simps! J obj map]
def OpenCover.bind (f : ∀ x : 𝒰.J, OpenCover (𝒰.obj x)) : OpenCover X

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : (x : 𝒰.J) → (𝒰.obj x).OpenCover)
(x : (i : 𝒰.J) × (f i).J)

(𝒰.bind f).map x = (f x.fst).map x.snd ≫ 𝒰.map x.fst


/-- If `a` semiconjugates `x` to `y` and `x'` to `y'`,
then it semiconjugates `x * x'` to `y * y'`. -/
@[to_additive (attr := simp) "If `a` semiconjugates `x` to `y` and `x'` to `y'`,
then it semiconjugates `x + x'` to `y + y'`."]
theorem mul_right (h : SemiconjBy a x y) (h' : SemiconjBy a x' y') :
    SemiconjBy a (x * x') (y * y')

{S : Type u_1}
[AddSemigroup S]
{a x y x' y' : S}
(h : AddSemiconjBy a x y)
(h' : AddSemiconjBy a x' y')


theorem vsub_le_vsub_left : g₁ ≤ g₂ → f -ᵥ g₁ ≤ f -ᵥ g₂

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{f g₁ g₂ : Filter β}

g₁ ≤ g₂ → f -ᵥ g₁ ≤ f -ᵥ g₂


theorem card_lt_card (ht : t.Finite) (hsub : s ⊂ t) : Nat.card s < Nat.card t

{α : Type u_1}
{s t : Set α}
(ht : t.Finite)
(hsub : s ⊂ t)


theorem isMax_iff_forall_not_lt : IsMax a ↔ ∀ b, ¬a < b


@[simp]
theorem removeZero_coeff_succ (p : FormalMultilinearSeries 𝕜 E F) (n : ℕ) :
    p.removeZero (n + 1) = p (n + 1)

{𝕜 : Type u}
{E : Type v}
{F : Type w}
[Ring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
(n : ℕ)


theorem summable_of_sum_range_le {f : ℕ → ℝ} {c : ℝ} (hf : ∀ n, 0 ≤ f n)
    (h : ∀ n, ∑ i ∈ Finset.range n, f i ≤ c) : Summable f

(h : ∀ (n : ℕ), ∑ i ∈ Finset.range n, f i ≤ c)


theorem RingHom.isIntegralElem_map {x : R} : f.IsIntegralElem (f x)

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
(f : R →+* S)
{x : R}


@[simp]
theorem himp_idem : b ⇨ b ⇨ a = b ⇨ a

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


@[simp]
theorem coeff_add (p q : R[X]) (n : ℕ) : coeff (p + q) n = coeff p n + coeff q n

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


theorem eval_neg (f : σ → R) : eval f (-p) = -eval f p

{R : Type u}
{σ : Type u_1}
[CommRing R]
(p : MvPolynomial σ R)
(f : σ → R)

(MvPolynomial.eval f) (-p) = -(MvPolynomial.eval f) p


theorem trace_eq_matrix_trace (f : M →ₗ[R] M) :
    trace R M f = Matrix.trace (LinearMap.toMatrix b b f)

(R : Type u)
[CommSemiring R]
{M : Type v}
[AddCommMonoid M]
[Module R M]
{ι : Type w}
[DecidableEq ι]
[Fintype ι]
(b : Basis ι R M)
(f : M →ₗ[R] M)

(LinearMap.trace R M) f = ((LinearMap.toMatrix b b) f).trace


theorem untrop_sum [ConditionallyCompleteLinearOrder R] [Fintype S] (f : S → Tropical (WithTop R)) :
    untrop (∑ i : S, f i) = ⨅ i : S, untrop (f i)

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

Tropical.untrop (∑ i : S, f i) = ⨅ i, Tropical.untrop (f i)


@[simp]
lemma dist_pi_const [Nonempty β] (a b : α) : (dist (fun _ : β => a) fun _ => b) = dist a b

{α : Type u_1}
{β : Type u_2}
[PseudoMetricSpace α]
[Fintype β]
[Nonempty β]
(a b : α)

(dist (fun x => a) fun x => b) = dist a b


@[to_additive]
theorem comap_injective_isCommutative {f : G' →* G} (hf : Injective f) [H.IsCommutative] :
    (H.comap f).IsCommutative

{G : Type u_1}
{G' : Type u_2}
[Group G]
[Group G']
(H : Subgroup G)
{f : G' →* G}
(hf : Function.Injective ⇑f)
[H.IsCommutative]


theorem sdiff_eq_sdiff_iff_inter_eq_inter {s t₁ t₂ : Finset α} :
    s \ t₁ = s \ t₂ ↔ s ∩ t₁ = s ∩ t₂

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


theorem add_choose_mul_factorial_mul_factorial (i j : ℕ) :
    (i + j).choose j * i ! * j ! = (i + j)!


theorem zero_lt_one : (0 : Fin (n + 2)) < 1


@[to_additive]
theorem isUnit_comp (j : N →* P) (y : S) : IsUnit (j.comp f.toMap y)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
(j : N →+ P)
(y : ↥S)


@[to_additive]
theorem isMulLeftInvariant_map {H : Type*} [MeasurableSpace H] [Mul H] [MeasurableMul H]
    [IsMulLeftInvariant μ] (f : G →ₙ* H) (hf : Measurable f) (h_surj : Surjective f) :
    IsMulLeftInvariant (Measure.map f μ)

{G : Type u_2}
[MeasurableSpace G]
[Add G]
{μ : MeasureTheory.Measure G}
[MeasurableAdd G]
{H : Type u_4}
[MeasurableSpace H]
[Add H]
[MeasurableAdd H]
[μ.IsAddLeftInvariant]
(f : AddHom G H)
(hf : Measurable ⇑f)
(h_surj : Function.Surjective ⇑f)


/-- A morphism between source objects `S ⟶ S'`
contravariantly induces a functor between structured arrows,
`StructuredArrow S' T ⥤ StructuredArrow S T`.

Ideally this would be described as a 2-functor from `D`
(promoted to a 2-category with equations as 2-morphisms)
to `Cat`.
-/
@[simps!]
def map (f : S ⟶ S') : StructuredArrow S' T ⥤ StructuredArrow S T

(X : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit S') T)

((CategoryTheory.StructuredArrow.map f).obj X).left = X.left


/-- The equivalence of functor categories induced by `leftOp` and `rightOp`.
-/
@[simps!]
def leftOpRightOpEquiv : (Cᵒᵖ ⥤ D)ᵒᵖ ≌ C ⥤ Dᵒᵖ

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

(CategoryTheory.Functor.leftOpRightOpEquiv C D).inverse.obj F = Opposite.op F.leftOp


theorem coe_injective : Injective ((↑) : Cₛ^n⟮I; F, V⟯ → ∀ x, V x)

[TopologicalSpace (Bundle.TotalSpace F V)]


/-- For `F : J ⥤ C`, given a cone `c : Cone F`, and a natural isomorphism `α : H ≅ H'` for functors
`H H' : C ⥤ D`, the postcomposition of the cone `H.mapCone` using the isomorphism `α` is
isomorphic to the cone `H'.mapCone`.
-/
@[simps!]
def postcomposeWhiskerLeftMapCone {H H' : C ⥤ D} (α : H ≅ H') (c : Cone F) :
    (Cones.postcompose (whiskerLeft F α.hom : _)).obj (mapCone H c) ≅ mapCone H' c

{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 : J ⥤ C}
{H H' : C ⥤ D}
(α : H ≅ H')
(c : CategoryTheory.Limits.Cone F)

(CategoryTheory.Functor.postcomposeWhiskerLeftMapCone α c).hom.hom = α.hom.app c.pt


@[to_additive (attr := simp)]
theorem semiconjBy_op [Mul α] {a x y : α} : SemiconjBy (op a) (op y) (op x) ↔ SemiconjBy a x y

AddSemiconjBy (AddOpposite.op a) (AddOpposite.op y) (AddOpposite.op x) ↔ AddSemiconjBy a x y


theorem invFunOn_neg (h : ¬∃ a ∈ s, f a = b) : invFunOn f s b = Classical.choice ‹Nonempty α›

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

Function.invFunOn f s b = Classical.choice inst✝


/-- In a pseudoemetric space, Cauchy sequences are characterized by the fact that, eventually,
the pseudoedistance between its elements is arbitrarily small -/
theorem cauchySeq_iff [Nonempty β] [SemilatticeSup β] {u : β → α} :
    CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ m, N ≤ m → ∀ n, N ≤ n → edist (u m) (u n) < ε

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[Nonempty β]
[SemilatticeSup β]
{u : β → α}

CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ (m : β), N ≤ m → ∀ (n : β), N ≤ n → edist (u m) (u n) < ε


theorem sphere_eq_empty_of_subsingleton [Subsingleton α] (hε : ε ≠ 0) : sphere x ε = ∅

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


theorem isGLB_preimage' {s : Set β} {x : β} : IsGLB (f ⁻¹' s) (f.symm x) ↔ IsGLB s x

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(f : α ≃o β)
{s : Set β}
{x : β}


theorem exists_singleton_mem_of_mem_of_forall_separating [Nonempty α] (p : Set α → Prop)
    {s : Set α} [HasCountableSeparatingOn α p s] (hs : s ∈ l) (hl : ∀ U, p U → U ∈ l ∨ Uᶜ ∈ l) :
    ∃ a, {a} ∈ l

(hl : ∀ (U : Set α), p U → U ∈ l ∨ Uᶜ ∈ l)


@[simp] theorem filterMap_replicate_of_none {f : α → Option β} (h : f a = none) :
    (replicate n a).filterMap f = []

{α : Type u_1}
{β : Type u_2}
{a : α}
{n : Nat}
{f : α → Option β}
(h : f a = none)

List.filterMap f (List.replicate n a) = []


@[simp]
theorem symm_trans_apply (e₁ : α ≃o β) (e₂ : β ≃o γ) (c : γ) :
    (e₁.trans e₂).symm c = e₁.symm (e₂.symm c)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[LE α]
[LE β]
[LE γ]
(e₁ : α ≃o β)
(e₂ : β ≃o γ)
(c : γ)


lemma conjExponent_eq : conjExponent p = q


lemma concaveOn_negMulLog : ConcaveOn ℝ (Set.Ici (0 : ℝ)) negMulLog


@[to_additive (attr := simp)]
lemma isSquare_one [MulOneClass α] : IsSquare (1 : α)


theorem comp_assoc (φ₁ : C →ₐc[R] D) (φ₂ : B →ₐc[R] C) (φ₃ : A →ₐc[R] B) :
    (φ₁.comp φ₂).comp φ₃ = φ₁.comp (φ₂.comp φ₃)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
{D : Type u_5}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[Semiring C]
[Algebra R C]
[Semiring D]
[Algebra R D]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
[CoalgebraStruct R C]
[CoalgebraStruct R D]
(φ₁ : C →ₐc[R] D)
(φ₂ : B →ₐc[R] C)
(φ₃ : A →ₐc[R] B)


/-- For a nonempty set `s`, a function `f` takes pairwise equal values on `s` if and only if
for some `z` in the codomain, `f` takes value `z` on all `x ∈ s`. See also
`Set.pairwise_eq_iff_exists_eq` for a version that assumes `[Nonempty ι]` instead of
`Set.Nonempty s`. -/
theorem Nonempty.pairwise_eq_iff_exists_eq {s : Set α} (hs : s.Nonempty) {f : α → ι} :
    (s.Pairwise fun x y => f x = f y) ↔ ∃ z, ∀ x ∈ s, f x = z

{α : Type u_1}
{ι : Type u_4}
{s : Set α}
(hs : s.Nonempty)
{f : α → ι}


lemma factorsThrough_one_iff : FactorsThrough χ 1 ↔ χ = 1

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
(χ : DirichletCharacter R n)


@[to_additive (attr := simp)]
theorem cocone_naturality {j j' : J} (f : j ⟶ j') :
    F.map f ≫ coconeMorphism.{v, u} F j' = coconeMorphism F j

{J : Type v}
[CategoryTheory.SmallCategory J]
(F : J ⥤ AddMonCatMax)
[CategoryTheory.IsFiltered J]
{j j' : J}
(f : j ⟶ j')

F.map f ≫ AddMonCat.FilteredColimits.coconeMorphism F j' = AddMonCat.FilteredColimits.coconeMorphism F j


/-- A unit is `M`-regular. -/
theorem IsUnit.isSMulRegular (ua : IsUnit a) : IsSMulRegular M a

{R : Type u_1}
(M : Type u_3)
{a : R}
[Monoid R]
[MulAction R M]
(ua : IsUnit a)


theorem ofReal_norm_eq_lintegral (f : α →₁[μ] β) :
    ENNReal.ofReal ‖f‖ = ∫⁻ x, (‖f x‖₊ : ℝ≥0∞) ∂μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
(f : ↥(MeasureTheory.Lp β 1 μ))

ENNReal.ofReal ‖f‖ = ∫⁻ (x : α), ↑‖↑↑f x‖₊ ∂μ


@[to_additive (attr := simp, norm_cast)]
theorem const_inv [Inv G] (a : G) : (↑(a⁻¹) : Germ l G) = (↑a)⁻¹

{α : Type u_1}
{l : Filter α}
{G : Type u_6}
[Inv G]
(a : G)

↑a⁻¹ = (↑a)⁻¹


theorem image_iso_iff [LE α] [LE β] {φ : α ≃o β} :
    IsAntichain (· ≤ ·) (φ '' s) ↔ IsAntichain (· ≤ ·) s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
[LE α]
[LE β]
{φ : α ≃o β}

IsAntichain (fun x x_1 => x ≤ x_1) (⇑φ '' s) ↔ IsAntichain (fun x x_1 => x ≤ x_1) s


@[simp]
theorem map_snd_prod (f : Filter α) (g : Filter β) [NeBot f] : map Prod.snd (f ×ˢ g) = g

{α : Type u_1}
{β : Type u_2}
(f : Filter α)
(g : Filter β)
[f.NeBot]


theorem ω_pow_eq_one (p' : ℕ) (h : lucasLehmerResidue (p' + 2) = 0) :
    (ω : X (q (p' + 2))) ^ 2 ^ (p' + 2) = 1


/-- Useful rewrite for the absolute value of `invInterpStrip`-/
lemma abs_invInterpStrip {ε : ℝ} (hε : ε > 0) :
    abs (invInterpStrip f z ε) =
    (ε + sSupNormIm f 0) ^ (z.re - 1) * (ε + sSupNormIm f 1) ^ (-z.re)

{E : Type u_1}
[NormedAddCommGroup E]
(f : ℂ → E)
(z : ℂ)
{ε : ℝ}
(hε : ε > 0)

Complex.abs (Complex.HadamardThreeLines.invInterpStrip f z ε) =
  (ε + Complex.HadamardThreeLines.sSupNormIm f 0) ^ (z.re - 1) *
    (ε + Complex.HadamardThreeLines.sSupNormIm f 1) ^ (-z.re)


theorem length_mul_simple_ne (w : W) (i : B) : ℓ (w * s i) ≠ ℓ w

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(w : W)
(i : B)

cs.length (w * cs.simple i) ≠ cs.length w


/-- The **Banach-Alaoglu theorem**: closed balls of the dual of a normed space `E` are compact in
the weak-star topology. -/
theorem isCompact_closedBall [ProperSpace 𝕜] (x' : Dual 𝕜 E) (r : ℝ) :
    IsCompact (toNormedDual ⁻¹' closedBall x' r)

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
[ProperSpace 𝕜]
(x' : NormedSpace.Dual 𝕜 E)
(r : ℝ)

IsCompact (⇑WeakDual.toNormedDual ⁻¹' Metric.closedBall x' r)


/-- The fully faithful embedding `LightDiagram ⥤ Profinite` -/
@[simps!]
def lightDiagramToProfinite : LightDiagram ⥤ Profinite

∀ {X Y : CategoryTheory.InducedCategory Profinite LightDiagram.toProfinite} (f : X ⟶ Y),
  lightDiagramToProfinite.map f = f


theorem isCoprime_map [Field k] (f : R →+* k) : IsCoprime (p.map f) (q.map f) ↔ IsCoprime p q

{R : Type u}
{k : Type y}
[Field R]
{p q : R[X]}
[Field k]
(f : R →+* k)

IsCoprime (Polynomial.map f p) (Polynomial.map f q) ↔ IsCoprime p q


@[simp]
theorem IsAffineOpen.fromSpecStalk_eq_fromSpecStalk
    {X : Scheme} {U : X.Opens} (hU : IsAffineOpen U) {x : X} (hxU : x ∈ U) :
    hU.fromSpecStalk hxU = X.fromSpecStalk x

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)
{x : ↑↑X.toPresheafedSpace}
(hxU : x ∈ U)


@[to_additive]
theorem prod_apply_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g : α → γ) (k : γ → β)
    (h : ∀ x ∈ s, ¬p x) : (∏ x ∈ s, k (if p x then f x else g x)) = ∏ x ∈ s, k (g x)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
{s : Finset α}
[AddCommMonoid β]
{p : α → Prop}
{hp : DecidablePred p}
(f g : α → γ)
(k : γ → β)
(h : ∀ x ∈ s, ¬p x)

∑ x ∈ s, k (if p x then f x else g x) = ∑ x ∈ s, k (g x)


@[simp]
theorem deriv_cexp (hc : DifferentiableAt 𝕜 f x) :
    deriv (fun x => Complex.exp (f x)) x = Complex.exp (f x) * deriv f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[NormedAlgebra 𝕜 ℂ]
{f : 𝕜 → ℂ}
{x : 𝕜}
(hc : DifferentiableAt 𝕜 f x)


@[nolint unusedHavesSuffices] -- Porting note: false positive
theorem strongDownwardInductionOn_eq {p : Finset α → Sort*} (s : Finset α)
    (H : ∀ t₁, (∀ {t₂ : Finset α}, t₂.card ≤ n → t₁ ⊂ t₂ → p t₂) → t₁.card ≤ n → p t₁) :
    s.strongDownwardInductionOn H = H s fun {t} ht _ => t.strongDownwardInductionOn H ht

(H : (t₁ : Finset α) → ({t₂ : Finset α} → t₂.card ≤ n → t₁ ⊂ t₂ → p t₂) → t₁.card ≤ n → p t₁)

(fun a => s.strongDownwardInductionOn H a) = H s fun {t} ht x => t.strongDownwardInductionOn H ht


theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) :
    IsNoetherian R s

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s t : Submodule R M}
[ht : IsNoetherian R ↥t]
(h : s ≤ t)


/-- **Maximum modulus principle** on a connected set. Let `U` be a (pre)connected open set in a
complex normed space.  Let `f : E → F` be a function that is complex differentiable on `U` and is
continuous on its closure. Suppose that `‖f x‖` takes its maximum value on `U` at `c ∈ U`. Then
`‖f x‖ = ‖f c‖` for all `x ∈ closure U`. -/
theorem norm_eqOn_closure_of_isPreconnected_of_isMaxOn {f : E → F} {U : Set E} {c : E}
    (hc : IsPreconnected U) (ho : IsOpen U) (hd : DiffContOnCl ℂ f U) (hcU : c ∈ U)
    (hm : IsMaxOn (norm ∘ f) U c) : EqOn (norm ∘ f) (const E ‖f c‖) (closure U)

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace ℂ F]
{f : E → F}
{U : Set E}
{c : E}
(hc : IsPreconnected U)
(ho : IsOpen U)
(hd : DiffContOnCl ℂ f U)
(hcU : c ∈ U)
(hm : IsMaxOn (norm ∘ f) U c)

Set.EqOn (norm ∘ f) (Function.const E ‖f c‖) (closure U)


/-- If a composition of a function `f` followed by an injection `g` is locally
constant, then the locally constant property descends to `f`. -/
theorem desc {α β : Type*} (f : X → α) (g : α → β) (h : IsLocallyConstant (g ∘ f))
    (inj : Function.Injective g) : IsLocallyConstant f

{X : Type u_1}
[TopologicalSpace X]
{α : Type u_5}
{β : Type u_6}
(f : X → α)
(g : α → β)
(h : IsLocallyConstant (g ∘ f))
(inj : Function.Injective g)


theorem isOpen_preimage (A : Set S) : IsOpen (S.proj ⁻¹' A)

{X : Type u_2}
[TopologicalSpace X]
(S : DiscreteQuotient X)
(A : Set (Quotient S.toSetoid))


@[simp 1100] -- Porting note: higher priority for linter
theorem disjoint_principal_principal {s t : Set α} : Disjoint (𝓟 s) (𝓟 t) ↔ Disjoint s t


@[to_additive]
theorem isOfFinOrder_iff_pow_eq_one : IsOfFinOrder x ↔ ∃ n, 0 < n ∧ x ^ n = 1


/-- See also `minpoly.ker_eval` which relaxes the assumptions on `A` in exchange for
stronger assumptions on `B`. -/
@[simp]
lemma ker_aeval_eq_span_minpoly :
    RingHom.ker (Polynomial.aeval x) = A[X] ∙ minpoly A x

(A : Type u_1)
{B : Type u_2}
[Field A]
[Ring B]
[Algebra A B]
(x : B)

RingHom.ker (Polynomial.aeval x) = Submodule.span A[X] {minpoly A x}


theorem Injective.preimage_image (hf : Injective f) (s : Set α) : f ⁻¹' (f '' s) = s

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


nonrec theorem IsLocalMaxOn.neg (hf : IsLocalMaxOn f s a) : IsLocalMinOn (fun x => -f x) s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[OrderedAddCommGroup β]
{f : α → β}
{a : α}
{s : Set α}
(hf : IsLocalMaxOn f s a)


theorem isTorsion_of_finiteDimensional [Field K] [Ring A] [Algebra K A]
    [AddCommGroup M] [Module A M] [Module K M] [IsScalarTower K A M] [FiniteDimensional K A] :
    IsTorsion K[X] (AEval K M a)

(K : Type u_2)
(M : Type u_3)
{A : Type u_4}
(a : A)
[Field K]
[Ring A]
[Algebra K A]
[AddCommGroup M]
[Module A M]
[Module K M]
[IsScalarTower K A M]
[FiniteDimensional K A]

Module.IsTorsion K[X] (Module.AEval K M a)


theorem gelfandTransform_map_star (a : A) :
    gelfandTransform ℂ A (star a) = star (gelfandTransform ℂ A a)

{A : Type u_1}
[NormedCommRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[StarModule ℂ A]
(a : A)

(WeakDual.gelfandTransform ℂ A) (star a) = star ((WeakDual.gelfandTransform ℂ A) a)


theorem isOpen_of_isOpen_subideal {U I : Ideal R} (h : U ≤ I) (hU : IsOpen (U : Set R)) :
    IsOpen (I : Set R)

{R : Type u_1}
[CommRing R]
[TopologicalSpace R]
[TopologicalRing R]
{U I : Ideal R}
(h : U ≤ I)
(hU : IsOpen ↑U)


theorem convex_pi {ι : Type*} {E : ι → Type*} [∀ i, AddCommMonoid (E i)] [∀ i, SMul 𝕜 (E i)]
    {s : Set ι} {t : ∀ i, Set (E i)} (ht : ∀ ⦃i⦄, i ∈ s → Convex 𝕜 (t i)) : Convex 𝕜 (s.pi t)

(ht : ∀ ⦃i : ι⦄, i ∈ s → Convex 𝕜 (t i))


theorem right_map_implicitFunction :
    ∀ᶠ p : F × G in 𝓝 (φ.prodFun φ.pt), φ.rightFun (φ.implicitFunction p.1 p.2) = p.2

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[CompleteSpace G]
(φ : ImplicitFunctionData 𝕜 E F G)

∀ᶠ (p : F × G) in 𝓝 (φ.prodFun φ.pt), φ.rightFun (φ.implicitFunction p.1 p.2) = p.2


@[simp]
lemma Hom.id_comp (f : Hom P P') : (Hom.id P').comp f = f

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u_1}
{S' : Type u_2}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra S S']
(f : P.Hom P')

(Algebra.Generators.Hom.id P').comp f = f


@[to_additive]
theorem saturated_iff_zpow {H : Subgroup G} :
    Saturated H ↔ ∀ (n : ℤ) (g : G), g ^ n ∈ H → n = 0 ∨ g ∈ H

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}

H.Saturated ↔ ∀ (n : ℤ) (g : G), n • g ∈ H → n = 0 ∨ g ∈ H


@[simp]
theorem zero_apply : (0 : M [⋀^ι]→ₗ[R] N) v = 0

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
(v : ι → M)


@[ext]
lemma hom_ext {sq₁ sq₂ : Square C} {f g : sq₁ ⟶ sq₂}
    (h₁ : f.τ₁ = g.τ₁) (h₂ : f.τ₂ = g.τ₂)
    (h₃ : f.τ₃ = g.τ₃) (h₄ : f.τ₄ = g.τ₄) : f = g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{sq₁ sq₂ : CategoryTheory.Square C}
{f g : sq₁ ⟶ sq₂}
(h₁ : f.τ₁ = g.τ₁)
(h₂ : f.τ₂ = g.τ₂)
(h₃ : f.τ₃ = g.τ₃)
(h₄ : f.τ₄ = g.τ₄)


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

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


/-- A partial diffeomorphism on `s` is a function `f : M → N` such that `f` restricts to a
diffeomorphism `s → t` between open subsets of `M` and `N`, respectively.
This is an auxiliary definition and should not be used outside of this file. -/
structure PartialDiffeomorph extends PartialEquiv M N where
  open_source : IsOpen source
  open_target : IsOpen target
  contMDiffOn_toFun : ContMDiffOn I J n toFun source
  contMDiffOn_invFun : ContMDiffOn J I n invFun target

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_4}
[TopologicalSpace H]
{G : Type u_5}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_7}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
(self : PartialDiffeomorph I J M N n)

ContMDiffOn J I n self.invFun self.target


lemma natDegree_preΨ'_pos {n : ℕ} (hn : 2 < n) (h : (n : R) ≠ 0) : 0 < (W.preΨ' n).natDegree

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
{n : ℕ}
(hn : 2 < n)
(h : ↑n ≠ 0)


theorem smul_quot [Algebra S R] {n : S} {a : R} :
    (n • ⟨Quot.mk _ a⟩ : RingQuot r) = ⟨Quot.mk _ (n • a)⟩

{R : Type uR}
[Semiring R]
{S : Type uS}
[CommSemiring S]
(r : R → R → Prop)
[Algebra S R]
{n : S}
{a : R}

n • { toQuot := Quot.mk (RingQuot.Rel r) a } = { toQuot := Quot.mk (RingQuot.Rel r) (n • a) }


@[simp]
theorem lor_bit (a m b n) : lor (bit a m) (bit b n) = bit (a || b) (lor m n)

(Int.bit a m).lor (Int.bit b n) = Int.bit (a || b) (m.lor n)


protected lemma _root_.IsCompact.exists_isOpen_lt_of_lt [InnerRegularCompactLTTop μ]
    [IsLocallyFiniteMeasure μ] [R1Space α] [BorelSpace α] {K : Set α}
    (hK : IsCompact K) (r : ℝ≥0∞) (hr : μ K < r) :
    ∃ U, K ⊆ U ∧ IsOpen U ∧ μ U < r


theorem LinearIndependent.inl_union_inr {s : Set M} {t : Set M'}
    (hs : LinearIndependent R (fun x => x : s → M))
    (ht : LinearIndependent R (fun x => x : t → M')) :
    LinearIndependent R (fun x => x : ↥(inl R M M' '' s ∪ inr R M M' '' t) → M × M')

(hs : LinearIndependent R fun (x : ↑s) => ↑x)

(ht : LinearIndependent R fun (x : ↑t) => ↑x)

LinearIndependent R fun (x : ↑(⇑(LinearMap.inl R M M') '' s ∪ ⇑(LinearMap.inr R M M') '' t)) => ↑x


protected theorem «forall» {p : ℚ → Prop} : (∀ r, p r) ↔ ∀ a b : ℤ, p (a / b)

(∀ (r : ℚ), p r) ↔ ∀ (a b : ℤ), p (↑a / ↑b)


theorem exp_analytic (x : 𝔸) : AnalyticAt 𝕂 (exp 𝕂) x

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


/-- The definition of a Grothendieck topology: a set of sieves `J X` on each object `X` satisfying
three axioms:
1. For every object `X`, the maximal sieve is in `J X`.
2. If `S ∈ J X` then its pullback along any `h : Y ⟶ X` is in `J Y`.
3. If `S ∈ J X` and `R` is a sieve on `X`, then provided that the pullback of `R` along any arrow
   `f : Y ⟶ X` in `S` is in `J Y`, we have that `R` itself is in `J X`.

A sieve `S` on `X` is referred to as `J`-covering, (or just covering), if `S ∈ J X`.

See <https://stacks.math.columbia.edu/tag/00Z4>, or [nlab], or [MM92][] Chapter III, Section 2,
Definition 1.
-/
structure GrothendieckTopology where
  /-- A Grothendieck topology on `C` consists of a set of sieves for each object `X`,
    which satisfy some axioms. -/
  sieves : ∀ X : C, Set (Sieve X)
  /-- The sieves associated to each object must contain the top sieve.
    Use `GrothendieckTopology.top_mem`. -/
  top_mem' : ∀ X, ⊤ ∈ sieves X
  /-- Stability under pullback. Use `GrothendieckTopology.pullback_stable`. -/
  pullback_stable' : ∀ ⦃X Y : C⦄ ⦃S : Sieve X⦄ (f : Y ⟶ X), S ∈ sieves X → S.pullback f ∈ sieves Y
  /-- Transitivity of sieves in a Grothendieck topology.
    Use `GrothendieckTopology.transitive`. -/
  transitive' :
    ∀ ⦃X⦄ ⦃S : Sieve X⦄ (_ : S ∈ sieves X) (R : Sieve X),
      (∀ ⦃Y⦄ ⦃f : Y ⟶ X⦄, S f → R.pullback f ∈ sieves Y) → R ∈ sieves X

(self : CategoryTheory.GrothendieckTopology C)


theorem integral_const_on_unit_interval : ∫ _ in a..a + 1, b = b


@[simp]
theorem coe_linear (e : P₁ ≃ᵃ[k] P₂) : (e : P₁ →ᵃ[k] P₂).linear = e.linear

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(e : P₁ ≃ᵃ[k] P₂)


/-- An intermediate field contains the ring's 0. -/
protected theorem zero_mem : (0 : L) ∈ S

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


@[reassoc (attr := simp)]
theorem pi_condition : Pi.lift K.ι ≫ I.fstPiMap = Pi.lift K.ι ≫ I.sndPiMap

{I : CategoryTheory.Limits.MulticospanIndex C}

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Pi.lift K.ι) I.fstPiMap =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Pi.lift K.ι) I.sndPiMap


theorem le_invariants_iterate (f : α → α) (n : ℕ) :
    invariants f ≤ invariants (f^[n])

{α : Type u_1}
[MeasurableSpace α]
(f : α → α)
(n : ℕ)

MeasurableSpace.invariants f ≤ MeasurableSpace.invariants f^[n]


/-- The ring of integers of a number field is not a field. -/
theorem not_isField : ¬IsField (𝓞 K)

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


@[simp]
theorem intCoe_one [AddGroupWithOne R] : ((1 : ArithmeticFunction ℤ) :
    ArithmeticFunction R) = 1


/-- The composition of `C^n` functions on domains is `C^n`. -/
theorem ContMDiffOn.comp' {t : Set M'} {g : M' → M''} (hg : ContMDiffOn I' I'' n g t)
    (hf : ContMDiffOn I I' n f s) : ContMDiffOn I I'' n (g ∘ f) (s ∩ f ⁻¹' t)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{E'' : Type u_8}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{H'' : Type u_9}
[TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''}
{M'' : Type u_10}
[TopologicalSpace M'']
[ChartedSpace H'' M'']
{f : M → M'}
{s : Set M}
{n : ℕ∞}
{t : Set M'}
{g : M' → M''}
(hg : ContMDiffOn I' I'' n g t)
(hf : ContMDiffOn I I' n f s)


/-- The categorical equivalence between `C` and `ULift C`. -/
@[simps]
def ULift.equivalence : C ≌ ULift.{u₂} C

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

CategoryTheory.ULift.equivalence.counitIso.hom.app X =
  CategoryTheory.CategoryStruct.id ((CategoryTheory.ULift.downFunctor.comp CategoryTheory.ULift.upFunctor).obj X)


theorem add_pow_prime_eq (hp : p.Prime) (x y : R) :
    (x + y) ^ p =
      x ^ p + y ^ p + p * ∑ k ∈ Finset.Ioo 0 p, x ^ k * y ^ (p - k) * ↑(p.choose k / p)

{R : Type u_1}
[CommSemiring R]
{p : ℕ}
(hp : Nat.Prime p)
(x y : R)

(x + y) ^ p = x ^ p + y ^ p + ↑p * ∑ k ∈ Finset.Ioo 0 p, x ^ k * y ^ (p - k) * ↑(p.choose k / p)


theorem integral_subtype {α} [MeasureSpace α] {s : Set α} (hs : MeasurableSet s) (f : α → G) :
    ∫ x : s, f x = ∫ x in s, f x

{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{α : Type u_7}
[MeasureTheory.MeasureSpace α]
{s : Set α}
(hs : MeasurableSet s)
(f : α → G)


theorem mul_pos_mem_iff {a t : ℝ} (ha : 0 < a) : a * t ∈ I ↔ t ∈ Set.Icc (0 : ℝ) (1 / a)

a * t ∈ unitInterval ↔ t ∈ Set.Icc 0 (1 / a)


theorem covering_mem_family {p : α × Set α} (hp : p ∈ h.index) : h.covering p ∈ v.setsAt p.1

{α : Type u_1}
[MetricSpace α]
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{v : VitaliFamily μ}
{f : α → Set (Set α)}
{s : Set α}
(h : v.FineSubfamilyOn f s)
{p : α × Set α}
(hp : p ∈ h.index)


theorem toMeasure_uniformOfFintype_apply [MeasurableSpace α] (hs : MeasurableSet s) :
    (uniformOfFintype α).toMeasure s = Fintype.card s / Fintype.card α

{α : Type u_1}
[Fintype α]
[Nonempty α]
(s : Set α)
[MeasurableSpace α]
(hs : MeasurableSet s)

(PMF.uniformOfFintype α).toMeasure s = ↑(Fintype.card ↑s) / ↑(Fintype.card α)


@[simp] lemma tprod_noncommProd {κ : Type*} (s : Finset κ) (x : κ → Π i, A i) (hx) :
    tprod R (s.noncommProd x hx) = s.noncommProd (fun k => tprod R (x k))
      (hx.imp fun _ _ => Commute.tprod)

(hx : (↑s).Pairwise fun a b => Commute (x a) (x b))

(PiTensorProduct.tprod R) (s.noncommProd x hx) = s.noncommProd (fun k => (PiTensorProduct.tprod R) (x k)) ⋯


@[simp]
theorem LinearMap.toMatrixₛₗ₂'_symm :
    ((LinearMap.toMatrixₛₗ₂' R).symm : Matrix n m N₂ ≃ₗ[R] _) = Matrix.toLinearMapₛₗ₂' R σ₁ σ₂

{R : Type u_1}
{R₁ : Type u_2}
{S₁ : Type u_3}
{R₂ : Type u_4}
{S₂ : Type u_5}
{N₂ : Type u_11}
{n : Type u_12}
{m : Type u_13}
[CommSemiring R]
[AddCommMonoid N₂]
[Module R N₂]
[Semiring R₁]
[Semiring R₂]
[Semiring S₁]
[Semiring S₂]
[Module S₁ N₂]
[Module S₂ N₂]
[SMulCommClass S₁ R N₂]
[SMulCommClass S₂ R N₂]
[SMulCommClass S₂ S₁ N₂]
(σ₁ : R₁ →+* S₁)
(σ₂ : R₂ →+* S₂)
[Fintype n]
[Fintype m]
[DecidableEq n]
[DecidableEq m]

(LinearMap.toMatrixₛₗ₂' R).symm = Matrix.toLinearMapₛₗ₂' R σ₁ σ₂


@[reassoc]
theorem comp_val_base {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) :
    (f ≫ g).val.base = f.val.base ≫ g.val.base

{X Y Z : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(g : Y ⟶ Z)


@[simp]
theorem ack_succ_succ (m n : ℕ) : ack (m + 1) (n + 1) = ack m (ack (m + 1) n)


theorem type_fin (n : ℕ) : @type (Fin n) (· < ·) _ = n

(Ordinal.type fun x x_1 => x < x_1) = ↑n


theorem ext_iff {A B : StructuredArrow S T} (f g : A ⟶ B) : f = g ↔ f.right = g.right

{A B : CategoryTheory.StructuredArrow S T}


@[to_additive (attr := simp, norm_cast)]
theorem coe_mul (x y : H) : (↑(x * y) : G) = ↑x * ↑y

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
(x y : ↥H)


lemma isLocalHomeomorph_coe [DiscreteTopology (zmultiples p)] [DenselyOrdered 𝕜] :
    IsLocalHomeomorph ((↑) : 𝕜 → AddCircle p)


@[simp]
theorem ofIsCompl_zero (h : IsCompl p q) : (ofIsCompl h 0 0 : E →ₗ[R] F) = 0

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{p q : Submodule R E}
(h : IsCompl p q)


/-- Composition of lax functors. -/
@[simps]
def comp {D : Type u₃} [Bicategory.{w₃, v₃} D] (F : LaxFunctor B C) (G : LaxFunctor C D) :
    LaxFunctor B D

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{D : Type u₃}
[CategoryTheory.Bicategory D]
(F : CategoryTheory.LaxFunctor B C)
(G : CategoryTheory.LaxFunctor C D)

∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c),
  (F.comp G).mapComp f g = CategoryTheory.CategoryStruct.comp (G.mapComp (F.map f) (F.map g)) (G.map₂ (F.mapComp f g))


theorem smul_mem (r : R) (h : x ∈ p) : r • x ∈ p

{R : Type u}
{M : Type v}
[SMul R M]
(p : SubMulAction R M)
{x : M}
(r : R)
(h : x ∈ p)