/-- The logarithmic derivative of a finite product is the sum of the logarithmic derivatives. -/
theorem logDeriv_prod {ι : Type*} (s : Finset ι) (f : ι → 𝕜 → 𝕜') (x : 𝕜) (hf : ∀ i ∈ s, f i x ≠ 0)
    (hd : ∀ i ∈ s, DifferentiableAt 𝕜 (f i) x) :
    logDeriv (∏ i ∈ s, f i ·) x = ∑ i ∈ s, logDeriv (f i) x

(f : ι → 𝕜 → 𝕜')

logDeriv (fun x => ∏ i ∈ s, f i x) x = ∑ i ∈ s, logDeriv (f i) x


@[simp]
lemma natCast_mul_right (h : SemiconjBy a x y) (n : ℕ) : SemiconjBy a (n * x) (n * y)

{α : Type u_1}
[Semiring α]
{a x y : α}
(h : SemiconjBy a x y)
(n : ℕ)


@[to_additive add_le_of_nonpos_right]
theorem mul_le_of_le_one_right' [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} (h : b ≤ 1) :
    a * b ≤ a

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


theorem coe_nonempty (s : NonemptyInterval α) : (s : Set α).Nonempty

{α : Type u_1}
[Preorder α]
(s : NonemptyInterval α)


/-- This is the homology data for a short complex `S` that is obtained
from a left homology data `h₁` and a right homology data `h₂` when the comparison
morphism `leftRightHomologyComparison' h₁ h₂ : h₁.H ⟶ h₂.H` is an isomorphism. -/
@[simps]
noncomputable def ofIsIsoLeftRightHomologyComparison'
    (h₁ : S.LeftHomologyData) (h₂ : S.RightHomologyData)
    [IsIso (leftRightHomologyComparison' h₁ h₂)] :
    S.HomologyData

[CategoryTheory.IsIso (CategoryTheory.ShortComplex.leftRightHomologyComparison' h₁ h₂)]

(CategoryTheory.ShortComplex.HomologyData.ofIsIsoLeftRightHomologyComparison' h₁ h₂).left = h₁


theorem Nonempty.image (f : α → β) {s : Set α} : s.Nonempty → (f '' s).Nonempty

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


theorem lie_le_iff : ⁅I, N⁆ ≤ N' ↔ ∀ x ∈ I, ∀ m ∈ N, ⁅x, m⁆ ∈ N'

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


theorem convexHull_subset_affineSpan (s : Set E) : convexHull 𝕜 s ⊆ (affineSpan 𝕜 s : Set E)

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


/-- `OrderDual` as a functor. -/
@[simps]
def dual : FinBoolAlg ⥤ FinBoolAlg

(a : BoundedLatticeHom ↑X.toBoolAlg.toBddDistLat.toBddLat.toLat ↑Y.toBoolAlg.toBddDistLat.toBddLat.toLat)

FinBoolAlg.dual.map a = BoundedLatticeHom.dual a


/-- The functor `N` for the equivalence is obtained by composing
`N' : SimplicialObject C ⥤ Karoubi (ChainComplex C ℕ)` and the inverse
of the equivalence `ChainComplex C ℕ ≌ Karoubi (ChainComplex C ℕ)`. -/
@[simps!, nolint unusedArguments]
def N [IsIdempotentComplete C] [HasFiniteCoproducts C] : SimplicialObject C ⥤ ChainComplex C ℕ

∀ {X Y : CategoryTheory.SimplicialObject C} (f : X ⟶ Y),
  CategoryTheory.Idempotents.DoldKan.N.map f =
    (CategoryTheory.Idempotents.toKaroubiEquivalence (ChainComplex C ℕ)).inverse.map
      (AlgebraicTopology.DoldKan.N₁.map f)


theorem ball_eq_empty_iff : ball x ε = ∅ ↔ ε = 0

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


/-- A coalgebra over a commutative (semi)ring `R` is an `R`-module equipped with a coassociative
comultiplication `Δ` and a counit `ε` obeying the left and right counitality laws. -/
class Coalgebra (R : Type u) (A : Type v)
    [CommSemiring R] [AddCommMonoid A] [Module R A] extends CoalgebraStruct R A where
  /-- The comultiplication is coassociative -/
  coassoc : TensorProduct.assoc R A A A ∘ₗ comul.rTensor A ∘ₗ comul = comul.lTensor A ∘ₗ comul
  /-- The counit satisfies the left counitality law -/
  rTensor_counit_comp_comul : counit.rTensor A ∘ₗ comul = TensorProduct.mk R _ _ 1
  /-- The counit satisfies the right counitality law -/
  lTensor_counit_comp_comul : counit.lTensor A ∘ₗ comul = (TensorProduct.mk R _ _).flip 1

{R : Type u}
{A : Type v}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[self : Coalgebra R A]

↑(TensorProduct.assoc R A A A) ∘ₗ LinearMap.rTensor A Coalgebra.comul ∘ₗ Coalgebra.comul =
  LinearMap.lTensor A Coalgebra.comul ∘ₗ Coalgebra.comul


theorem independent_of_dfinsupp_sumAddHom_injective' (p : ι → AddSubgroup N)
    (h : Function.Injective (sumAddHom fun i => (p i).subtype)) : Independent p

(h : Function.Injective ⇑(DFinsupp.sumAddHom fun i => (p i).subtype))


/-- The equalizer definition of a sheaf given by `isSheaf'` is equivalent to `isSheaf`. -/
theorem isSheaf_iff_isSheaf' : IsSheaf J P' ↔ IsSheaf' J P'

[CategoryTheory.Category.{max v₁ u₁, u₂} A']

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.Presheaf.IsSheaf J P' ↔ CategoryTheory.Presheaf.IsSheaf' J P'


theorem ChartedSpace.isOpen_iff (s : Set M) :
    IsOpen s ↔ ∀ x : M, IsOpen <| chartAt H x '' ((chartAt H x).source ∩ s)

(H : Type u)
{M : Type u_2}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
(s : Set M)

IsOpen s ↔ ∀ (x : M), IsOpen (↑(chartAt H x) '' ((chartAt H x).source ∩ s))


theorem cos_nonpos_of_pi_div_two_le_of_le {x : ℝ} (hx₁ : π / 2 ≤ x) (hx₂ : x ≤ π + π / 2) :
    cos x ≤ 0

{x : ℝ}
(hx₁ : Real.pi / 2 ≤ x)
(hx₂ : x ≤ Real.pi + Real.pi / 2)


theorem nadd_le_nadd_iff_right : ∀ (a) {b c}, b ♯ a ≤ c ♯ a ↔ b ≤ c

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


theorem decode_isSome (α) [Denumerable α] (n : ℕ) : (decode (α := α) n).isSome


theorem arrow_intersect (f : Y ⟶ X) (S R : Sieve X) (hS : J.Covers S f) (hR : J.Covers R f) :
    J.Covers (S ⊓ R) f


class IncidenceGeometry where
  Point : Type u₁
  Line : Type u₂
  Circle : Type u₃

  between : Point → Point → Point → Prop -- implies colinearity
  onLine : Point → Line → Prop
  onCircle : Point → Circle → Prop
  inCircle : Point → Circle → Prop
  centerCircle : Point → Circle → Prop
  circlesInter : Circle → Circle → Prop

  ne_23_of_between : ∀ {a b c : Point}, between a b c → b ≠ c
  line_unique_of_pts : ∀ {a b : Point}, ∀ {L M : Line},
    a ≠ b → onLine a L → onLine b L → onLine a M → onLine b M → L = M
  onLine_2_of_between : ∀ {a b c : Point}, ∀ {L : Line},
    between a b c → onLine a L → onLine c L → onLine b L
  line_of_pts : ∀ a b, ∃ L, onLine a L ∧ onLine b L
  circle_of_ne : ∀ a b, a ≠ b → ∃ C, centerCircle a C ∧ onCircle b C
  circlesInter_of_onCircle_inCircle :
    ∀ {a b α β}, onCircle b α → onCircle a β → inCircle a α →
    inCircle b β → circlesInter α β
  pts_of_circlesInter : ∀ {α β}, circlesInter α β →
    ∃ a b, a ≠ b ∧ onCircle a α ∧ onCircle a β ∧ onCircle b α ∧ onCircle b β
  inCircle_of_centerCircle : ∀ {a α}, centerCircle a α → inCircle a α

[self : IncidenceGeometry]
{a b : IncidenceGeometry.Point}
{α β : IncidenceGeometry.Circle}

IncidenceGeometry.onCircle b α →
  IncidenceGeometry.onCircle a β →
    IncidenceGeometry.inCircle a α → IncidenceGeometry.inCircle b β → IncidenceGeometry.circlesInter α β


theorem pmap_map (g : γ → α) (x : Option γ) (H) :
    pmap f (x.map g) H = pmap (fun a h ↦ f (g a) h) x fun a h ↦ H _ (mem_map_of_mem _ h)

(H : ∀ (a : α), a ∈ Option.map g x → p a)

Option.pmap f (Option.map g x) H = Option.pmap (fun a h => f (g a) h) x ⋯


@[simp] theorem exists_apply_eq_apply (f : α → β) (a' : α) : ∃ a, f a = f a'

{α : Sort u_2}
{β : Sort u_1}
(f : α → β)
(a' : α)


theorem center_le_centralizer (s) : center R ≤ centralizer s

Subring.center R ≤ Subring.centralizer s


@[to_additive]
lemma mem_stabilizer_set_iff_smul_set_subset {s : Set α} (hs : s.Finite) :
    a ∈ stabilizer G s ↔ a • s ⊆ s

{G : Type u_1}
{α : Type u_3}
[AddGroup G]
[AddAction G α]
{a : G}
{s : Set α}
(hs : s.Finite)

a ∈ AddAction.stabilizer G s ↔ a +ᵥ s ⊆ s


lemma nonsingular_zero [Nontrivial R] : W.Nonsingular ![0, 1, 0]

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)
[Nontrivial R]


theorem ssubset_def : s ⊂ t ↔ s ⊆ t ∧ ¬t ⊆ s

s ⊂ t ↔ s ⊆ t ∧ ¬t ⊆ s


theorem apply_eq_of_dist_lt {x y : ∀ n, E n} {n : ℕ} (h : dist x y < (1 / 2) ^ n) {i : ℕ}
    (hi : i ≤ n) : x i = y i

{E : ℕ → Type u_1}
{x y : (n : ℕ) → E n}
{n : ℕ}
(h : dist x y < (1 / 2) ^ n)
{i : ℕ}
(hi : i ≤ n)


@[to_additive (attr := simp)]
lemma injective_pow_iff_not_isOfFinOrder : Injective (fun n : ℕ ↦ x ^ n) ↔ ¬IsOfFinOrder x

{G : Type u_1}
[LeftCancelMonoid G]
{x : G}

(Function.Injective fun n => x ^ n) ↔ ¬IsOfFinOrder x


theorem top_rpow_def (y : ℝ) : (⊤ : ℝ≥0∞) ^ y = if 0 < y then ⊤ else if y = 0 then 1 else 0

⊤ ^ y = if 0 < y then ⊤ else if y = 0 then 1 else 0


/-- If `K/F` is algebraic, the "generated by roots" condition in IsNormalClosure can be replaced
  by "generated by images of embeddings". -/
lemma isNormalClosure_iff : IsNormalClosure F K L ↔
    (∀ x : K, (minpoly F x).Splits (algebraMap F L)) ∧ normalClosure F K L = ⊤

{F : Type u_1}
{K : Type u_2}
{L : Type u_3}
[Field F]
[Field K]
[Field L]
[Algebra F K]
[Algebra F L]
[Algebra.IsAlgebraic F K]

IsNormalClosure F K L ↔ (∀ (x : K), Polynomial.Splits (algebraMap F L) (minpoly F x)) ∧ normalClosure F K L = ⊤


theorem _root_.BoundedVariationOn.mono {f : α → E} {s : Set α} (h : BoundedVariationOn f s)
    {t : Set α} (ht : t ⊆ s) : BoundedVariationOn f t

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{f : α → E}
{s : Set α}
(h : BoundedVariationOn f s)
{t : Set α}
(ht : t ⊆ s)


lemma smul_le_of_le_one_left [SMulPosMono α β] (hb : 0 ≤ b) (h : a ≤ 1) : a • b ≤ b

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Monoid α]
[Zero β]
[MulAction α β]
[Preorder α]
[Preorder β]
[SMulPosMono α β]
(hb : 0 ≤ b)
(h : a ≤ 1)


theorem OrdConnected.uIcc_subset (hs : OrdConnected s) ⦃x⦄ (hx : x ∈ s) ⦃y⦄ (hy : y ∈ s) :
    [[x, y]] ⊆ s

{α : Type u_1}
[LinearOrder α]
{s : Set α}
(hs : s.OrdConnected)
⦃x : α⦄
(hx : x ∈ s)
⦃y : α⦄
(hy : y ∈ s)


theorem birthday_add_one : (a + 1).birthday = Order.succ a.birthday


/-- Deprecated. Use `map_continuous` instead. -/
protected theorem continuous (f : C(α, β)) : Continuous f

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(f : C(α, β))


theorem naturality_pf (η : ApplicativeTransformation F G) (f : α → F β) :
    traverse (@η _ ∘ f) = @η _ ∘ (traverse f : t α → F (t β))

{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
{F G : Type u → Type u}
[Applicative F]
[LawfulApplicative F]
[Applicative G]
[LawfulApplicative G]
{α β : Type u}
(η : ApplicativeTransformation F G)
(f : α → F β)

traverse ((fun {α} => η.app α) ∘ f) = (fun {α} => η.app α) ∘ traverse f


lemma of_isIso [IsIso τ] [NatTrans.CommShift τ A] :
    NatTrans.CommShift (inv τ) A

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_7, u_1} C]
[CategoryTheory.Category.{u_6, u_2} D]
{F₁ F₂ : CategoryTheory.Functor C D}
(τ : F₁ ⟶ F₂)
(A : Type u_5)
[AddMonoid A]
[CategoryTheory.HasShift C A]
[CategoryTheory.HasShift D A]
[F₁.CommShift A]
[F₂.CommShift A]
[CategoryTheory.IsIso τ]
[CategoryTheory.NatTrans.CommShift τ A]

CategoryTheory.NatTrans.CommShift (CategoryTheory.inv τ) A


/-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function
`∑' n : ℤ, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/
theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, ℂ)}
    (hf : ∀ K : Compacts ℝ, Summable fun n : ℤ => ‖(f.comp (ContinuousMap.addRight n)).restrict K‖)
    (m : ℤ) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m

(hf :
  ∀ (K : TopologicalSpace.Compacts ℝ),
    Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖)


theorem forall_swap {p : α → β → Prop} : (∀ x y, p x y) ↔ ∀ y x, p x y

{α : Sort u_1}
{β : Sort u_2}
{p : α → β → Prop}

(∀ (x : α) (y : β), p x y) ↔ ∀ (y : β) (x : α), p x y


@[simp]
theorem coeff_zero_C (a : R) : coeff R 0 (C R a) = a

(PowerSeries.coeff R 0) ((PowerSeries.C R) a) = a


/-- The left whiskering of a 2-isomorphism is a 2-isomorphism. -/
@[simps]
def whiskerLeftIso (f : a ⟶ b) {g h : b ⟶ c} (η : g ≅ h) : f ≫ g ≅ f ≫ h

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

(CategoryTheory.Bicategory.whiskerLeftIso f η).inv = CategoryTheory.Bicategory.whiskerLeft f η.inv


/-- If `f : α → E` is a function such that `norm ∘ f` has a local maximum on a set `s` at a point
`c`, then the function `fun x => ‖f x + f c‖` has a local maximum on `s` at `c`. -/
theorem IsLocalMaxOn.norm_add_self (h : IsLocalMaxOn (norm ∘ f) s c) :
    IsLocalMaxOn (fun x => ‖f x + f c‖) s c

{X : Type u_2}
{E : Type u_3}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
[TopologicalSpace X]
{f : X → E}
{s : Set X}
{c : X}
(h : IsLocalMaxOn (norm ∘ f) s c)


/-- Non-dependent version of `Function.update_comp_eq_of_forall_ne'` -/
theorem update_comp_eq_of_forall_ne {α β : Sort*} (g : α' → β) {f : α → α'} {i : α'} (a : β)
    (h : ∀ x, f x ≠ i) : update g i a ∘ f = g ∘ f

{α' : Sort w}
[DecidableEq α']
{α : Sort u_1}
{β : Sort u_2}
(g : α' → β)
{f : α → α'}
{i : α'}
(a : β)
(h : ∀ (x : α), f x ≠ i)


/-- The functor which sends a bicomplex to its associated graded object. -/
@[simps]
def toGradedObjectFunctor : HomologicalComplex₂ C c₁ c₂ ⥤ GradedObject (I₁ × I₂) C

(HomologicalComplex₂.toGradedObjectFunctor C c₁ c₂).obj K = K.toGradedObject


protected theorem IsPrefix.reduceOption {l₁ l₂ : List (Option α)} (h : l₁ <+: l₂) :
    l₁.reduceOption <+: l₂.reduceOption

{α : Type u_1}
{l₁ l₂ : List (Option α)}
(h : l₁ <+: l₂)


theorem add_mul_subset : (s + t) * u ⊆ s * u + t * u

{α : Type u_2}
[DecidableEq α]
[Distrib α]
(s t u : Finset α)


/-- A functor that preserves the pullbacks of `f i j` and `f i k` can map a family of glue data. -/
@[simps]
def mapGlueData : GlueData C'

[H : (i j k : D.J) → CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan (D.f i j) (D.f i k)) F]

(D.mapGlueData F).t i j = F.map (D.t i j)


@[simp]
theorem sub_snd : (x - y).snd = x.snd - y.snd

{p : ℝ≥0∞}
{α : Type u_2}
{β : Type u_3}
[AddCommGroup α]
[AddCommGroup β]
(x y : WithLp p (α × β))


/-- If two differentiable functions on `[a, b]` have the same derivative within `[a, b]` everywhere
  on `[a, b)` and are equal at `a`, then they are equal everywhere on `[a, b]`. -/
theorem eq_of_derivWithin_eq (fdiff : DifferentiableOn ℝ f (Icc a b))
    (gdiff : DifferentiableOn ℝ g (Icc a b))
    (hderiv : EqOn (derivWithin f (Icc a b)) (derivWithin g (Icc a b)) (Ico a b)) (hi : f a = g a) :
    ∀ y ∈ Icc a b, f y = g y

(fdiff : DifferentiableOn ℝ f (Set.Icc a b))

(gdiff : DifferentiableOn ℝ g (Set.Icc a b))

(hderiv : Set.EqOn (derivWithin f (Set.Icc a b)) (derivWithin g (Set.Icc a b)) (Set.Ico a b))


/-- Composing two multiplications on the left by `y` then `x`
is equal to a multiplication on the left by `x * y`.
-/
@[to_additive (attr := simp) "Composing two additions on the left by `y` then `x`
is equal to an addition on the left by `x + y`."]
theorem comp_mul_left (x y : α) : (x * ·) ∘ (y * ·) = (x * y * ·)

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


@[to_additive (attr := simp)]
theorem inv_div : (a / b)⁻¹ = b / a

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


/-- A `PEquiv` is a partial equivalence, a representation of a bijection between a subset
  of `α` and a subset of `β`. See also `PartialEquiv` for a version that requires `toFun` and
`invFun` to be globally defined functions and has `source` and `target` sets as extra fields. -/
structure PEquiv (α : Type u) (β : Type v) where
  /-- The underlying partial function of a `PEquiv` -/
  toFun : α → Option β
  /-- The partial inverse of `toFun` -/
  invFun : β → Option α
  /-- `invFun` is the partial inverse of `toFun`  -/
  inv : ∀ (a : α) (b : β), a ∈ invFun b ↔ b ∈ toFun a

{α : Type u}
{β : Type v}
(self : α ≃. β)
(a : α)
(b : β)


theorem _root_.LieAlgebra.isNilpotent_ad_of_isNilpotent {L : LieSubalgebra R A} {x : L}
    (h : IsNilpotent (x : A)) : IsNilpotent (LieAlgebra.ad R L x)

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
{L : LieSubalgebra R A}
{x : ↥L}
(h : IsNilpotent ↑x)


/-- If the last element of `l` does not satisfy `p`, then it is also the last element of
`l.filter p`. -/
lemma getLast_filter {p : α → Bool} :
    ∀ (l : List α) (hlp : l.filter p ≠ []), p (l.getLast (hlp <| ·.symm ▸ rfl)) = true →
      (l.filter p).getLast hlp = l.getLast (hlp <| ·.symm ▸ rfl)

{α : Type u}
{p : α → Bool}
(l : List α)
(hlp : List.filter p l ≠ [])

p (l.getLast ⋯) = true → (List.filter p l).getLast hlp = l.getLast ⋯


theorem from_union_surjective_of_isColimit {D : Cocone F} (hD : IsColimit D) :
    let ff : (Σj : J, F.obj j) → D.pt := fun a => D.ι.app a.1 a.2
    Function.Surjective ff

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

(hD : CategoryTheory.Limits.IsColimit D)

let ff := fun a => (D.ι.app a.fst) a.snd;
Function.Surjective ff


/-- A homeomorphism induces an order-preserving equivalence on open sets, by taking comaps. -/
@[simps (config := .asFn) apply]
def _root_.Homeomorph.opensCongr (f : α ≃ₜ β) : Opens α ≃o Opens β

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
(f : α ≃ₜ β)

⇑f.opensCongr = ⇑(TopologicalSpace.Opens.comap f.symm.toContinuousMap)


theorem existsUnique_from_graph {g : Submodule R (E × F)}
    (hg : ∀ {x : E × F} (_hx : x ∈ g) (_hx' : x.fst = 0), x.snd = 0) {a : E}
    (ha : a ∈ g.map (LinearMap.fst R E F)) : ∃! b : F, (a, b) ∈ g

(ha : a ∈ Submodule.map (LinearMap.fst R E F) g)


theorem finite_range_findGreatest {P : α → ℕ → Prop} [∀ x, DecidablePred (P x)] {b : ℕ} :
    (range fun x => Nat.findGreatest (P x) b).Finite

{α : Type u}
{P : α → ℕ → Prop}
[(x : α) → DecidablePred (P x)]
{b : ℕ}

(Set.range fun x => Nat.findGreatest (P x) b).Finite


@[to_additive (attr := simp)]
theorem pow_iterate (n : ℕ) (j : ℕ) : (fun x : G => x ^ n)^[j] = fun x : G => x ^ n ^ j

(fun x => x ^ n)^[j] = fun x => x ^ n ^ j


theorem size_eq (data : Buckets α β) :
  size data = .sum (data.1.data.map (·.toList.length))

(data : Batteries.HashMap.Imp.Buckets α β)

data.size = Nat.sum (List.map (fun x => x.toList.length) data.val.data)


/-- The equivalence of categories `(C ⥤ Karoubi D) ≌ (Karoubi C ⥤ Karoubi D)`. -/
@[simps]
def karoubiUniversal₁ : C ⥤ Karoubi D ≌ Karoubi C ⥤ Karoubi D

(C : Type u_1)
(D : Type u_2)
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]

(CategoryTheory.Idempotents.karoubiUniversal₁ C D).inverse =
  (CategoryTheory.whiskeringLeft C (CategoryTheory.Idempotents.Karoubi C) (CategoryTheory.Idempotents.Karoubi D)).obj
    (CategoryTheory.Idempotents.toKaroubi C)


theorem coe_sSup_of_directedOn {S : Set (Subsemiring R)} (Sne : S.Nonempty)
    (hS : DirectedOn (· ≤ ·) S) : (↑(sSup S) : Set R) = ⋃ s ∈ S, ↑s

(hS : DirectedOn (fun x x_1 => x ≤ x_1) S)


/-- An analytic function is infinitely differentiable. -/
theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn 𝕜 f s) {n : ℕ∞} :
    ContDiffOn 𝕜 n f s

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


/-- The torsion ideal of `x`, containing all `a` such that `a • x = 0`. -/
@[simps!]
def torsionOf (x : M) : Ideal R

(R : Type u_1)
(M : Type u_2)
[Semiring R]
[AddCommMonoid M]
[Module R M]
(x : M)

↑(Ideal.torsionOf R M x) = ⇑(LinearMap.toSpanSingleton R M x) ⁻¹' {0}


theorem hasStrictDerivAt_of_bilinear (hu : HasStrictDerivAt u u' x) (hv : HasStrictDerivAt v v' x) :
    HasStrictDerivAt (fun x ↦ B (u x) (v x)) (B (u x) v' + B u' (v x)) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{G : Type u_1}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : 𝕜}
{B : E →L[𝕜] F →L[𝕜] G}
{u : 𝕜 → E}
{v : 𝕜 → F}
{u' : E}
{v' : F}
(hu : HasStrictDerivAt u u' x)
(hv : HasStrictDerivAt v v' x)

HasStrictDerivAt (fun x => (B (u x)) (v x)) ((B (u x)) v' + (B u') (v x)) x


/-- If a function `f` is strictly monotone on a neighborhood of `a` and the image of this
neighborhood under `f` meets every interval `[b, f a)`, `b < f a`, and every interval
`(f a, b]`, `b > f a`, then `f` is continuous at `a`. -/
theorem StrictMonoOn.continuousAt_of_exists_between {f : α → β} {s : Set α} {a : α}
    (h_mono : StrictMonoOn f s) (hs : s ∈ 𝓝 a) (hfs_l : ∀ b < f a, ∃ c ∈ s, f c ∈ Ico b (f a))
    (hfs_r : ∀ b > f a, ∃ c ∈ s, f c ∈ Ioc (f a) b) : ContinuousAt f a

(hfs_l : ∀ b < f a, ∃ c ∈ s, f c ∈ Set.Ico b (f a))

(hfs_r : ∀ b > f a, ∃ c ∈ s, f c ∈ Set.Ioc (f a) b)


@[deprecated Sorted.rel_get_of_le (since := "2024-05-08")]
theorem Sorted.rel_nthLe_of_le [IsRefl α r] {l : List α} (h : l.Sorted r) {a b : ℕ}
    (ha : a < l.length) (hb : b < l.length) (hab : a ≤ b) : r (l.nthLe a ha) (l.nthLe b hb)

{α : Type u}
{r : α → α → Prop}
[IsRefl α r]
{l : List α}
(h : List.Sorted r l)
{a b : ℕ}
(ha : a < l.length)
(hb : b < l.length)
(hab : a ≤ b)


theorem derivationToSquareZeroOfLift_apply (f : A →ₐ[R] B)
    (e : (Ideal.Quotient.mkₐ R I).comp f = IsScalarTower.toAlgHom R A (B ⧸ I)) (x : A) :
    (derivationToSquareZeroOfLift I hI f e x : B) = f x - algebraMap A B x

↑((derivationToSquareZeroOfLift I hI f e) x) = f x - (algebraMap A B) x


theorem toList_formPerm_nil (x : α) : toList (formPerm ([] : List α)) x = []

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


/-- Symmetric statement to `Finset.image_image₂_antidistrib_right`. -/
theorem image_image₂_right_anticomm {f : α → β' → γ} {g : β → β'} {f' : β → α → δ} {g' : δ → γ}
    (h_right_anticomm : ∀ a b, f a (g b) = g' (f' b a)) :
    image₂ f s (t.image g) = (image₂ f' t s).image g'

{f : α → β' → γ}

{f' : β → α → δ}

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

Finset.image₂ f s (Finset.image g t) = Finset.image g' (Finset.image₂ f' t s)


@[reassoc (attr := simp)]
theorem sigmaIsoSigma_hom_ι {ι : Type v} (α : ι → TopCat.{max v u}) (i : ι) :
    Sigma.ι α i ≫ (sigmaIsoSigma α).hom = sigmaι α i

CategoryTheory.Limits.Sigma.ι α i ≫ (TopCat.sigmaIsoSigma α).hom = TopCat.sigmaι α i


/-- Translating a function by left-multiplication does not change its Lebesgue integral
with respect to a left-invariant measure. -/
@[to_additive
      "Translating a function by left-addition does not change its Lebesgue integral with
      respect to a left-invariant measure."]
theorem lintegral_mul_left_eq_self [IsMulLeftInvariant μ] (f : G → ℝ≥0∞) (g : G) :
    (∫⁻ x, f (g * x) ∂μ) = ∫⁻ x, f x ∂μ

{G : Type u_1}
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[AddGroup G]
[MeasurableAdd G]
[μ.IsAddLeftInvariant]
(f : G → ENNReal)
(g : G)

∫⁻ (x : G), f (g + x) ∂μ = ∫⁻ (x : G), f x ∂μ


theorem tendsto_floor_left_pure_ceil_sub_one (x : α) :
    Tendsto (floor : α → ℤ) (𝓝[<] x) (pure (⌈x⌉ - 1))

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]
[TopologicalSpace α]
[OrderClosedTopology α]
(x : α)

Filter.Tendsto Int.floor (𝓝[<] x) (pure (⌈x⌉ - 1))


theorem isSupFiniteCompact_iff_all_elements_compact :
    IsSupFiniteCompact α ↔ ∀ k : α, IsCompactElement k

CompleteLattice.IsSupFiniteCompact α ↔ ∀ (k : α), CompleteLattice.IsCompactElement k


theorem fg_iff_addSubmonoid_fg (P : Submodule ℕ M) : P.FG ↔ P.toAddSubmonoid.FG

{M : Type u_2}
[AddCommMonoid M]
(P : Submodule ℕ M)


theorem one_le_inv (h₁ : 0 < a) (h₂ : a ≤ 1) : 1 ≤ a⁻¹

{α : Type u_2}
[LinearOrderedSemifield α]
{a : α}
(h₁ : 0 < a)
(h₂ : a ≤ 1)


theorem natDegree_sub_le_iff_left (qn : q.natDegree ≤ n) :
    (p - q).natDegree ≤ n ↔ p.natDegree ≤ n

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


theorem freeGroupoidFunctor_comp (φ : V ⥤q V') (φ' : V' ⥤q V'') :
    freeGroupoidFunctor (φ ⋙q φ') = freeGroupoidFunctor φ ⋙ freeGroupoidFunctor φ'

{V : Type u}
[Quiver V]
{V' : Type u'}
[Quiver V']
{V'' : Type u''}
[Quiver V'']
(φ : V ⥤q V')
(φ' : V' ⥤q V'')

CategoryTheory.freeGroupoidFunctor (φ ⋙q φ') =
  (CategoryTheory.freeGroupoidFunctor φ).comp (CategoryTheory.freeGroupoidFunctor φ')


theorem IsEulerian.mem_edges_iff {u v : V} {p : G.Walk u v} (h : p.IsEulerian) {e : Sym2 V} :
    e ∈ p.edges ↔ e ∈ G.edgeSet

{V : Type u_1}
{G : SimpleGraph V}
[DecidableEq V]
{u v : V}
{p : G.Walk u v}
(h : p.IsEulerian)
{e : Sym2 V}


@[simp]
theorem asIdeal_lt_asIdeal (x y : PrimeSpectrum R) : x.asIdeal < y.asIdeal ↔ x < y

{R : Type u}
[CommSemiring R]
(x y : PrimeSpectrum R)


theorem exists_covBy_le_of_lt [IsStronglyAtomic α] (h : a < b) : ∃ x, a ⋖ x ∧ x ≤ b

{α : Type u_4}
{a b : α}
[Preorder α]
[IsStronglyAtomic α]
(h : a < b)


/-- The real inner product as a bilinear form.

Note that unlike `sesqFormOfInner`, this does not reverse the order of the arguments. -/
@[simps!]
def bilinFormOfRealInner : BilinForm ℝ F

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(m : F)

∀ (m_1 : F), (bilinFormOfRealInner m) m_1 = ⟪m, m_1⟫_ℝ


theorem FinitaryPreExtensive.isUniversal_finiteCoproducts_Fin [FinitaryPreExtensive C] {n : ℕ}
    {F : Discrete (Fin n) ⥤ C} {c : Cocone F} (hc : IsColimit c) : IsUniversalColimit c

{F : CategoryTheory.Functor (CategoryTheory.Discrete (Fin n)) C}

(hc : CategoryTheory.Limits.IsColimit c)


theorem iterate_verschiebung_mul_left (x y : 𝕎 R) (i : ℕ) :
    verschiebung^[i] x * y = verschiebung^[i] (x * frobenius^[i] y)

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

(⇑WittVector.verschiebung)^[i] x * y = (⇑WittVector.verschiebung)^[i] (x * (⇑WittVector.frobenius)^[i] y)


@[ext]
theorem ext {f g : ⨁ i, M i} (h : ∀ i, component R ι M i f = component R ι M i g) : f = g

(h : ∀ (i : ι), (DirectSum.component R ι M i) f = (DirectSum.component R ι M i) g)


@[simp, norm_cast]
lemma coe_compAddMonoidHom (φ : AddChar B M) (f : A →+ B) : φ.compAddMonoidHom f = φ ∘ f

{A : Type u_1}
{B : Type u_2}
{M : Type u_3}
[AddMonoid A]
[AddMonoid B]
[Monoid M]
(φ : AddChar B M)
(f : A →+ B)


protected theorem eq' {f g : Lp.simpleFunc E p μ} : (f : α →ₘ[μ] E) = (g : α →ₘ[μ] E) → f = g

{f g : ↥(MeasureTheory.Lp.simpleFunc E p μ)}


@[to_additive]
theorem subgroupOf_bot_eq_bot : H.subgroupOf ⊥ = ⊥

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


theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂

{K : Type u_1}
{Γ : K → Type u_2}
{Λ : Type u_3}
{σ : Type u_4}
{q₁ q₂ : Turing.TM2.Stmt Γ Λ σ}

q₁ ∈ Turing.TM2.stmts₁ q₂ → Turing.TM2.stmts₁ q₁ ⊆ Turing.TM2.stmts₁ q₂


/-- The counit isomorphism of the equivalence
`ShortComplex.functorEquivalence : ShortComplex (J ⥤ C) ≌ J ⥤ ShortComplex C`. -/
@[simps!]
def counitIso : inverse J C ⋙ functor J C ≅ 𝟭 _

(X : CategoryTheory.Functor J (CategoryTheory.ShortComplex C))

∀ (X_1 : J),
  (((CategoryTheory.ShortComplex.FunctorEquivalence.counitIso J C).hom.app X).app X_1).τ₂ =
    CategoryTheory.CategoryStruct.id (X.obj X_1).X₂


@[simp]
theorem neLocus_zero_left : (0 : Π₀ a, N a).neLocus f = f.support

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


lemma Indep.exists_bijOn_of_map {I : Set β} (hf) (hI : (M.map f hf).Indep I) :
    ∃ I₀, M.Indep I₀ ∧ BijOn f I₀ I

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{M : Matroid α}
{I : Set β}
(hf : Set.InjOn f M.E)
(hI : (M.map f hf).Indep I)


@[to_additive (attr := simp)]
theorem mulSingle_mem_pi [DecidableEq η] {I : Set η} {H : ∀ i, Subgroup (f i)} (i : η) (x : f i) :
    Pi.mulSingle i x ∈ pi I H ↔ i ∈ I → x ∈ H i

{η : Type u_7}
{f : η → Type u_8}
[(i : η) → AddGroup (f i)]
[DecidableEq η]
{I : Set η}
{H : (i : η) → AddSubgroup (f i)}
(i : η)
(x : f i)

Pi.single i x ∈ AddSubgroup.pi I H ↔ i ∈ I → x ∈ H i


theorem _root_.Wbtw.wSameSide₁₂ {s : AffineSubspace R P} {x y z : P} (h : Wbtw R x y z)
    (hz : z ∈ s) : s.WSameSide 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 z : P}
(h : Wbtw R x y z)
(hz : z ∈ s)


@[norm_cast]
theorem coe_orderAddMonoidHom_apply (f : α →+*o β) (a : α) : (f : α →+o β) a = f a

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


theorem monovaryOn_const_left (g : ι → β) (a : α) (s : Set ι) : MonovaryOn (const ι a) g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
(g : ι → β)
(a : α)
(s : Set ι)


theorem extChartAt_comp [ChartedSpace H H'] (x : M') :
    (letI := ChartedSpace.comp H H' M'; extChartAt I x) =
      (chartAt H' x).toPartialEquiv ≫ extChartAt I (chartAt H' x x)

{𝕜 : Type u_1}
{E : Type u_2}
{H : Type u_4}
{M' : Type u_6}
{H' : Type u_7}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
[TopologicalSpace H']
[TopologicalSpace M']
[ChartedSpace H' M']
[ChartedSpace H H']
(x : M')

extChartAt I x = (chartAt H' x).toPartialEquiv ≫ extChartAt I (↑(chartAt H' x) x)


lemma isIso_iCycles (hg : S.g = 0) : IsIso S.iCycles


@[simp]
theorem argmax_nil (f : α → β) : argmax f [] = none

{α : Type u_1}
{β : Type u_2}
[Preorder β]
[DecidableRel fun x x_1 => x < x_1]
(f : α → β)


theorem inf_eq_inf_iff_right : a ⊓ c = b ⊓ c ↔ b ⊓ c ≤ a ∧ a ⊓ c ≤ b

{α : Type u}
[SemilatticeInf α]
{a b c : α}


@[to_additive]
theorem apply_abs_le_mul_of_one_le {β : Type*} [MulOneClass β] [Preorder β]
    [CovariantClass β β (· * ·) (· ≤ ·)] [CovariantClass β β (swap (· * ·)) (· ≤ ·)] {f : α → β}
    (h : ∀ x, 1 ≤ f x) (a : α) : f |a| ≤ f a * f (-a)

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

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


/-- The right inverse of matrix A is unique when existing. -/
theorem right_inv_eq_right_inv (h : A * B = 1) (g : A * C = 1) : B = C

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
{A B C : Matrix n n α}
(h : A * B = 1)
(g : A * C = 1)


/-- If `F i → f` in `L1`, then `∫ x in s, F i x ∂μ → ∫ x in s, f x ∂μ`. -/
lemma tendsto_setIntegral_of_L1 {ι} (f : α → G) (hfi : Integrable f μ) {F : ι → α → G}
    {l : Filter ι}
    (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖₊ ∂μ) l (𝓝 0))
    (s : Set α) :
    Tendsto (fun i ↦ ∫ x in s, F i x ∂μ) l (𝓝 (∫ x in s, f x ∂μ))

(hFi : ∀ᶠ (i : ι) in l, MeasureTheory.Integrable (F i) μ)

(hF : Filter.Tendsto (fun i => ∫⁻ (x : α), ↑‖F i x - f x‖₊ ∂μ) l (𝓝 0))

Filter.Tendsto (fun i => ∫ (x : α) in s, F i x ∂μ) l (𝓝 (∫ (x : α) in s, f x ∂μ))


lemma mfderiv_chartAt_eq_tangentCoordChange {x y : M} (hsrc : x ∈ (chartAt H y).source) :
    mfderiv I I (chartAt H y) x = tangentCoordChange I x y x

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

mfderiv I I (↑(chartAt H y)) x = tangentCoordChange I x y x


@[simp] theorem valid_endPos : Valid s (endPos s)


/-- A point is in an `Ioo` iff it can be expressed as a strict convex combination of the endpoints.
-/
theorem Convex.mem_Ioo (h : x < y) :
    z ∈ Ioo 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.Ioo x y ↔ ∃ a b, 0 < a ∧ 0 < b ∧ a + b = 1 ∧ a * x + b * y = z


theorem isIndObject_of_isFiltered_of_finallySmall (A : Cᵒᵖ ⥤ Type v)
    [IsFiltered (CostructuredArrow yoneda A)] [FinallySmall.{v} (CostructuredArrow yoneda A)] :
    IsIndObject A

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

[CategoryTheory.IsFiltered (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)]

[CategoryTheory.FinallySmall (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)]


theorem msb_eq_getLsb_last (x : BitVec w) :
    x.msb = x.getLsb (w - 1)


theorem strictConvex_Ioo (r s : β) : StrictConvex 𝕜 (Ioo r s)

{𝕜 : Type u_1}
{β : Type u_5}
[OrderedSemiring 𝕜]
[TopologicalSpace β]
[LinearOrderedCancelAddCommMonoid β]
[OrderTopology β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
(r s : β)


@[simp]
theorem add_mk_eq_max' {α β : Type u} [Infinite β] : #α + #β = max #α #β


@[to_additive (attr := simp)]
lemma hasProd_singleton (m : β) (f : β → α) : HasProd (({m} : Set β).restrict f) (f m)

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
(m : β)
(f : β → α)


/-- We show that the presheaf of functions to a type `T`
(no continuity assumptions, just plain functions)
form a sheaf.

In fact, the proof is identical when we do this for dependent functions to a type family `T`,
so we do the more general case.
-/
theorem toTypes_isSheaf (T : X → Type u) : (presheafToTypes X T).IsSheaf


theorem terminatedAt_iff_s_terminatedAt : g.TerminatedAt n ↔ g.s.TerminatedAt n

{α : Type u_1}
{g : GenContFract α}
{n : ℕ}


@[simp, norm_cast]
theorem coe_sInf (S : Set (NonUnitalStarSubalgebra R A)) : (↑(sInf S) : Set A) = ⋂ s ∈ S, ↑s

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


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

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

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


theorem bind_continuous' {β γ : Type v} (f : α → Part β) (g : α → β → Part γ) :
    Continuous' f → Continuous' g → Continuous' fun x => f x >>= g x

{α : Type u}
[OmegaCompletePartialOrder α]
{β γ : Type v}
(f : α → Part β)
(g : α → β → Part γ)

OmegaCompletePartialOrder.Continuous' f →
  OmegaCompletePartialOrder.Continuous' g → OmegaCompletePartialOrder.Continuous' fun x => f x >>= g x


lemma iIndepSets.meas_biInter (h : iIndepSets π μ) (s : Finset ι) {f : ι → Set Ω}
    (hf : ∀ i, i ∈ s → f i ∈ π i) : μ (⋂ i ∈ s, f i) = ∏ i ∈ s, μ (f i)

{Ω : Type u_1}
{ι : Type u_2}
{π : ι → Set (Set Ω)}

∀ {x : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω},
  ProbabilityTheory.iIndepSets π μ →
    ∀ (s : Finset ι) {f : ι → Set Ω}, (∀ i ∈ s, f i ∈ π i) → μ (⋂ i ∈ s, f i) = ∏ i ∈ s, μ (f i)


theorem bijective_id : Bijective (@id α)


@[simp, norm_cast]
theorem specializes_coe {x y : X} : (x : OnePoint X) ⤳ y ↔ x ⤳ y

{X : Type u_1}
[TopologicalSpace X]
{x y : X}

↑x ⤳ ↑y ↔ x ⤳ y


theorem list_tail : Primrec (@List.tail α)


lemma isIso_ranAdjunction_unit_app_iff (G : D ⥤ H) :
    IsIso ((L.ranAdjunction H).unit.app G) ↔ G.IsRightKanExtension (𝟙 (L ⋙ G))

[∀ (F : CategoryTheory.Functor C H), L.HasRightKanExtension F]

CategoryTheory.IsIso ((L.ranAdjunction H).unit.app G) ↔
  G.IsRightKanExtension (CategoryTheory.CategoryStruct.id (L.comp G))


theorem Associates.mk_normalize (x : α) : Associates.mk (normalize x) = Associates.mk x

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
(x : α)


theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic


/-- A quiver `HasInvolutiveReverse` if reversing twice is the identity. -/
class HasInvolutiveReverse extends HasReverse V where
  /-- `reverse` is involutive -/
  inv' : ∀ {a b : V} (f : a ⟶ b), reverse (reverse f) = f

{V : Type u_2}
[Quiver V]
[self : Quiver.HasInvolutiveReverse V]
{a b : V}
(f : a ⟶ b)


theorem or_iff_not_imp_left  : a ∨ b ↔ (¬a → b)

a ∨ b ↔ ¬a → b


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

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

ContDiffAt ℝ n (fun x => ⟪f x, g x⟫_𝕜) x


theorem Image.lift_fac (F' : MonoFactorisation f) : Image.lift F' ≫ F'.m = Image.ι f

(F' : CategoryTheory.Limits.MonoFactorisation f)

CategoryTheory.Limits.Types.Image.lift F' ≫ F'.m = CategoryTheory.Limits.Types.Image.ι f


theorem single_pow [AddMonoid G] {a : G} {b : k} : ∀ n : ℕ, single a b ^ n = single (n • a) (b ^ n)

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[AddMonoid G]
{a : G}
{b : k}
(n : ℕ)

AddMonoidAlgebra.single a b ^ n = AddMonoidAlgebra.single (n • a) (b ^ n)


/-- The cosine of the angle between two vectors, multiplied by the
product of their norms. -/
theorem cos_angle_mul_norm_mul_norm (x y : V) : Real.cos (angle x y) * (‖x‖ * ‖y‖) = ⟪x, y⟫

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
(x y : V)

Real.cos (InnerProductGeometry.angle x y) * (‖x‖ * ‖y‖) = ⟪x, y⟫_ℝ


lemma predAbove_last_apply {i : Fin (n + 2)} :
    predAbove (last n) i = if hi : i = last _ then last _ else i.castPred hi

(Fin.last n).predAbove i = if hi : i = Fin.last (n + 1) then Fin.last n else i.castPred hi


@[simp]
theorem sigmaFinsuppEquivDFinsupp_apply [Zero N] (f : (Σi, η i) →₀ N) :
    (sigmaFinsuppEquivDFinsupp f : ∀ i, η i →₀ N) = Finsupp.split f

{ι : Type u_1}
{η : ι → Type u_4}
{N : Type u_5}
[Zero N]
(f : (i : ι) × η i →₀ N)

⇑(sigmaFinsuppEquivDFinsupp f) = f.split


/-- If `s` is a convex set, then `a • closure s + b • interior s ⊆ interior s` for all `0 ≤ a`,
`0 < b`, `a + b = 1`. See also `Convex.combo_self_interior_subset_interior` for a weaker version. -/
theorem Convex.combo_closure_interior_subset_interior {s : Set E} (hs : Convex 𝕜 s) {a b : 𝕜}
    (ha : 0 ≤ a) (hb : 0 < b) (hab : a + b = 1) : a • closure s + b • interior s ⊆ interior s

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
{a b : 𝕜}
(ha : 0 ≤ a)
(hb : 0 < b)
(hab : a + b = 1)


@[to_additive]
theorem mul_eq_one_iff' [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α} (ha : 1 ≤ a) (hb : 1 ≤ b) :
    a * b = 1 ↔ a = 1 ∧ b = 1

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

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


@[to_additive two_zsmul] lemma zpow_two (a : G) : a ^ (2 : ℤ) = a * a


@[simp]
lemma singularPart_self (μ : Measure α) : μ.singularPart μ = 0

{α : Type u_1}
{m : MeasurableSpace α}
(μ : MeasureTheory.Measure α)


theorem cons_diff_of_not_mem {a : α} {l₂ : List α} (h : a ∉ l₂) (l₁ : List α) :
    (a :: l₁).diff l₂ = a :: l₁.diff l₂

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a : α}
{l₂ : List α}
(h : ¬a ∈ l₂)
(l₁ : List α)


/-- **Divergence theorem** for functions on the plane along rectangles. It is formulated in terms of
two functions `f g : ℝ × ℝ → E` and an integral over `Icc a b = [a.1, b.1] × [a.2, b.2]`, where
`a b : ℝ × ℝ`, `a ≤ b`. When thinking of `f` and `g` as the two coordinates of a single function
`F : ℝ × ℝ → E × E` and when `E = ℝ`, this is the usual statement that the integral of the
divergence of `F` inside the rectangle equals the integral of the normal derivative of `F` along the
boundary.

See also `MeasureTheory.integral2_divergence_prod_of_hasFDerivWithinAt_off_countable` for a
version that does not assume `a ≤ b` and uses iterated interval integral instead of the integral
over `Icc a b`. -/
theorem integral_divergence_prod_Icc_of_hasFDerivWithinAt_off_countable_of_le (f g : ℝ × ℝ → E)
    (f' g' : ℝ × ℝ → ℝ × ℝ →L[ℝ] E) (a b : ℝ × ℝ) (hle : a ≤ b) (s : Set (ℝ × ℝ)) (hs : s.Countable)
    (Hcf : ContinuousOn f (Icc a b)) (Hcg : ContinuousOn g (Icc a b))
    (Hdf : ∀ x ∈ Ioo a.1 b.1 ×ˢ Ioo a.2 b.2 \ s, HasFDerivAt f (f' x) x)
    (Hdg : ∀ x ∈ Ioo a.1 b.1 ×ˢ Ioo a.2 b.2 \ s, HasFDerivAt g (g' x) x)
    (Hi : IntegrableOn (fun x => f' x (1, 0) + g' x (0, 1)) (Icc a b)) :
    (∫ x in Icc a b, f' x (1, 0) + g' x (0, 1)) =
      (((∫ x in a.1..b.1, g (x, b.2)) - ∫ x in a.1..b.1, g (x, a.2)) +
          ∫ y in a.2..b.2, f (b.1, y)) -
        ∫ y in a.2..b.2, f (a.1, y)

(Hdf : ∀ x ∈ Set.Ioo a.1 b.1 ×ˢ Set.Ioo a.2 b.2 \ s, HasFDerivAt f (f' x) x)

(Hdg : ∀ x ∈ Set.Ioo a.1 b.1 ×ˢ Set.Ioo a.2 b.2 \ s, HasFDerivAt g (g' x) x)

(Hi : MeasureTheory.IntegrableOn (fun x => (f' x) (1, 0) + (g' x) (0, 1)) (Set.Icc a b) MeasureTheory.volume)


theorem tendsto_iff_forall_toWeakDualBCNN_tendsto {γ : Type*} {F : Filter γ}
    {μs : γ → FiniteMeasure Ω} {μ : FiniteMeasure Ω} :
    Tendsto μs F (𝓝 μ) ↔
      ∀ f : Ω →ᵇ ℝ≥0, Tendsto (fun i => (μs i).toWeakDualBCNN f) F (𝓝 (μ.toWeakDualBCNN f))

{μs : γ → MeasureTheory.FiniteMeasure Ω}

Filter.Tendsto μs F (𝓝 μ) ↔
  ∀ (f : Ω →ᵇ ℝ≥0), Filter.Tendsto (fun i => (μs i).toWeakDualBCNN f) F (𝓝 (μ.toWeakDualBCNN f))


@[simp]
theorem mk_smul (r : S) (x : M) : (mk (r • x) : M ⧸ p) = r • mk x

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)
{S : Type u_3}
[SMul S R]
[SMul S M]
[IsScalarTower S R M]
(r : S)
(x : M)

Submodule.Quotient.mk (r • x) = r • Submodule.Quotient.mk x


theorem mkContinuousMultilinear_norm_le' (f : MultilinearMap 𝕜 E (MultilinearMap 𝕜 E' G)) (C : ℝ)
    (H : ∀ m₁ m₂, ‖f m₁ m₂‖ ≤ (C * ∏ i, ‖m₁ i‖) * ∏ i, ‖m₂ i‖) :
    ‖mkContinuousMultilinear f C H‖ ≤ max C 0

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

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

(H : ∀ (m₁ : (i : ι) → E i) (m₂ : (i : ι') → E' i), ‖(f m₁) m₂‖ ≤ (C * ∏ i : ι, ‖m₁ i‖) * ∏ i : ι', ‖m₂ i‖)

‖f.mkContinuousMultilinear C H‖ ≤ max C 0


@[to_additive]
theorem div_subset_iff : s / t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, x / y ∈ u


/-- See also `Ideal.mem_quotient_iff_mem_sup` if the assumption `I ≤ J` is not available. -/
theorem mem_quotient_iff_mem {I J : Ideal R} (hIJ : I ≤ J) {x : R} :
    Quotient.mk I x ∈ J.map (Quotient.mk I) ↔ x ∈ J

{R : Type u}
[CommRing R]
{I J : Ideal R}
(hIJ : I ≤ J)
{x : R}

(Ideal.Quotient.mk I) x ∈ Ideal.map (Ideal.Quotient.mk I) J ↔ x ∈ J


theorem nontrivial_of_ne (x y : α) (h : x ≠ y) : Nontrivial α


lemma bijective_pi_of_isIdempotentElem (e : I → R)
    (he : ∀ i, IsIdempotentElem (e i))
    (he₁ : ∀ i j, i ≠ j → (1 - e i) * (1 - e j) = 0) (he₂ : ∏ i, e i = 0) :
    Function.Bijective (Pi.ringHom fun i ↦ Ideal.Quotient.mk (Ideal.span {e i}))

(he : ∀ (i : I), IsIdempotentElem (e i))

Function.Bijective ⇑(Pi.ringHom fun i => Ideal.Quotient.mk (Ideal.span {e i}))


theorem mem_map (f : α → β) {o : Part α} : ∀ {a}, a ∈ o → f a ∈ map f o

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


theorem map_iInf_le {ι β} (f : α → β) (m : ι → OuterMeasure α) :
    map f (⨅ i, m i) ≤ ⨅ i, map f (m i)

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

(MeasureTheory.OuterMeasure.map f) (⨅ i, m i) ≤ ⨅ i, (MeasureTheory.OuterMeasure.map f) (m i)


theorem add_tsub_add_eq_tsub_left (a b c : α) : a + b - (a + c) = b - c

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

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


/-- Functor translating a functor into the category of commutative monoid objects
to a commutative monoid object in the functor category
-/
@[simps!]
def inverse : (C ⥤ CommMon_ D) ⥤ CommMon_ (C ⥤ D)

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

∀ {X Y : C} (f : X ⟶ Y),
  (CategoryTheory.Monoidal.CommMonFunctorCategoryEquivalence.inverse.obj F).X.map f = (F.map f).hom


lemma closedEmbedding_nonUnitalStarAlgHom {a : A} {φ : C(σₙ S a, S)₀ →⋆ₙₐ[S] A}
    (hφ : ClosedEmbedding φ) {f : C(S, R)} (h : QuasispectrumRestricts a f)
    (halg : UniformEmbedding (algebraMap R S)) [h_cpct : CompactSpace (σₙ S a)] :
    ClosedEmbedding (h.nonUnitalStarAlgHom φ)

{φ : ContinuousMapZero (↑(quasispectrum S a)) S →⋆ₙₐ[S] A}

(halg : UniformEmbedding ⇑(algebraMap R S))

[h_cpct : CompactSpace ↑(quasispectrum S a)]

ClosedEmbedding ⇑(QuasispectrumRestricts.nonUnitalStarAlgHom φ h)


@[simp] theorem card_of_isEmpty [IsEmpty α] : Nat.card α = 0


@[simp]
theorem unop_op (S : Subsemiring R) : S.op.unop = S

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


@[simp]
theorem K'.elim_update_aux {a b c d c'} : update (K'.elim a b c d) aux c' = K'.elim a b c' d

{a b c d c' : List Turing.PartrecToTM2.Γ'}

Function.update (Turing.PartrecToTM2.K'.elim a b c d) Turing.PartrecToTM2.K'.aux c' =
  Turing.PartrecToTM2.K'.elim a b c' d


theorem Monic.mul_natDegree_lt_iff (h : Monic p) {q : R[X]} :
    (p * q).natDegree < p.natDegree ↔ p ≠ 1 ∧ q = 0

{R : Type u}
[Semiring R]
{p : R[X]}
(h : p.Monic)
{q : R[X]}


theorem rel_replicate_left {m : Multiset α} {a : α} {r : α → α → Prop} {n : ℕ} :
    (replicate n a).Rel r m ↔ card m = n ∧ ∀ x, x ∈ m → r a x

{α : Type u_1}
{m : Multiset α}
{a : α}
{r : α → α → Prop}
{n : ℕ}

Multiset.Rel r (Multiset.replicate n a) m ↔ Multiset.card m = n ∧ ∀ x ∈ m, r a x


@[measurability]
theorem measurableSet_bliminf {s : ℕ → Set α} {p : ℕ → Prop} (h : ∀ n, p n → MeasurableSet (s n)) :
    MeasurableSet <| Filter.bliminf s Filter.atTop p

(h : ∀ (n : ℕ), p n → MeasurableSet (s n))

MeasurableSet (Filter.bliminf s Filter.atTop p)


theorem transReflReparamAux_mem_I (t : I) : transReflReparamAux t ∈ I


theorem finallySmall (h : IsIndObject A) : FinallySmall.{v} (CostructuredArrow yoneda A)

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

(h : CategoryTheory.Limits.IsIndObject A)

CategoryTheory.FinallySmall (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)


@[simp]
theorem toFinset_univ [Fintype α] [Fintype (Set.univ : Set α)] :
    (Set.univ : Set α).toFinset = Finset.univ

{α : Type u_1}
[Fintype α]
[Fintype ↑Set.univ]


lemma pred_succ_le (a : α) : pred (succ a) ≤ a

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


@[simp] theorem enumFrom_map_fst (n) :
    ∀ (l : List α), map Prod.fst (enumFrom n l) = range' n l.length

List.map Prod.fst (List.enumFrom n l) = List.range' n l.length


theorem eq_zero_of_inner_right (hK : Dense (K : Set E)) (h : ∀ v : K, ⟪(v : E), x⟫ = 0) : x = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
{x : E}
(hK : Dense ↑K)
(h : ∀ (v : ↥K), ⟪↑v, x⟫_𝕜 = 0)


@[simp]
theorem hasSum_unop {f : β → αᵐᵒᵖ} {a : αᵐᵒᵖ} :
    HasSum (fun a ↦ unop (f a)) (unop a) ↔ HasSum f a

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → αᵐᵒᵖ}
{a : αᵐᵒᵖ}

HasSum (fun a => MulOpposite.unop (f a)) (MulOpposite.unop a) ↔ HasSum f a


theorem IsDetector.isSeparator [HasEqualizers C] {G : C} : IsDetector G → IsSeparator G

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Limits.HasEqualizers C]
{G : C}

CategoryTheory.IsDetector G → CategoryTheory.IsSeparator G


/-- If a function `f` locally integrable on an open subset `U` of a finite-dimensional real
  manifold has zero integral when multiplied by any smooth function compactly supported
  in `U`, then `f` vanishes almost everywhere in `U`. -/
nonrec theorem IsOpen.ae_eq_zero_of_integral_smooth_smul_eq_zero' {U : Set M} (hU : IsOpen U)
    (hSig : IsSigmaCompact U) (hf : LocallyIntegrableOn f U μ)
    (h : ∀ g : M → ℝ,
      Smooth I 𝓘(ℝ) g → HasCompactSupport g → tsupport g ⊆ U → ∫ x, g x • f x ∂μ = 0) :
    ∀ᵐ x ∂μ, x ∈ U → f x = 0

(hf : MeasureTheory.LocallyIntegrableOn f U μ)

(h : ∀ (g : M → ℝ), Smooth I 𝓘(ℝ, ℝ) g → HasCompactSupport g → tsupport g ⊆ U → ∫ (x : M), g x • f x ∂μ = 0)


theorem integrable_posConvolution {f : ℝ → E} {g : ℝ → E'} {μ ν : Measure ℝ} [SFinite μ]
    [SFinite ν] [IsAddRightInvariant μ] [NoAtoms ν] (hf : IntegrableOn f (Ioi 0) ν)
    (hg : IntegrableOn g (Ioi 0) μ) (L : E →L[ℝ] E' →L[ℝ] F) :
    Integrable (posConvolution f g L ν) μ

(hf : MeasureTheory.IntegrableOn f (Set.Ioi 0) ν)

(hg : MeasureTheory.IntegrableOn g (Set.Ioi 0) μ)

MeasureTheory.Integrable (MeasureTheory.posConvolution f g L ν) μ


@[simp]
theorem neg_iInf {ι : Sort*} (S : ι → Submodule R M) : (-⨅ i, S i) = ⨅ i, -S i

{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommGroup M]
[Module R M]
{ι : Sort u_4}
(S : ι → Submodule R M)


theorem piComparison_fac :
    have : HasCoproduct X := ⟨⟨c, hc⟩⟩
    piComparison F (fun x ↦ op (X x)) = F.map (opCoproductIsoProduct' hc (productIsProduct _)).inv ≫
    Equalizer.Presieve.Arrows.forkMap F X c.inj

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

(hc : CategoryTheory.Limits.IsColimit c)

let_fun this := ⋯;
(CategoryTheory.Limits.piComparison F fun x => Opposite.op (X x)) =
  CategoryTheory.CategoryStruct.comp
    (F.map
      (CategoryTheory.Limits.opCoproductIsoProduct' hc
          (CategoryTheory.Limits.productIsProduct fun x => Opposite.op (X x))).inv)
    (CategoryTheory.Equalizer.Presieve.Arrows.forkMap F X c.inj)


theorem smul_univ₀' {s : Set α} (hs : s.Nontrivial) : s • (univ : Set β) = univ

{α : Type u_2}
{β : Type u_3}
[GroupWithZero α]
[MulAction α β]
{s : Set α}
(hs : s.Nontrivial)


/-- `ContinuousMultilinearMap.pi` as a `LinearEquiv`. -/
@[simps (config := { simpRhs := true })]
def piLinearEquiv {ι' : Type*} {M' : ι' → Type*} [∀ i, AddCommMonoid (M' i)]
    [∀ i, TopologicalSpace (M' i)] [∀ i, ContinuousAdd (M' i)] [∀ i, Module R' (M' i)]
    [∀ i, Module A (M' i)] [∀ i, SMulCommClass A R' (M' i)] [∀ i, ContinuousConstSMul R' (M' i)] :
    (∀ i, ContinuousMultilinearMap A M₁ (M' i)) ≃ₗ[R'] ContinuousMultilinearMap A M₁ (∀ i, M' i)

[∀ (i : ι'), ContinuousConstSMul R' (M' i)]

∀ (a : (i : ι') → ContinuousMultilinearMap A M₁ (M' i)),
  ContinuousMultilinearMap.piLinearEquiv a = ContinuousMultilinearMap.pi a


/-- The angle between three points is π if and only if the second point is strictly between the
other two. -/
theorem angle_eq_pi_iff_sbtw {p₁ p₂ p₃ : P} : ∠ p₁ p₂ p₃ = π ↔ Sbtw ℝ p₁ p₂ p₃

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}

EuclideanGeometry.angle p₁ p₂ p₃ = π ↔ Sbtw ℝ p₁ p₂ p₃


/-- `LinearMap.BilinForm.toQuadraticMap` as a linear map -/
@[simps!]
def toQuadraticMapLinearMap [Semiring S] [Module S N] [SMulCommClass S R N] [SMulCommClass R S N] :
    (BilinMap R M N) →ₗ[S] QuadraticMap R M N

(S : Type u_1)
(R : Type u_3)
(M : Type u_4)
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
[Semiring S]
[Module S N]
[SMulCommClass S R N]
[SMulCommClass R S N]
(B : LinearMap.BilinMap R M N)
(x : M)

((LinearMap.BilinMap.toQuadraticMapLinearMap S R M) B) x = (B x) x


@[simp]
lemma preNormEDS'_two : preNormEDS' b c d 2 = 1


theorem coeff_root_pow (h : IsAdjoinRootMonic S f) {n} (hn : n < natDegree f) :
    h.coeff (h.root ^ n) = Pi.single n 1

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)
{n : ℕ}
(hn : n < f.natDegree)


/-- The natural isomorphism between a pushout cocone and the corresponding pushout cocone
reconstructed using `PushoutCocone.mk`. -/
@[simps!]
def eta (t : PushoutCocone f g) : t ≅ mk t.inl t.inr t.condition

(t : CategoryTheory.Limits.PushoutCocone f g)


theorem IsExtrFilter.filter_mono (h : IsExtrFilter f l a) (hl : l' ≤ l) : IsExtrFilter f l' a

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{l : Filter α}
{a : α}
{l' : Filter α}
(h : IsExtrFilter f l a)
(hl : l' ≤ l)


/-- The natural map from `characterSpace ℂ (elementalStarAlgebra ℂ x)` to `spectrum ℂ x` given
by evaluating `φ` at `x`. This is essentially just evaluation of the `gelfandTransform` of `x`,
but because we want something in `spectrum ℂ x`, as opposed to
`spectrum ℂ ⟨x, elementalStarAlgebra.self_mem ℂ x⟩` there is slightly more work to do. -/
@[simps]
noncomputable def elementalStarAlgebra.characterSpaceToSpectrum (x : A)
    (φ : characterSpace ℂ (elementalStarAlgebra ℂ x)) : spectrum ℂ x

(φ : ↑(WeakDual.characterSpace ℂ ↥(elementalStarAlgebra ℂ x)))

↑(elementalStarAlgebra.characterSpaceToSpectrum x φ) = φ ⟨x, ⋯⟩


@[to_additive]
theorem mulSupport_mulSingle_one : mulSupport (mulSingle a (1 : B)) = ∅

{A : Type u_1}
{B : Type u_2}
[DecidableEq A]
[Zero B]
{a : A}


/-- **Halmos' theorem: Haar measure is completion regular.** More precisely, any finite measure
set can be approximated from inside by a level set of a continuous function with compact support. -/
@[to_additive innerRegularWRT_preimage_one_hasCompactSupport_measure_ne_top_of_addGroup]
theorem innerRegularWRT_preimage_one_hasCompactSupport_measure_ne_top_of_group :
    InnerRegularWRT μ (fun s ↦ ∃ (f : G → ℝ), Continuous f ∧ HasCompactSupport f ∧ s = f ⁻¹' {1})
    (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞)

μ.InnerRegularWRT (fun s => ∃ f, Continuous f ∧ HasCompactSupport f ∧ s = f ⁻¹' {1}) fun s => MeasurableSet s ∧ μ s ≠ ⊤


theorem tendsto_logGammaSeq (hf_conv : ConvexOn ℝ (Ioi 0) f)
    (hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y) (hx : 0 < x) :
    Tendsto (logGammaSeq x) atTop (𝓝 <| f x - f 1)

(hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + Real.log y)

Filter.Tendsto (Real.BohrMollerup.logGammaSeq x) Filter.atTop (𝓝 (f x - f 1))


theorem HasFDerivAt.cpow (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x)
    (h0 : f x ∈ slitPlane) : HasFDerivAt (fun x => f x ^ g x)
      ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * Complex.log (f x)) • g') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f g : E → ℂ}
{f' g' : E →L[ℂ] ℂ}
{x : E}
(hf : HasFDerivAt f f' x)
(hg : HasFDerivAt g g' x)
(h0 : f x ∈ Complex.slitPlane)


/-- Closed intervals `Set.Icc (x - ε) (x + ε)`, `ε ≠ 0`, form a basis of neighborhoods of an
extended nonnegative real number `x ≠ ∞`. We use `Set.Icc` instead of `Set.Ioo` because this way the
statement works for `x = 0`.
-/
theorem hasBasis_nhds_of_ne_top' (xt : x ≠ ∞) :
    (𝓝 x).HasBasis (· ≠ 0) (fun ε => Icc (x - ε) (x + ε))

(𝓝 x).HasBasis (fun x => x ≠ 0) fun ε => Set.Icc (x - ε) (x + ε)


theorem of_int_mul (m : ℤ) (h : Irrational (m * x)) : Irrational x

{x : ℝ}
(m : ℤ)
(h : Irrational (↑m * x))


@[simp] lemma cast_lt_zero : (q : K) < 0 ↔ q < 0

{q : ℚ}
{K : Type u_5}
[LinearOrderedField K]


@[to_additive (attr := simp)]
protected theorem Commute.map [MulHomClass F M N] (h : Commute x y) (f : F) : Commute (f x) (f y)

{F : Type u_1}
{M : Type u_2}
{N : Type u_3}
[Add M]
[Add N]
{x y : M}
[FunLike F M N]
[AddHomClass F M N]
(h : AddCommute x y)
(f : F)


/-- Etale is stable under composition. -/
theorem comp [Algebra A B] [IsScalarTower R A B] [Etale R A] [Etale A B] : Etale R B

(R : Type u)
[CommRing R]
(A B : Type u)
[CommRing A]
[Algebra R A]
[CommRing B]
[Algebra R B]
[Algebra A B]
[IsScalarTower R A B]
[Algebra.Etale R A]
[Algebra.Etale A B]


/-- A bijective `Semigroup` homomorphism is an isomorphism -/
@[to_additive (attr := simps! apply) "A bijective `AddSemigroup` homomorphism is an isomorphism"]
noncomputable def ofBijective {M N F} [Mul M] [Mul N] [FunLike F M N] [MulHomClass F M N]
    (f : F) (hf : Bijective f) : M ≃* N

{M : Type u_12}
{N : Type u_13}
{F : Type u_14}
[Add M]
[Add N]
[FunLike F M N]
[AddHomClass F M N]
(f : F)
(hf : Function.Bijective ⇑f)
(a : M)


lemma _root_.Even.natCast [AddMonoidWithOne α] {n : ℕ} (hn : Even n) : Even (n : α)

{α : Type u_1}
[AddMonoidWithOne α]
{n : ℕ}
(hn : Even n)


@[simp]
theorem det_vandermonde_add {n : ℕ} (v : Fin n → R) (a : R) :
    (Matrix.vandermonde fun i ↦ v i + a).det = (Matrix.vandermonde v).det

{R : Type u_1}
[CommRing R]
{n : ℕ}
(v : Fin n → R)
(a : R)

(Matrix.vandermonde fun i => v i + a).det = (Matrix.vandermonde v).det


lemma add_pow_dvd_pow_of_pow_eq_zero_left (hp : n + m ≤ p + 1) (h_comm : Commute x y)
    (hy : y ^ n = 0) : (x + y) ^ m ∣ x ^ p

{R : Type u_1}
{x y : R}
{n m p : ℕ}
[Ring R]
(hp : n + m ≤ p + 1)
(h_comm : Commute x y)
(hy : y ^ n = 0)


theorem Perm.sizeOf_eq_sizeOf [SizeOf α] {l₁ l₂ : List α} (h : l₁ ~ l₂) :
    sizeOf l₁ = sizeOf l₂

{α : Type u_1}
[SizeOf α]
{l₁ l₂ : List α}
(h : l₁ ~ l₂)


@[simp]
theorem SpectralRadius.of_subsingleton [Subsingleton A] (a : A) : spectralRadius 𝕜 a = 0

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[Subsingleton A]
(a : A)


theorem expand_comp_bind₁ (p : ℕ) (f : σ → MvPolynomial τ R) :
    (expand p).comp (bind₁ f) = bind₁ fun i ↦ expand p (f i)

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_3}
[CommSemiring R]
(p : ℕ)
(f : σ → MvPolynomial τ R)

(MvPolynomial.expand p).comp (MvPolynomial.bind₁ f) = MvPolynomial.bind₁ fun i => (MvPolynomial.expand p) (f i)


/-- The unit ball of a valued ring is open. -/
theorem integer_isOpen : IsOpen (_i.v.integer : Set R)

(R : Type u)
[Ring R]
{Γ₀ : Type v}
[LinearOrderedCommGroupWithZero Γ₀]
[_i : Valued R Γ₀]


@[to_additive]
theorem inv_mem_inv (ha : a ∈ s) : a⁻¹ ∈ s⁻¹

{α : Type u_2}
[DecidableEq α]
[Neg α]
{s : Finset α}
{a : α}
(ha : a ∈ s)


/-- Elements of finite order are closed under multiplication. -/
@[to_additive "Elements of finite additive order are closed under addition."]
theorem IsOfFinOrder.mul (hx : IsOfFinOrder x) (hy : IsOfFinOrder y) : IsOfFinOrder (x * y)

{G : Type u_1}
[CommMonoid G]
{x y : G}
(hx : IsOfFinOrder x)
(hy : IsOfFinOrder y)


@[to_additive]
theorem map_mk' (M : Subgroup H) [M.Normal] (f : G →* H) (h : N ≤ M.comap f) (x : G) :
    map N M f h (mk' _ x) = ↑(f x)

{G : Type u}
[Group G]
(N : Subgroup G)
[nN : N.Normal]
{H : Type v}
[Group H]
(M : Subgroup H)
[M.Normal]
(f : G →* H)
(h : N ≤ Subgroup.comap f M)
(x : G)

(QuotientGroup.map N M f h) ((QuotientGroup.mk' N) x) = ↑(f x)


/-- The angle between a vector and a positive multiple of a vector. -/
@[simp]
theorem angle_smul_right_of_pos (x y : V) {r : ℝ} (hr : 0 < r) : angle x (r • y) = angle x y

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
(x y : V)
{r : ℝ}
(hr : 0 < r)

InnerProductGeometry.angle x (r • y) = InnerProductGeometry.angle x y


@[simp] theorem all_eq_true {l : List α} : l.all p ↔ ∀ x, x ∈ l →  p x

{α : Type u_1}
{p : α → Bool}
{l : List α}

l.all p = true ↔ ∀ (x : α), x ∈ l → p x = true


theorem map_obj {α : F ⟶ G} (X : Grothendieck F) :
    (Grothendieck.map α).obj X = ⟨X.base, (α.app X.base).obj X.fiber⟩

{F G : CategoryTheory.Functor C CategoryTheory.Cat}

(CategoryTheory.Grothendieck.map α).obj X = { base := X.base, fiber := (α.app X.base).obj X.fiber }


/-- Rotating the first vector by the angle between the two vectors results in an angle of 0. -/
@[simp]
theorem oangle_rotation_oangle_left (x y : V) : o.oangle (o.rotation (o.oangle x y) x) y = 0

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

o.oangle ((o.rotation (o.oangle x y)) x) y = 0


@[fun_prop]
theorem continuousOn_sin {s} : ContinuousOn sin s


@[simp]
theorem join_distrib (X : Compactum) (uux : Ultrafilter (Ultrafilter X)) :
    X.str (X.join uux) = X.str (map X.str uux)

(X : Compactum)
(uux : Ultrafilter (Ultrafilter X.A))

X.str (X.join uux) = X.str (Ultrafilter.map X.str uux)


theorem coe_zero : DFunLike.coe (0 : 𝓢(E, F)) = (0 : E → F)

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]


/-- On a locally ringed space `X`, the preimage of the zero locus of the prime spectrum
of `Γ(X, ⊤)` under `toΓSpecFun` agrees with the associated zero locus on `X`. -/
lemma Scheme.toΓSpec_preimage_zeroLocus_eq {X : Scheme.{u}} (s : Set Γ(X, ⊤)) :
    (ΓSpec.adjunction.unit.app X).val.base ⁻¹' PrimeSpectrum.zeroLocus s = X.zeroLocus s

(s : Set ↑(X.presheaf.obj (Opposite.op ⊤)))

⇑(AlgebraicGeometry.ΓSpec.adjunction.unit.app X).val.base ⁻¹' PrimeSpectrum.zeroLocus s = X.zeroLocus s


theorem dist_pointReflection_self (x y : P) :
    dist (pointReflection 𝕜 x y) y = ‖(2 : 𝕜)‖ * dist x y

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_10}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(x y : P)

dist ((AffineIsometryEquiv.pointReflection 𝕜 x) y) y = ‖2‖ * dist x y


theorem HasDerivAt.comp_hasFDerivAt {f : E → 𝕜'} {f' : E →L[𝕜] 𝕜'} (x)
    (hh : HasDerivAt h₂ h₂' (f x)) (hf : HasFDerivAt f f' x) : HasFDerivAt (h₂ ∘ f) (h₂' • f') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{h₂ : 𝕜' → 𝕜'}
{h₂' : 𝕜'}
{f : E → 𝕜'}
{f' : E →L[𝕜] 𝕜'}
(x : E)
(hh : HasDerivAt h₂ h₂' (f x))
(hf : HasFDerivAt f f' x)


@[simp]
theorem vars_neg : (-p).vars = p.vars

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


lemma isLittleO_self_div_log_id :
    (fun (n : ℕ) => n / log n ^ 2) =o[atTop] (fun (n : ℕ) => (n : ℝ))

(fun n => ↑n / Real.log ↑n ^ 2) =o[Filter.atTop] fun n => ↑n


@[simp] theorem comm_toLinearEquiv :
    (Algebra.TensorProduct.comm R A B).toLinearEquiv = _root_.TensorProduct.comm R A B

(R : Type uR)
(A : Type uA)
(B : Type uB)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]

(Algebra.TensorProduct.comm R A B).toLinearEquiv = TensorProduct.comm R A B


@[simp]
theorem smul_apply [SMul R ℝ] [SMul R ℝ≥0] [IsScalarTower R ℝ≥0 ℝ] (r : R) (p : Seminorm 𝕜 E)
    (x : E) : (r • p) x = r • p x

{R : Type u_1}
{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]
[SMul R ℝ]
[SMul R ℝ≥0]
[IsScalarTower R ℝ≥0 ℝ]
(r : R)
(p : Seminorm 𝕜 E)
(x : E)


@[to_additive (attr := simp)]
theorem noncommCoprod_comp_inl : (f.noncommCoprod g comm).comp (inl M N) = f

(comm : ∀ (m : M) (n : N), Commute (f m) (g n))

(f.noncommCoprod g comm).comp (MonoidHom.inl M N) = f


@[simp]
theorem vsub_nonempty : (s -ᵥ t : Set α).Nonempty ↔ s.Nonempty ∧ t.Nonempty

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

(s -ᵥ t).Nonempty ↔ s.Nonempty ∧ t.Nonempty


@[simp]
theorem principal_bot : principal (⊥ : P) = ⊥

{P : Type u_1}
[Preorder P]
[OrderBot P]


theorem measurableSpace_le_of_le (hτ : IsStoppingTime f τ) {n : ι} (hτ_le : ∀ ω, τ ω ≤ n) :
    hτ.measurableSpace ≤ m

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[Preorder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
(hτ : MeasureTheory.IsStoppingTime f τ)
{n : ι}
(hτ_le : ∀ (ω : Ω), τ ω ≤ n)


theorem card_le_three : card {a, b, c} ≤ 3

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


theorem integrable_inner (f g : α →₂[μ] E) : Integrable (fun x : α => ⟪f x, g x⟫) μ

{α : Type u_1}
{E : Type u_2}
{𝕜 : Type u_4}
[RCLike 𝕜]
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(f g : ↥(MeasureTheory.Lp E 2 μ))

MeasureTheory.Integrable (fun x => ⟪↑↑f x, ↑↑g x⟫_𝕜) μ


theorem hasPushout_of_right_iso : HasPushout f g

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


theorem vadd_lineMap (v : V₁) (p₁ p₂ : P₁) (c : k) :
    v +ᵥ lineMap p₁ p₂ c = lineMap (v +ᵥ p₁) (v +ᵥ p₂) c

{k : Type u_1}
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(v : V₁)
(p₁ p₂ : P₁)
(c : k)

v +ᵥ (AffineMap.lineMap p₁ p₂) c = (AffineMap.lineMap (v +ᵥ p₁) (v +ᵥ p₂)) c


theorem map_mul_map_eq_neg_of_isOrtho_of_mem_evenOdd_one
    (hm₁ : m₁ ∈ evenOdd Q₁ 1) (hm₂ : m₂ ∈ evenOdd Q₂ 1) :
    map f₁ m₁ * map f₂ m₂ = - map f₂ m₂ * map f₁ m₁

(hf : ∀ (x : M₁) (y : M₂), QuadraticMap.IsOrtho Qₙ (f₁ x) (f₂ y))

(hm₁ : m₁ ∈ CliffordAlgebra.evenOdd Q₁ 1)

(hm₂ : m₂ ∈ CliffordAlgebra.evenOdd Q₂ 1)

(CliffordAlgebra.map f₁) m₁ * (CliffordAlgebra.map f₂) m₂ = -(CliffordAlgebra.map f₂) m₂ * (CliffordAlgebra.map f₁) m₁


lemma charpoly_prodMap (f₁ : M₁ →ₗ[R] M₁) (f₂ : M₂ →ₗ[R] M₂) :
    (f₁.prodMap f₂).charpoly = f₁.charpoly * f₂.charpoly

{R : Type u_1}
{M₁ : Type u_3}
{M₂ : Type u_4}
[CommRing R]
[Nontrivial R]
[AddCommGroup M₁]
[Module R M₁]
[Module.Finite R M₁]
[Module.Free R M₁]
[AddCommGroup M₂]
[Module R M₂]
[Module.Finite R M₂]
[Module.Free R M₂]
(f₁ : M₁ →ₗ[R] M₁)
(f₂ : M₂ →ₗ[R] M₂)


/-- If `L` is a finite separable extension of `K = Frac(A)`, where `A` is a principal ring
and `L` has no zero smul divisors by `A`, the integral closure `C` of `A` in `L` is
a free `A`-module. -/
theorem IsIntegralClosure.module_free [NoZeroSMulDivisors A L] [IsPrincipalIdealRing A] :
    Module.Free A C

(A : Type u_2)
(K : Type u_3)
[CommRing A]
[Field K]
[IsDomain A]
[Algebra A K]
[IsFractionRing A K]
(L : Type u_4)
[Field L]
(C : Type u_5)
[CommRing C]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[Algebra C L]
[IsIntegralClosure C A L]
[Algebra A C]
[IsScalarTower A C L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[NoZeroSMulDivisors A L]
[IsPrincipalIdealRing A]


theorem toNNReal_lt_of_lt_coe (h : a < p) : a.toNNReal < p


theorem denumerable_iff {α : Type u} : Nonempty (Denumerable α) ↔ #α = ℵ₀

Nonempty (Denumerable α) ↔ Cardinal.mk α = Cardinal.aleph0


@[to_additive (attr := simp)]
theorem MonoidHom.coe_coe [MonoidHomClass F M N] (f : F) : ((f : M →* N) : M → N) = f

{M : Type u_4}
{N : Type u_5}
{F : Type u_9}
[MulOneClass M]
[MulOneClass N]
[FunLike F M N]
[MonoidHomClass F M N]
(f : F)


@[simp]
theorem one_le_card {o} : 1 ≤ card o ↔ 1 ≤ o


theorem norm_setToFun_le_mul_norm' (hT : DominatedFinMeasAdditive μ T C) (f : α →₁[μ] E) :
    ‖setToFun μ T hT f‖ ≤ max C 0 * ‖f‖

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

‖MeasureTheory.setToFun μ T hT ↑↑f‖ ≤ max C 0 * ‖f‖


@[simp] theorem or_self_right : (a ∨ b) ∨ b ↔ a ∨ b


/-- **L'Hôpital's rule** for approaching a real from the left, `deriv` version -/
theorem lhopital_zero_nhds_left (hdf : ∀ᶠ x in 𝓝[<] a, DifferentiableAt ℝ f x)
    (hg' : ∀ᶠ x in 𝓝[<] a, deriv g x ≠ 0) (hfa : Tendsto f (𝓝[<] a) (𝓝 0))
    (hga : Tendsto g (𝓝[<] a) (𝓝 0))
    (hdiv : Tendsto (fun x => (deriv f) x / (deriv g) x) (𝓝[<] a) l) :
    Tendsto (fun x => f x / g x) (𝓝[<] a) l

(hdf : ∀ᶠ (x : ℝ) in 𝓝[<] a, DifferentiableAt ℝ f x)

(hg' : ∀ᶠ (x : ℝ) in 𝓝[<] a, deriv g x ≠ 0)

(hdiv : Filter.Tendsto (fun x => deriv f x / deriv g x) (𝓝[<] a) l)

Filter.Tendsto (fun x => f x / g x) (𝓝[<] a) l


/-- The identity morphism in `SingleFunctors C D A`. -/
@[simps]
def id : Hom F F

(F : CategoryTheory.SingleFunctors C D A)

(CategoryTheory.SingleFunctors.Hom.id F).hom a = 𝟙 (F.functor a)


/-- **First moment method**. A measurable function is smaller than its integral on a set f
positive measure. -/
theorem measure_le_lintegral_pos (hf : AEMeasurable f μ) : 0 < μ {x | f x ≤ ∫⁻ a, f a ∂μ}

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
[MeasureTheory.IsProbabilityMeasure μ]
(hf : AEMeasurable f μ)


/-- A function from a locally finite preorder is monotone if and only if it is monotone when
restricted to pairs satisfying `a ⩿ b`. -/
lemma monotone_iff_forall_wcovBy [Preorder α] [LocallyFiniteOrder α] [Preorder β]
    (f : α → β) : Monotone f ↔ ∀ a b : α, a ⩿ b → f a ≤ f b

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

Monotone f ↔ ∀ (a b : α), a ⩿ b → f a ≤ f b


@[to_additive]
theorem mclosure_preimage_le (f : F) (s : Set N) : closure (f ⁻¹' s) ≤ (closure s).comap f

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_5}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
(f : F)
(s : Set N)

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


@[measurability]
theorem MeasurableSet.iInter [Countable ι] {f : ι → Set α} (h : ∀ b, MeasurableSet (f b)) :
    MeasurableSet (⋂ b, f b)

{α : Type u_1}
{ι : Sort u_6}
{m : MeasurableSpace α}
[Countable ι]
{f : ι → Set α}
(h : ∀ (b : ι), MeasurableSet (f b))


@[simp] theorem and_imp : (a ∧ b → c) ↔ (a → b → c)


theorem dist_eq_iff_eq_sq_sinh (hr : 0 ≤ r) :
    dist z w = r ↔ dist (z : ℂ) w ^ 2 / (4 * z.im * w.im) = sinh (r / 2) ^ 2

dist z w = r ↔ dist ↑z ↑w ^ 2 / (4 * z.im * w.im) = Real.sinh (r / 2) ^ 2


theorem IsSubordinate.mono [Fintype ι] {π : TaggedPrepartition I} (hr₁ : π.IsSubordinate r₁)
    (h : ∀ x ∈ Box.Icc I, r₁ x ≤ r₂ x) : π.IsSubordinate r₂

(h : ∀ x ∈ BoxIntegral.Box.Icc I, r₁ x ≤ r₂ x)


theorem biprod.desc_eq {T : C} {f : X ⟶ T} {g : Y ⟶ T} :
    biprod.desc f g = biprod.fst ≫ f + biprod.snd ≫ g

CategoryTheory.Limits.biprod.desc f g = CategoryTheory.Limits.biprod.fst ≫ f + CategoryTheory.Limits.biprod.snd ≫ g


theorem le_of_abs_le (h : |a| ≤ b) : a ≤ b

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


theorem one_not_equiv_zero : ¬const abv 1 ≈ const abv 0

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
[IsDomain β]
(abv : β → α)
[IsAbsoluteValue abv]

¬CauSeq.const abv 1 ≈ CauSeq.const abv 0


theorem cast_add_one_ne_zero (n : ℕ) : (n + 1 : R) ≠ 0

{R : Type u_1}
[AddMonoidWithOne R]
[CharZero R]
(n : ℕ)


@[to_additive]
theorem Group.rank_le [h : Group.FG G] {S : Finset G} (hS : Subgroup.closure (S : Set G) = ⊤) :
    Group.rank G ≤ S.card

(G : Type u_3)
[AddGroup G]
[h : AddGroup.FG G]
{S : Finset G}
(hS : AddSubgroup.closure ↑S = ⊤)


@[simp]
theorem dotProduct_sub : u ⬝ᵥ (v - w) = u ⬝ᵥ v - u ⬝ᵥ w

{m : Type u_2}
{α : Type v}
[Fintype m]
[NonUnitalNonAssocRing α]
(u v w : m → α)


@[simp]
theorem Ioi_insert [DecidableEq α] (a : α) : insert a (Ioi a) = Ici a

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrderTop α]
[DecidableEq α]
(a : α)


theorem SameCycle.eq_of_left (h : SameCycle f x y) (hx : IsFixedPt f x) : x = y

{α : Type u_2}
{f : Equiv.Perm α}
{x y : α}
(h : f.SameCycle x y)
(hx : Function.IsFixedPt (⇑f) x)


theorem IsCycle.of_pow {n : ℕ} (h1 : IsCycle (f ^ n)) (h2 : f.support ⊆ (f ^ n).support) :
    IsCycle f

{α : Type u_2}
{f : Equiv.Perm α}
[DecidableEq α]
[Fintype α]
{n : ℕ}
(h1 : (f ^ n).IsCycle)
(h2 : f.support ⊆ (f ^ n).support)


/-- Haar measure of the frontier of a convex set is zero. -/
theorem addHaar_frontier (hs : Convex ℝ s) : μ (frontier s) = 0

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
{s : Set E}
(hs : Convex ℝ s)


@[simp]
theorem equivAddCircle_symm_apply_mk (hp : p ≠ 0) (hq : q ≠ 0) (x : 𝕜) :
    (equivAddCircle p q hp hq).symm (x : 𝕜) = (x * (q⁻¹ * p) : 𝕜)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
(p q : 𝕜)
(hp : p ≠ 0)
(hq : q ≠ 0)
(x : 𝕜)

(AddCircle.equivAddCircle p q hp hq).symm ↑x = ↑(x * (q⁻¹ * p))


/-- If a predicate is true in a neighbourhood of `x`, then for `y` sufficiently close
to `x` this predicate is true in a neighbourhood of `y`. -/
theorem Filter.Eventually.eventually_nhds {p : X → Prop} (h : ∀ᶠ y in 𝓝 x, p y) :
    ∀ᶠ y in 𝓝 x, ∀ᶠ x in 𝓝 y, p x

{X : Type u}
{x : X}
[TopologicalSpace X]
{p : X → Prop}
(h : ∀ᶠ (y : X) in 𝓝 x, p y)

∀ᶠ (y : X) in 𝓝 x, ∀ᶠ (x : X) in 𝓝 y, p x


@[simp]
theorem floor_ofNat (n : ℕ) [n.AtLeastTwo] : ⌊no_index (OfNat.ofNat n : α)⌋₊ = n

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
(n : ℕ)
[n.AtLeastTwo]


theorem limZero_sub_rev {f g : CauSeq β abv} (hfg : LimZero (f - g)) : LimZero (g - f)

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{f g : CauSeq β abv}
(hfg : (f - g).LimZero)


@[norm_cast, simp]
theorem isSquare_natCast_iff {n : ℕ} : IsSquare (n : ℚ) ↔ IsSquare n


protected theorem lt_of_tsub_lt_tsub_left_of_le [ContravariantClass α α (· + ·) (· < ·)]
    (hb : AddLECancellable b) (hca : c ≤ a) (h : a - b < a - c) : c < b

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

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


lemma HasFDerivWithinAt.hasLineDerivWithinAt (hf : HasFDerivWithinAt f L s x) (v : E) :
    HasLineDerivWithinAt 𝕜 f (L v) s x v

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


theorem and_congr_left (h : c → (a ↔ b)) : a ∧ c ↔ b ∧ c


theorem isClosed_iff_bsup :
    IsClosed s ↔
      ∀ {o : Ordinal}, o ≠ 0 → ∀ f : ∀ a < o, Ordinal,
        (∀ i hi, f i hi ∈ s) → bsup.{u, u} o f ∈ s

IsClosed s ↔
  ∀ {o : Ordinal.{u}},
    o ≠ 0 →
      ∀ (f : (a : Ordinal.{u}) → a < o → Ordinal.{u}), (∀ (i : Ordinal.{u}) (hi : i < o), f i hi ∈ s) → o.bsup f ∈ s


@[simp]
theorem evalFrom_comap (f : α' → α) (s : σ) (x : List α') :
    (M.comap f).evalFrom s x = M.evalFrom s (x.map f)

{α : Type u}
{σ : Type v}
(M : DFA α σ)
{α' : Type u_1}
(f : α' → α)
(s : σ)
(x : List α')

(DFA.comap f M).evalFrom s x = M.evalFrom s (List.map f x)


/-- The inner product of two vectors given with `weightedVSub`, in
terms of the pairwise distances. -/
theorem inner_weightedVSub {ι₁ : Type*} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ} (p₁ : ι₁ → P)
    (h₁ : ∑ i ∈ s₁, w₁ i = 0) {ι₂ : Type*} {s₂ : Finset ι₂} {w₂ : ι₂ → ℝ} (p₂ : ι₂ → P)
    (h₂ : ∑ i ∈ s₂, w₂ i = 0) :
    ⟪s₁.weightedVSub p₁ w₁, s₂.weightedVSub p₂ w₂⟫ =
      (-∑ i₁ ∈ s₁, ∑ i₂ ∈ s₂, w₁ i₁ * w₂ i₂ * (dist (p₁ i₁) (p₂ i₂) * dist (p₁ i₁) (p₂ i₂))) /
        2

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{ι₁ : Type u_3}
{s₁ : Finset ι₁}
{w₁ : ι₁ → ℝ}
(p₁ : ι₁ → P)
(h₁ : ∑ i ∈ s₁, w₁ i = 0)
{ι₂ : Type u_4}
{s₂ : Finset ι₂}
{w₂ : ι₂ → ℝ}
(p₂ : ι₂ → P)
(h₂ : ∑ i ∈ s₂, w₂ i = 0)

⟪(s₁.weightedVSub p₁) w₁, (s₂.weightedVSub p₂) w₂⟫_ℝ =
  (-∑ i₁ ∈ s₁, ∑ i₂ ∈ s₂, w₁ i₁ * w₂ i₂ * (dist (p₁ i₁) (p₂ i₂) * dist (p₁ i₁) (p₂ i₂))) / 2


theorem Associates.finprod_ne_zero (I : Ideal R) :
    Associates.mk (∏ᶠ v : HeightOneSpectrum R, v.maxPowDividing I) ≠ 0

{R : Type u_1}
[CommRing R]
[IsDedekindDomain R]
(I : Ideal R)

Associates.mk (∏ᶠ (v : IsDedekindDomain.HeightOneSpectrum R), v.maxPowDividing I) ≠ 0


theorem wbtw_comm {x y z : P} : Wbtw R x y z ↔ Wbtw R z y x

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}


theorem contMDiffWithinAt_proj {s : Set (TotalSpace F E)} {p : TotalSpace F E} :
    ContMDiffWithinAt (IB.prod 𝓘(𝕜, F)) IB n (π F E) s p

[TopologicalSpace (Bundle.TotalSpace F E)]

ContMDiffWithinAt (IB.prod 𝓘(𝕜, F)) IB n Bundle.TotalSpace.proj s p


theorem union_ae_eq_univ_of_ae_eq_univ_right (h : t =ᵐ[μ] univ) : (s ∪ t : Set α) =ᵐ[μ] univ

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{s t : Set α}
(h : t =ᵐ[μ] Set.univ)


@[to_additive]
lemma prod_Iio_mul_eq_prod_Iic (a : α) : (∏ x ∈ Iio a, f x) * f a = ∏ x ∈ Iic a, f x

{α : Type u_1}
{M : Type u_2}
[PartialOrder α]
[AddCommMonoid M]
{f : α → M}
[LocallyFiniteOrderBot α]
(a : α)

∑ x ∈ Finset.Iio a, f x + f a = ∑ x ∈ Finset.Iic a, f x


@[to_additive]
theorem iff_existsUnique (aA : a0 ∈ A) (bB : b0 ∈ B) :
    UniqueMul A B a0 b0 ↔ ∃! ab, ab ∈ A ×ˢ B ∧ ab.1 * ab.2 = a0 * b0

{G : Type u_1}
[Add G]
{A B : Finset G}
{a0 b0 : G}
(aA : a0 ∈ A)
(bB : b0 ∈ B)

UniqueAdd A B a0 b0 ↔ ∃! ab, ab ∈ A ×ˢ B ∧ ab.1 + ab.2 = a0 + b0


lemma hasFiniteLimits_of_hasLimitsOfSize [HasLimitsOfSize.{v', u'} C] :
    HasFiniteLimits C

[CategoryTheory.Limits.HasLimitsOfSize.{v', u', v, u} C]


theorem orderIsoOfFin_symm_apply (s : Finset α) {k : ℕ} (h : s.card = k) (x : s) :
    ↑((s.orderIsoOfFin h).symm x) = (s.sort (· ≤ ·)).indexOf ↑x

{α : Type u_1}
[LinearOrder α]
(s : Finset α)
{k : ℕ}
(h : s.card = k)
(x : { x // x ∈ s })

↑((s.orderIsoOfFin h).symm x) = List.indexOf (↑x) (Finset.sort (fun x x_1 => x ≤ x_1) s)


@[simp]
theorem π_obj (p : ActionCategory M X) : (π M X).obj p = SingleObj.star M

(M : Type u_1)
[Monoid M]
(X : Type u)
[MulAction M X]
(p : CategoryTheory.ActionCategory M X)

(CategoryTheory.ActionCategory.π M X).obj p = CategoryTheory.SingleObj.star M


theorem hasBasis_nhds_zero_of_basis {ι : Type*} {p : ι → Prop} {b : ι → Set F}
    (h : (𝓝 (0 : F)).HasBasis p b) :
    (𝓝 (0 : ContinuousMultilinearMap 𝕜 E F)).HasBasis
      (fun Si : Set (Π i, E i) × ι => IsVonNBounded 𝕜 Si.1 ∧ p Si.2)
      fun Si => { f | MapsTo f Si.1 (b Si.2) }

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

∀ {ι_1 : Type u_5} {p : ι_1 → Prop} {b : ι_1 → Set F},
  (𝓝 0).HasBasis p b →
    (𝓝 0).HasBasis (fun Si => Bornology.IsVonNBounded 𝕜 Si.1 ∧ p Si.2) fun Si => {f | Set.MapsTo (⇑f) Si.1 (b Si.2)}


/-- This lemma says that `Gal(L/K) = L ≃ₐ[K] L` -/
theorem IntermediateField.fixingSubgroup.bot {K L : Type*} [Field K] [Field L] [Algebra K L] :
    IntermediateField.fixingSubgroup (⊥ : IntermediateField K L) = ⊤

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]


protected theorem HasFDerivWithinAt.fderivWithin (h : HasFDerivWithinAt f f' s x)
    (hxs : UniqueDiffWithinAt 𝕜 s x) : fderivWithin 𝕜 f s x = f'

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


/-- The balancing properties of the `balLeft` function. -/
protected theorem Balanced.balLeft (hl : l.RedRed True n) (hr : r.Balanced cr (n + 1)) :
    (balLeft l v r).RedRed (cr = red) (n + 1)

∀ {α : Type u_1} {l : Batteries.RBNode α} {v : α} {r : Batteries.RBNode α} {cr : Batteries.RBColor} {n : Nat},
  Batteries.RBNode.RedRed True l n →
    r.Balanced cr (n + 1) → Batteries.RBNode.RedRed (cr = Batteries.RBColor.red) (l.balLeft v r) (n + 1)


@[gcongr]
theorem diff_subset_diff_right {s t u : Set α} (h : t ⊆ u) : s \ u ⊆ s \ t

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


/-- The `lTensor`-variant of `iff_rTensor_injective`. . -/
theorem iff_lTensor_injective :
    Module.Flat R M ↔ ∀ ⦃I : Ideal R⦄ (_ : I.FG), Function.Injective (lTensor M I.subtype)

(R : Type u)
(M : Type v)
[CommRing R]
[AddCommGroup M]
[Module R M]

Module.Flat R M ↔ ∀ ⦃I : Ideal R⦄, I.FG → Function.Injective ⇑(LinearMap.lTensor M (Submodule.subtype I))


theorem cosh_log {x : ℝ} (hx : 0 < x) : cosh (log x) = (x + x⁻¹) / 2


/-- **Strict inequality case of the Rearrangement Inequality**: Pointwise multiplication of
`f` and `g`, which monovary together, is strictly decreased by a permutation if and only if
`f` and `g ∘ σ` do not monovary together. Stated by permuting the entries of `g`. -/
theorem Monovary.sum_mul_comp_perm_lt_sum_mul_iff (hfg : Monovary f g) :
    ∑ i, f i * g (σ i) < ∑ i, f i * g i ↔ ¬Monovary f (g ∘ σ)

{ι : Type u_1}
{α : Type u_2}
[LinearOrderedRing α]
{σ : Equiv.Perm ι}
{f g : ι → α}
[Fintype ι]
(hfg : Monovary f g)

∑ i : ι, f i * g (σ i) < ∑ i : ι, f i * g i ↔ ¬Monovary f (g ∘ ⇑σ)


@[to_additive]
theorem map_mrange (g : N →* P) (f : M →* N) : f.mrange.map g = mrange (comp g f)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass P]
(g : N →+ P)
(f : M →+ N)

AddSubmonoid.map g (AddMonoidHom.mrange f) = AddMonoidHom.mrange (g.comp f)


lemma or_exists_succ : p 0 ∨ (∃ n, p (n + 1)) ↔ ∃ n, p n


theorem AddMonoidHom.toIntLinearMap_injective [AddCommGroup M] [AddCommGroup M₂] :
    Function.Injective (@AddMonoidHom.toIntLinearMap M M₂ _ _)

{M : Type u_9}
{M₂ : Type u_11}
[AddCommGroup M]
[AddCommGroup M₂]


theorem countP_congr {s s' : Multiset α} (hs : s = s')
    {p p' : α → Prop} [DecidablePred p] [DecidablePred p']
    (hp : ∀ x ∈ s, p x = p' x) : s.countP p = s'.countP p'

{α : Type u_1}
{s s' : Multiset α}
(hs : s = s')
{p p' : α → Prop}
[DecidablePred p]
[DecidablePred p']
(hp : ∀ x ∈ s, p x = p' x)

Multiset.countP p s = Multiset.countP p' s'


/-- An orthogonal family of subspaces of `E` satisfies `DirectSum.IsInternal` (that is,
they provide an internal direct sum decomposition of `E`) if and only if their span has trivial
orthogonal complement. -/
theorem OrthogonalFamily.isInternal_iff [DecidableEq ι] [FiniteDimensional 𝕜 E]
    {V : ι → Submodule 𝕜 E} (hV : OrthogonalFamily 𝕜 (fun i => V i) fun i => (V i).subtypeₗᵢ) :
    DirectSum.IsInternal V ↔ (iSup V)ᗮ = ⊥

(hV : OrthogonalFamily 𝕜 (fun i => ↥(V i)) fun i => (V i).subtypeₗᵢ)


theorem StructureGroupoid.chart_mem_maximalAtlas [HasGroupoid M G] (x : M) :
    chartAt H x ∈ G.maximalAtlas M

{H : Type u}
{M : Type u_2}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
(G : StructureGroupoid H)
[HasGroupoid M G]
(x : M)

chartAt H x ∈ StructureGroupoid.maximalAtlas M G


lemma map_eq {X Y : C} (φ : W.LeftFraction X Y) (L : C ⥤ D) [L.IsLocalization W] :
    φ.map L (Localization.inverts L W) =
      L.map φ.f ≫ (Localization.isoOfHom L W φ.s φ.hs).inv

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{W : CategoryTheory.MorphismProperty C}
{X Y : C}
(φ : W.LeftFraction X Y)
(L : CategoryTheory.Functor C D)
[L.IsLocalization W]

φ.map L ⋯ = CategoryTheory.CategoryStruct.comp (L.map φ.f) (CategoryTheory.Localization.isoOfHom L W φ.s ⋯).inv


/-- A category is adhesive if it has pushouts and pullbacks along monomorphisms,
and such pushouts are van Kampen. -/
class Adhesive (C : Type u) [Category.{v} C] : Prop where
  [hasPullback_of_mono_left : ∀ {X Y S : C} (f : X ⟶ S) (g : Y ⟶ S) [Mono f], HasPullback f g]
  [hasPushout_of_mono_left : ∀ {X Y S : C} (f : S ⟶ X) (g : S ⟶ Y) [Mono f], HasPushout f g]
  van_kampen : ∀ {W X Y Z : C} {f : W ⟶ X} {g : W ⟶ Y} {h : X ⟶ Z} {i : Y ⟶ Z} [Mono f]
    (H : IsPushout f g h i), H.IsVanKampen

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[self : CategoryTheory.Adhesive C]
{W X Y Z : C}
{f : W ⟶ X}
{g : W ⟶ Y}
{h : X ⟶ Z}
{i : Y ⟶ Z}
[CategoryTheory.Mono f]
(H : CategoryTheory.IsPushout f g h i)


theorem normalize_testAgainstNN (nonzero : μ ≠ 0) (f : Ω →ᵇ ℝ≥0) :
    μ.normalize.toFiniteMeasure.testAgainstNN f = μ.mass⁻¹ * μ.testAgainstNN f

{Ω : Type u_1}
[Nonempty Ω]
{m0 : MeasurableSpace Ω}
(μ : MeasureTheory.FiniteMeasure Ω)
[TopologicalSpace Ω]
(nonzero : μ ≠ 0)
(f : Ω →ᵇ ℝ≥0)


theorem dvd_of_le_of_aleph0_le (ha : a ≠ 0) (h : a ≤ b) (hb : ℵ₀ ≤ b) : a ∣ b

{a b : Cardinal.{u}}
(ha : a ≠ 0)
(h : a ≤ b)
(hb : Cardinal.aleph0 ≤ b)


/-- The forgetful functor from `TopCatᵒᵖ` to `Frm`. -/
@[simps]
def topCatOpToFrm : TopCatᵒᵖ ⥤ Frm

∀ {X Y : TopCatᵒᵖ} (f : X ⟶ Y), topCatOpToFrm.map f = TopologicalSpace.Opens.comap f.unop


/-- See `FiniteDimensional.finrank_zero_iff`
  for the stronger version with `NoZeroSMulDivisors R M`. -/
theorem FiniteDimensional.finrank_eq_zero_iff :
    finrank R M = 0 ↔ ∀ x : M, ∃ a : R, a ≠ 0 ∧ a • x = 0

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

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


/-- The identity of a commutative square. -/
@[simps]
def id (sq : Square C) : Hom sq sq

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

(CategoryTheory.Square.Hom.id sq).τ₄ = CategoryTheory.CategoryStruct.id sq.X₄


theorem Wbtw.trans_sbtw_left [NoZeroSMulDivisors R V] {w x y z : P} (h₁ : Wbtw R w y z)
    (h₂ : Sbtw R w x y) : Sbtw R w x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[NoZeroSMulDivisors R V]
{w x y z : P}
(h₁ : Wbtw R w y z)
(h₂ : Sbtw R w x y)


@[reassoc]
lemma mapRightHomologyIso_hom_naturality [S₁.HasRightHomology] [S₂.HasRightHomology]
    [F.PreservesRightHomologyOf S₁] [F.PreservesRightHomologyOf S₂] :
    rightHomologyMap (F.mapShortComplex.map φ) ≫ (S₂.mapRightHomologyIso F).hom =
      (S₁.mapRightHomologyIso F).hom ≫ F.map (rightHomologyMap φ)

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.rightHomologyMap (F.mapShortComplex.map φ))
    (S₂.mapRightHomologyIso F).hom =
  CategoryTheory.CategoryStruct.comp (S₁.mapRightHomologyIso F).hom
    (F.map (CategoryTheory.ShortComplex.rightHomologyMap φ))


@[simp]
theorem mem_filterMap {b : β} : b ∈ s.filterMap f f_inj ↔ ∃ a ∈ s, f a = some b

{f_inj : ∀ (a a' : α), ∀ b ∈ f a, b ∈ f a' → a = a'}

b ∈ Finset.filterMap f s f_inj ↔ ∃ a ∈ s, f a = some b


theorem xor_assoc (x y z : BitVec w) :
    x ^^^ y ^^^ z = x ^^^ (y ^^^ z)


theorem rice₂ (C : Set Code) (H : ∀ cf cg, eval cf = eval cg → (cf ∈ C ↔ cg ∈ C)) :
    (ComputablePred fun c => c ∈ C) ↔ C = ∅ ∨ C = Set.univ

(H : ∀ (cf cg : Nat.Partrec.Code), cf.eval = cg.eval → (cf ∈ C ↔ cg ∈ C))


@[simp]
theorem range_sin : Set.range sin = Set.univ


/-- For almost every `a : α`, the `condDistrib Y X μ` kernel applied to `X a` and a measurable set
`s` is equal to the conditional expectation of the indicator of `Y ⁻¹' s`. -/
theorem condDistrib_ae_eq_condexp (hX : Measurable X) (hY : Measurable Y) (hs : MeasurableSet s) :
    (fun a => (condDistrib Y X μ (X a) s).toReal) =ᵐ[μ] μ⟦Y ⁻¹' s|mβ.comap X⟧

{α : Type u_1}
{β : Type u_2}
{Ω : Type u_3}
[MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{mα : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
{X : α → β}
{Y : α → Ω}
{mβ : MeasurableSpace β}
{s : Set Ω}
(hX : Measurable X)
(hY : Measurable Y)
(hs : MeasurableSet s)

(fun a => (((ProbabilityTheory.condDistrib Y X μ) (X a)) s).toReal) =ᵐ[μ]
  μ[(Y ⁻¹' s).indicator fun ω => 1|MeasurableSpace.comap X mβ]


@[simp] theorem add_mod_left (x z : Nat) : (x + z) % x = z % x


@[simp]
theorem coe_basisMonomials :
    (basisMonomials σ R : (σ →₀ ℕ) → MvPolynomial σ R) = fun s => monomial s 1

(σ : Type u)
(R : Type v)
[CommSemiring R]

⇑(MvPolynomial.basisMonomials σ R) = fun s => (MvPolynomial.monomial s) 1


theorem ofUnitHom_coe (f : Rˣ →* R'ˣ) (a : Rˣ) : ofUnitHom f ↑a = f a

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
(f : Rˣ →* R'ˣ)
(a : Rˣ)


@[simp]
theorem composePath_comp {X Y Z : C} (f : Path X Y) (g : Path Y Z) :
    composePath (f.comp g) = composePath f ≫ composePath g

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

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


theorem disjoint_ker_aeval_of_coprime (f : M →ₗ[R] M) {p q : R[X]} (hpq : IsCoprime p q) :
    Disjoint (LinearMap.ker (aeval f p)) (LinearMap.ker (aeval f q))

{R : Type u}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
(f : M →ₗ[R] M)
{p q : R[X]}
(hpq : IsCoprime p q)

Disjoint (LinearMap.ker ((Polynomial.aeval f) p)) (LinearMap.ker ((Polynomial.aeval f) q))


@[simp] lemma prob_compl_eq_one_iff (hs : MeasurableSet s) : μ sᶜ = 1 ↔ μ s = 0

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[MeasureTheory.IsProbabilityMeasure μ]
(hs : MeasurableSet s)


theorem div_rpow (x y : ℝ≥0) (z : ℝ) : (x / y) ^ z = x ^ z / y ^ z


/-- If `f : R → ℝ` is a nonnegative, multiplicatively bounded function, then
  `seminormFromBounded' f 1 ≤ 1`. -/
theorem seminormFromBounded_one_le (f_nonneg : 0 ≤ f)
    (f_mul : ∀ x y : R, f (x * y) ≤ c * f x * f y) :
    seminormFromBounded' f 1 ≤ 1

(f_mul : ∀ (x y : R), f (x * y) ≤ c * f x * f y)


theorem measurePreserving_piCongrLeft (f : ι' ≃ ι) :
    MeasurePreserving (MeasurableEquiv.piCongrLeft α f)
      (Measure.pi fun i' => μ (f i')) (Measure.pi μ)

(μ : (i : ι) → MeasureTheory.Measure (α i))

[∀ (i : ι), MeasureTheory.SigmaFinite (μ i)]

MeasureTheory.MeasurePreserving (⇑(MeasurableEquiv.piCongrLeft α f)) (MeasureTheory.Measure.pi fun i' => μ (f i'))
  (MeasureTheory.Measure.pi μ)


/-- Definition of `x ⧏ y` on pre-games built using the constructor. -/
@[simp]
theorem mk_lf_mk {xl xr xL xR yl yr yL yR} :
    mk xl xr xL xR ⧏ mk yl yr yL yR ↔ (∃ i, mk xl xr xL xR ≤ yL i) ∨ ∃ j, xR j ≤ mk yl yr yL yR

{xl xr : Type u_1}
{xL : xl → SetTheory.PGame}
{xR : xr → SetTheory.PGame}
{yl yr : Type u_1}
{yL : yl → SetTheory.PGame}
{yR : yr → SetTheory.PGame}

(SetTheory.PGame.mk xl xr xL xR).LF (SetTheory.PGame.mk yl yr yL yR) ↔
  (∃ i, SetTheory.PGame.mk xl xr xL xR ≤ yL i) ∨ ∃ j, xR j ≤ SetTheory.PGame.mk yl yr yL yR


@[elab_as_elim]
protected lemma inductionOn₂ [TopologicalSpace Y] {motive : t2Quotient X → t2Quotient Y → Prop}
    (q : t2Quotient X) (q' : t2Quotient Y) (h : ∀ x y, motive (mk x) (mk y)) : motive q q'

(h : ∀ (x : X) (y : Y), motive (t2Quotient.mk x) (t2Quotient.mk y))


@[simp] theorem set_nil_succ : set [] (i+1) y = 0 :: set [] i y

Lean.Omega.IntList.set [] (i + 1) y = 0 :: Lean.Omega.IntList.set [] i y


theorem of_eq (h₁ : x ⊓ y = ⊥) (h₂ : x ⊔ y = ⊤) : IsCompl x y

{α : Type u_1}
[Lattice α]
[BoundedOrder α]
{x y : α}
(h₁ : x ⊓ y = ⊥)
(h₂ : x ⊔ y = ⊤)


lemma pow_nilpotencyClass (hx : IsNilpotent x) : x ^ (nilpotencyClass x) = 0

{R : Type u_1}
{x : R}
[Zero R]
[Pow R ℕ]
(hx : IsNilpotent x)


theorem eq_conj_prod_map' {f : E →ₗ[R] E} (h : IsProj p f) :
    f = (p.prodEquivOfIsCompl (ker f) h.isCompl).toLinearMap ∘ₗ
        prodMap id 0 ∘ₗ (p.prodEquivOfIsCompl (ker f) h.isCompl).symm.toLinearMap

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{p : Submodule R E}
{f : E →ₗ[R] E}
(h : LinearMap.IsProj p f)

f =
  ↑(p.prodEquivOfIsCompl (LinearMap.ker f) ⋯) ∘ₗ
    LinearMap.id.prodMap 0 ∘ₗ ↑(p.prodEquivOfIsCompl (LinearMap.ker f) ⋯).symm


@[simp]
theorem smul_mem_pointwise_smul_iff {a : α} {S : AddSubmonoid A} {x : A} : a • x ∈ a • S ↔ x ∈ S

{α : Type u_1}
{A : Type u_5}
[AddMonoid A]
[Group α]
[DistribMulAction α A]
{a : α}
{S : AddSubmonoid A}
{x : A}


@[mono, gcongr]
theorem interior_mono (h : s ⊆ t) : interior s ⊆ interior t

{X : Type u}
{s t : Set X}
[TopologicalSpace X]
(h : s ⊆ t)


/-- A trivial bundle is equivalent to the product `B × F`. -/
@[simps (config := { attrs := [`mfld_simps] })]
def TotalSpace.toProd (B F : Type*) : (TotalSpace F fun _ : B => F) ≃ B × F

(B : Type u_4)
(F : Type u_5)
(x : B × F)

((Bundle.TotalSpace.toProd B F).symm x).proj = x.1


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

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


theorem union_ae_eq_right_of_ae_eq_empty (h : s =ᵐ[μ] (∅ : Set α)) : (s ∪ t : Set α) =ᵐ[μ] t

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{s t : Set α}
(h : s =ᵐ[μ] ∅)


theorem image₂_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image₂ f s t = image₂ f' s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f f' : α → β → γ}
{s : Finset α}
{t : Finset β}
(h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b)

Finset.image₂ f s t = Finset.image₂ f' s t


@[simp]
theorem zeroth_conv'_eq_h : g.convs' 0 = g.h

{K : Type u_1}
{g : GenContFract K}
[DivisionRing K]


theorem fromStalk_to_skyscraper {𝓕 : Presheaf C X} {c : C} (f : 𝓕.stalk p₀ ⟶ c) :
    fromStalk p₀ (toSkyscraperPresheaf _ f) = f

[(U : TopologicalSpace.Opens ↑X) → Decidable (p₀ ∈ U)]

StalkSkyscraperPresheafAdjunctionAuxs.fromStalk p₀ (StalkSkyscraperPresheafAdjunctionAuxs.toSkyscraperPresheaf p₀ f) = f


theorem mk_embedding_eq_zero_iff_lift_lt : #(α ↪ β') = 0 ↔ lift.{u} #β' < lift.{v} #α

#(α ↪ β') = 0 ↔ Cardinal.lift.{u, v} #β' < Cardinal.lift.{v, u} #α


@[simp] theorem measurableSet_setOf : MeasurableSet {a | p a} ↔ Measurable p

{α : Type u_1}
[MeasurableSpace α]
{p : α → Prop}


/-- The orthogonal projection is symmetric. -/
theorem orthogonalProjection_isSymmetric [HasOrthogonalProjection K] :
    (K.subtypeL ∘L orthogonalProjection K : E →ₗ[𝕜] E).IsSymmetric

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(K : Submodule 𝕜 E)
[HasOrthogonalProjection K]


theorem IsOpen.closure_inter (h : IsOpen t) : closure s ∩ t ⊆ closure (s ∩ t)

{X : Type u}
{s t : Set X}
[TopologicalSpace X]
(h : IsOpen t)


@[simp] theorem diff_cons (l₁ l₂ : List α) (a : α) : l₁.diff (a :: l₂) = (l₁.erase a).diff l₂

{α : Type u_1}
[BEq α]
[LawfulBEq α]
(l₁ l₂ : List α)
(a : α)


/-- The variant of `is_left_invariant_chaar` for `haarContent` -/
@[to_additive "The variant of `is_left_invariant_addCHaar` for `addHaarContent`"]
theorem is_left_invariant_haarContent {K₀ : PositiveCompacts G} (g : G) (K : Compacts G) :
    haarContent K₀ (K.map _ <| continuous_mul_left g) = haarContent K₀ K

{K₀ : TopologicalSpace.PositiveCompacts G}

(fun s => ↑((MeasureTheory.Measure.haar.haarContent K₀).toFun s)) (TopologicalSpace.Compacts.map (fun b => g * b) ⋯ K) =
  (fun s => ↑((MeasureTheory.Measure.haar.haarContent K₀).toFun s)) K


theorem IsClosed.preimage (hf : Continuous f) {t : Set Y} (h : IsClosed t) :
    IsClosed (f ⁻¹' t)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : Continuous f)
{t : Set Y}
(h : IsClosed t)


theorem smul (hxy : x ≡ y [SMOD U]) (c : R) : c • x ≡ c • y [SMOD U]

{R : Type u_1}
[Ring R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{U : Submodule R M}
{x y : M}
(hxy : x ≡ y [SMOD U])
(c : R)


/-- An auxiliary structure that witnesses the fact that `f` factors through an image object of `G`.
-/
-- Porting note(#5171): removed `@[nolint has_nonempty_instance]`
structure Presieve.CoverByImageStructure (G : C ⥤ D) {V U : D} (f : V ⟶ U) where
  obj : C
  lift : V ⟶ G.obj obj
  map : G.obj obj ⟶ U
  fac : lift ≫ map = f := by aesop_cat

(self : CategoryTheory.Presieve.CoverByImageStructure G f)

CategoryTheory.CategoryStruct.comp self.lift self.map = f


@[simp]
theorem arccos_eq_pi {x} : arccos x = π ↔ x ≤ -1


@[simp]
theorem smul_apply (n : M) (f : CentroidHom α) (a : α) : (n • f) a = n • f a

{M : Type u_2}
{α : Type u_5}
[NonUnitalNonAssocSemiring α]
[Monoid M]
[DistribMulAction M α]
[SMulCommClass M α α]
[IsScalarTower M α α]
(n : M)
(f : CentroidHom α)
(a : α)


@[simp]
theorem isUnit_gcd_one_left [GCDMonoid α] (a : α) : IsUnit (gcd 1 a)

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
(a : α)


/-- A left homology data for a short complex `S` in the opposite category
induces a right homology data for `S.unop`. -/
@[simps]
def unop {S : ShortComplex Cᵒᵖ} (h : S.LeftHomologyData) : S.unop.RightHomologyData


/-- If the stabilizer of `x` is `S`, then the stabilizer of `g +ᵥ x` is `g + S + (-g)`. -/
theorem stabilizer_vadd_eq_stabilizer_map_conj (g : G) (a : α) :
    stabilizer G (g +ᵥ a) = (stabilizer G a).map (AddAut.conj g).toAddMonoidHom

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
(g : G)
(a : α)

AddAction.stabilizer G (g +ᵥ a) = AddSubgroup.map (AddEquiv.toAddMonoidHom (AddAut.conj g)) (AddAction.stabilizer G a)


theorem lt_aleph0_of_finite (α : Type u) [Finite α] : #α < ℵ₀


/-- The top subgroup is isomorphic to the group.

This is the group version of `Submonoid.topEquiv`. -/
@[to_additive (attr := simps!)
      "The top additive subgroup is isomorphic to the additive group.

      This is the additive group version of `AddSubmonoid.topEquiv`."]
def topEquiv : (⊤ : Subgroup G) ≃* G


@[simp]
theorem mem_prod {x y z : ZFSet.{u}} : z ∈ prod x y ↔ ∃ a ∈ x, ∃ b ∈ y, z = pair a b

z ∈ x.prod y ↔ ∃ a ∈ x, ∃ b ∈ y, z = a.pair b


@[simp] lemma induceHomOfLE_toHom :
    (G.induceHomOfLE h).toHom = induceHom (.id : G →g G) ((Set.mapsTo_id s).mono_right h)

{V : Type u_1}
(G : SimpleGraph V)
{s s' : Set V}
(h : s ≤ s')

(G.induceHomOfLE h).toHom = SimpleGraph.induceHom SimpleGraph.Hom.id ⋯


theorem iInter_union (s : ι → Set β) (t : Set β) : (⋂ i, s i) ∪ t = ⋂ i, s i ∪ t

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


theorem continuous_if' {p : α → Prop} {f g : α → β} [∀ a, Decidable (p a)]
    (hpf : ∀ a ∈ frontier { x | p x }, Tendsto f (𝓝[{ x | p x }] a) (𝓝 <| ite (p a) (f a) (g a)))
    (hpg : ∀ a ∈ frontier { x | p x }, Tendsto g (𝓝[{ x | ¬p x }] a) (𝓝 <| ite (p a) (f a) (g a)))
    (hf : ContinuousOn f { x | p x }) (hg : ContinuousOn g { x | ¬p x }) :
    Continuous fun a => ite (p a) (f a) (g a)

(hpf : ∀ a ∈ frontier {x | p x}, Filter.Tendsto f (𝓝[{x | p x}] a) (𝓝 (if p a then f a else g a)))

(hpg : ∀ a ∈ frontier {x | p x}, Filter.Tendsto g (𝓝[{x | ¬p x}] a) (𝓝 (if p a then f a else g a)))

Continuous fun a => if p a then f a else g a


theorem transpose_circulant [AddGroup n] (v : n → α) :
    (circulant v)ᵀ = circulant fun i => v (-i)

{α : Type u_1}
{n : Type u_4}
[AddGroup n]
(v : n → α)

(Matrix.circulant v).transpose = Matrix.circulant fun i => v (-i)


/-- The functor sending an arrow to its source. -/
@[simps!]
def leftFunc : Arrow C ⥤ C

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

∀ {X Y : CategoryTheory.Comma (CategoryTheory.Functor.id C) (CategoryTheory.Functor.id C)} (f : X ⟶ Y),
  CategoryTheory.Arrow.leftFunc.map f = f.left


@[simp] lemma inter_eq_left : s ∩ t = s ↔ s ⊆ t


/-- The `vectorSpan` of an indexed family of `n + 1` points has
dimension at most `n`. -/
theorem finrank_vectorSpan_range_le [Fintype ι] (p : ι → P) {n : ℕ} (hc : Fintype.card ι = n + 1) :
    finrank k (vectorSpan k (Set.range p)) ≤ n

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
{ι : Type u_4}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
[Fintype ι]
(p : ι → P)
{n : ℕ}
(hc : Fintype.card ι = n + 1)

FiniteDimensional.finrank k ↥(vectorSpan k (Set.range p)) ≤ n


@[to_additive (attr := simp) abs_pos] lemma one_lt_mabs : 1 < |a|ₘ ↔ a ≠ 1

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


@[simp] theorem intersperse_nil (sep : α) : ([] : List α).intersperse sep = []

List.intersperse sep List.nil = List.nil


/-- The unit for the adjunction for `Cocones.functoriality K F : Cocone K ⥤ Cocone (K ⋙ F)`.

Auxiliary definition for `functorialityIsLeftAdjoint`.
-/
@[simps]
def functorialityUnit :
    𝟭 (Cocone K) ⟶ Cocones.functoriality _ F ⋙ functorialityRightAdjoint adj K

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
{G : CategoryTheory.Functor D C}
(adj : F ⊣ G)
{J : Type u}
[CategoryTheory.Category.{v, u} J]
(K : CategoryTheory.Functor J C)
(c : CategoryTheory.Limits.Cocone K)

((adj.functorialityUnit K).app c).hom = adj.unit.app c.pt


@[simp]
theorem one_apply_ne {i j} : i ≠ j → (1 : Matrix n n α) i j = 0

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
[One α]
{i j : n}


theorem ball_sup (p : Seminorm 𝕜 E) (q : Seminorm 𝕜 E) (e : E) (r : ℝ) :
    ball (p ⊔ q) e r = ball p e r ∩ ball q e r

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

(p ⊔ q).ball e r = p.ball e r ∩ q.ball e r


@[simp]
theorem mul_snd (a b : 𝓜(𝕜, A)) : (a * b).snd = b.snd * a.snd

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
(a b : 𝓜(𝕜, A))

(a * b).toProd.2 = b.toProd.2 * a.toProd.2


@[to_additive (attr := simp)]
theorem coe_subtype : (MulMemClass.subtype S' : S' → M) = Subtype.val

{M : Type u_1}
{A : Type u_5}
[Add M]
[SetLike A M]
[hA : AddMemClass A M]
(S' : A)


theorem Basis.iUnion_basis_iUnion {ι : Type _} (X I : ι → Set α) (hI : ∀ i, M.Basis (I i) (X i))
    (h_ind : M.Indep (⋃ i, I i)) : M.Basis (⋃ i, I i) (⋃ i, X i)

{α : Type u_1}
{M : Matroid α}
{ι : Type u_2}
(X I : ι → Set α)
(hI : ∀ (i : ι), M.Basis (I i) (X i))
(h_ind : M.Indep (⋃ i, I i))


@[to_additive (attr := simp)]
theorem preimage_mul_left_ball [IsometricSMul G G] (a b : G) (r : ℝ) :
    (a * ·) ⁻¹' ball b r = ball (a⁻¹ * b) r

{G : Type v}
[AddGroup G]
[PseudoMetricSpace G]
[IsometricVAdd G G]
(a b : G)
(r : ℝ)

(fun x => a + x) ⁻¹' Metric.ball b r = Metric.ball (-a + b) r


@[ext]
lemma hom_ext {M N : Mod_ A} (f₁ f₂ : M ⟶ N) (h : f₁.hom = f₂.hom) : f₁ = f₂

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{A : Mon_ C}
{M N : Mod_ A}
(f₁ f₂ : M ⟶ N)
(h : f₁.hom = f₂.hom)


/-- If `F` is cofinal,
the category of cocones on `F ⋙ G` is equivalent to the category of cocones on `G`,
for any `G : D ⥤ E`.
-/
@[simps]
def coconesEquiv : Cocone (F ⋙ G) ≌ Cocone G

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
[F.Final]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
(G : CategoryTheory.Functor D E)

(CategoryTheory.Functor.Final.coconesEquiv F G).counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun c =>
      CategoryTheory.Limits.Cocones.ext
        (CategoryTheory.Iso.refl
          (((CategoryTheory.Limits.Cocones.whiskering F).comp CategoryTheory.Functor.Final.extendCocone).obj c).pt)
        ⋯)
    ⋯