/-- An `OrderedSemiring` is a semiring with a partial order such that addition is monotone and
multiplication by a nonnegative number is monotone. -/
class OrderedSemiring (α : Type u) extends Semiring α, OrderedAddCommMonoid α where
  /-- `0 ≤ 1` in any ordered semiring. -/
  protected zero_le_one : (0 : α) ≤ 1
  /-- In an ordered semiring, we can multiply an inequality `a ≤ b` on the left
  by a non-negative element `0 ≤ c` to obtain `c * a ≤ c * b`. -/
  protected mul_le_mul_of_nonneg_left : ∀ a b c : α, a ≤ b → 0 ≤ c → c * a ≤ c * b
  /-- In an ordered semiring, we can multiply an inequality `a ≤ b` on the right
  by a non-negative element `0 ≤ c` to obtain `a * c ≤ b * c`. -/
  protected mul_le_mul_of_nonneg_right : ∀ a b c : α, a ≤ b → 0 ≤ c → a * c ≤ b * c


@[simp]
theorem degree_T [Nontrivial R] (n : ℤ) : (T n : R[T;T⁻¹]).degree = n

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


/-- A monoid is a submonoid of itself. -/
@[to_additive "An `AddMonoid` is an `AddSubmonoid` of itself."]
theorem Univ.isSubmonoid : IsSubmonoid (@Set.univ M)


theorem coe_toAddSubmonoid (s : Subsemiring R) : (s.toAddSubmonoid : Set R) = s

{R : Type u}
[NonAssocSemiring R]
(s : Subsemiring R)


theorem self_mem_nhdsWithin {a : α} {s : Set α} : s ∈ 𝓝[s] a

{α : Type u_1}
[TopologicalSpace α]
{a : α}
{s : Set α}


@[simp]
theorem dotProduct_diagonal (i : m) : v ⬝ᵥ diagonal w i = v i * w i

{m : Type u_2}
{α : Type v}
[Fintype m]
[DecidableEq m]
[NonUnitalNonAssocSemiring α]
(v w : m → α)
(i : m)


theorem subset_upperBounds_lowerBounds (s : Set α) : s ⊆ upperBounds (lowerBounds s)


theorem NoetherianSpace.discrete [NoetherianSpace α] [T2Space α] : DiscreteTopology α

{α : Type u_1}
[TopologicalSpace α]
[TopologicalSpace.NoetherianSpace α]
[T2Space α]


theorem sup'_mono {s₁ s₂ : Finset β} (h : s₁ ⊆ s₂) (h₁ : s₁.Nonempty) :
    s₁.sup' h₁ f ≤ s₂.sup' (h₁.mono h) f

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
(f : β → α)
{s₁ s₂ : Finset β}
(h : s₁ ⊆ s₂)
(h₁ : s₁.Nonempty)


lemma SMulPosReflectLE.lift [SMulPosReflectLE α γ]
    (hf : ∀ {b₁ b₂}, f b₁ ≤ f b₂ ↔ b₁ ≤ b₂)
    (smul : ∀ (a : α) b, f (a • b) = a • f b)
    (zero : f 0 = 0) : SMulPosReflectLE α β

(hf : ∀ {b₁ b₂ : β}, f b₁ ≤ f b₂ ↔ b₁ ≤ b₂)

(smul : ∀ (a : α) (b : β), f (a • b) = a • f b)


@[to_additive nnnorm_nsmul_le]
theorem nnnorm_pow_le_mul_norm (n : ℕ) (a : E) : ‖a ^ n‖₊ ≤ n * ‖a‖₊

{E : Type u_6}
[SeminormedCommGroup E]
(n : ℕ)
(a : E)

‖a ^ n‖₊ ≤ ↑n * ‖a‖₊


/-- Let `f` and `g` be two maps to the same commutative monoid. This lemma gives a sufficient
condition for comparison of the filter `atTop.map (fun s ↦ ∏ b ∈ s, f b)` with
`atTop.map (fun s ↦ ∏ b ∈ s, g b)`. This is useful to compare the set of limit points of
`Π b in s, f b` as `s → atTop` with the similar set for `g`. -/
@[to_additive "Let `f` and `g` be two maps to the same commutative additive monoid. This lemma gives
a sufficient condition for comparison of the filter `atTop.map (fun s ↦ ∑ b ∈ s, f b)` with
`atTop.map (fun s ↦ ∑ b ∈ s, g b)`. This is useful to compare the set of limit points of
`∑ b ∈ s, f b` as `s → atTop` with the similar set for `g`."]
theorem map_atTop_finset_prod_le_of_prod_eq [CommMonoid α] {f : β → α} {g : γ → α}
    (h_eq : ∀ u : Finset γ,
      ∃ v : Finset β, ∀ v', v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x ∈ u', g x = ∏ b ∈ v', f b) :
    (atTop.map fun s : Finset β => ∏ b ∈ s, f b) ≤
      atTop.map fun s : Finset γ => ∏ x ∈ s, g x

(h_eq : ∀ (u : Finset γ), ∃ v, ∀ (v' : Finset β), v ⊆ v' → ∃ u', u ⊆ u' ∧ ∑ x ∈ u', g x = ∑ b ∈ v', f b)

Filter.map (fun s => ∑ b ∈ s, f b) Filter.atTop ≤ Filter.map (fun s => ∑ x ∈ s, g x) Filter.atTop


@[to_additive (attr := simp)] theorem swap_comp_inr : (swap M N).comp inr = inl

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]

(AddMonoid.Coprod.swap M N).comp AddMonoid.Coprod.inr = AddMonoid.Coprod.inl


@[simp]
theorem constantCoeff_map (φ : MvPowerSeries σ R) :
    constantCoeff σ S (map σ f φ) = f (constantCoeff σ R φ)

{σ : Type u_1}
{R : Type u_2}
{S : Type u_3}
[Semiring R]
[Semiring S]
(f : R →+* S)
(φ : MvPowerSeries σ R)

(MvPowerSeries.constantCoeff σ S) ((MvPowerSeries.map σ f) φ) = f ((MvPowerSeries.constantCoeff σ R) φ)


@[simp]
theorem binaryProductLimitCone_cone_π_app_left (G H : AddCommGrp.{u}) :
    (binaryProductLimitCone G H).cone.π.app ⟨WalkingPair.left⟩ = AddMonoidHom.fst G H

(G.binaryProductLimitCone H).cone.π.app { as := CategoryTheory.Limits.WalkingPair.left } = AddMonoidHom.fst ↑G ↑H


@[simp]
theorem Quotient.liftₐ_apply (I : Ideal A) (f : A →ₐ[R₁] B) (hI : ∀ a : A, a ∈ I → f a = 0) (x) :
    Ideal.Quotient.liftₐ I f hI x = Ideal.Quotient.lift I (f : A →+* B) hI x

{R₁ : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R₁]
[CommRing A]
[Algebra R₁ A]
[Semiring B]
[Algebra R₁ B]
(I : Ideal A)
(f : A →ₐ[R₁] B)
(hI : ∀ a ∈ I, f a = 0)
(x : A ⧸ I)

(Ideal.Quotient.liftₐ I f hI) x = (Ideal.Quotient.lift I (↑f) hI) x


/-- In a locally compact group, any neighborhood of the identity contains a compact closed
neighborhood of the identity, even without separation assumptions on the space. -/
@[to_additive (attr := deprecated isCompact_isClosed_basis_nhds (since := "2024-01-28"))
  "In a locally compact additive group, any neighborhood of the identity contains a
  compact closed neighborhood of the identity, even without separation assumptions on the space."]
theorem local_isCompact_isClosed_nhds_of_group [LocallyCompactSpace G] {U : Set G}
    (hU : U ∈ 𝓝 (1 : G)) :
    ∃ K : Set G, IsCompact K ∧ IsClosed K ∧ K ⊆ U ∧ (1 : G) ∈ interior K

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
[LocallyCompactSpace G]
{U : Set G}
(hU : U ∈ 𝓝 0)

∃ K, IsCompact K ∧ IsClosed K ∧ K ⊆ U ∧ 0 ∈ interior K


theorem Iic_eq_finset_subtype : Iic b = (Iic (b : ℕ)).fin n

Finset.Iic b = Finset.fin n (Finset.Iic ↑b)


protected theorem mul_add : ∀ a b c : Int, a * (b + c) = a * b + a * c


theorem lhopital_zero_atTop_on_Ioi (hff' : ∀ x ∈ Ioi a, HasDerivAt f (f' x) x)
    (hgg' : ∀ x ∈ Ioi a, HasDerivAt g (g' x) x) (hg' : ∀ x ∈ Ioi a, g' x ≠ 0)
    (hftop : Tendsto f atTop (𝓝 0)) (hgtop : Tendsto g atTop (𝓝 0))
    (hdiv : Tendsto (fun x => f' x / g' x) atTop l) : Tendsto (fun x => f x / g x) atTop l

(hff' : ∀ x ∈ Set.Ioi a, HasDerivAt f (f' x) x)

(hgg' : ∀ x ∈ Set.Ioi a, HasDerivAt g (g' x) x)

(hftop : Filter.Tendsto f Filter.atTop (𝓝 0))

(hgtop : Filter.Tendsto g Filter.atTop (𝓝 0))

(hdiv : Filter.Tendsto (fun x => f' x / g' x) Filter.atTop l)

Filter.Tendsto (fun x => f x / g x) Filter.atTop l


@[reassoc (attr := simp)]
theorem biprod.symmetry' (P Q : C) :
    biprod.lift biprod.snd biprod.fst ≫ biprod.lift biprod.snd biprod.fst = 𝟙 (P ⊞ Q)

CategoryTheory.Limits.biprod.lift CategoryTheory.Limits.biprod.snd CategoryTheory.Limits.biprod.fst ≫
    CategoryTheory.Limits.biprod.lift CategoryTheory.Limits.biprod.snd CategoryTheory.Limits.biprod.fst =
  𝟙 (P ⊞ Q)


theorem mul_eq_mul_iff_eq_and_eq_of_pos' [PosMulStrictMono α] [MulPosStrictMono α]
    (hab : a ≤ b) (hcd : c ≤ d) (b0 : 0 < b) (c0 : 0 < c) :
    a * c = b * d ↔ a = b ∧ c = d

{α : Type u_1}
{a b c d : α}
[MulZeroClass α]
[PartialOrder α]
[PosMulStrictMono α]
[MulPosStrictMono α]
(hab : a ≤ b)
(hcd : c ≤ d)
(b0 : 0 < b)
(c0 : 0 < c)


lemma vanishingIdeal_irreducibleComponents :
    vanishingIdeal '' (irreducibleComponents <| PrimeSpectrum R) =
    minimalPrimes R

PrimeSpectrum.vanishingIdeal '' irreducibleComponents (PrimeSpectrum R) = minimalPrimes R


theorem nodal_ne_zero [Nontrivial R] : nodal s v ≠ 0

{R : Type u_1}
[CommRing R]
{ι : Type u_2}
{s : Finset ι}
{v : ι → R}
[Nontrivial R]


theorem QuasiconvexOn.convex [IsDirected β (· ≤ ·)] (hf : QuasiconvexOn 𝕜 s f) : Convex 𝕜 s

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LE β]
[SMul 𝕜 E]
{s : Set E}
{f : E → β}
[IsDirected β fun x x_1 => x ≤ x_1]
(hf : QuasiconvexOn 𝕜 s f)


/-- A point is in an `Ioc` iff it can be expressed as a semistrict convex combination of the
endpoints. -/
theorem Convex.mem_Ioc (h : x < y) :
    z ∈ Ioc x y ↔ ∃ a b, 0 ≤ a ∧ 0 < b ∧ a + b = 1 ∧ a * x + b * y = z

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{x y z : 𝕜}
(h : x < y)

z ∈ Set.Ioc x y ↔ ∃ a b, 0 ≤ a ∧ 0 < b ∧ a + b = 1 ∧ a * x + b * y = z


/-- An auxiliary induction lemma, which is generalized by `solvableByRad.isSolvable`. -/
theorem induction1 {α β : solvableByRad F E} (hβ : β ∈ F⟮α⟯) (hα : P α) : P β

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{α β : ↥(solvableByRad F E)}
(hβ : β ∈ F⟮α⟯)
(hα : solvableByRad.P α)


/-- The series defining the theta function is summable if and only if `0 < im τ`. -/
lemma summable_jacobiTheta₂_term_iff (z τ : ℂ) : Summable (jacobiTheta₂_term · z τ) ↔ 0 < im τ

(Summable fun x => jacobiTheta₂_term x z τ) ↔ 0 < τ.im


@[reassoc (attr := simp)]
lemma limitConeπApp_naturality {i j : J} (f : i ⟶ j) :
    limitConeπApp F i ≫ F.map f = limitConeπApp F j

[∀ (X : Cᵒᵖ),
    Small.{v, max u₂ v}
      ↑((F ⋙ PresheafOfModules.evaluation R X) ⋙ CategoryTheory.forget (ModuleCat ↑(R.obj X))).sections]

PresheafOfModules.limitConeπApp F i ≫ F.map f = PresheafOfModules.limitConeπApp F j


theorem smul_mem_pointwise_smul (m : G) (a : α) (S : Subgroup G) : m ∈ S → a • m ∈ a • S

{α : Type u_1}
{G : Type u_2}
[Group G]
[Monoid α]
[MulDistribMulAction α G]
(m : G)
(a : α)
(S : Subgroup G)


theorem iIndepSets.iIndepSet_of_mem {π : ι → Set (Set Ω)} {f : ι → Set Ω}
    (hfπ : ∀ i, f i ∈ π i) (hf : ∀ i, MeasurableSet (f i))
    (hπ : iIndepSets π μ) : iIndepSet f μ

{Ω : Type u_1}
{ι : Type u_2}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsProbabilityMeasure μ]
{π : ι → Set (Set Ω)}
{f : ι → Set Ω}
(hfπ : ∀ (i : ι), f i ∈ π i)
(hf : ∀ (i : ι), MeasurableSet (f i))
(hπ : ProbabilityTheory.iIndepSets π μ)


@[to_additive]
theorem le_comap_map (H : Subgroup G) : H ≤ comap f (map f H)

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
(f : G →+ N)
(H : AddSubgroup G)

H ≤ AddSubgroup.comap f (AddSubgroup.map f H)


@[simp]
lemma opensFunctor_map_homOfLE {U V : X.Opens} (e : U ≤ V) :
    (Scheme.Hom.opensFunctor f).map (homOfLE e) = homOfLE (f.image_le_image_of_le e)

[H : AlgebraicGeometry.IsOpenImmersion f]

f.opensFunctor.map (CategoryTheory.homOfLE e) = CategoryTheory.homOfLE ⋯


theorem image_preimage_val (s t : Set α) : (Subtype.val : s → α) '' (Subtype.val ⁻¹' t) = s ∩ t

Subtype.val '' (Subtype.val ⁻¹' t) = s ∩ t


theorem ContMDiff.clm_comp {g : M → F₁ →L[𝕜] F₃} {f : M → F₂ →L[𝕜] F₁}
    (hg : ContMDiff I 𝓘(𝕜, F₁ →L[𝕜] F₃) n g) (hf : ContMDiff I 𝓘(𝕜, F₂ →L[𝕜] F₁) n f) :
    ContMDiff I 𝓘(𝕜, F₂ →L[𝕜] F₃) n fun x => (g x).comp (f x)


@[simp] theorem Subset.refl (l : List α) : l ⊆ l


theorem map_subtype_embedding_Ioo (hp : ∀ ⦃a b x⦄, a ≤ x → x ≤ b → p a → p b → p x):
    (Ioo a b).map (Embedding.subtype p) = (Ioo a b : Finset α)

(hp : ∀ ⦃a b x : α⦄, a ≤ x → x ≤ b → p a → p b → p x)

Finset.map (Function.Embedding.subtype p) (Finset.Ioo a b) = Finset.Ioo ↑a ↑b


/-- `padicValInt p 0` is `0` for any `p`. -/
@[simp]
protected theorem zero : padicValInt p 0 = 0


@[to_additive]
theorem one_def [One β] : (1 : α →ₘ[μ] β) = mk (fun _ : α => 1) aestronglyMeasurable_const

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
[One β]

1 = MeasureTheory.AEEqFun.mk (fun x => 1) ⋯


theorem find?_some : ∀ {l}, find? p l = some a → p a

∀ {α : Type u_1} {p : α → Bool} {a : α} {l : List α}, List.find? p l = some a → p a = true


@[simp] theorem Bool.not_eq_true (b : Bool) : (¬(b = true)) = (b = false)


theorem Monotone.map_max (hf : Monotone f) : f (max a b) = max (f a) (f b)

{α : Type u}
{β : Type v}
[LinearOrder α]
[LinearOrder β]
{f : α → β}
{a b : α}
(hf : Monotone f)


theorem data_swap (a : Array α) (i j : Fin a.size) :
    (a.swap i j).data = (a.data.set i (a.get j)).set j (a.get i)

{α : Type u_1}
(a : Array α)
(i j : Fin a.size)

(a.swap i j).data = (a.data.set (↑i) (a.get j)).set (↑j) (a.get i)


@[simp]
theorem frontier_univ_prod_eq (s : Set Y) :
    frontier ((univ : Set X) ×ˢ s) = univ ×ˢ frontier s

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
(s : Set Y)

frontier (Set.univ ×ˢ s) = Set.univ ×ˢ frontier s


@[congr]
theorem toFinset_congr {s t : Set α} [Fintype s] [Fintype t] (h : s = t) :
    toFinset s = toFinset t

{α : Type u_1}
{s t : Set α}
[Fintype ↑s]
[Fintype ↑t]
(h : s = t)


theorem squareCylinders_eq_iUnion_image (C : ∀ i, Set (Set (α i))) :
    squareCylinders C = ⋃ s : Finset ι, (fun t ↦ (s : Set ι).pi t) '' univ.pi C

{ι : Type u_2}
{α : ι → Type u_1}
(C : (i : ι) → Set (Set (α i)))

MeasureTheory.squareCylinders C = ⋃ s, (fun t => (↑s).pi t) '' Set.univ.pi C


theorem map_succ' (a : Fin (n + 1) → ℕ) : map d a = a 0 + map d (a ∘ Fin.succ) * d

(Behrend.map d) a = a 0 + (Behrend.map d) (a ∘ Fin.succ) * d


@[simp]
theorem lift_gen (pb : PowerBasis A S) (y : S') (hy : aeval y (minpoly A pb.gen) = 0) :
    pb.lift y hy pb.gen = y

(hy : (Polynomial.aeval y) (minpoly A pb.gen) = 0)


theorem modifyNthTail_modifyNthTail_le {f g : List α → List α} (m n : ℕ) (l : List α)
    (h : n ≤ m) :
    (l.modifyNthTail f n).modifyNthTail g m =
      l.modifyNthTail (fun l => (f l).modifyNthTail g (m - n)) n

{α : Type u}
{f g : List α → List α}
(m n : ℕ)
(l : List α)
(h : n ≤ m)

List.modifyNthTail g m (List.modifyNthTail f n l) = List.modifyNthTail (fun l => List.modifyNthTail g (m - n) (f l)) n l


theorem span_gcd (x y : R) : span {gcd x y} = span {x, y}

{R : Type u}
[CommRing R]
[IsDomain R]
[IsBezout R]
[GCDMonoid R]
(x y : R)

Ideal.span {gcd x y} = Ideal.span {x, y}


theorem eventually_nhdsWithin_of_eventually_nhds {α : Type*} [TopologicalSpace α] {s : Set α}
    {a : α} {p : α → Prop} (h : ∀ᶠ x in 𝓝 a, p x) : ∀ᶠ x in 𝓝[s] a, p x

{α : Type u_7}
[TopologicalSpace α]
{s : Set α}
{a : α}
{p : α → Prop}
(h : ∀ᶠ (x : α) in 𝓝 a, p x)


@[simp]
theorem val_zero (n : ℕ) : (0 : AdicCompletion I M).val n = 0

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(M : Type u_2)
[AddCommGroup M]
[Module R M]
(n : ℕ)


@[simp]
theorem deriv_inv'' (hc : DifferentiableAt 𝕜 c x) (hx : c x ≠ 0) :
    deriv (fun x => (c x)⁻¹) x = -deriv c x / c x ^ 2

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{c : 𝕜 → 𝕜}
(hc : DifferentiableAt 𝕜 c x)
(hx : c x ≠ 0)


theorem mem_restrict_range {r : β} {s : Set α} {f : α →ₛ β} (hs : MeasurableSet s) :
    r ∈ (restrict f s).range ↔ r = 0 ∧ s ≠ univ ∨ r ∈ f '' s

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Zero β]
{r : β}
{s : Set α}
{f : MeasureTheory.SimpleFunc α β}
(hs : MeasurableSet s)

r ∈ (f.restrict s).range ↔ r = 0 ∧ s ≠ Set.univ ∨ r ∈ ↑f '' s


@[to_additive (attr := simp)]
theorem lowerClosure_smul : lowerClosure (a • s) = a • lowerClosure s

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


@[simp]
theorem toBoolRing_bot : toBoolRing (⊥ : α) = 0


@[simp] lemma shiftl_eq_shiftLeft (p : PosNum) (n : Nat) : p.shiftl n = p <<< n


theorem sSup_unit_ball_eq_nnnorm {𝕜 𝕜₂ E F : Type*} [NormedAddCommGroup E]
    [SeminormedAddCommGroup F] [DenselyNormedField 𝕜] [NontriviallyNormedField 𝕜₂] {σ₁₂ : 𝕜 →+* 𝕜₂}
    [NormedSpace 𝕜 E] [NormedSpace 𝕜₂ F] [RingHomIsometric σ₁₂] (f : E →SL[σ₁₂] F) :
    sSup ((fun x => ‖f x‖₊) '' ball 0 1) = ‖f‖₊

{𝕜 : Type u_11}
{𝕜₂ : Type u_12}
{E : Type u_13}
{F : Type u_14}
[NormedAddCommGroup E]
[SeminormedAddCommGroup F]
[DenselyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)

sSup ((fun x => ‖f x‖₊) '' Metric.ball 0 1) = ‖f‖₊


@[simp] lemma zpow_addLeft (n : ℤ) : Equiv.addLeft a ^ n = Equiv.addLeft (n • a)

{α : Type u}
[AddGroup α]
(a : α)
(n : ℤ)


/-- Coercion to a function as an `AlgHom`. -/
@[simps!]
def ContinuousMap.coeFnAlgHom : C(α, A) →ₐ[R] α → A

{α : Type u_1}
[TopologicalSpace α]
(R : Type u_2)
[CommSemiring R]
{A : Type u_3}
[TopologicalSpace A]
[Semiring A]
[Algebra R A]
[TopologicalSemiring A]
(f : C(α, A))
(a : α)


theorem preimage_relIso {t : Set β} (hs : IsAntichain r' t) (φ : r ≃r r') :
    IsAntichain r (φ ⁻¹' t)

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{r' : β → β → Prop}
{t : Set β}
(hs : IsAntichain r' t)
(φ : r ≃r r')


theorem sSameSide_vadd_left_iff {s : AffineSubspace R P} {x y : P} {v : V} (hv : v ∈ s.direction) :
    s.SSameSide (v +ᵥ x) y ↔ s.SSameSide x y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y : P}
{v : V}
(hv : v ∈ s.direction)


@[simp] theorem countP_cons_of_neg (l) (pa : ¬p a) : countP p (a :: l) = countP p l

{α : Type u_1}
(p : α → Bool)
{a : α}
(l : List α)
(pa : ¬p a = true)

List.countP p (a :: l) = List.countP p l


@[to_additive]
theorem smul_mem_orbit_smul (g h : G) (a : α) : g • a ∈ orbit G (h • a)

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


/-- An expression for the inverse of an upper block-triangular matrix, when either both elements of
diagonal are invertible, or both are not. -/
theorem inv_fromBlocks_zero₂₁_of_isUnit_iff (A : Matrix m m α) (B : Matrix m n α) (D : Matrix n n α)
    (hAD : IsUnit A ↔ IsUnit D) :
    (fromBlocks A B 0 D)⁻¹ = fromBlocks A⁻¹ (-(A⁻¹ * B * D⁻¹)) 0 D⁻¹

{m : Type u_2}
{n : Type u_3}
{α : Type u_4}
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
[CommRing α]
(A : Matrix m m α)
(B : Matrix m n α)
(D : Matrix n n α)
(hAD : IsUnit A ↔ IsUnit D)

(Matrix.fromBlocks A B 0 D)⁻¹ = Matrix.fromBlocks A⁻¹ (-(A⁻¹ * B * D⁻¹)) 0 D⁻¹


/-- Change a `Cocone F` into a `Cone F.op`. -/
@[simps]
def Cocone.op (c : Cocone F) : Cone F.op

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


theorem map_disjUnion {f : α ↪ β} (s₁ s₂ : Finset α) (h) (h' := (disjoint_map _).mpr h) :
    (s₁.disjUnion s₂ h).map f = (s₁.map f).disjUnion (s₂.map f) h'

(h' : Disjoint (Finset.map f s₁) (Finset.map f s₂) := ⋯)

Finset.map f (s₁.disjUnion s₂ h) = (Finset.map f s₁).disjUnion (Finset.map f s₂) h'


/-- The character of a representation is constant on conjugacy classes. -/
@[simp]
theorem char_conj (V : FDRep k G) (g : G) (h : G) : V.character (h * g * h⁻¹) = V.character g

{k : Type u}
[Field k]
{G : Type u}
[Group G]
(V : FDRep k G)
(g h : G)


@[to_additive (attr := simp)]
lemma ker_fst : ker (fst G G') = .prod ⊥ ⊤

{G : Type u_1}
{G' : Type u_2}
[Group G]
[Group G']


theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn 𝕜 f s) (hg : s.EqOn f g) :
    AnalyticOn 𝕜 g s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{s : Set E}
(hs : IsOpen s)
(hf : AnalyticOn 𝕜 f s)
(hg : Set.EqOn f g s)


/-- Bundled `n` times continuously differentiable sections of a vector bundle. -/
structure ContMDiffSection where
  /-- the underlying function of this section -/
  protected toFun : ∀ x, V x
  /-- proof that this section is `C^n` -/
  protected contMDiff_toFun : ContMDiff I (I.prod 𝓘(𝕜, F)) n fun x ↦
    TotalSpace.mk' F x (toFun x)

[TopologicalSpace (Bundle.TotalSpace F V)]

ContMDiff I (I.prod 𝓘(𝕜, F)) n fun x => Bundle.TotalSpace.mk' F x (self.toFun x)


theorem mapL_comp : mapL (fun (i : ι) ↦ g i ∘L f i) = mapL g ∘L mapL f

[(i : ι) → SeminormedAddCommGroup (E i)]

[(i : ι) → SeminormedAddCommGroup (E' i)]

[(i : ι) → SeminormedAddCommGroup (E'' i)]

(PiTensorProduct.mapL fun i => (g i).comp (f i)) = (PiTensorProduct.mapL g).comp (PiTensorProduct.mapL f)


@[simp]
lemma isoAdd_inv_app {a b : A}
    (e₁ : shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a)
    (e₂ : shiftFunctor C b ⋙ F ≅ F ⋙ shiftFunctor D b) (X : C) :
      (CommShift.isoAdd e₁ e₂).inv.app X = (shiftFunctorAdd D a b).hom.app (F.obj X) ≫
        (shiftFunctor D b).map (e₁.inv.app X) ≫ e₂.inv.app ((shiftFunctor C a).obj X) ≫
        F.map ((shiftFunctorAdd C a b).inv.app X)

(e₁ : (CategoryTheory.shiftFunctor C a).comp F ≅ F.comp (CategoryTheory.shiftFunctor D a))

(e₂ : (CategoryTheory.shiftFunctor C b).comp F ≅ F.comp (CategoryTheory.shiftFunctor D b))

(CategoryTheory.Functor.CommShift.isoAdd e₁ e₂).inv.app X =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctorAdd D a b).hom.app (F.obj X))
    (CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctor D b).map (e₁.inv.app X))
      (CategoryTheory.CategoryStruct.comp (e₂.inv.app ((CategoryTheory.shiftFunctor C a).obj X))
        (F.map ((CategoryTheory.shiftFunctorAdd C a b).inv.app X))))


/-- If `f'` and `f₁'` are two derivatives of `f` within `s` at `x`, then they are equal on the
tangent cone to `s` at `x` -/
theorem HasFDerivWithinAt.unique_on (hf : HasFDerivWithinAt f f' s x)
    (hg : HasFDerivWithinAt f f₁' s x) : EqOn f' f₁' (tangentConeAt 𝕜 s x)

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

Set.EqOn (⇑f') (⇑f₁') (tangentConeAt 𝕜 s x)


@[to_additive]
theorem eq_class_eq_leftCoset (s : Subgroup α) (g : α) :
    { x : α | (x : α ⧸ s) = g } = g • s

{α : Type u_1}
[AddGroup α]
(s : AddSubgroup α)
(g : α)


theorem xInTermsOfW_vars_subset (n : ℕ) : (xInTermsOfW p ℚ n).vars ⊆ range (n + 1)

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

(xInTermsOfW p ℚ n).vars ⊆ Finset.range (n + 1)


@[simp]
theorem adjoin_insert_adjoin (x : E) :
    adjoin F (insert x (adjoin F S : Set E)) = adjoin F (insert x S)

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(S : Set E)
(x : E)

IntermediateField.adjoin F (insert x ↑(IntermediateField.adjoin F S)) = IntermediateField.adjoin F (insert x S)


theorem isOpen_iff_nhds : IsOpen s ↔ ∀ x ∈ s, 𝓝 x ≤ 𝓟 s

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


@[simp]
theorem toNNReal_one : Real.toNNReal 1 = 1


@[simp]
theorem bihimp_himp_right : a ⇔ b ⇨ b = a ⊔ b

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


theorem Pi.lt_def [∀ i, Preorder (π i)] {x y : ∀ i, π i} :
    x < y ↔ x ≤ y ∧ ∃ i, x i < y i

{ι : Type u_1}
{π : ι → Type u_4}
[(i : ι) → Preorder (π i)]
{x y : (i : ι) → π i}


/-- The functorial map taking `f : C(X, Y)` to `C(Y, A) →⋆ₐ[𝕜] C(X, A)` given by pre-composition
with the continuous function `f`. See `ContinuousMap.compMonoidHom'` and
`ContinuousMap.compAddMonoidHom'`, `ContinuousMap.compRightAlgHom` for bundlings of
pre-composition into a `MonoidHom`, an `AddMonoidHom` and an `AlgHom`, respectively, under
suitable assumptions on `A`. -/
@[simps]
def compStarAlgHom' (f : C(X, Y)) : C(Y, A) →⋆ₐ[𝕜] C(X, A)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(𝕜 : Type u_4)
[CommSemiring 𝕜]
(A : Type u_5)
[TopologicalSpace A]
[Semiring A]
[TopologicalSemiring A]
[Star A]
[ContinuousStar A]
[Algebra 𝕜 A]
(f : C(X, Y))
(g : C(Y, A))

(ContinuousMap.compStarAlgHom' 𝕜 A f) g = g.comp f


theorem measurePreserving_funUnique {β : Type u} {_m : MeasurableSpace β} (μ : Measure β)
    (α : Type v) [Unique α] :
    MeasurePreserving (MeasurableEquiv.funUnique α β) (Measure.pi fun _ : α => μ) μ

{β : Type u}
{_m : MeasurableSpace β}
(μ : MeasureTheory.Measure β)
(α : Type v)
[Unique α]

MeasureTheory.MeasurePreserving (⇑(MeasurableEquiv.funUnique α β)) (MeasureTheory.Measure.pi fun x => μ) μ


/-- Any type with a distinguished element is equivalent to an `Option` type on the subtype excluding
that element. -/
@[simps!]
def optionSubtypeNe (a : α) : Option {b // b ≠ a} ≃ α

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

(Equiv.optionSubtypeNe a).symm b = if h : b = a then none else some ⟨b, h⟩


@[ext]
theorem ext {P Q : Sylow p G} (h : (P : Subgroup G) = Q) : P = Q

{p : ℕ}
{G : Type u_1}
[Group G]
{P Q : Sylow p G}
(h : ↑P = ↑Q)


theorem degree_mul_le_of_le {a b : WithBot ℕ} (hp : degree p ≤ a) (hq : degree q ≤ b) :
    degree (p * q) ≤ a + b

{R : Type u}
[Semiring R]
{p q : R[X]}
{a b : WithBot ℕ}
(hp : p.degree ≤ a)
(hq : q.degree ≤ b)


/-- 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).counitIso.hom.app X =
  (equivShrink (X.fromShrinkHoms ⟶ X.fromShrinkHoms)) (𝟙 X.fromShrinkHoms)


@[simp]
theorem preimage_subset_preimage_iff {s t : Set α} {f : β → α} (hs : s ⊆ range f) :
    f ⁻¹' s ⊆ f ⁻¹' t ↔ s ⊆ t

{α : Type u_1}
{β : Type u_2}
{s t : Set α}
{f : β → α}
(hs : s ⊆ Set.range f)


theorem card_Ioc : (Ioc f g).card = (∏ i ∈ f.support ∪ g.support, (Icc (f i) (g i)).card) - 1

{ι : Type u_1}
{α : Type u_2}
[PartialOrder α]
[Zero α]
[LocallyFiniteOrder α]
(f g : ι →₀ α)

(Finset.Ioc f g).card = ∏ i ∈ f.support ∪ g.support, (Finset.Icc (f i) (g i)).card - 1


theorem sub_mul_mod {x k n : Nat} (h₁ : n*k ≤ x) : (x - n*k) % n = x % n


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

(CategoryTheory.ShortComplex.LeftHomologyData.ofEpiOfIsIsoOfMono φ h).H = h.H


/-- A functor which maps objects to objects satisfying a certain property induces a lift through
    the full subcategory of objects satisfying that property. -/
@[simps]
def FullSubcategory.lift (F : C ⥤ D) (hF : ∀ X, P (F.obj X)) : C ⥤ FullSubcategory P

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(P : D → Prop)
(F : CategoryTheory.Functor C D)
(hF : ∀ (X : C), P (F.obj X))

∀ {X Y : C} (f : X ⟶ Y), (CategoryTheory.FullSubcategory.lift P F hF).map f = F.map f


@[to_additive]
theorem MonoidHomClass.uniformContinuous_of_bound [MonoidHomClass 𝓕 E F] (f : 𝓕) (C : ℝ)
    (h : ∀ x, ‖f x‖ ≤ C * ‖x‖) : UniformContinuous f

{𝓕 : Type u_1}
{E : Type u_3}
{F : Type u_4}
[SeminormedGroup E]
[SeminormedGroup F]
[FunLike 𝓕 E F]
[MonoidHomClass 𝓕 E F]
(f : 𝓕)
(C : ℝ)
(h : ∀ (x : E), ‖f x‖ ≤ C * ‖x‖)


@[simp]
theorem orderIsoSumLexPUnit_symm_inr (x : PUnit) :
    (@orderIsoSumLexPUnit α _).symm (toLex <| inr x) = ⊤

WithTop.orderIsoSumLexPUnit.symm (toLex (Sum.inr x)) = ⊤


theorem mapRange_finset_sum (f : F) (s : Finset ι) (g : ι → α →₀ M) :
    mapRange f (map_zero f) (∑ x ∈ s, g x) = ∑ x ∈ s, mapRange f (map_zero f) (g x)

{α : Type u_1}
{ι : Type u_4}
{M : Type u_5}
{N : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
{F : Type u_13}
[FunLike F M N]
[AddMonoidHomClass F M N]
(f : F)
(s : Finset ι)
(g : ι → α →₀ M)

Finsupp.mapRange ⇑f ⋯ (∑ x ∈ s, g x) = ∑ x ∈ s, Finsupp.mapRange ⇑f ⋯ (g x)


/-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring
that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated
over `A` by the roots of `X ^ n - 1`. -/

@[mk_iff]
class IsCyclotomicExtension : Prop where
  /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/
  exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n
  /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/
  adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}

{S : Set ℕ+}
{A : Type u}
{B : Type v}
[CommRing A]
[CommRing B]
[Algebra A B]
[self : IsCyclotomicExtension S A B]
(x : B)

x ∈ Algebra.adjoin A {b | ∃ n ∈ S, b ^ ↑n = 1}


@[simp]
theorem restrict_add_restrict_compl (hs : MeasurableSet s) :
    μ.restrict s + μ.restrict sᶜ = μ

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


@[simp]
theorem coe_ofInjectiveEndo (f : V →ₗ[K] V) (h_inj : Injective f) :
    ⇑(ofInjectiveEndo f h_inj) = f

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
(f : V →ₗ[K] V)
(h_inj : Function.Injective ⇑f)

⇑(LinearEquiv.ofInjectiveEndo f h_inj) = ⇑f


theorem Inducing.withSeminorms [hι : Nonempty ι] {q : SeminormFamily 𝕜₂ F ι} (hq : WithSeminorms q)
    [TopologicalSpace E] {f : E →ₛₗ[σ₁₂] F} (hf : Inducing f) : WithSeminorms (q.comp f)

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_5}
{F : Type u_6}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[NormedField 𝕜₂]
[AddCommGroup F]
[Module 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
[TopologicalSpace F]
[hι : Nonempty ι]
{q : SeminormFamily 𝕜₂ F ι}
(hq : WithSeminorms q)
[TopologicalSpace E]
{f : E →ₛₗ[σ₁₂] F}
(hf : Inducing ⇑f)


theorem normSq_def' : normSq a = a.1 ^ 2 + a.2 ^ 2 + a.3 ^ 2 + a.4 ^ 2

Quaternion.normSq a = a.re ^ 2 + a.imI ^ 2 + a.imJ ^ 2 + a.imK ^ 2


theorem pos_of_invertible_cast [Semiring α] [Nontrivial α] (n : ℕ) [Invertible (n : α)] : 0 < n

{α : Type u}
[Semiring α]
[Nontrivial α]
(n : ℕ)
[Invertible ↑n]


/-- The sum of two upper semicontinuous functions is upper semicontinuous. Formulated with an
explicit continuity assumption on addition, for application to `EReal`. The unprimed version of
the lemma uses `[ContinuousAdd]`. -/
theorem UpperSemicontinuousAt.add' {f g : α → γ} (hf : UpperSemicontinuousAt f x)
    (hg : UpperSemicontinuousAt g x)
    (hcont : ContinuousAt (fun p : γ × γ => p.1 + p.2) (f x, g x)) :
    UpperSemicontinuousAt (fun z => f z + g z) x

(hcont : ContinuousAt (fun p => p.1 + p.2) (f x, g x))


theorem hasFDerivAt_zero_of_eventually_const (c : F) (hf : f =ᶠ[𝓝 x] fun _ => c) :
    HasFDerivAt f (0 : E →L[𝕜] F) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
(c : F)
(hf : f =ᶠ[𝓝 x] fun x => c)


@[to_additive]
lemma inv (h : IsUnit a) : IsUnit a⁻¹

{α : Type u}
[SubtractionMonoid α]
{a : α}
(h : IsAddUnit a)


@[simp]
theorem scanl_nil (b : β) : scanl f b nil = [b]

{α : Type u}
{β : Type v}
{f : β → α → β}
(b : β)


lemma toSpec_base_apply_eq_comap {f} (x : Proj| pbo f) :
    (toSpec 𝒜 f).1.base x = PrimeSpectrum.comap (mapId 𝒜 (Submonoid.powers_le.mpr x.2))
      (closedPoint (AtPrime 𝒜 x.1.asHomogeneousIdeal.toIdeal))

(x : ↑((AlgebraicGeometry.Proj.toLocallyRingedSpace 𝒜).restrict ⋯).toTopCat)

(AlgebraicGeometry.ProjectiveSpectrum.Proj.toSpec 𝒜 f).val.base x =
  (PrimeSpectrum.comap (HomogeneousLocalization.mapId 𝒜 ⋯))
    (LocalRing.closedPoint (HomogeneousLocalization.AtPrime 𝒜 (↑x).asHomogeneousIdeal.toIdeal))


lemma isTheta_deriv_rpow_p_mul_one_sub_smoothingFn {p : ℝ} (hp : p ≠ 0) :
    (fun x => ‖deriv (fun z => z ^ p * (1 - ε z)) x‖) =Θ[atTop] fun z => z ^ (p-1)

(fun x => ‖deriv (fun z => z ^ p * (1 - AkraBazziRecurrence.smoothingFn z)) x‖) =Θ[Filter.atTop] fun z => z ^ (p - 1)


theorem eq_inv_smul_iff₀ {a : α} (ha : a ≠ 0) {x y : β} : x = a⁻¹ • y ↔ a • x = y

{α : Type u}
{β : Type v}
[GroupWithZero α]
[MulAction α β]
{a : α}
(ha : a ≠ 0)
{x y : β}


@[to_additive] lemma Monovary.pow_left (hfg : Monovary f g) (n : ℕ) : Monovary (f ^ n) g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedCommGroup α]
[OrderedCommGroup β]
{f : ι → α}
{g : ι → β}
(hfg : Monovary f g)
(n : ℕ)


/-- The common part of the proofs of `le_nhds_of_cauchy_adhp` and
`SequentiallyComplete.le_nhds_of_seq_tendsto_nhds`: if for any entourage `s`
one can choose a set `t ∈ f` of diameter `s` such that it contains a point `y`
with `(x, y) ∈ s`, then `f` converges to `x`. -/
theorem le_nhds_of_cauchy_adhp_aux {f : Filter α} {x : α}
    (adhs : ∀ s ∈ 𝓤 α, ∃ t ∈ f, t ×ˢ t ⊆ s ∧ ∃ y, (x, y) ∈ s ∧ y ∈ t) : f ≤ 𝓝 x


/-- `WithOne.coe` as a bundled morphism -/
@[to_additive (attr := simps apply) "`WithZero.coe` as a bundled morphism"]
def coeMulHom [Mul α] : α →ₙ* WithOne α


/-- There is a natural quaternionic basis for the `QuaternionAlgebra`. -/
@[simps i j k]
protected def self : Basis ℍ[R,c₁,c₂] c₁ c₂

(QuaternionAlgebra.Basis.self R).k = { re := 0, imI := 0, imJ := 0, imK := 1 }


/-- If the multiplicative supports of `f` and `g` are finite, then the product of `f i * g i` equals
the product of `f i` multiplied by the product of `g i`. -/
@[to_additive
      "If the additive supports of `f` and `g` are finite, then the sum of `f i + g i`
      equals the sum of `f i` plus the sum of `g i`."]
theorem finprod_mul_distrib (hf : (mulSupport f).Finite) (hg : (mulSupport g).Finite) :
    ∏ᶠ i, f i * g i = (∏ᶠ i, f i) * ∏ᶠ i, g i

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
{f g : α → M}
(hf : (Function.mulSupport f).Finite)
(hg : (Function.mulSupport g).Finite)

∏ᶠ (i : α), f i * g i = (∏ᶠ (i : α), f i) * ∏ᶠ (i : α), g i


/-- Given an affinely independent family of points, a weighted subtraction lies in the
`vectorSpan` of two points given as affine combinations if and only if it is a weighted
subtraction with weights a multiple of the difference between the weights of the two points. -/
theorem weightedVSub_mem_vectorSpan_pair {p : ι → P} (h : AffineIndependent k p) {w w₁ w₂ : ι → k}
    {s : Finset ι} (hw : ∑ i ∈ s, w i = 0) (hw₁ : ∑ i ∈ s, w₁ i = 1)
    (hw₂ : ∑ i ∈ s, w₂ i = 1) :
    s.weightedVSub p w ∈
        vectorSpan k ({s.affineCombination k p w₁, s.affineCombination k p w₂} : Set P) ↔
      ∃ r : k, ∀ i ∈ s, w i = r * (w₁ i - w₂ i)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
{p : ι → P}
(h : AffineIndependent k p)
{w w₁ w₂ : ι → k}
{s : Finset ι}
(hw : ∑ i ∈ s, w i = 0)
(hw₁ : ∑ i ∈ s, w₁ i = 1)
(hw₂ : ∑ i ∈ s, w₂ i = 1)

(s.weightedVSub p) w ∈ vectorSpan k {(Finset.affineCombination k s p) w₁, (Finset.affineCombination k s p) w₂} ↔
  ∃ r, ∀ i ∈ s, w i = r * (w₁ i - w₂ i)


@[simp]
theorem sq_abs_sub_sq_re (z : ℂ) : Complex.abs z ^ 2 - z.re ^ 2 = z.im ^ 2


theorem le_hnot_inf_hnot : ￢(a ⊔ b) ≤ ￢a ⊓ ￢b

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

￢(a ⊔ b) ≤ ￢a ⊓ ￢b


/--
The categories of cocones over `F` and `G` are equivalent if `F` and `G` are naturally isomorphic
(possibly after changing the indexing category by an equivalence).
-/
@[simps! functor_obj]
def equivalenceOfReindexing {G : K ⥤ C} (e : K ≌ J) (α : e.functor ⋙ F ≅ G) : Cocone F ≌ Cocone G

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{G : K ⥤ C}
(e : K ≌ J)
(α : e.functor ⋙ F ≅ G)
(X : CategoryTheory.Limits.Cocone F)

(CategoryTheory.Limits.Cocones.equivalenceOfReindexing e α).functor.obj X =
  (CategoryTheory.Limits.Cocones.precompose α.inv).obj (CategoryTheory.Limits.Cocone.whisker e.functor X)


@[to_additive (attr := simp)]
theorem comap_top (f : G →* N) : (⊤ : Subgroup N).comap f = ⊤

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


lemma shiftIso_add' (n m mn : M) (hnm : m + n = mn) (a a' a'' : M)
    (ha' : n + a = a') (ha'' : m + a' = a'') :
    F.shiftIso mn a a'' (by rw [← hnm, ← ha'', ← ha', add_assoc]) =
      isoWhiskerRight (shiftFunctorAdd' C m n _ hnm) _ ≪≫ Functor.associator _ _ _ ≪≫
        isoWhiskerLeft _ (F.shiftIso n a a' ha') ≪≫ F.shiftIso m a' a'' ha''

{C : Type u_1}
{A : Type u_2}
[CategoryTheory.Category.{u_6, u_1} C]
[CategoryTheory.Category.{u_5, u_2} A]
(F : C ⥤ A)
{M : Type u_3}
[AddMonoid M]
[CategoryTheory.HasShift C M]
[F.ShiftSequence M]
(n m mn : M)
(hnm : m + n = mn)
(a a' a'' : M)
(ha' : n + a = a')
(ha'' : m + a' = a'')

F.shiftIso mn a a'' ⋯ =
  CategoryTheory.isoWhiskerRight (CategoryTheory.shiftFunctorAdd' C m n mn hnm) (F.shift a) ≪≫
    (CategoryTheory.shiftFunctor C m).associator (CategoryTheory.shiftFunctor C n) (F.shift a) ≪≫
      CategoryTheory.isoWhiskerLeft (CategoryTheory.shiftFunctor C m) (F.shiftIso n a a' ha') ≪≫
        F.shiftIso m a' a'' ha''


protected theorem sub_lt_iff_lt_right (hb : b ≠ ∞) (hab : b ≤ a) : a - b < c ↔ a < c + b

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


{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{a : α}


theorem setToFun_nonneg {T : Set α → G' →L[ℝ] G''} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C)
    (hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f : α → G'}
    (hf : 0 ≤ᵐ[μ] f) : 0 ≤ setToFun μ T hT f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x)


@[simp]
theorem toReal_neg_pi_div_two : ((-π / 2 : ℝ) : Angle).toReal = -π / 2


/-- A finite dimensional space is nontrivial if it has `finrank` equal to the successor of a
natural number. -/
theorem FiniteDimensional.nontrivial_of_finrank_eq_succ {n : ℕ}
    (hn : finrank R M = n.succ) : Nontrivial M

(hn : FiniteDimensional.finrank R M = n.succ)


theorem AEStronglyMeasurable.convolution_integrand (hf : AEStronglyMeasurable f ν)
    (hg : AEStronglyMeasurable g μ) :
    AEStronglyMeasurable (fun p : G × G => L (f p.2) (g (p.1 - p.2))) (μ.prod ν)

(hf : MeasureTheory.AEStronglyMeasurable f ν)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

MeasureTheory.AEStronglyMeasurable (fun p => (L (f p.2)) (g (p.1 - p.2))) (μ.prod ν)


@[simp]
lemma Hom.id_eq_id (X : WalkingMulticospan fst snd) :
    Hom.id X = 𝟙 X

(X : CategoryTheory.Limits.WalkingMulticospan fst snd)

CategoryTheory.Limits.WalkingMulticospan.Hom.id X = CategoryTheory.CategoryStruct.id X


theorem floor_eq_on_Ico (n : ℤ) : ∀ a ∈ Set.Ico (n : α) (n + 1), ⌊a⌋ = n

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


@[simp] theorem toCoalgHom_id {M : CoalgebraCat.{v} R} :
    Hom.toCoalgHom (𝟙 M) = CoalgHom.id _ _

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

(𝟙 M).toCoalgHom = CoalgHom.id R ↑M.toModuleCat


theorem ker_intCastAddHom (n : ℕ) :
    (Int.castAddHom (ZMod n)).ker = AddSubgroup.zmultiples (n : ℤ)

(Int.castAddHom (ZMod n)).ker = AddSubgroup.zmultiples ↑n


theorem zeroRootSubalgebra_eq_iff_is_cartan [IsNoetherian R L] :
    zeroRootSubalgebra R L H = H ↔ H.IsCartanSubalgebra

(R : Type u_1)
(L : Type u_2)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(H : LieSubalgebra R L)
[LieAlgebra.IsNilpotent R ↥H]
[IsNoetherian R L]

LieAlgebra.zeroRootSubalgebra R L H = H ↔ H.IsCartanSubalgebra


/-- If the determinant of a map vanishes, then the map is not onto. -/
theorem range_lt_top_of_det_eq_zero {𝕜 : Type*} [Field 𝕜] [Module 𝕜 M] {f : M →ₗ[𝕜] M}
    (hf : LinearMap.det f = 0) : LinearMap.range f < ⊤

{M : Type u_2}
[AddCommGroup M]
{𝕜 : Type u_7}
[Field 𝕜]
[Module 𝕜 M]
{f : M →ₗ[𝕜] M}
(hf : LinearMap.det f = 0)


@[simp]
theorem map_zero {f : ArithmeticFunction R} : f 0 = 0

{R : Type u_1}
[Zero R]
{f : ArithmeticFunction R}


/-- The topology induced under an inclusion `f : X → Y` from a discrete topological space `Y`
is the discrete topology on `X`.

See also `DiscreteTopology.of_continuous_injective`. -/
theorem Embedding.discreteTopology [DiscreteTopology Y] (hf : Embedding f) : DiscreteTopology X

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


@[continuity]
theorem continuous_id : Continuous (id : X → X)


@[simp] theorem pwFilter_idem [DecidableRel (α := α) R] :
    pwFilter R (pwFilter R l) = pwFilter R l

{α : Type u_1}
{R : α → α → Prop}
{l : List α}
[DecidableRel R]

List.pwFilter R (List.pwFilter R l) = List.pwFilter R l


theorem Algebra.trace_complex_apply (z : ℂ) : Algebra.trace ℝ ℂ z = 2 * z.re


lemma quotientInfToPiQuotient_surj [Finite ι] {I : ι → Ideal R}
    (hI : Pairwise fun i j => IsCoprime (I i) (I j)) : Surjective (quotientInfToPiQuotient I)


/-- Given an element `x : A`, there is a natural morphism of representations `k[G] ⟶ A` sending
`g ↦ A.ρ(g)(x).` -/
@[simps]
noncomputable def leftRegularHom (A : Rep k G) (x : A) : Rep.ofMulAction k G G ⟶ A

{k G : Type u}
[CommRing k]
[Monoid G]
(A : Rep k G)
(x : CoeSort.coe A)

(A.leftRegularHom x).hom = (Finsupp.lift (↑A.V) k G) fun g => (A.ρ g) x


theorem disjoint_left : Disjoint l₁ l₂ ↔ ∀ ⦃a⦄, a ∈ l₁ → a ∉ l₂

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.Disjoint l₂ ↔ ∀ ⦃a : α⦄, a ∈ l₁ → ¬a ∈ l₂


/-- If `m` and `m'` are finite products in `M`, then so is `m * m'`, provided that `m'` is obtained
from a subsequence of `M` starting sufficiently late. -/
@[to_additive
      "If `m` and `m'` are finite sums in `M`, then so is `m + m'`, provided that `m'`
      is obtained from a subsequence of `M` starting sufficiently late."]
theorem FP.mul {M} [Semigroup M] {a : Stream' M} {m : M} (hm : m ∈ FP a) :
    ∃ n, ∀ m' ∈ FP (a.drop n), m * m' ∈ FP a

{M : Type u_1}
[Semigroup M]
{a : Stream' M}
{m : M}
(hm : m ∈ Hindman.FP a)

∃ n, ∀ m' ∈ Hindman.FP (Stream'.drop n a), m * m' ∈ Hindman.FP a


@[to_additive]
lemma NormedCommGroup.cauchySeq_iff [Nonempty α] [SemilatticeSup α] {u : α → E} :
    CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ m, N ≤ m → ∀ n, N ≤ n → ‖u m / u n‖ < ε

{α : Type u_1}
{E : Type u_3}
[SeminormedAddGroup E]
[Nonempty α]
[SemilatticeSup α]
{u : α → E}

CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ (m : α), N ≤ m → ∀ (n : α), N ≤ n → ‖u m - u n‖ < ε


/-- If `(x, y)` is a solution with `x` positive, then all its powers have positive `x`. -/
theorem x_zpow_pos {a : Solution₁ d} (hax : 0 < a.x) (n : ℤ) : 0 < (a ^ n).x

{d : ℤ}
{a : Pell.Solution₁ d}
(hax : 0 < a.x)
(n : ℤ)


theorem neg_right (h : SemiconjBy a x y) : SemiconjBy a (-x) (-y)

{R : Type x}
[Mul R]
[HasDistribNeg R]
{a x y : R}
(h : SemiconjBy a x y)


theorem f_iUnion {s : ℕ → Set α} (h : ∀ i, IsCaratheodory m (s i)) (hd : Pairwise (Disjoint on s)) :
    m (⋃ i, s i) = ∑' i, m (s i)

{α : Type u}
(m : MeasureTheory.OuterMeasure α)
{s : ℕ → Set α}
(h : ∀ (i : ℕ), m.IsCaratheodory (s i))
(hd : Pairwise (Disjoint on s))


theorem HasFPowerSeriesAt.eventually_eq_zero
    (hf : HasFPowerSeriesAt f (0 : FormalMultilinearSeries 𝕜 E F) x) : ∀ᶠ z in 𝓝 x, f z = 0

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


/-- **Cantor's diagonal argument** implies that there are no injective functions from `Set α`
to `α`. -/
theorem cantor_injective {α : Type*} (f : Set α → α) : ¬Injective f


@[simp]
theorem convexJoin_iUnion_left (s : ι → Set E) (t : Set E) :
    convexJoin 𝕜 (⋃ i, s i) t = ⋃ i, convexJoin 𝕜 (s i) t

{ι : Sort u_1}
{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(s : ι → Set E)
(t : Set E)


theorem Reaches₀.trans {σ} {f : σ → Option σ} {a b c : σ} (h₁ : Reaches₀ f a b)
    (h₂ : Reaches₀ f b c) : Reaches₀ f a c

{σ : Type u_1}
{f : σ → Option σ}
{a b c : σ}
(h₁ : Turing.Reaches₀ f a b)
(h₂ : Turing.Reaches₀ f b c)


@[simp]
theorem ker_id : ker (LinearMap.id : M →ₗ[R] M) = ⊥

{R : Type u_1}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]


theorem Icc_subset_Iic_self : Icc a b ⊆ Iic b


@[simp]
lemma Hom.toAlgHom_id : Hom.toAlgHom (.id P) = AlgHom.id _ _

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(P : Algebra.Generators R S)

(Algebra.Generators.Hom.id P).toAlgHom = AlgHom.id R P.Ring


lemma le_induce_union : G'.induce s ⊔ G'.induce s' ≤ G'.induce (s ∪ s')

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


/-- Postcompose a partial homeomorphism with a homeomorphism.
We modify the source and target to have better definitional behavior. -/
@[simps! (config := .asFn)]
def transHomeomorph (e : PartialHomeomorph X Y) (f' : Y ≃ₜ Z) : PartialHomeomorph X Z

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

↑(e.transHomeomorph f').symm = ↑e.symm ∘ ⇑f'.symm


theorem compl_mem_coprodᵢ {s : Set (∀ i, α i)} :
    sᶜ ∈ Filter.coprodᵢ f ↔ ∀ i, (eval i '' s)ᶜ ∈ f i

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

sᶜ ∈ Filter.coprodᵢ f ↔ ∀ (i : ι), (Function.eval i '' s)ᶜ ∈ f i


@[simp, mfld_simps]
theorem coe_transDiffeomorph : ⇑(I.transDiffeomorph e) = e ∘ I

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_5}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(e : E ≃ₘ⟮𝓘(𝕜, E), 𝓘(𝕜, E')⟯ E')


@[to_additive]
theorem Homeomorph.mulLeft_symm (a : G) : (Homeomorph.mulLeft a).symm = Homeomorph.mulLeft a⁻¹

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

(Homeomorph.addLeft a).symm = Homeomorph.addLeft (-a)


lemma inv_inv {a : EReal} (h : a ≠ ⊥) (h' : a ≠ ⊤) : (a⁻¹)⁻¹ = a


lemma imp_congr_ctx_eq {a b c d : Prop} (h₁ : a = c) (h₂ : c → b = d) : (a → b) = (c → d)


/-- In a join, taking the first elements up to an index which is the sum of the lengths of the
first `i` sublists, is the same as taking the join of the first `i` sublists.

See `List.take_sum_join` for the corresponding statement using `List.sum`. -/
theorem take_sum_join' (L : List (List α)) (i : ℕ) :
    L.join.take (Nat.sum ((L.map length).take i)) = (L.take i).join

{α : Type u_1}
(L : List (List α))
(i : ℕ)

List.take (Nat.sum (List.take i (List.map List.length L))) L.join = (List.take i L).join


@[simp] theorem rank_bot' : Module.rank (⊥ : IntermediateField F E) E = Module.rank F E

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]


/-- A simply connected space is one whose fundamental groupoid is equivalent to `Discrete Unit` -/
@[mk_iff simply_connected_def]
class SimplyConnectedSpace (X : Type*) [TopologicalSpace X] : Prop where
  equiv_unit : Nonempty (FundamentalGroupoid X ≌ Discrete Unit)

{X : Type u_1}
[TopologicalSpace X]
[self : SimplyConnectedSpace X]

Nonempty (FundamentalGroupoid X ≌ CategoryTheory.Discrete Unit)


theorem coeToSubmodule_injective :
    Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P))

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]


theorem Colorable.of_embedding {V' : Type*} {G' : SimpleGraph V'} (f : G ↪g G') {n : ℕ}
    (h : G'.Colorable n) : G.Colorable n

{V : Type u}
{G : SimpleGraph V}
{V' : Type u_3}
{G' : SimpleGraph V'}
(f : G ↪g G')
{n : ℕ}
(h : G'.Colorable n)


@[to_additive]
theorem IsOpen.mul_right (hs : IsOpen s) : IsOpen (s * t)

{α : Type u}
[TopologicalSpace α]
[Group α]
[ContinuousConstSMul αᵐᵒᵖ α]
{s t : Set α}
(hs : IsOpen s)


/-- This can be use to prove
```lean
example (P : (Fin 2 → α) → Prop) : (∀ f, P f) ↔ ∀ a₀ a₁, P ![a₀, a₁] :=
  (forall_iff _).symm
```
-/
@[simp]
theorem forall_iff : ∀ {m} (P : (Fin m → α) → Prop), Forall P ↔ ∀ x, P x

{α : Type u_1}
{m : ℕ}
(P : (Fin m → α) → Prop)

FinVec.Forall P ↔ ∀ (x : Fin m → α), P x


protected theorem sSup_empty : sSup (∅ : Set (Seminorm 𝕜 E)) = ⊥

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]


@[simp]
theorem sup'_cons {b : β} {hb : b ∉ s} :
    (cons b s hb).sup' (nonempty_cons hb) f = f b ⊔ s.sup' H f

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
{s : Finset β}
(H : s.Nonempty)
(f : β → α)
{b : β}
{hb : b ∉ s}

(Finset.cons b s hb).sup' ⋯ f = f b ⊔ s.sup' H f


@[to_additive]
theorem prod_range_succ' (f : ℕ → β) :
    ∀ n : ℕ, (∏ k ∈ range (n + 1), f k) = (∏ k ∈ range n, f (k + 1)) * f 0

{β : Type u_4}
[AddCommMonoid β]
(f : ℕ → β)
(n : ℕ)

∑ k ∈ Finset.range (n + 1), f k = ∑ k ∈ Finset.range n, f (k + 1) + f 0


theorem Insert.comm (a b : α) (s : Finset α) : insert a (insert b s) = insert b (insert a s)

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


/-- The natural isomorphism between taking preimages under `f ≫ g`, and the composite
of taking preimages under `g`, then preimages under `f`.
-/
@[simps]
def mapComp (f : X ⟶ Y) (g : Y ⟶ Z) : map (f ≫ g) ≅ map g ⋙ map f

{X Y Z : TopCat}
(f : X ⟶ Y)
(g : Y ⟶ Z)
(U : TopologicalSpace.Opens ↑Z)

(TopologicalSpace.Opens.mapComp f g).inv.app U = CategoryTheory.eqToHom ⋯


@[simp]
theorem pushoutCoconeOfLeftIso_ι_app_right : (pushoutCoconeOfLeftIso f g).ι.app right = 𝟙 _

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

(CategoryTheory.Limits.pushoutCoconeOfLeftIso f g).ι.app CategoryTheory.Limits.WalkingSpan.right =
  𝟙 ((CategoryTheory.Limits.span f g).obj CategoryTheory.Limits.WalkingSpan.right)


theorem segment_subset_Icc (h : x ≤ y) : [x -[𝕜] y] ⊆ Icc x y

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[OrderedAddCommMonoid E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{x y : E}
(h : x ≤ y)


/-- If `C` has limits of shape `J` then any coreflective subcategory has limits of shape `J`. -/
theorem hasLimitsOfShape_of_coreflective (R : D ⥤ C) [Coreflective R] [HasLimitsOfShape J C] :
    HasLimitsOfShape J D


/-- When `D` is a monoidal category,
comonoid objects in `C ⥤ D` are the same thing
as functors from `C` into the comonoid objects of `D`.
-/
@[simps]
def comonFunctorCategoryEquivalence : Comon_ (C ⥤ D) ≌ C ⥤ Comon_ D

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

(CategoryTheory.Monoidal.comonFunctorCategoryEquivalence C D).unitIso =
  CategoryTheory.Monoidal.ComonFunctorCategoryEquivalence.unitIso


theorem IsSRGWith.card_commonNeighbors_eq_of_adj_compl (h : G.IsSRGWith n k ℓ μ) {v w : V}
    (ha : Gᶜ.Adj v w) : Fintype.card (Gᶜ.commonNeighbors v w) = n - (2 * k - μ) - 2

{V : Type u}
[Fintype V]
[DecidableEq V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{n k ℓ μ : ℕ}
(h : G.IsSRGWith n k ℓ μ)
{v w : V}
(ha : Gᶜ.Adj v w)

Fintype.card ↑(Gᶜ.commonNeighbors v w) = n - (2 * k - μ) - 2


@[simp] lemma flip_innerₗ : (innerₗ F).flip = innerₗ F

(F : Type u_3)
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]


lemma δ_eq {A : C} (x₃ : A ⟶ S.L₀.X₃) (x₂ : A ⟶ S.L₁.X₂) (x₁ : A ⟶ S.L₂.X₁)
    (h₂ : x₂ ≫ S.L₁.g = x₃ ≫ S.v₀₁.τ₃) (h₁ : x₁ ≫ S.L₂.f = x₂ ≫ S.v₁₂.τ₂) :
    x₃ ≫ S.δ = x₁ ≫ S.v₂₃.τ₁

(S : CategoryTheory.ShortComplex.SnakeInput C)

(h₂ : CategoryTheory.CategoryStruct.comp x₂ S.L₁.g = CategoryTheory.CategoryStruct.comp x₃ S.v₀₁.τ₃)

(h₁ : CategoryTheory.CategoryStruct.comp x₁ S.L₂.f = CategoryTheory.CategoryStruct.comp x₂ S.v₁₂.τ₂)

CategoryTheory.CategoryStruct.comp x₃ S.δ = CategoryTheory.CategoryStruct.comp x₁ S.v₂₃.τ₁


/-- See `Int.inductionOn'` for an induction in both directions. -/
protected theorem le_induction_down {P : ℤ → Prop} {m : ℤ} (h0 : P m)
    (h1 : ∀ n : ℤ, n ≤ m → P n → P (n - 1)) (n : ℤ) : n ≤ m → P n

(h1 : ∀ (n : ℤ), n ≤ m → P n → P (n - 1))


theorem ae_eq_image_of_ae_eq_comap {β} [MeasurableSpace α] {mβ : MeasurableSpace β} (f : α → β)
    (μ : Measure β) (hfi : Injective f) (hf : ∀ s, MeasurableSet s → NullMeasurableSet (f '' s) μ)
    {s t : Set α} (hst : s =ᵐ[comap f μ] t) : f '' s =ᵐ[μ] f '' t

(hf : ∀ (s : Set α), MeasurableSet s → MeasureTheory.NullMeasurableSet (f '' s) μ)

(hst : s =ᵐ[MeasureTheory.Measure.comap f μ] t)


theorem IsLittleO.const_mul_left {f : α → R} (h : f =o[l] g) (c : R) : (fun x => c * f x) =o[l] g

{α : Type u_1}
{F : Type u_4}
{R : Type u_13}
[Norm F]
[SeminormedRing R]
{g : α → F}
{l : Filter α}
{f : α → R}
(h : f =o[l] g)
(c : R)


theorem prod_eq_bot_iff {p₁ : Submodule R M} {p₂ : Submodule R M₂} :
    p₁.prod p₂ = ⊥ ↔ p₁ = ⊥ ∧ p₂ = ⊥

(R : Type u)
(M : Type v)
(M₂ : Type w)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
{p₁ : Submodule R M}
{p₂ : Submodule R M₂}


/-- A morphism between two commutative squares consists of 4 morphisms
which extend these two squares into a commuting cube. -/
@[ext]
structure Hom (sq₁ sq₂ : Square C) where
  /-- the top-left morphism -/
  τ₁ : sq₁.X₁ ⟶ sq₂.X₁
  /-- the top-right morphism -/
  τ₂ : sq₁.X₂ ⟶ sq₂.X₂
  /-- the bottom-left morphism -/
  τ₃ : sq₁.X₃ ⟶ sq₂.X₃
  /-- the bottom-right morphism -/
  τ₄ : sq₁.X₄ ⟶ sq₂.X₄
  comm₁₂ : sq₁.f₁₂ ≫ τ₂ = τ₁ ≫ sq₂.f₁₂ := by aesop_cat
  comm₁₃ : sq₁.f₁₃ ≫ τ₃ = τ₁ ≫ sq₂.f₁₃ := by aesop_cat
  comm₂₄ : sq₁.f₂₄ ≫ τ₄ = τ₂ ≫ sq₂.f₂₄ := by aesop_cat
  comm₃₄ : sq₁.f₃₄ ≫ τ₄ = τ₃ ≫ sq₂.f₃₄ := by aesop_cat

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{sq₁ sq₂ : CategoryTheory.Square C}
(self : sq₁.Hom sq₂)

CategoryTheory.CategoryStruct.comp sq₁.f₂₄ self.τ₄ = CategoryTheory.CategoryStruct.comp self.τ₂ sq₂.f₂₄


theorem lt_tsub_comm : a < b - c ↔ c < b - a

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


/-- The projection of a graded object to its `i`-th component. -/
@[simps]
def eval {β : Type w} (b : β) : GradedObject β C ⥤ C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{β : Type w}
(b : β)
(X : CategoryTheory.GradedObject β C)

(CategoryTheory.GradedObject.eval b).obj X = X b


/-- When `V` is monoidal the forgetful functor `Action V G` to `V` is monoidal. -/
@[simps]
def forgetMonoidal : MonoidalFunctor (Action V G) V

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
(G : MonCat)
[CategoryTheory.MonoidalCategory V]

(Action.forgetMonoidal V G).toFunctor = Action.forget V G


@[simp]
theorem coe_basisOneIJK_repr (q : ℍ[R,c₁,c₂]) :
    ⇑((basisOneIJK c₁ c₂).repr q) = ![q.re, q.imI, q.imJ, q.imK]

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

⇑((QuaternionAlgebra.basisOneIJK c₁ c₂).repr q) = ![q.re, q.imI, q.imJ, q.imK]


/-- Typeclass for division rounded up. For each `a > 0`, this asserts the existence of a left
adjoint to the map `b ↦ a • b : β → β`. -/
class CeilDiv where
  /-- Ceiling division. If `a > 0`, then `b ⌈/⌉ a` is the least `c` such that `b ≤ a • c`. -/
  ceilDiv : β → α → β
  /-- Do not use this. Use `gc_smul_ceilDiv` or `gc_mul_ceilDiv` instead. -/
  protected ceilDiv_gc ⦃a⦄ : 0 < a → GaloisConnection (ceilDiv · a) (a • ·)
  /-- Do not use this. Use `ceilDiv_nonpos` instead. -/
  protected ceilDiv_nonpos ⦃a⦄ : a ≤ 0 → ∀ b, ceilDiv b a = 0
  /-- Do not use this. Use `zero_ceilDiv` instead. -/
  protected zero_ceilDiv (a) : ceilDiv 0 a = 0

{α : Type u_2}
{β : Type u_3}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMulZeroClass α β]
[self : CeilDiv α β]
⦃a : α⦄

0 < a → GaloisConnection (fun x => x ⌈/⌉ a) fun x => a • x


@[to_additive]
theorem length_le (h : Red L₁ L₂) : L₂.length ≤ L₁.length

{α : Type u}
{L₁ L₂ : List (α × Bool)}
(h : FreeAddGroup.Red L₁ L₂)


@[to_additive]
theorem hasProd_iff_tendsto_nat [T2Space M] {f : ℕ → M} (hf : Multipliable f) :
    HasProd f m ↔ Tendsto (fun n : ℕ ↦ ∏ i ∈ range n, f i) atTop (𝓝 m)

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
{m : M}
[T2Space M]
{f : ℕ → M}
(hf : Multipliable f)

HasProd f m ↔ Filter.Tendsto (fun n => ∏ i ∈ Finset.range n, f i) Filter.atTop (𝓝 m)


lemma subset_coborder :
    s ⊆ coborder s

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


theorem odd_card_of_char_ne_two (hF : ringChar F ≠ 2) : Fintype.card F % 2 = 1

{F : Type u_3}
[Field F]
[Fintype F]
(hF : ringChar F ≠ 2)


@[to_additive]
theorem isSubgroup_iUnion_of_directed {ι : Type*} [Nonempty ι] {s : ι → Set G}
    (hs : ∀ i, IsSubgroup (s i)) (directed : ∀ i j, ∃ k, s i ⊆ s k ∧ s j ⊆ s k) :
    IsSubgroup (⋃ i, s i)

(directed : ∀ (i j : ι), ∃ k, s i ⊆ s k ∧ s j ⊆ s k)


theorem map_surjective_of_surjective {f : α → β} (hf : Function.Surjective f) :
    Function.Surjective (map f)

{α : Type u_1}
{β : Type v}
{f : α → β}
(hf : Function.Surjective f)


theorem ext_iff {z w : K} : z = w ↔ re z = re w ∧ im z = im w

z = w ↔ RCLike.re z = RCLike.re w ∧ RCLike.im z = RCLike.im w


@[simp, norm_cast]
theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m

↑n ∣ ↑m ↔ n ∣ m


@[simp]
theorem toPGame_le_iff {a b : Ordinal} : a.toPGame ≤ b.toPGame ↔ a ≤ b


theorem leftLim_le (h : x ≤ y) : leftLim f x ≤ f y

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Monotone f)
{x y : α}
(h : x ≤ y)


@[to_additive]
theorem prod_Ico_consecutive (f : ℕ → M) {m n k : ℕ} (hmn : m ≤ n) (hnk : n ≤ k) :
    ((∏ i ∈ Ico m n, f i) * ∏ i ∈ Ico n k, f i) = ∏ i ∈ Ico m k, f i

{M : Type u_2}
[AddCommMonoid M]
(f : ℕ → M)
{m n k : ℕ}
(hmn : m ≤ n)
(hnk : n ≤ k)

∑ i ∈ Finset.Ico m n, f i + ∑ i ∈ Finset.Ico n k, f i = ∑ i ∈ Finset.Ico m k, f i


@[to_additive (attr := simp, nolint simpNF)] -- Porting note: LHS does not simplify.
theorem mk_div (f g : α → γ) (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
    mk (f / g) (hf.div hg) = (mk f hf : α →ₘ[μ] γ) / mk g hg

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

MeasureTheory.AEEqFun.mk (f - g) ⋯ = MeasureTheory.AEEqFun.mk f hf - MeasureTheory.AEEqFun.mk g hg


theorem get?_set_of_lt' (a : α) {m n} (l : List α) (h : m < length l) :
    (set l m a).get? n = if m = n then some a else l.get? n

{α : Type u_1}
(a : α)
{m n : Nat}
(l : List α)
(h : m < l.length)

(l.set m a).get? n = if m = n then some a else l.get? n


protected theorem Nontrivial.choose_fst_mem (hs : s.Nontrivial) : hs.choose.fst ∈ s

{α : Type u}
{s : Set α}
(hs : s.Nontrivial)


theorem ofReal_toReal_ae_eq {f : α → ℝ≥0∞} (hf : ∀ᵐ x ∂μ, f x < ∞) :
    (fun x => ENNReal.ofReal (f x).toReal) =ᵐ[μ] f

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : ∀ᵐ (x : α) ∂μ, f x < ⊤)


theorem coe_mk (A : Matrix n n R) (h : det A = 1) : ↑(⟨A, h⟩ : SpecialLinearGroup n R) = A

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(A : Matrix n n R)
(h : A.det = 1)


/-- For every open cover of a compact set, there exists a finite subcover. -/
theorem IsCompact.elim_finite_subcover {ι : Type v} (hs : IsCompact s) (U : ι → Set X)
    (hUo : ∀ i, IsOpen (U i)) (hsU : s ⊆ ⋃ i, U i) : ∃ t : Finset ι, s ⊆ ⋃ i ∈ t, U i

{X : Type u}
[TopologicalSpace X]
{s : Set X}
{ι : Type v}
(hs : IsCompact s)
(U : ι → Set X)
(hUo : ∀ (i : ι), IsOpen (U i))
(hsU : s ⊆ ⋃ i, U i)


theorem IsUnit.sub_iff [Ring α] {x y : α} : IsUnit (x - y) ↔ IsUnit (y - x)


/-- The continuous homomorphism given by projection onto the first factor. -/
@[to_additive (attr := simps!)
  "The continuous homomorphism given by projection onto the first factor."]
def fst : ContinuousMonoidHom (A × B) A

(A : Type u_2)
(B : Type u_3)
[AddMonoid A]
[AddMonoid B]
[TopologicalSpace A]
[TopologicalSpace B]
(self : A × B)

(ContinuousAddMonoidHom.fst A B) self = self.1


protected theorem hasCompactSupport : HasCompactSupport f

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)
[T2Space M]


@[mfld_simps]
theorem preimage_id {s : Set α} : id ⁻¹' s = s


theorem whiskerRight_iff {X Y : C} (f g : X ⟶ Y) : f ▷ 𝟙_ C = g ▷ 𝟙_ C ↔ f = g

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

CategoryTheory.MonoidalCategory.whiskerRight f (𝟙_ C) = CategoryTheory.MonoidalCategory.whiskerRight g (𝟙_ C) ↔ f = g


@[simp] theorem toNat_eq_zero : toNat n = 0 ↔ n = 0 ∨ n = ⊤


theorem mul_nonneg_iff [ExistsAddOfLE α] [MulPosStrictMono α] [PosMulStrictMono α]
    [ContravariantClass α α (· + ·) (· ≤ ·)] [CovariantClass α α (· + ·) (· ≤ ·)]:
    0 ≤ a * b ↔ 0 ≤ a ∧ 0 ≤ b ∨ a ≤ 0 ∧ b ≤ 0

[ContravariantClass α α (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]


@[simp]
theorem pi_univ_Iic : (pi univ fun i ↦ Iic (x i)) = Iic x

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Preorder (α i)]
(x : (i : ι) → α i)

(Set.univ.pi fun i => Set.Iic (x i)) = Set.Iic x


theorem Ico_filter_le_left {a b : α} [DecidablePred (· ≤ a)] (hab : a < b) :
    ((Ico a b).filter fun x => x ≤ a) = {a}

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrder α]
{a b : α}
[DecidablePred fun x => x ≤ a]
(hab : a < b)

Finset.filter (fun x => x ≤ a) (Finset.Ico a b) = {a}


theorem bernoulli'_eq_bernoulli (n : ℕ) : bernoulli' n = (-1) ^ n * bernoulli n


@[simp]
theorem eval_nil : M.eval [] = M.εClosure M.start

{α : Type u}
{σ : Type v}
(M : εNFA α σ)


theorem contMDiffAt_iff_of_mem_source {x' : M} {y : M'} (hx : x' ∈ (chartAt H x).source)
    (hy : f x' ∈ (chartAt H' y).source) :
    ContMDiffAt I I' n f x' ↔
      ContinuousAt f x' ∧
        ContDiffWithinAt 𝕜 n (extChartAt I' y ∘ f ∘ (extChartAt I x).symm) (range I)
          (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]
{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']
[SmoothManifoldWithCorners I' M']
{f : M → M'}
{x : M}
{n : ℕ∞}
{x' : M}
{y : M'}
(hx : x' ∈ (chartAt H x).source)
(hy : f x' ∈ (chartAt H' y).source)

ContMDiffAt I I' n f x' ↔
  ContinuousAt f x' ∧
    ContDiffWithinAt 𝕜 n (↑(extChartAt I' y) ∘ f ∘ ↑(extChartAt I x).symm) (Set.range ↑I) (↑(extChartAt I x) x')


theorem ContDiff.real_of_complex {n : ℕ∞} (h : ContDiff ℂ n e) :
    ContDiff ℝ n fun x : ℝ => (e x).re

{e : ℂ → ℂ}
{n : ℕ∞}
(h : ContDiff ℂ n e)


theorem Nodup.pmap {p : α → Prop} {f : ∀ a, p a → β} {s : Multiset α} {H}
    (hf : ∀ a ha b hb, f a ha = f b hb → a = b) : Nodup s → Nodup (pmap f s H)

(hf : ∀ (a : α) (ha : p a) (b : α) (hb : p b), f a ha = f b hb → a = b)


theorem permCongr_trans (p p' : Equiv.Perm α') :
    (e.permCongr p).trans (e.permCongr p') = e.permCongr (p.trans p')

{α' : Type u_1}
{β' : Type u_2}
(e : α' ≃ β')
(p p' : Equiv.Perm α')

Equiv.trans (e.permCongr p) (e.permCongr p') = e.permCongr (Equiv.trans p p')


@[simp]
theorem num_X : num (X : RatFunc K) = Polynomial.X


lemma Spec.map_base : (Spec.map f).1.base = PrimeSpectrum.comap f

(AlgebraicGeometry.Spec.map f).val.base = PrimeSpectrum.comap f


theorem restrict_const_lintegral (c : ℝ≥0∞) {s : Set α} (hs : MeasurableSet s) :
    ((const α c).restrict s).lintegral μ = c * μ s

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(c : ℝ≥0∞)
{s : Set α}
(hs : MeasurableSet s)

((MeasureTheory.SimpleFunc.const α c).restrict s).lintegral μ = c * μ s


/-- Given any `Finset` of objects `{X, ...}` and
indexed collection of `Finset`s of morphisms `{f, ...}` in `C`,
there exists an object `S`, with a morphism `T X : S ⟶ X` from each `X`,
such that the triangles commute: `T X ≫ f = T Y`, for `f : X ⟶ Y` in the `Finset`.
-/
theorem inf_exists :
    ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (S ⟶ X)),
      ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y},
        (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H →
          T mX ≫ f = T mY

∃ S T,
  ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y},
    ⟨X, ⟨Y, ⟨mX, ⟨mY, f⟩⟩⟩⟩ ∈ H → CategoryTheory.CategoryStruct.comp (T mX) f = T mY


@[to_additive sub_nonpos]
theorem div_le_one' : a / b ≤ 1 ↔ a ≤ b

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


@[simp] lemma piAntidiag_zero (s : Finset ι) : piAntidiag s (0 : μ) = {0}

{ι : Type u_1}
{μ : Type u_2}
[DecidableEq ι]
[CanonicallyOrderedAddCommMonoid μ]
[Finset.HasAntidiagonal μ]
[DecidableEq μ]
(s : Finset ι)


/-- An affine subspace constructed from a point and a direction is nonempty. -/
theorem mk'_nonempty (p : P) (direction : Submodule k V) : (mk' p direction : Set P).Nonempty

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


theorem exp_blockDiagonal' (v : ∀ i, Matrix (n' i) (n' i) 𝔸) :
    exp 𝕂 (blockDiagonal' v) = blockDiagonal' (exp 𝕂 v)

(𝕂 : Type u_1)
{m : Type u_2}
{n' : m → Type u_5}
{𝔸 : Type u_6}
[Fintype m]
[DecidableEq m]
[(i : m) → Fintype (n' i)]
[(i : m) → DecidableEq (n' i)]
[Field 𝕂]
[Ring 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]
[Algebra 𝕂 𝔸]
[T2Space 𝔸]
(v : (i : m) → Matrix (n' i) (n' i) 𝔸)

NormedSpace.exp 𝕂 (Matrix.blockDiagonal' v) = Matrix.blockDiagonal' (NormedSpace.exp 𝕂 v)


/-- Interpret a natural isomorphism of the underlying lax monoidal functors as an
isomorphism of the lax braided monoidal functors.
-/
@[simps]
def mkIso {F G : LaxBraidedFunctor C D} (i : F.toLaxMonoidalFunctor ≅ G.toLaxMonoidalFunctor) :
    F ≅ G

{F G : CategoryTheory.LaxBraidedFunctor C D}

(CategoryTheory.LaxBraidedFunctor.mkIso i).hom = i.hom


/-- A graded version of `DistribMulAction`. -/
class GdistribMulAction [AddMonoid ιA] [VAdd ιA ιB] [GMonoid A] [∀ i, AddMonoid (M i)]
    extends GMulAction A M where
  smul_add {i j} (a : A i) (b c : M j) : smul a (b + c) = smul a b + smul a c
  smul_zero {i j} (a : A i) : smul a (0 : M j) = 0

[self : DirectSum.GdistribMulAction A M]

GradedMonoid.GSMul.smul a (b + c) = GradedMonoid.GSMul.smul a b + GradedMonoid.GSMul.smul a c


theorem add_martingale [Preorder E] [CovariantClass E E (· + ·) (· ≤ ·)]
    (hf : Supermartingale f ℱ μ) (hg : Martingale g ℱ μ) : Supermartingale (f + g) ℱ μ

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

(hf : MeasureTheory.Supermartingale f ℱ μ)

MeasureTheory.Supermartingale (f + g) ℱ μ


@[simp]
theorem div_left (hac : Commute a c) (hbc : Commute b c) : Commute (a / b) c

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b c : G₀}
(hac : Commute a c)
(hbc : Commute b c)


theorem image_iInter_subset (s : ι → Set α) (f : α → β) : (f '' ⋂ i, s i) ⊆ ⋂ i, f '' s i

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


theorem sum_le_one (x : X) : ∑ᶠ i, f i x ≤ 1

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


/-- In the specific case of multilinear maps on spaces indexed by `Fin (n+1)`, where one can build
an element of `∀ (i : Fin (n+1)), M i` using `cons`, one can express directly the multiplicativity
of a multilinear map along the first variable. -/
theorem snoc_smul (f : MultilinearMap R M M₂) (m : ∀ i : Fin n, M (castSucc i)) (c : R)
    (x : M (last n)) : f (snoc m (c • x)) = c • f (snoc m x)

[(i : Fin n.succ) → AddCommMonoid (M i)]

f (Fin.snoc m (c • x)) = c • f (Fin.snoc m x)


/-- The isomorphism `S₁.sc' _ i j k ≅ S₂.sc' _ i j k` induced by an isomorphism `S₁ ≅ S₂`
in `ComposableArrows C n`. -/
@[simps]
def sc'MapIso {S₁ S₂ : ComposableArrows C n} (e : S₁ ≅ S₂)
    (h₁ : S₁.IsComplex) (h₂ : S₂.IsComplex) (i j k : ℕ) (hij : i + 1 = j := by omega)
    (hjk : j + 1 = k := by omega) (hk : k ≤ n := by omega) :
    S₁.sc' h₁ i j k ≅ S₂.sc' h₂ i j k

{S₁ S₂ : CategoryTheory.ComposableArrows C n}

(CategoryTheory.ComposableArrows.sc'MapIso e h₁ h₂ i j k hij hjk hk).inv =
  CategoryTheory.ComposableArrows.sc'Map e.inv h₂ h₁ i j k ⋯ ⋯ ⋯


@[simp]
lemma quasispectrum.zero_mem [Nontrivial R] (a : A) : 0 ∈ quasispectrum R a

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[NonUnitalRing A]
[Module R A]
[Nontrivial R]
(a : A)


@[simp]
theorem toHomeomorph_symm : e.toHomeomorph.symm = e.symm.toHomeomorph

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)


theorem hasGradientWithinAt_iff_hasFDerivWithinAt {s : Set F} :
    HasGradientWithinAt f f' s x ↔ HasFDerivWithinAt f (toDual 𝕜 F f') s x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}
{s : Set F}

HasGradientWithinAt f f' s x ↔ HasFDerivWithinAt f ((InnerProductSpace.toDual 𝕜 F) f') s x


@[simp, norm_cast]
theorem coe_compl (s : Finset α) : ↑sᶜ = (↑s : Set α)ᶜ

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


theorem mk'_neg {M M' : Type*} [AddCommGroup M] [AddCommGroup M'] [Module R M] [Module R M']
    (f : M →ₗ[R] M') [IsLocalizedModule S f] (m : M) (s : S) : mk' f (-m) s = -mk' f m s

{R : Type u_1}
[CommSemiring R]
{S : Submonoid R}
{M : Type u_6}
{M' : Type u_7}
[AddCommGroup M]
[AddCommGroup M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
(m : M)
(s : ↥S)

IsLocalizedModule.mk' f (-m) s = -IsLocalizedModule.mk' f m s


lemma mod_two_add_add_odd_mod_two (m : ℕ) {n : ℕ} (hn : Odd n) : m % 2 + (m + n) % 2 = 1


theorem _root_.aestronglyMeasurable_const_smul_iff₀ {c : G₀} (hc : c ≠ 0) :
    AEStronglyMeasurable (fun x => c • f x) μ ↔ AEStronglyMeasurable f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
{f : α → β}
{G₀ : Type u_7}
[GroupWithZero G₀]
[MulAction G₀ β]
[ContinuousConstSMul G₀ β]
{c : G₀}
(hc : c ≠ 0)

MeasureTheory.AEStronglyMeasurable (fun x => c • f x) μ ↔ MeasureTheory.AEStronglyMeasurable f μ


/-- If `a` is the least element of `s` and `b` is the least element of `t`,
then `min a b` is the least element of `s ∪ t`. -/
theorem IsLeast.union [LinearOrder γ] {a b : γ} {s t : Set γ} (ha : IsLeast s a)
    (hb : IsLeast t b) : IsLeast (s ∪ t) (min a b)

{γ : Type w}
[LinearOrder γ]
{a b : γ}
{s t : Set γ}
(ha : IsLeast s a)
(hb : IsLeast t b)


@[simp]
theorem lift_comp_of (f : FreeRing α →+* R) : lift (f ∘ of) = f

{α : Type u}
{R : Type v}
[Ring R]
(f : FreeRing α →+* R)


@[simp]
theorem aeval_zero' (p : MvPolynomial σ R) :
    aeval (fun _ => 0 : σ → S₁) p = algebraMap _ _ (constantCoeff p)

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
[Algebra R S₁]
(p : MvPolynomial σ R)

(MvPolynomial.aeval fun x => 0) p = (algebraMap R S₁) (MvPolynomial.constantCoeff p)


@[simp]
theorem prod_edist_eq_card (f g : WithLp 0 (α × β)) :
    edist f g =
      (if edist f.fst g.fst = 0 then 0 else 1) + (if edist f.snd g.snd = 0 then 0 else 1)

{α : Type u_2}
{β : Type u_3}
[EDist α]
[EDist β]
(f g : WithLp 0 (α × β))

edist f g = (if edist f.1 g.1 = 0 then 0 else 1) + if edist f.2 g.2 = 0 then 0 else 1


@[to_additive]
theorem isPWO_support_mulAntidiagonal : { a | (mulAntidiagonal hs ht a).Nonempty }.IsPWO

{α : Type u_1}
[OrderedCancelCommMonoid α]
{s t : Set α}
{hs : s.IsPWO}
{ht : t.IsPWO}

{a | (Finset.mulAntidiagonal hs ht a).Nonempty}.IsPWO


@[simp]
theorem map_id : map (id : M →ₗ[A] M) (id : N →ₗ[R] N) = .id

{R : Type uR}
{A : Type uA}
{M : Type uM}
{N : Type uN}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid N]
[Module R N]

TensorProduct.AlgebraTensorModule.map LinearMap.id LinearMap.id = LinearMap.id


/-- The `MulEquiv` that takes an automorphism `f` to the element `k : (ZMod n)ˣ` such that
  `f μ = μ ^ k` for any root of unity `μ`. A strengthening of `IsPrimitiveRoot.autToPow`. -/
@[simps]
noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ

(h : Irreducible (Polynomial.cyclotomic (↑n) K))

(IsCyclotomicExtension.autEquivPow L h).symm t =
  (IsPrimitiveRoot.powerBasis K ⋯).equivOfMinpoly (IsPrimitiveRoot.powerBasis K ⋯) ⋯


@[simp]
theorem supported_empty : supported R (∅ : Set σ) = ⊥

{σ : Type u_1}
{R : Type u}
[CommSemiring R]


theorem comp_apply (f : L₂ →ₗ⁅R⁆ L₃) (g : L₁ →ₗ⁅R⁆ L₂) (x : L₁) : f.comp g x = f (g x)

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
{L₃ : Type w₁}
[CommRing R]
[LieRing L₁]
[LieAlgebra R L₁]
[LieRing L₂]
[LieAlgebra R L₂]
[LieRing L₃]
[LieAlgebra R L₃]
(f : L₂ →ₗ⁅R⁆ L₃)
(g : L₁ →ₗ⁅R⁆ L₂)
(x : L₁)


theorem IsLocalMax.on (h : IsLocalMax f a) (s) : IsLocalMaxOn f s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{f : α → β}
{a : α}
(h : IsLocalMax f a)
(s : Set α)


lemma isLUB_of_scottContinuous {c : Chain α} {f : α → β} (hf : ScottContinuous f) :
    IsLUB (Set.range (Chain.map c ⟨f, (ScottContinuous.monotone hf)⟩)) (f (ωSup c))

{α : Type u}
{β : Type v}
[OmegaCompletePartialOrder α]
[OmegaCompletePartialOrder β]
{c : OmegaCompletePartialOrder.Chain α}
{f : α → β}
(hf : ScottContinuous f)

IsLUB (Set.range ⇑(c.map { toFun := f, monotone' := ⋯ })) (f (OmegaCompletePartialOrder.ωSup c))


@[simp]
theorem mapAlgEquiv_trans (e : A₁ ≃ₐ[R] A₂) (f : A₂ ≃ₐ[R] A₃) :
    (mapAlgEquiv σ e).trans (mapAlgEquiv σ f) = mapAlgEquiv σ (e.trans f)

{R : Type u}
(σ : Type u_1)
[CommSemiring R]
{A₁ : Type u_2}
{A₂ : Type u_3}
{A₃ : Type u_4}
[CommSemiring A₁]
[CommSemiring A₂]
[CommSemiring A₃]
[Algebra R A₁]
[Algebra R A₂]
[Algebra R A₃]
(e : A₁ ≃ₐ[R] A₂)
(f : A₂ ≃ₐ[R] A₃)

(MvPolynomial.mapAlgEquiv σ e).trans (MvPolynomial.mapAlgEquiv σ f) = MvPolynomial.mapAlgEquiv σ (e.trans f)


protected lemma sq_sub_sq (h : Commute a b) : a ^ 2 - b ^ 2 = (a + b) * (a - b)

{R : Type x}
[Ring R]
{a b : R}
(h : Commute a b)


theorem Disjoint.set_prod_right (ht : Disjoint t₁ t₂) (s₁ s₂ : Set α) :
    Disjoint (s₁ ×ˢ t₁) (s₂ ×ˢ t₂)

{α : Type u_1}
{β : Type u_2}
{t₁ t₂ : Set β}
(ht : Disjoint t₁ t₂)
(s₁ s₂ : Set α)


@[deprecated getElem_list (since := "2024-06-12")]
theorem get_list (i : Fin (list n).length) : (list n).get i = i.cast (length_list n)


theorem integrableOn_Ici_iff_integrableAtFilter_atTop [LinearOrder X] [CompactIccSpace X] :
    IntegrableOn f (Ici a) μ ↔ IntegrableAtFilter f atTop μ ∧ LocallyIntegrableOn f (Ici a) μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[TopologicalSpace X]
[NormedAddCommGroup E]
{f : X → E}
{μ : MeasureTheory.Measure X}
{a : X}
[LinearOrder X]
[CompactIccSpace X]

MeasureTheory.IntegrableOn f (Set.Ici a) μ ↔
  MeasureTheory.IntegrableAtFilter f Filter.atTop μ ∧ MeasureTheory.LocallyIntegrableOn f (Set.Ici a) μ


@[to_additive (attr := ext)]
theorem hom_eq ⦃f g : FreeMonoid α →* M⦄ (h : ∀ x, f (of x) = g (of x)) : f = g

(h : ∀ (x : α), f (FreeAddMonoid.of x) = g (FreeAddMonoid.of x))


@[simp]
theorem imJ_fst_dualNumberEquiv (q : Quaternion (DualNumber R)) :
    (dualNumberEquiv q).fst.imJ = q.imJ.fst

{R : Type u_1}
[CommRing R]
(q : Quaternion (DualNumber R))

(TrivSqZeroExt.fst (Quaternion.dualNumberEquiv q)).imJ = TrivSqZeroExt.fst q.imJ


theorem raise_chain : ∀ l n, List.Chain (· ≤ ·) n (raise l n)

List.Chain (fun x x_1 => x ≤ x_1) n (Denumerable.raise l n)


@[to_additive mod_addOrderOf_zsmul]
lemma zpow_mod_orderOf (x : G) (z : ℤ) : x ^ (z % (orderOf x : ℤ)) = x ^ z

{G : Type u_1}
[AddGroup G]
(x : G)
(z : ℤ)


@[simp, norm_cast]
theorem coe_image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) :
    (image₂ f s t : Set γ) = Set.image2 f s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
(f : α → β → γ)
(s : Finset α)
(t : Finset β)

↑(Finset.image₂ f s t) = Set.image2 f ↑s ↑t


private theorem center_eq_top [Finite D] : Subring.center D = ⊤

(D : Type u_1)
[DivisionRing D]
[Finite D]


/-- If for any three points `x < y < z`, the slope of the secant line of `f : 𝕜 → 𝕜` on `[x, y]` is
greater than the slope of the secant line of `f` on `[y, z]`, then `f` is concave. -/
theorem concaveOn_of_slope_anti_adjacent (hs : Convex 𝕜 s)
    (hf :
      ∀ {x y z : 𝕜},
        x ∈ s → z ∈ s → x < y → y < z → (f z - f y) / (z - y) ≤ (f y - f x) / (y - x)) :
    ConcaveOn 𝕜 s f


@[simp]
theorem _root_.NonUnitalSubalgebra.toSubmodule_toNonUnitalSubalgebra (S : NonUnitalSubalgebra R A) :
    (S.toSubmodule.toNonUnitalSubalgebra fun _ _ => mul_mem (s := S)) = S

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
(S : NonUnitalSubalgebra R A)

S.toSubmodule.toNonUnitalSubalgebra ⋯ = S


@[to_additive] lemma sup_div_inf_eq_mabs_div (a b : α) : (a ⊔ b) / (a ⊓ b) = |b / a|ₘ

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


@[simp]
theorem continuous_lift₂ {f : X → Y → Z} {hf : ∀ a b c d, (a ~ᵢ c) → (b ~ᵢ d) → f a b = f c d} :
    Continuous (uncurry <| lift₂ f hf) ↔ Continuous (uncurry f)

{hf : ∀ (a : X) (b : Y) (c : X) (d : Y), (a ~ᵢ c) → (b ~ᵢ d) → f a b = f c d}

Continuous (Function.uncurry (SeparationQuotient.lift₂ f hf)) ↔ Continuous (Function.uncurry f)


theorem ker_coeff_eq_max_ideal : RingHom.ker (constantCoeff k) = maximalIdeal _

RingHom.ker (PowerSeries.constantCoeff k) = LocalRing.maximalIdeal (PowerSeries k)


/-- If `s` is a convex bounded set with a nonempty interior in a real normed space,
then there is a homeomorphism of the ambient space to itself
that sends the interior of `s` to the unit open ball
and the closure of `s` to the unit closed ball. -/
theorem exists_homeomorph_image_interior_closure_frontier_eq_unitBall {s : Set E}
    (hc : Convex ℝ s) (hne : (interior s).Nonempty) (hb : IsBounded s) :
    ∃ h : E ≃ₜ E, h '' interior s = ball 0 1 ∧ h '' closure s = closedBall 0 1 ∧
      h '' frontier s = sphere 0 1

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{s : Set E}
(hc : Convex ℝ s)
(hne : (interior s).Nonempty)
(hb : Bornology.IsBounded s)

∃ h, ⇑h '' interior s = Metric.ball 0 1 ∧ ⇑h '' closure s = Metric.closedBall 0 1 ∧ ⇑h '' frontier s = Metric.sphere 0 1


/--
M is flat if and only if `- ⊗ M` is a left exact functor.
-/
lemma iff_rTensor_exact [Small.{v} R] :
    Flat R M ↔
    ∀ ⦃N N' N'' : Type v⦄ [AddCommGroup N] [AddCommGroup N'] [AddCommGroup N'']
      [Module R N] [Module R N'] [Module R N''] ⦃f : N →ₗ[R] N'⦄ ⦃g : N' →ₗ[R] N''⦄,
        Function.Exact f g → Function.Exact (f.rTensor M) (g.rTensor M)

{R : Type u}
{M : Type v}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Small.{v, u} R]

Module.Flat R M ↔
  ∀ ⦃N N' N'' : Type v⦄ [inst : AddCommGroup N] [inst_1 : AddCommGroup N'] [inst_2 : AddCommGroup N'']
    [inst_3 : Module R N] [inst_4 : Module R N'] [inst_5 : Module R N''] ⦃f : N →ₗ[R] N'⦄ ⦃g : N' →ₗ[R] N''⦄,
    Function.Exact ⇑f ⇑g → Function.Exact ⇑(LinearMap.rTensor M f) ⇑(LinearMap.rTensor M g)


theorem Set.Countable.preimage_circleMap {s : Set ℂ} (hs : s.Countable) (c : ℂ) {R : ℝ}
    (hR : R ≠ 0) : (circleMap c R ⁻¹' s).Countable


theorem Filter.EventuallyLE.isLocalMaxOn {f g : α → β} {a : α} (hle : g ≤ᶠ[𝓝[s] a] f)
    (hfga : f a = g a) (h : IsLocalMaxOn f s a) : IsLocalMaxOn g s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{s : Set α}
{f g : α → β}
{a : α}
(hle : g ≤ᶠ[𝓝[s] a] f)
(hfga : f a = g a)
(h : IsLocalMaxOn f s a)


/-- An equivalent definition for prime powers: `n` is a prime power iff there is a unique prime
dividing it. -/
theorem isPrimePow_iff_unique_prime_dvd {n : ℕ} : IsPrimePow n ↔ ∃! p : ℕ, p.Prime ∧ p ∣ n

IsPrimePow n ↔ ∃! p, Nat.Prime p ∧ p ∣ n


theorem stmts_trans {M : Λ → Stmt₁} {S : Finset Λ} {q₁ q₂ : Stmt₁} (h₁ : q₁ ∈ stmts₁ q₂) :
    some q₂ ∈ stmts M S → some q₁ ∈ stmts M S

{Γ : Type u_1}
{Λ : Type u_2}
{σ : Type u_3}
{M : Λ → Turing.TM1.Stmt Γ Λ σ}
{S : Finset Λ}
{q₁ q₂ : Turing.TM1.Stmt Γ Λ σ}
(h₁ : q₁ ∈ Turing.TM1.stmts₁ q₂)

some q₂ ∈ Turing.TM1.stmts M S → some q₁ ∈ Turing.TM1.stmts M S


@[simp] theorem mk_univ : (⟨univ, isOpen_univ⟩ : Opens α) = ⊤

{ carrier := Set.univ, is_open' := ⋯ } = ⊤


@[simp]
theorem realize_relabel {t : L.Term α} {g : α → β} {v : β → M} :
    (t.relabel g).realize v = t.realize (v ∘ g)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{β : Type v'}
{t : L.Term α}
{g : α → β}
{v : β → M}

FirstOrder.Language.Term.realize v (FirstOrder.Language.Term.relabel g t) = FirstOrder.Language.Term.realize (v ∘ g) t


lemma const (e : E) {U : Set 𝕜} : MeromorphicOn (fun _ ↦ e) U

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(e : E)
{U : Set 𝕜}


@[simp]
theorem dual_bot : dual (⊥ : Interval α) = ⊥


/--
Cost structure for strings, where cost is the length of the token.
-/
@[simps!]
def stringLengthCost : Cost String String ℕ

Levenshtein.stringLengthCost.substitute a b = max a.length b.length


theorem toL1_sub (f g : α → β) (hf : Integrable f μ) (hg : Integrable g μ) :
    toL1 (f - g) (hf.sub hg) = toL1 f hf - toL1 g hg

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
(f g : α → β)
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)

MeasureTheory.Integrable.toL1 (f - g) ⋯ = MeasureTheory.Integrable.toL1 f hf - MeasureTheory.Integrable.toL1 g hg


theorem Ici_pred (a : α) : Ici (pred a) = insert (pred a) (Ici a)

{α : Type u_1}
[PartialOrder α]
[PredOrder α]
(a : α)

Set.Ici (Order.pred a) = insert (Order.pred a) (Set.Ici a)


/-- See also `Finset.prod_bij`. -/
@[to_additive "See also `Finset.sum_bij`."]
theorem finprod_mem_eq_of_bijOn {s : Set α} {t : Set β} {f : α → M} {g : β → M} (e : α → β)
    (he₀ : s.BijOn e t) (he₁ : ∀ x ∈ s, f x = g (e x)) : ∏ᶠ i ∈ s, f i = ∏ᶠ j ∈ t, g j

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[CommMonoid M]
{s : Set α}
{t : Set β}
{f : α → M}
{g : β → M}
(e : α → β)
(he₀ : Set.BijOn e s t)
(he₁ : ∀ x ∈ s, f x = g (e x))

∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ᶠ (j : β) (_ : j ∈ t), g j


@[simp]
theorem comp_left_eq_zero [IsIso f] : f ≫ g = 0 ↔ g = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{P Q R : C}
(f : P ⟶ Q)
(g : Q ⟶ R)
[CategoryTheory.IsIso f]


/-- The closure of a preperfect set is perfect.
For a converse, see `preperfect_iff_perfect_closure`. -/
theorem Preperfect.perfect_closure (hC : Preperfect C) : Perfect (closure C)

{α : Type u_1}
[TopologicalSpace α]
{C : Set α}
(hC : Preperfect C)


theorem arg_cos_add_sin_mul_I_sub (θ : ℝ) :
    arg (cos θ + sin θ * I) - θ = 2 * π * ⌊(π - θ) / (2 * π)⌋

(Complex.cos ↑θ + Complex.sin ↑θ * Complex.I).arg - θ = 2 * π * ↑⌊(π - θ) / (2 * π)⌋


/-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of a point
is a neighborhood of the preimage. -/
theorem extChartAt_preimage_mem_nhds {x : M} (ht : t ∈ 𝓝 x) :
    (extChartAt I x).symm ⁻¹' t ∈ 𝓝 ((extChartAt I x) x)

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(I : ModelWithCorners 𝕜 E H)
{t : Set M}
[ChartedSpace H M]
{x : M}
(ht : t ∈ 𝓝 x)

↑(extChartAt I x).symm ⁻¹' t ∈ 𝓝 (↑(extChartAt I x) x)


@[simp]
theorem coe_toReal (θ : Angle) : (θ.toReal : Angle) = θ


/-- Taking the product of two maps with the same codomain is equivalent to taking the product of
their domains.

See note [bundled maps over different rings] for why separate `R` and `S` semirings are used. -/
@[simps]
def coprodEquiv [Module S M₃] [SMulCommClass R S M₃] :
    ((M →ₗ[R] M₃) × (M₂ →ₗ[R] M₃)) ≃ₗ[S] M × M₂ →ₗ[R] M₃

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
(S : Type u_3)
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R M₂]
[Module R M₃]
[Module S M₃]
[SMulCommClass R S M₃]
(f : M × M₂ →ₗ[R] M₃)

(LinearMap.coprodEquiv S).symm f = (f ∘ₗ LinearMap.inl R M M₂, f ∘ₗ LinearMap.inr R M M₂)


theorem ker_eq : (ker f : Set R) = Set.preimage f {0}

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rcf : RingHomClass F R S]
(f : F)


theorem iterate_le_nfp (f a n) : f^[n] a ≤ nfp f a

(f : Ordinal.{u_1} → Ordinal.{u_1})
(a : Ordinal.{u_1})
(n : ℕ)


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

{R : Type u_1}
{M : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
{p : Submodule R M}
(a : A)
{m : M}
(hm : m ∈ p)


/-- Sum of elements in a `Subsemiring` of a `Semiring` indexed by a `Finset`
is in the `add_subsemiring`. -/
protected theorem sum_mem (s : Subsemiring R) {ι : Type*} {t : Finset ι} {f : ι → R}
    (h : ∀ c ∈ t, f c ∈ s) : (∑ i ∈ t, f i) ∈ s

{R : Type u}
[NonAssocSemiring R]
(s : Subsemiring R)
{ι : Type u_1}
{t : Finset ι}
{f : ι → R}
(h : ∀ c ∈ t, f c ∈ s)


@[simp] theorem isRegular_X : IsRegular (X : R[X])


@[ext]
theorem ext_mint {f g : Multiplicative ℤ →* M} (h1 : f (ofAdd 1) = g (ofAdd 1)) : f = g

(h1 : f (Multiplicative.ofAdd 1) = g (Multiplicative.ofAdd 1))


/-- A oplax monoidal functor is a functor `F : C ⥤ D` between monoidal categories,
equipped with morphisms `η : F.obj (𝟙_ C) ⟶ 𝟙 _D` and `δ X Y : F.obj (X ⊗ Y) ⟶ F.obj X ⊗ F.obj Y`,
satisfying the appropriate coherences. -/
structure OplaxMonoidalFunctor extends C ⥤ D where
  /-- counit morphism -/
  η : obj (𝟙_ C) ⟶ 𝟙_ D
  /-- cotensorator -/
  δ : ∀ X Y : C, obj (X ⊗ Y) ⟶ obj X ⊗ obj Y
  δ_natural_left :
    ∀ {X Y : C} (f : X ⟶ Y) (X' : C),
      δ X X' ≫ map f ▷ obj X' = map (f ▷ X') ≫ δ Y X' := by
    aesop_cat
  δ_natural_right :
    ∀ {X Y : C} (X' : C) (f : X ⟶ Y) ,
      δ X' X ≫ obj X' ◁ map f = map (X' ◁ f) ≫ δ X' Y := by
    aesop_cat
  /-- associativity of the tensorator -/
  associativity :
    ∀ X Y Z : C,
      δ (X ⊗ Y) Z ≫ δ X Y ▷ obj Z ≫ (α_ (obj X) (obj Y) (obj Z)).hom =
        map (α_ X Y Z).hom ≫ δ X (Y ⊗ Z) ≫ obj X ◁ δ Y Z := by
    aesop_cat
  -- unitality
  left_unitality : ∀ X : C, (λ_ (obj X)).inv = map (λ_ X).inv ≫ δ (𝟙_ C) X ≫ η ▷ obj X := by
    aesop_cat
  right_unitality : ∀ X : C, (ρ_ (obj X)).inv = map (ρ_ X).inv ≫ δ X (𝟙_ C) ≫ obj X ◁ η := by
    aesop_cat

(self : CategoryTheory.OplaxMonoidalFunctor C D)

(CategoryTheory.MonoidalCategory.leftUnitor (self.obj X)).inv =
  self.map (CategoryTheory.MonoidalCategory.leftUnitor X).inv ≫
    self.δ (𝟙_ C) X ≫ CategoryTheory.MonoidalCategory.whiskerRight self.η (self.obj X)


/-- `map` is natural with respect to `cons`. -/
@[simp]
theorem map_cons (f : α → β) (a : α) : ∀ v : Vector α n, map f (cons a v) = cons (f a) (map f v)

{α : Type u}
{β : Type v}
{n : ℕ}
(f : α → β)
(a : α)
(v : Mathlib.Vector α n)

Mathlib.Vector.map f (Mathlib.Vector.cons a v) = Mathlib.Vector.cons (f a) (Mathlib.Vector.map f v)


/-- `Finsupp.single` as an `AddMonoidHom`.

See `Finsupp.lsingle` in `LinearAlgebra/Finsupp` for the stronger version as a linear map. -/
@[simps]
def singleAddHom (a : α) : M →+ α →₀ M

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

(Finsupp.singleAddHom a) b = Finsupp.single a b


theorem edges_nodup_of_support_nodup {u v : V} {p : G.Walk u v} (h : p.support.Nodup) :
    p.edges.Nodup

{V : Type u}
{G : SimpleGraph V}
{u v : V}
{p : G.Walk u v}
(h : p.support.Nodup)


lemma GrowsPolynomially.of_isEquivalent {f g : ℝ → ℝ} (hg : GrowsPolynomially g)
    (hf : f ~[atTop] g) : GrowsPolynomially f

(hg : AkraBazziRecurrence.GrowsPolynomially g)


@[simp] lemma ofENat_le_nat {m : ℕ∞} {n : ℕ} : ofENat m ≤ n ↔ m ≤ n

↑m ≤ ↑n ↔ m ≤ ↑n


@[measurability]
protected theorem norm {β : Type*} [SeminormedAddCommGroup β] {f : α → β}
    (hf : AEStronglyMeasurable f μ) : AEStronglyMeasurable (fun x => ‖f x‖) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (fun x => ‖f x‖) μ


lemma HasPullbackOpenEmbedding : HasPullback f i

{X Y Z : Stonean}
(f : X ⟶ Z)
{i : Y ⟶ Z}
(hi : OpenEmbedding ⇑i)


@[simp]
theorem dropFun_diag {α} : dropFun (@prod.diag (n + 1) α) = prod.diag

TypeVec.dropFun TypeVec.prod.diag = TypeVec.prod.diag


/-- The non-commutative version of `Finset.prod_mul_distrib` -/
@[to_additive "The non-commutative version of `Finset.sum_add_distrib`"]
theorem noncommProd_mul_distrib {s : Finset α} (f : α → β) (g : α → β) (comm_ff comm_gg comm_gf) :
    noncommProd s (f * g) (noncommProd_mul_distrib_aux comm_ff comm_gg comm_gf) =
      noncommProd s f comm_ff * noncommProd s g comm_gg

(comm_ff : (↑s).Pairwise fun x y => AddCommute (f x) (f y))

(comm_gg : (↑s).Pairwise fun x y => AddCommute (g x) (g y))

(comm_gf : (↑s).Pairwise fun x y => AddCommute (g x) (f y))

s.noncommSum (f + g) ⋯ = s.noncommSum f comm_ff + s.noncommSum g comm_gg


/-- If `M / R` and `M' / R'` are modules, `i : R' → R` is a map, `j : M →+ M'` is a monoid map,
such that they send non-zero elements to non-zero elements, and compatible with the scalar
multiplications on `M` and `M'`, then `j` sends linearly independent families of vectors to
linearly independent families of vectors. As a special case, taking `R = R'`
it is `LinearIndependent.map'`. -/
theorem LinearIndependent.map_of_injective_injective {R' : Type*} {M' : Type*}
    [Semiring R'] [AddCommMonoid M'] [Module R' M'] (hv : LinearIndependent R v)
    (i : R' → R) (j : M →+ M') (hi : ∀ r, i r = 0 → r = 0) (hj : ∀ m, j m = 0 → m = 0)
    (hc : ∀ (r : R') (m : M), j (i r • m) = r • j m) : LinearIndependent R' (j ∘ v)


/-- `ContinuousMap.compStarAlgHom` sends the identity `StarAlgHom` on `A` to the identity
`StarAlgHom` on `C(X, A)`. -/
lemma compStarAlgHom_id : compStarAlgHom X (.id 𝕜 A) continuous_id = .id 𝕜 C(X, A)

(X : Type u_1)
{𝕜 : Type u_2}
{A : Type u_3}
[TopologicalSpace X]
[CommSemiring 𝕜]
[TopologicalSpace A]
[Semiring A]
[TopologicalSemiring A]
[Star A]
[ContinuousStar A]
[Algebra 𝕜 A]

ContinuousMap.compStarAlgHom X (StarAlgHom.id 𝕜 A) ⋯ = StarAlgHom.id 𝕜 C(X, A)


theorem div_tendsto_zero_of_degree_lt (hdeg : P.degree < Q.degree) :
    Tendsto (fun x => eval x P / eval x Q) atTop (𝓝 0)

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

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


theorem measure_ext_Ioo_rat {μ ν : Measure ℝ} [IsLocallyFiniteMeasure μ]
    (h : ∀ a b : ℚ, μ (Ioo a b) = ν (Ioo a b)) : μ = ν

(h : ∀ (a b : ℚ), μ (Set.Ioo ↑a ↑b) = ν (Set.Ioo ↑a ↑b))


/-- If `M / S / R` is a scalar tower, and `M / R` is Artinian, then `M / S` is also Artinian. -/
theorem isArtinian_of_tower (R) {S M} [CommRing R] [Ring S] [AddCommGroup M] [Algebra R S]
    [Module S M] [Module R M] [IsScalarTower R S M] (h : IsArtinian R M) : IsArtinian S M

(R : Type u_1)
{S : Type u_2}
{M : Type u_3}
[CommRing R]
[Ring S]
[AddCommGroup M]
[Algebra R S]
[Module S M]
[Module R M]
[IsScalarTower R S M]
(h : IsArtinian R M)


theorem map_comap_le (hφ : Function.Injective φ.obj) (T : Subgroupoid D) :
    map φ hφ (comap φ T) ≤ T

{C : Type u}
[CategoryTheory.Groupoid C]
{D : Type u_1}
[CategoryTheory.Groupoid D]
(φ : CategoryTheory.Functor C D)
(hφ : Function.Injective φ.obj)
(T : CategoryTheory.Subgroupoid D)

CategoryTheory.Subgroupoid.map φ hφ (CategoryTheory.Subgroupoid.comap φ T) ≤ T


/-- The `MulHom` from the preimage of a subsemigroup to itself. -/
@[to_additive (attr := simps)
  "The `AddHom` from the preimage of an additive subsemigroup to itself."]
def subsemigroupComap (f : M →ₙ* N) (N' : Subsemigroup N) :
    N'.comap f →ₙ* N'

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(f : M →ₙ* N)
(N' : Subsemigroup N)
(x : ↥(Subsemigroup.comap f N'))


nonrec theorem Smooth.prod_mk_space {f : M → E'} {g : M → F'} (hf : Smooth I 𝓘(𝕜, E') f)
    (hg : Smooth I 𝓘(𝕜, F') g) : Smooth I 𝓘(𝕜, E' × F') fun x => (f x, g 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]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{f : M → E'}
{g : M → F'}
(hf : Smooth I 𝓘(𝕜, E') f)
(hg : Smooth I 𝓘(𝕜, F') g)


theorem mem_of_le {F : PFilter P} : x ≤ y → x ∈ F → y ∈ F

{P : Type u_1}
[Preorder P]
{x y : P}
{F : Order.PFilter P}


@[simp]
theorem coe_inter (s t : Subtype (MeasurableSet : Set α → Prop)) : ↑(s ∩ t) = (s ∩ t : Set α)

{α : Type u_1}
[MeasurableSpace α]
(s t : Subtype MeasurableSet)


/-- **Strict inequality case of the Rearrangement Inequality**: Pointwise multiplication of
`f` and `g`, which antivary together, is strictly decreased by a permutation if and only if
`f` and `g ∘ σ` do not antivary together. Stated by permuting the entries of `g`. -/
theorem AntivaryOn.sum_mul_lt_sum_mul_comp_perm_iff (hfg : AntivaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) :
    ∑ i ∈ s, f i * g i < ∑ i ∈ s, f i * g (σ i) ↔ ¬AntivaryOn f (g ∘ σ) s

{ι : Type u_1}
{α : Type u_2}
[LinearOrderedRing α]
{s : Finset ι}
{σ : Equiv.Perm ι}
{f g : ι → α}
(hfg : AntivaryOn f g ↑s)
(hσ : {x | σ x ≠ x} ⊆ ↑s)

∑ i ∈ s, f i * g i < ∑ i ∈ s, f i * g (σ i) ↔ ¬AntivaryOn f (g ∘ ⇑σ) ↑s


theorem tendsto_natCast_atTop_iff [StrictOrderedSemiring R] [Archimedean R] {f : α → ℕ}
    {l : Filter α} : Tendsto (fun n => (f n : R)) l atTop ↔ Tendsto f l atTop

{α : Type u_1}
{R : Type u_2}
[StrictOrderedSemiring R]
[Archimedean R]
{f : α → ℕ}
{l : Filter α}

Filter.Tendsto (fun n => ↑(f n)) l Filter.atTop ↔ Filter.Tendsto f l Filter.atTop


theorem intPow_negOfNat_bit1 {b' c' : ℕ} (h1 : Nat.pow a b' = c')
    (hb : nat_lit 2 * b' + nat_lit 1 = b) (hc : c' * (c' * a) = c) :
    Int.pow (Int.negOfNat a) b = Int.negOfNat c


/-- The right unitor, a natural isomorphism `(F ⋙ (𝟭 B)) ≅ F`.
-/
@[simps]
def rightUnitor (F : A ⥤ B) :
    F ⋙ 𝟭 B ≅ F

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
(F : CategoryTheory.Functor A B)
(X : A)

F.rightUnitor.inv.app X = CategoryTheory.CategoryStruct.id (F.obj X)


theorem apply_eq_iff_eq_symm_apply (e : P₁ ≃ᵃL[k] P₂) {p₁ p₂} : e p₁ = p₂ ↔ p₁ = e.symm p₂

{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₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]
(e : P₁ ≃ᵃL[k] P₂)
{p₁ : P₁}
{p₂ : P₂}


/--
An alternative characterization of the Grothendieck topology associated to a coverage `K`:
it is the infimum of all Grothendieck topologies whose associated coverage contains `K`.
-/
theorem toGrothendieck_eq_sInf (K : Coverage C) : toGrothendieck _ K =
    sInf {J | K ≤ ofGrothendieck _ J }

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
(K : CategoryTheory.Coverage C)

CategoryTheory.Coverage.toGrothendieck C K = sInf {J | K ≤ CategoryTheory.Coverage.ofGrothendieck C J}


protected theorem add_lt_add_of_lt_of_le {a b c d : Int} (h₁ : a < b) (h₂ : c ≤ d) :
    a + c < b + d


@[simp]
theorem divByMonic_one (p : R[X]) : p /ₘ 1 = p


theorem subtype_val_iff {p : β → Prop} [DecidablePred p] {hp : PrimrecPred p} {f : α → Subtype p} :
    haveI := Primcodable.subtype hp
    (Primrec fun a => (f a).1) ↔ Primrec f

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{p : β → Prop}
[DecidablePred p]
{hp : PrimrecPred p}
{f : α → Subtype p}


/-- If the topology of a space is induced by a countable family of seminorms, then the topology
is first countable. -/
theorem WithSeminorms.first_countable (hp : WithSeminorms p) :
    FirstCountableTopology E

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
[Countable ι]
{p : SeminormFamily 𝕜 E ι}
[TopologicalSpace E]
(hp : WithSeminorms p)


theorem lintegral_mul_eq_zero_of_lintegral_rpow_eq_zero {p : ℝ} (hp0 : 0 ≤ p) {f g : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (hf_zero : ∫⁻ a, f a ^ p ∂μ = 0) : (∫⁻ a, (f * g) a ∂μ) = 0

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{p : ℝ}
(hp0 : 0 ≤ p)
{f g : α → ENNReal}
(hf : AEMeasurable f μ)
(hf_zero : ∫⁻ (a : α), f a ^ p ∂μ = 0)


@[simp]
lemma le_egirth {n : ℕ∞} : n ≤ G.egirth ↔ ∀ a (w : G.Walk a a), w.IsCycle → n ≤ w.length

{α : Type u_1}
{G : SimpleGraph α}
{n : ℕ∞}

n ≤ G.egirth ↔ ∀ (a : α) (w : G.Walk a a), w.IsCycle → n ≤ ↑w.length


lemma LieSubmodule.coe_toEnd_pow (N : LieSubmodule R L M) (x : L) (y : N) (n : ℕ) :
    ((toEnd R L N x ^ n) y : M) = (toEnd R L M x ^ n) y

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(N : LieSubmodule R L M)
(x : L)
(y : ↥N)
(n : ℕ)

↑(((LieModule.toEnd R L ↥↑N) x ^ n) y) = ((LieModule.toEnd R L M) x ^ n) ↑y


theorem image_source_inter_eq (s : Set α) :
    e '' (e.source ∩ s) = e.target ∩ e.symm ⁻¹' (e.source ∩ s)

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
(s : Set α)

↑e '' (e.source ∩ s) = e.target ∩ ↑e.symm ⁻¹' (e.source ∩ s)


theorem span_singleton_smul_eq {r : R} (hr : IsUnit r) (x : M) : (R ∙ r • x) = R ∙ x

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

Submodule.span R {r • x} = Submodule.span R {x}


@[to_additive]
lemma sup_mul_right [SemilatticeSup β] [OrderBot β] (s t : Finset α) (f : α → β) :
    sup (s * t) f = sup t fun y ↦ sup s (f <| · * y)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Add α]
[SemilatticeSup β]
[OrderBot β]
(s t : Finset α)
(f : α → β)

(s + t).sup f = t.sup fun y => s.sup fun x => f (x + y)


@[to_additive]
theorem prod_piecewise [DecidableEq α] (s t : Finset α) (f g : α → β) :
    (∏ x ∈ s, (t.piecewise f g) x) = (∏ x ∈ s ∩ t, f x) * ∏ x ∈ s \ t, g x

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
[DecidableEq α]
(s t : Finset α)
(f g : α → β)

∑ x ∈ s, t.piecewise f g x = ∑ x ∈ s ∩ t, f x + ∑ x ∈ s \ t, g x


/-- A `PreGaloisCategory` is a `GaloisCategory` if it admits a fiber functor. -/
class GaloisCategory (C : Type u₁) [Category.{u₂, u₁} C]
    extends PreGaloisCategory C : Prop where
  hasFiberFunctor : ∃ F : C ⥤ FintypeCat.{u₂}, Nonempty (PreGaloisCategory.FiberFunctor F)

[self : CategoryTheory.GaloisCategory C]

∃ F, Nonempty (CategoryTheory.PreGaloisCategory.FiberFunctor F)


@[to_additive (attr := simp)]
theorem iterate_map_zpow {M F : Type*} [Group M] [FunLike F M M] [MonoidHomClass F M M]
    (f : F) (n : ℕ) (x : M) (k : ℤ) :
    f^[n] (x ^ k) = f^[n] x ^ k

{M : Type u_5}
{F : Type u_6}
[AddGroup M]
[FunLike F M M]
[AddMonoidHomClass F M M]
(f : F)
(n : ℕ)
(x : M)
(k : ℤ)


/-- If `N` is in perfect pairing with `M`, then it is reflexive. -/
lemma isReflexive_of_equiv_dual_of_isReflexive : IsReflexive R N

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
[Module.IsReflexive R M]
(e : N ≃ₗ[R] Module.Dual R M)


@[simp] lemma tensorRId_symm_apply (Q₁ : QuadraticForm R M₁) (x : M₁) :
    (tensorRId Q₁).symm x = (TensorProduct.rid R M₁).symm x

{R : Type uR}
{M₁ : Type uM₁}
[CommRing R]
[AddCommGroup M₁]
[Module R M₁]
[Invertible 2]
(Q₁ : QuadraticForm R M₁)
(x : M₁)

Q₁.tensorRId.symm x = (TensorProduct.rid R M₁).symm x


lemma id_lift_eqToHom_codomain {p : 𝒳 ⥤ 𝒮} {R S : 𝒮} (hRS : R = S) {b : 𝒳} (hb : p.obj b = S) :
    p.IsHomLift (eqToHom hRS) (𝟙 b)

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₂} 𝒳]
[CategoryTheory.Category.{v₂, u₁} 𝒮]
{p : 𝒳 ⥤ 𝒮}
{R S : 𝒮}
(hRS : R = S)
{b : 𝒳}
(hb : p.obj b = S)

p.IsHomLift (CategoryTheory.eqToHom hRS) (𝟙 b)


@[simp]
theorem isLittleO_one_left_iff : (fun _x => 1 : α → F) =o[l] f ↔ Tendsto (fun x => ‖f x‖) l atTop

{α : Type u_1}
{E : Type u_3}
(F : Type u_4)
[Norm E]
[Norm F]
{f : α → E}
{l : Filter α}
[One F]
[NormOneClass F]

(fun _x => 1) =o[l] f ↔ Filter.Tendsto (fun x => ‖f x‖) l Filter.atTop


@[simp]
theorem edgeSet_top : (⊤ : SimpleGraph V).edgeSet = {e | ¬e.IsDiag}


lemma ext_s (s s' : S.Splitting) (h : s.s = s'.s) : s = s'

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(s s' : S.Splitting)
(h : s.s = s'.s)


@[to_additive] lemma IsMulFreimanHom.div {β : Type*} [DivisionCommMonoid β] {B₁ B₂ : Set β}
    {f₁ f₂ : α → β} (h₁ : IsMulFreimanHom n A B₁ f₁) (h₂ : IsMulFreimanHom n A B₂ f₂) :
    IsMulFreimanHom n A (B₁ / B₂) (f₁ / f₂)

{α : Type u_2}
[CommMonoid α]
{A : Set α}
{n : ℕ}
{β : Type u_5}
[DivisionCommMonoid β]
{B₁ B₂ : Set β}
{f₁ f₂ : α → β}
(h₁ : IsMulFreimanHom n A B₁ f₁)
(h₂ : IsMulFreimanHom n A B₂ f₂)


/-- A functor `F : C ⥤ D` sends binary bicones for `P` and `Q`
to binary bicones for `G.obj P` and `G.obj Q` functorially. -/
@[simps]
def functoriality : BinaryBicone P Q ⥤ BinaryBicone (F.obj P) (F.obj Q)

(A : CategoryTheory.Limits.BinaryBicone P Q)

((CategoryTheory.Limits.BinaryBicones.functoriality P Q F).obj A).fst = F.map A.fst