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

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


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

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


@[reassoc (attr := simp), elementwise (attr := simp)]
theorem kernelSubobject_arrow_comp : (kernelSubobject f).arrow ≫ f = 0

(CategoryTheory.Limits.kernelSubobject f).arrow ≫ f = 0


lemma jacobiTheta₂''_neg_left (z τ : ℂ) : jacobiTheta₂'' (-z) τ = -jacobiTheta₂'' z τ

HurwitzZeta.jacobiTheta₂'' (-z) τ = -HurwitzZeta.jacobiTheta₂'' z τ


/--
In an `IsDomain R`, split any `Prop` over `R` into the three cases:
- *prime* characteristic.
- equal characteristic zero.
- mixed characteristic `(0, p)`.
-/
theorem split_by_characteristic_domain [IsDomain R] (h_pos : ∀ p : ℕ, Nat.Prime p → CharP R p → P)
    (h_equal : Algebra ℚ R → P) (h_mixed : ∀ p : ℕ, Nat.Prime p → MixedCharZero R p → P) : P

(h_pos : ∀ (p : ℕ), Nat.Prime p → CharP R p → P)

(h_mixed : ∀ (p : ℕ), Nat.Prime p → MixedCharZero R p → P)


/-- Forgetting the sheaf condition is a functor from `SheafedSpace C` to `PresheafedSpace C`. -/
@[simps! obj map]
def forgetToPresheafedSpace : SheafedSpace C ⥤ PresheafedSpace C

(self : AlgebraicGeometry.SheafedSpace C)

AlgebraicGeometry.SheafedSpace.forgetToPresheafedSpace.obj self = self.toPresheafedSpace


/-- The induction hypothesis of `Submodule.basisOfPid` and `Submodule.smithNormalForm`.

Basically, it says: let `N ≤ M` be a pair of submodules, then we can find a pair of
submodules `N' ≤ M'` of strictly smaller rank, whose basis we can extend to get a basis
of `N` and `M`. Moreover, if the basis for `M'` is up to scalars a basis for `N'`,
then the basis we find for `M` is up to scalars a basis for `N`.

For `basis_of_pid` we only need the first half and can fix `M = ⊤`,
for `smith_normal_form` we need the full statement,
but must also feed in a basis for `M` using `basis_of_pid` to keep the induction going.
-/
theorem Submodule.basis_of_pid_aux [Finite ι] {O : Type*} [AddCommGroup O] [Module R O]
    (M N : Submodule R O) (b'M : Basis ι R M) (N_bot : N ≠ ⊥) (N_le_M : N ≤ M) :
    ∃ y ∈ M, ∃ a : R, a • y ∈ N ∧ ∃ M' ≤ M, ∃ N' ≤ N,
      N' ≤ M' ∧ (∀ (c : R) (z : O), z ∈ M' → c • y + z = 0 → c = 0) ∧
      (∀ (c : R) (z : O), z ∈ N' → c • a • y + z = 0 → c = 0) ∧
      ∀ (n') (bN' : Basis (Fin n') R N'),
        ∃ bN : Basis (Fin (n' + 1)) R N,
          ∀ (m') (hn'm' : n' ≤ m') (bM' : Basis (Fin m') R M'),
            ∃ (hnm : n' + 1 ≤ m' + 1) (bM : Basis (Fin (m' + 1)) R M),
              ∀ as : Fin n' → R,
                (∀ i : Fin n', (bN' i : O) = as i • (bM' (Fin.castLE hn'm' i) : O)) →
                  ∃ as' : Fin (n' + 1) → R,
                    ∀ i : Fin (n' + 1), (bN i : O) = as' i • (bM (Fin.castLE hnm i) : O)

{ι : Type u_1}
{R : Type u_2}
[CommRing R]
[IsDomain R]
[IsPrincipalIdealRing R]
[Finite ι]
{O : Type u_4}
[AddCommGroup O]
[Module R O]
(M N : Submodule R O)
(b'M : Basis ι R ↥M)
(N_bot : N ≠ ⊥)
(N_le_M : N ≤ M)

∃ y ∈ M,
  ∃ a,
    a • y ∈ N ∧
      ∃ M' ≤ M,
        ∃ N' ≤ N,
          N' ≤ M' ∧
            (∀ (c : R), ∀ z ∈ M', c • y + z = 0 → c = 0) ∧
              (∀ (c : R), ∀ z ∈ N', c • a • y + z = 0 → c = 0) ∧
                ∀ (n' : ℕ) (bN' : Basis (Fin n') R ↥N'),
                  ∃ bN,
                    ∀ (m' : ℕ) (hn'm' : n' ≤ m') (bM' : Basis (Fin m') R ↥M'),
                      ∃ (hnm : n' + 1 ≤ m' + 1),
                        ∃ bM,
                          ∀ (as : Fin n' → R),
                            (∀ (i : Fin n'), ↑(bN' i) = as i • ↑(bM' (Fin.castLE hn'm' i))) →
                              ∃ as', ∀ (i : Fin (n' + 1)), ↑(bN i) = as' i • ↑(bM (Fin.castLE hnm i))


lemma ker_mono : Monotone (ker : Filter α → Set α)


theorem finiteAt_nhdsWithin [TopologicalSpace α] {_m0 : MeasurableSpace α} (μ : Measure α)
    [IsLocallyFiniteMeasure μ] (x : α) (s : Set α) : μ.FiniteAtFilter (𝓝[s] x)


theorem isMaxOn_const {b : β} : IsMaxOn (fun _ => b) s a

{α : Type u}
{β : Type v}
[Preorder β]
{s : Set α}
{a : α}
{b : β}


theorem dualAnnihilator_iInf_eq {ι : Type*} [Finite ι] (W : ι → Subspace K V₁) :
    (⨅ i : ι, W i).dualAnnihilator = ⨆ i : ι, (W i).dualAnnihilator

{K : Type uK}
[Field K]
{V₁ : Type uV₁}
[AddCommGroup V₁]
[Module K V₁]
{ι : Type u_1}
[Finite ι]
(W : ι → Subspace K V₁)

Submodule.dualAnnihilator (⨅ i, W i) = ⨆ i, Submodule.dualAnnihilator (W i)


theorem countable_iff_nonempty_encodable {s : Set α} : s.Countable ↔ Nonempty (Encodable s)


@[norm_cast]
lemma specializes_coe {f g : C(X, Y)} : ⇑f ⤳ ⇑g ↔ f ⤳ g

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{f g : C(X, Y)}

⇑f ⤳ ⇑g ↔ f ⤳ g


@[to_additive]
theorem inv_mem_Ioo_iff : a⁻¹ ∈ Set.Ioo c d ↔ a ∈ Set.Ioo d⁻¹ c⁻¹

{α : Type u_1}
[OrderedCommGroup α]
{a c d : α}


theorem Icc_pred_right {b : ℕ} (h : 0 < b) : Icc a (b - 1) = Ico a b


@[simp]
theorem tensorUnit_obj {X} : (𝟙_ (C ⥤ D)).obj X = 𝟙_ D

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


protected theorem strictMono (e : α ≃o β) : StrictMono e

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(e : α ≃o β)


theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he : ∀ n, e n ∈ s ∪ t) :
    ∃ g : ℕ ↪o ℕ, (∀ n, e (g n) ∈ s) ∨ ∀ n, e (g n) ∈ t

{α : Type u_1}
{s t : Set α}
(e : ℕ → α)
(he : ∀ (n : ℕ), e n ∈ s ∪ t)

∃ g, (∀ (n : ℕ), e (g n) ∈ s) ∨ ∀ (n : ℕ), e (g n) ∈ t


theorem isPartition_iff_iUnion_eq : IsPartition π ↔ π.iUnion = I

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.TaggedPrepartition I)


theorem ofMeasurable_apply {m : ∀ s : Set α, MeasurableSet s → ℝ≥0∞}
    {m0 : m ∅ MeasurableSet.empty = 0}
    {mU :
      ∀ ⦃f : ℕ → Set α⦄ (h : ∀ i, MeasurableSet (f i)),
        Pairwise (Disjoint on f) → m (⋃ i, f i) (MeasurableSet.iUnion h) = ∑' i, m (f i) (h i)}
    (s : Set α) (hs : MeasurableSet s) : ofMeasurable m m0 mU s = m s hs

{m : (s : Set α) → MeasurableSet s → ℝ≥0∞}

{mU :
  ∀ ⦃f : ℕ → Set α⦄ (h : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) → m (⋃ i, f i) ⋯ = ∑' (i : ℕ), m (f i) ⋯}

(MeasureTheory.Measure.ofMeasurable m m0 mU) s = m s hs


@[simp]
theorem fst_neg [Neg R] [Neg M] (x : tsze R M) : (-x).fst = -x.fst

{R : Type u}
{M : Type v}
[Neg R]
[Neg M]
(x : tsze R M)


/-- A closure operator on the preorder `α` is a monotone function which is extensive (every `x`
is less than its closure) and idempotent. -/
structure ClosureOperator [Preorder α] extends α →o α where
  /-- An element is less than or equal its closure -/
  le_closure' : ∀ x, x ≤ toFun x
  /-- Closures are idempotent -/
  idempotent' : ∀ x, toFun (toFun x) = toFun x
  /-- Predicate for an element to be closed.

  By default, this is defined as `c.IsClosed x := (c x = x)` (see `isClosed_iff`).
  We allow an override to fix definitional equalities. -/
  IsClosed (x : α) : Prop := toFun x = x
  isClosed_iff {x : α} : IsClosed x ↔ toFun x = x := by aesop

{α : Type u_1}
[Preorder α]
(self : ClosureOperator α)
(x : α)

self.toFun (self.toFun x) = self.toFun x


theorem not_prime_iff_exists_dvd_lt {n : ℕ} (h : 2 ≤ n) : (¬Prime n) ↔ ∃ m, m ∣ n ∧ 2 ≤ m ∧ m < n

¬Nat.Prime n ↔ ∃ m, m ∣ n ∧ 2 ≤ m ∧ m < n


theorem Balanced.smul (a : 𝕝) (hs : Balanced 𝕜 s) : Balanced 𝕜 (a • s)

{𝕜 : Type u_1}
{𝕝 : Type u_2}
{E : Type u_3}
[SeminormedRing 𝕜]
[SMul 𝕜 E]
{s : Set E}
[SMul 𝕝 E]
[SMulCommClass 𝕜 𝕝 E]
(a : 𝕝)
(hs : Balanced 𝕜 s)


theorem comp_differentiableOn_iff {f : G → E} {s : Set G} :
    DifferentiableOn 𝕜 (iso ∘ f) s ↔ DifferentiableOn 𝕜 f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(iso : E ≃ₗᵢ[𝕜] F)
{f : G → E}
{s : Set G}

DifferentiableOn 𝕜 (⇑iso ∘ f) s ↔ DifferentiableOn 𝕜 f s


theorem snd_apply {s : Set β} (hs : MeasurableSet s) : ρ.snd s = ρ (Prod.snd ⁻¹' s)

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{ρ : MeasureTheory.Measure (α × β)}
{s : Set β}
(hs : MeasurableSet s)


theorem join_map_eq_map_join {f : α → β} {x : Option (Option α)} :
    (x.map (Option.map f)).join = x.join.map f

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

(Option.map (Option.map f) x).join = Option.map f x.join


@[to_additive]
theorem singleton_div_singleton : ({a} : Set α) / {b} = {a / b}


@[to_additive]
lemma minOrder_le_orderOf (ha : a ≠ 1) (ha' : IsOfFinOrder a) : minOrder α ≤ orderOf a

{α : Type u_1}
[AddMonoid α]
{a : α}
(ha : a ≠ 0)
(ha' : IsOfFinAddOrder a)


/-- If `a ≤ b`, then `b` does not cover `a` iff there's an element in between. -/
theorem not_wcovBy_iff (h : a ≤ b) : ¬a ⩿ b ↔ ∃ c, a < c ∧ c < b

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


protected theorem compl_sSup (S : Set (LowerSet α)) : (sSup S).compl = ⨆ s ∈ S, LowerSet.compl s

{α : Type u_1}
[LE α]
(S : Set (LowerSet α))


theorem quotQuotEquivQuotOfLE_symm_comp_mk (h : I ≤ J) :
    RingHom.comp (↑(quotQuotEquivQuotOfLE h).symm) (Ideal.Quotient.mk J) = quotQuotMk I J

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

(↑(DoubleQuot.quotQuotEquivQuotOfLE h).symm).comp (Ideal.Quotient.mk J) = DoubleQuot.quotQuotMk I J


theorem toTopologicalSpace_subtype [u : UniformSpace α] {p : α → Prop} :
    @UniformSpace.toTopologicalSpace (Subtype p) instUniformSpaceSubtype =
      @instTopologicalSpaceSubtype α p u.toTopologicalSpace

{α : Type ua}
[u : UniformSpace α]
{p : α → Prop}


theorem mem_vars_bind₁ (f : σ → MvPolynomial τ R) (φ : MvPolynomial σ R) {j : τ}
    (h : j ∈ (bind₁ f φ).vars) : ∃ i : σ, i ∈ φ.vars ∧ j ∈ (f i).vars

(h : j ∈ ((MvPolynomial.bind₁ f) φ).vars)


lemma snd_apply (x : α × β) : snd x = x.snd

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(x : α × β)


lemma integrable_left_of_integrable_add_of_nonneg {f g : α → ℝ}
    (h_meas : AEStronglyMeasurable f μ) (hf : 0 ≤ᵐ[μ] f) (hg : 0 ≤ᵐ[μ] g)
    (h_int : Integrable (f + g) μ) : Integrable f μ

(h_meas : MeasureTheory.AEStronglyMeasurable f μ)

(h_int : MeasureTheory.Integrable (f + g) μ)


/-- The data needed to induce a `MonoidalCategory` via the functor `F`; namely, pre-existing
definitions of `⊗`, `𝟙_`, `▷`, `◁` that are preserved by `F`.
-/
structure InducingFunctorData [MonoidalCategoryStruct D] (F : D ⥤ C) where
  /-- Analogous to `CategoryTheory.LaxMonoidalFunctor.μIso` -/
  μIso : ∀ X Y,
    F.obj X ⊗ F.obj Y ≅ F.obj (X ⊗ Y)
  whiskerLeft_eq : ∀ (X : D) {Y₁ Y₂ : D} (f : Y₁ ⟶ Y₂),
    F.map (X ◁ f) = (μIso _ _).inv ≫ (F.obj X ◁ F.map f) ≫ (μIso _ _).hom := by
    aesop_cat
  whiskerRight_eq : ∀ {X₁ X₂ : D} (f : X₁ ⟶ X₂) (Y : D),
    F.map (f ▷ Y) = (μIso _ _).inv ≫ (F.map f ▷ F.obj Y) ≫ (μIso _ _).hom := by
    aesop_cat
  tensorHom_eq : ∀ {X₁ Y₁ X₂ Y₂ : D} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂),
    F.map (f ⊗ g) = (μIso _ _).inv ≫ (F.map f ⊗ F.map g) ≫ (μIso _ _).hom := by
    aesop_cat
  /-- Analogous to `CategoryTheory.LaxMonoidalFunctor.εIso` -/
  εIso : 𝟙_ _ ≅ F.obj (𝟙_ _)
  associator_eq : ∀ X Y Z : D,
    F.map (α_ X Y Z).hom =
      (((μIso _ _).symm ≪≫ ((μIso _ _).symm ⊗ .refl _))
        ≪≫ α_ (F.obj X) (F.obj Y) (F.obj Z)
        ≪≫ ((.refl _ ⊗ μIso _ _) ≪≫ μIso _ _)).hom := by
    aesop_cat
  leftUnitor_eq : ∀ X : D,
    F.map (λ_ X).hom =
      (((μIso _ _).symm ≪≫ (εIso.symm ⊗ .refl _)) ≪≫ λ_ (F.obj X)).hom := by
    aesop_cat
  rightUnitor_eq : ∀ X : D,
    F.map (ρ_ X).hom =
      (((μIso _ _).symm ≪≫ (.refl _ ⊗ εIso.symm)) ≪≫ ρ_ (F.obj X)).hom := by
    aesop_cat

(self : CategoryTheory.Monoidal.InducingFunctorData F)

F.map (f ⊗ g) = (self.μIso X₁ X₂).inv ≫ (F.map f ⊗ F.map g) ≫ (self.μIso Y₁ Y₂).hom


@[simp]
theorem compRightContinuousMap_apply {X Y : Type*} (T : Type*) [TopologicalSpace X]
    [CompactSpace X] [TopologicalSpace Y] [CompactSpace Y] [MetricSpace T] (f : C(X, Y))
    (g : C(Y, T)) : (compRightContinuousMap T f) g = g.comp f

{X : Type u_1}
{Y : Type u_2}
(T : Type u_3)
[TopologicalSpace X]
[CompactSpace X]
[TopologicalSpace Y]
[CompactSpace Y]
[MetricSpace T]
(f : C(X, Y))
(g : C(Y, T))

(ContinuousMap.compRightContinuousMap T f) g = g.comp f


@[simp] lemma sq_lt_one_iff_abs_lt_one (a : α) : a ^ 2 < 1 ↔ |a| < 1

{α : Type u_1}
[LinearOrderedRing α]
(a : α)


protected theorem lt_add_of_le_of_pos {a b c : Int} (hbc : b ≤ c) (ha : 0 < a) : b < c + a


@[simp]
theorem one_le_cosh (x : ℝ) : 1 ≤ cosh x


theorem div_sub_one {a b : K} (h : b ≠ 0) : a / b - 1 = (a - b) / b

{K : Type u_3}
[DivisionRing K]
{a b : K}
(h : b ≠ 0)


@[simp]
theorem darts_reverse {u v : V} (p : G.Walk u v) :
    p.reverse.darts = (p.darts.map Dart.symm).reverse

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

p.reverse.darts = (List.map SimpleGraph.Dart.symm p.darts).reverse


lemma twoTorsionPolynomial_disc_ne_zero [Nontrivial R] [Invertible (2 : R)] :
    E.twoTorsionPolynomial.disc ≠ 0

{R : Type u}
[CommRing R]
(E : EllipticCurve R)
[Nontrivial R]
[Invertible 2]


theorem tendsto_iff_comap {f : α → β} {l₁ : Filter α} {l₂ : Filter β} :
    Tendsto f l₁ l₂ ↔ l₁ ≤ l₂.comap f

{α : Type u}
{β : Type v}
{f : α → β}
{l₁ : Filter α}
{l₂ : Filter β}

Filter.Tendsto f l₁ l₂ ↔ l₁ ≤ Filter.comap f l₂


@[simp] theorem exists_eq_or_imp : (∃ a, (a = a' ∨ q a) ∧ p a) ↔ p a' ∨ ∃ a, q a ∧ p a

{α : Sort u_1}
{p q : α → Prop}
{a' : α}


lemma measure_prod_compl_eq_zero {s : Set α} {t : Set β}
    (s_ae_univ : μ sᶜ = 0) (t_ae_univ : ν tᶜ = 0) :
    μ.prod ν (s ×ˢ t)ᶜ = 0

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
{s : Set α}
{t : Set β}
(s_ae_univ : μ sᶜ = 0)
(t_ae_univ : ν tᶜ = 0)


theorem hasseDeriv_mul (f g : R[X]) :
    hasseDeriv k (f * g) = ∑ ij ∈ antidiagonal k, hasseDeriv ij.1 f * hasseDeriv ij.2 g

{R : Type u_1}
[Semiring R]
(k : ℕ)
(f g : Polynomial R)

(Polynomial.hasseDeriv k) (f * g) =
  ∑ ij ∈ Finset.antidiagonal k, (Polynomial.hasseDeriv ij.1) f * (Polynomial.hasseDeriv ij.2) g


/-- If `f` has a dense range and its domain is countable, then its codomain is a separable space.
See also `DenseRange.separableSpace`. -/
theorem SeparableSpace.of_denseRange {ι : Sort _} [Countable ι] (u : ι → α) (hu : DenseRange u) :
    SeparableSpace α

{α : Type u}
[t : TopologicalSpace α]
{ι : Type u_2}
[Countable ι]
(u : ι → α)
(hu : DenseRange u)


@[simp]
theorem Ioc_top : Ioc a ⊤ = Ioi a

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


theorem prod_X_sub_C_coeff_card_pred (s : Finset ι) (f : ι → R) (hs : 0 < s.card) :
    (∏ i ∈ s, (X - C (f i))).coeff (s.card - 1) = -∑ i ∈ s, f i

{R : Type u}
{ι : Type w}
[CommRing R]
(s : Finset ι)
(f : ι → R)
(hs : 0 < s.card)

(∏ i ∈ s, (Polynomial.X - Polynomial.C (f i))).coeff (s.card - 1) = -∑ i ∈ s, f i


@[simp]
theorem mem_carrier {S : VonNeumannAlgebra H} {x : H →L[ℂ] H} :
    x ∈ S.toStarSubalgebra ↔ x ∈ (S : Set (H →L[ℂ] H))

{H : Type u}
[NormedAddCommGroup H]
[InnerProductSpace ℂ H]
[CompleteSpace H]
{S : VonNeumannAlgebra H}
{x : H →L[ℂ] H}


theorem sin_add_two_pi (x : ℂ) : sin (x + 2 * π) = sin x

Complex.sin (x + 2 * ↑Real.pi) = Complex.sin x


@[ext]
theorem EuclideanHalfSpace.ext [Zero (Fin n)] (x y : EuclideanHalfSpace n)
    (h : x.1 = y.1) : x = y

{n : ℕ}
[Zero (Fin n)]
(x y : EuclideanHalfSpace n)
(h : ↑x = ↑y)


@[simp] theorem dual_dual (M : Matroid α) : M✶✶ = M


/-- Make a fan `f` into a limit fan by providing `lift`, `fac`, and `uniq` --
  just a convenience lemma to avoid having to go through `Discrete` -/
@[simps]
def mkFanLimit {f : β → C} (t : Fan f) (lift : ∀ s : Fan f, s.pt ⟶ t.pt)
    (fac : ∀ (s : Fan f) (j : β), lift s ≫ t.proj j = s.proj j := by aesop_cat)
    (uniq : ∀ (s : Fan f) (m : s.pt ⟶ t.pt) (_ : ∀ j : β, m ≫ t.proj j = s.proj j),
      m = lift s := by aesop_cat) :
    IsLimit t

(lift : (s : CategoryTheory.Limits.Fan f) → s.pt ⟶ t.pt)

(fac : ∀ (s : CategoryTheory.Limits.Fan f) (j : β), lift s ≫ t.proj j = s.proj j := by aesop_cat)

(uniq : ∀ (s : CategoryTheory.Limits.Fan f) (m : s.pt ⟶ t.pt), (∀ (j : β), m ≫ t.proj j = s.proj j) → m = lift s := by
  aesop_cat)

(CategoryTheory.Limits.mkFanLimit t lift fac uniq).lift s = lift s


@[simp]
theorem tendsto_comp_coe_Ioo_atTop (h : a < b) :
    Tendsto (fun x : Ioo a b => f x) atTop l ↔ Tendsto f (𝓝[<] b) l

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
{l : Filter β}
{f : α → β}
(h : a < b)

Filter.Tendsto (fun x => f ↑x) Filter.atTop l ↔ Filter.Tendsto f (𝓝[<] b) l


/-- **Rearrangement Inequality**: Pointwise scalar multiplication of `f` and `g` is maximized when
`f` and `g` monovary together. Stated by permuting the entries of `f`. -/
theorem MonovaryOn.sum_comp_perm_smul_le_sum_smul (hfg : MonovaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) : ∑ i ∈ s, f (σ i) • g i ≤ ∑ i ∈ s, f i • g i

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


protected theorem LocallyIntegrableOn.neg (hf : LocallyIntegrableOn f s μ) :
    LocallyIntegrableOn (-f) s μ

(hf : MeasureTheory.LocallyIntegrableOn f s μ)

MeasureTheory.LocallyIntegrableOn (-f) s μ


lemma ciSup_eq_ite {p : Prop} [Decidable p] {f : p → α} :
    (⨆ h : p, f h) = if h : p then f h else sSup (∅ : Set α)

{α : Type u_1}
[ConditionallyCompleteLattice α]
{p : Prop}
[Decidable p]
{f : p → α}

⨆ (h : p), f h = if h : p then f h else sSup ∅


theorem trans {a o o' : Ordinal.{u}} {f : ∀ b < o, Ordinal.{u}} (hf : IsFundamentalSequence a o f)
    {g : ∀ b < o', Ordinal.{u}} (hg : IsFundamentalSequence o o' g) :
    IsFundamentalSequence a o' fun i hi =>
      f (g i hi) (by rw [← hg.2.2]; apply lt_blsub)

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

{g : (b : Ordinal.{u}) → b < o' → Ordinal.{u}}

a.IsFundamentalSequence o' fun i hi => f (g i hi) ⋯


/-- **Intermediate Value Theorem** for continuous functions on closed intervals, case
`f a ≤ t ≤ f b`. -/
theorem intermediate_value_Icc {a b : α} (hab : a ≤ b) {f : α → δ} (hf : ContinuousOn f (Icc a b)) :
    Icc (f a) (f b) ⊆ f '' Icc a b

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{δ : Type u_1}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderClosedTopology δ]
{a b : α}
(hab : a ≤ b)
{f : α → δ}
(hf : ContinuousOn f (Set.Icc a b))


@[simp]
theorem equalizer.fork_π_app_zero : (equalizer.fork f g).π.app zero = equalizer.ι f g

(CategoryTheory.Limits.equalizer.fork f g).π.app CategoryTheory.Limits.WalkingParallelPair.zero =
  CategoryTheory.Limits.equalizer.ι f g


theorem comap_iSup_map_of_injective (S : ι → L.Substructure M) :
    (⨆ i, (S i).map f).comap f = iSup S

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

FirstOrder.Language.Substructure.comap f (⨆ i, FirstOrder.Language.Substructure.map f (S i)) = iSup S


@[to_additive (attr := simp)]
lemma UniformFun.toFun_div [Div β] (f g : α →ᵤ β) : toFun (f / g) = toFun f / toFun g

{α : Type u_1}
{β : Type u_2}
[Sub β]
(f g : α →ᵤ β)

UniformFun.toFun (f - g) = UniformFun.toFun f - UniformFun.toFun g


@[simp]
theorem isRefl_zero : (0 : BilinForm R M).IsRefl

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


@[simp] theorem run_map [Monad m] (f : α → β) (x : ReaderT ρ m α) (ctx : ρ)
    : (f <$> x).run ctx = f <$> x.run ctx

{m : Type u_1 → Type u_2}
{α β ρ : Type u_1}
[Monad m]
(f : α → β)
(x : ReaderT ρ m α)
(ctx : ρ)


@[to_additive]
lemma prod_map_le_prod_map {s : Multiset ι} (f : ι → α) (g : ι → α) (h : ∀ i, i ∈ s → f i ≤ g i) :
    (s.map f).prod ≤ (s.map g).prod

{ι : Type u_1}
{α : Type u_2}
[OrderedCommMonoid α]
{s : Multiset ι}
(f g : ι → α)
(h : ∀ i ∈ s, f i ≤ g i)

(Multiset.map f s).prod ≤ (Multiset.map g s).prod


@[simp]
protected theorem coe_coe {F : Type*} [FunLike F A B] [AlgHomClass F R A B] (f : F) :
    ⇑(f : A →ₐ[R] B) = f

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
{F : Type u_1}
[FunLike F A B]
[AlgHomClass F R A B]
(f : F)


@[ext]
theorem Algebra.ext {S : Type u} {A : Type v} [CommSemiring S] [Semiring A] (h1 h2 : Algebra S A)
    (h : ∀ (r : S) (x : A), (by have I := h1; exact r • x) = r • x) : h1 = h2

(h :
  ∀ (r : S) (x : A),
    (let_fun I := h1;
      r • x) =
      r • x)


/-- The surjective algebra morphism `R[X]/(minpoly R x) → R[x]`.
If `R` is a integrally closed domain and `x` is integral, this is an isomorphism,
see `minpoly.equivAdjoin`. -/
@[simps!]
def Minpoly.toAdjoin : AdjoinRoot (minpoly R x) →ₐ[R] adjoin R ({x} : Set S)

(R : Type u)
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(x : S)

∀ (a : R[X] ⧸ Submodule.toAddSubgroup (Ideal.span {minpoly R x})),
  (AdjoinRoot.Minpoly.toAdjoin R x) a =
    (QuotientAddGroup.lift (Submodule.toAddSubgroup (Ideal.span {minpoly R x}))
        ↑(Polynomial.eval₂RingHom (algebraMap R ↥(Algebra.adjoin R {x})) ⟨x, ⋯⟩) ⋯)
      a


theorem isCoseparator_iff_faithful_preadditiveYonedaObj (G : C) :
    IsCoseparator G ↔ (preadditiveYonedaObj G).Faithful

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

CategoryTheory.IsCoseparator G ↔ (CategoryTheory.preadditiveYonedaObj G).Faithful


theorem filter_map {p : β → Prop} [DecidablePred p] :
    (s.map f).filter p = (s.filter (p ∘ f)).map f

{α : Type u_1}
{β : Type u_2}
{f : α ↪ β}
{s : Finset α}
{p : β → Prop}
[DecidablePred p]

Finset.filter p (Finset.map f s) = Finset.map f (Finset.filter (p ∘ ⇑f) s)


theorem add_nonnneg_iff_neg_le (a b : Int) : 0 ≤ a + b ↔ -b ≤ a


theorem card_Ici : (Ici a).card = ∏ i, (Ici (a i)).card

{ι : Type u_1}
{α : ι → Type u_2}
[Fintype ι]
[DecidableEq ι]
[(i : ι) → DecidableEq (α i)]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → LocallyFiniteOrderTop (α i)]
(a : (i : ι) → α i)

(Finset.Ici a).card = ∏ i : ι, (Finset.Ici (a i)).card


theorem liftRel_destruct {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t → Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)

{α : Type u}
{β : Type v}
{R : α → β → Prop}
{s : Stream'.WSeq α}
{t : Stream'.WSeq β}

Stream'.WSeq.LiftRel R s t →
  Computation.LiftRel (Stream'.WSeq.LiftRelO R (Stream'.WSeq.LiftRel R)) s.destruct t.destruct


/-- `Prod.RProd` is a subrelation of the transitive closure of `Prod.GameAdd`. -/
theorem rprod_le_transGen_gameAdd : RProd rα rβ ≤ Relation.TransGen (GameAdd rα rβ)

{α : Type u_1}
{β : Type u_2}
(rα : α → α → Prop)
(rβ : β → β → Prop)

Prod.RProd rα rβ ≤ Relation.TransGen (Prod.GameAdd rα rβ)


theorem liftPropAt_of_mem_groupoid (hG : G.LocalInvariantProp G Q) (hQ : ∀ y, Q id univ y)
    {f : PartialHomeomorph H H} (hf : f ∈ G) {x : H} (hx : x ∈ f.source) : LiftPropAt Q f x

{H : Type u_1}
[TopologicalSpace H]
{G : StructureGroupoid H}
{Q : (H → H) → Set H → H → Prop}
(hG : G.LocalInvariantProp G Q)
(hQ : ∀ (y : H), Q id Set.univ y)
{f : PartialHomeomorph H H}
(hf : f ∈ G)
{x : H}
(hx : x ∈ f.source)


@[simp, norm_cast]
theorem coe_eq_univ : (s : Set α) = Set.univ ↔ s = univ

{α : Type u_1}
[Fintype α]
{s : Finset α}


theorem foldr_strictMono [Preorder β] {f : α → β → β} (H : ∀ a, StrictMono (f a)) (l : List α) :
    StrictMono fun b ↦ l.foldr f b

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β → β}
(H : ∀ (a : α), StrictMono (f a))
(l : List α)


@[fun_prop]
nonrec theorem ContinuousAt.zpow₀ (hf : ContinuousAt f a) (m : ℤ) (h : f a ≠ 0 ∨ 0 ≤ m) :
    ContinuousAt (fun x => f x ^ m) a

{G₀ : Type u_3}
[GroupWithZero G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
[ContinuousMul G₀]
{X : Type u_4}
[TopologicalSpace X]
{a : X}
{f : X → G₀}
(hf : ContinuousAt f a)
(m : ℤ)
(h : f a ≠ 0 ∨ 0 ≤ m)


/-- The order isomorphism between the factors of `mk m` and the factors of `mk n` induced by a
  bijection between the factors of `m` and the factors of `n` that preserves `∣`. -/
@[simps]
def mkFactorOrderIsoOfFactorDvdEquiv {m : M} {n : N} {d : { l : M // l ∣ m } ≃ { l : N // l ∣ n }}
    (hd : ∀ l l', (d l : N) ∣ d l' ↔ (l : M) ∣ (l' : M)) :
    Set.Iic (Associates.mk m) ≃o Set.Iic (Associates.mk n)

(hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l')

↑((RelIso.symm (mkFactorOrderIsoOfFactorDvdEquiv hd)) l) = Associates.mk ↑(d.symm ⟨associatesEquivOfUniqueUnits ↑l, ⋯⟩)


@[simp]
theorem bddAbove_empty [Nonempty α] : BddAbove (∅ : Set α)


/-- If the index type has cardinality equal to the finite dimension, an orientation equals the
negation of another orientation if and only if they are not equal. -/
theorem ne_iff_eq_neg (x₁ x₂ : Orientation R M ι) (h : Fintype.card ι = finrank R M) :
    x₁ ≠ x₂ ↔ x₁ = -x₂

(h : Fintype.card ι = FiniteDimensional.finrank R M)

x₁ ≠ x₂ ↔ x₁ = -x₂


theorem uniformSpace_eq_inf_precomp_of_cover {δ₁ δ₂ : Type*} [TopologicalSpace δ₁]
    [TopologicalSpace δ₂] (φ₁ : C(δ₁, α)) (φ₂ : C(δ₂, α)) (h_proper₁ : IsProperMap φ₁)
    (h_proper₂ : IsProperMap φ₂) (h_cover : range φ₁ ∪ range φ₂ = univ) :
    (inferInstanceAs <| UniformSpace C(α, β)) =
      .comap (comp · φ₁) inferInstance ⊓
      .comap (comp · φ₂) inferInstance

(h_cover : Set.range ⇑φ₁ ∪ Set.range ⇑φ₂ = Set.univ)

inferInstanceAs (UniformSpace C(α, β)) =
  UniformSpace.comap (fun x => x.comp φ₁) inferInstance ⊓ UniformSpace.comap (fun x => x.comp φ₂) inferInstance


@[simp]
theorem reverse_ι (m : M) : reverse (ι Q m) = ι Q m

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(m : M)

CliffordAlgebra.reverse ((CliffordAlgebra.ι Q) m) = (CliffordAlgebra.ι Q) m


@[to_additive (attr := simp)]
theorem relindex_top_right : H.relindex ⊤ = H.index

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


@[simp] theorem mk_empty : (⟨∅, isOpen_empty⟩ : Opens α) = ⊥


/-- If a function is continuous at every point of a compact set `k`, then it is bounded on
some open neighborhood of `k`. -/
theorem exists_isOpen_isBounded_image_of_isCompact_of_forall_continuousAt [TopologicalSpace β]
    {k : Set β} {f : β → α} (hk : IsCompact k) (hf : ∀ x ∈ k, ContinuousAt f x) :
    ∃ t, k ⊆ t ∧ IsOpen t ∧ IsBounded (f '' t)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[TopologicalSpace β]
{k : Set β}
{f : β → α}
(hk : IsCompact k)
(hf : ∀ x ∈ k, ContinuousAt f x)

∃ t, k ⊆ t ∧ IsOpen t ∧ Bornology.IsBounded (f '' t)


theorem wSameSide_lineMap_left {s : AffineSubspace R P} {x : P} (y : P) (h : x ∈ s) {t : R}
    (ht : 0 ≤ t) : s.WSameSide (lineMap x y t) 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 : P}
(y : P)
(h : x ∈ s)
{t : R}
(ht : 0 ≤ t)

s.WSameSide ((AffineMap.lineMap x y) t) y


@[to_additive (attr := simp)]
theorem mem_map {f : M →ₙ* N} {S : Subsemigroup M} {y : N} : y ∈ S.map f ↔ ∃ x ∈ S, f x = y

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{f : AddHom M N}
{S : AddSubsemigroup M}
{y : N}

y ∈ AddSubsemigroup.map f S ↔ ∃ x ∈ S, f x = y


@[simp, mfld_simps]
theorem preimage_symm_proj_inter (s : Set B) :
    e.toPartialEquiv.symm ⁻¹' (proj ⁻¹' s) ∩ e.baseSet ×ˢ univ = (s ∩ e.baseSet) ×ˢ univ

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
(e : Pretrivialization F proj)
(s : Set B)

↑e.symm ⁻¹' (proj ⁻¹' s) ∩ e.baseSet ×ˢ Set.univ = (s ∩ e.baseSet) ×ˢ Set.univ


theorem bind_assoc {γ} (f : Part α) (g : α → Part β) (k : β → Part γ) :
    (f.bind g).bind k = f.bind fun x => (g x).bind k

{α : Type u_1}
{β : Type u_2}
{γ : Type u_4}
(f : Part α)
(g : α → Part β)
(k : β → Part γ)


theorem isClopen_range_inl : IsClopen (range (Sum.inl : X → X ⊕ Y))

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]


lemma l2_opNNNorm_mul (A : Matrix m n 𝕜) (B : Matrix n l 𝕜) : ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊

{𝕜 : Type u_1}
{m : Type u_2}
{n : Type u_3}
{l : Type u_4}
[RCLike 𝕜]
[Fintype m]
[Fintype n]
[DecidableEq n]
[Fintype l]
[DecidableEq l]
(A : Matrix m n 𝕜)
(B : Matrix n l 𝕜)

‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊


theorem prod {ι : Type*} (s : Finset ι) (φ : ι → MvPolynomial σ R) (n : ι → ℕ)
    (h : ∀ i ∈ s, IsHomogeneous (φ i) (n i)) : IsHomogeneous (∏ i ∈ s, φ i) (∑ i ∈ s, n i)

(h : ∀ i ∈ s, (φ i).IsHomogeneous (n i))

(∏ i ∈ s, φ i).IsHomogeneous (∑ i ∈ s, n i)


theorem toLinearEquiv_injective : Function.Injective (toLinearEquiv : _ → A₁ ≃ₗ[R] A₂)

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]


theorem normalizeIsoApp_eq :
    ∀ (X : F C) (n : N C), normalizeIsoApp C X n = normalizeIsoApp' C X n.as

(X : CategoryTheory.FreeMonoidalCategory C)

(n : (CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C)

CategoryTheory.FreeMonoidalCategory.normalizeIsoApp C X n =
  CategoryTheory.FreeMonoidalCategory.normalizeIsoApp' C X n.as


theorem mem_support_finset_sum [AddCommMonoid M] {s : Finset ι} {h : ι → α →₀ M} (a : α)
    (ha : a ∈ (∑ c ∈ s, h c).support) : ∃ c ∈ s, a ∈ (h c).support

{α : Type u_1}
{ι : Type u_4}
{M : Type u_5}
[AddCommMonoid M]
{s : Finset ι}
{h : ι → α →₀ M}
(a : α)
(ha : a ∈ (∑ c ∈ s, h c).support)


theorem comp {g : F → G} (hg : IsBoundedLinearMap 𝕜 g) (hf : IsBoundedLinearMap 𝕜 f) :
    IsBoundedLinearMap 𝕜 (g ∘ f)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E → F}
{g : F → G}
(hg : IsBoundedLinearMap 𝕜 g)
(hf : IsBoundedLinearMap 𝕜 f)


lemma toMvPolynomial_totalDegree_le (f : M₁ →ₗ[R] M₂) (i : ι₂) :
    (f.toMvPolynomial b₁ b₂ i).totalDegree ≤ 1

{R : Type u_1}
{M₁ : Type u_2}
{M₂ : Type u_3}
{ι₁ : Type u_4}
{ι₂ : Type u_5}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
[Fintype ι₁]
[Finite ι₂]
[DecidableEq ι₁]
(b₁ : Basis ι₁ R M₁)
(b₂ : Basis ι₂ R M₂)
(f : M₁ →ₗ[R] M₂)
(i : ι₂)

(LinearMap.toMvPolynomial b₁ b₂ f i).totalDegree ≤ 1


lemma cons {r : R} {rs : List R} (h1 : IsSMulRegular M r)
    (h2 : IsRegular (QuotSMulTop r M) rs) : IsRegular M (r :: rs)

(h2 : RingTheory.Sequence.IsRegular (QuotSMulTop r M) rs)

RingTheory.Sequence.IsRegular M (r :: rs)


theorem iff_card [Fact p.Prime] [Finite G] : IsPGroup p G ↔ ∃ n : ℕ, Nat.card G = p ^ n

{p : ℕ}
{G : Type u_1}
[Group G]
[Fact (Nat.Prime p)]
[Finite G]


theorem iUnion_union_distrib (s : ι → Set β) (t : ι → Set β) :
    ⋃ i, s i ∪ t i = (⋃ i, s i) ∪ ⋃ i, t i

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


@[simp]
theorem cokernelIsoOfEq_refl {h : f = f} : cokernelIsoOfEq h = Iso.refl (cokernel f)

CategoryTheory.Limits.cokernelIsoOfEq h = CategoryTheory.Iso.refl (CategoryTheory.Limits.cokernel f)


@[simp]
lemma dual_eq_zero_iff :
    dual A K I = 0 ↔ I = 0

{A : Type u_1}
{K : Type u_2}
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsDomain A]
[IsFractionRing A K]
[IsIntegralClosure B A L]
[IsFractionRing B L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
[IsDedekindDomain B]
{I : FractionalIdeal B⁰ L}


@[simp]
lemma matPolyEquiv_map_smul (p : R[X]) (M : Matrix n n R[X]) :
    matPolyEquiv (p • M) = p.map (algebraMap _ _) * matPolyEquiv M

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

matPolyEquiv (p • M) = Polynomial.map (algebraMap R (Matrix n n R)) p * matPolyEquiv M


theorem LiftRel.refl (R : α → α → Prop) (H : Reflexive R) : Reflexive (LiftRel R)

{α : Type u}
(R : α → α → Prop)
(H : Reflexive R)


theorem HeapNode.WF.toHeap {s : HeapNode α} (h : s.WF le a n) : s.toHeap.WF le 0

{s : Batteries.BinomialHeap.Imp.HeapNode α}

(h : Batteries.BinomialHeap.Imp.HeapNode.WF le a s n)

Batteries.BinomialHeap.Imp.Heap.WF le 0 s.toHeap


/-- A block containing `a` is the orbit of `a` under its stabilizer -/
theorem IsBlock.orbit_stabilizer_eq
    [htGX : IsPretransitive G X] {B : Set X} (hB : IsBlock G B) {a : X} (ha : a ∈ B) :
    MulAction.orbit (stabilizer G B) a = B

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
[htGX : MulAction.IsPretransitive G X]
{B : Set X}
(hB : MulAction.IsBlock G B)
{a : X}
(ha : a ∈ B)

MulAction.orbit (↥(MulAction.stabilizer G B)) a = B


@[to_additive (attr := simp)]
theorem prod_zero : @prod α _ 0 = 1


@[simp]
theorem mem_assert_iff {p : Prop} {f : p → Part α} {a} : a ∈ assert p f ↔ ∃ h : p, a ∈ f h

{α : Type u_1}
{p : Prop}
{f : p → Part α}
{a : α}

a ∈ Part.assert p f ↔ ∃ (h : p), a ∈ f h


lemma map_polynomial : (W.map f).toAffine.polynomial = W.polynomial.map (mapRingHom f)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
{S : Type v}
[CommRing S]
(f : R →+* S)

(WeierstrassCurve.map W f).toAffine.polynomial = Polynomial.map (Polynomial.mapRingHom f) W.polynomial


theorem sqrt_mul_self_eq_abs (x : ℝ) : √(x * x) = |x|


/-- A specialized ext lemma for equality of sigma types over an indexed subtype. -/
@[ext]
theorem subtype_ext {β : Type*} {p : α → β → Prop} :
    ∀ {x₀ x₁ : Σa, Subtype (p a)}, x₀.fst = x₁.fst → (x₀.snd : β) = x₁.snd → x₀ = x₁

{α : Type u_1}
{β : Type u_7}
{p : α → β → Prop}
{x₀ x₁ : (a : α) × Subtype (p a)}

x₀.fst = x₁.fst → x₀.snd.val = x₁.snd.val → x₀ = x₁


/-- A Lie subalgebra of a Noetherian Lie algebra is nilpotent
if it is contained in the Engel subalgebra of all its elements. -/
lemma isNilpotent_of_forall_le_engel [IsNoetherian R L]
    (H : LieSubalgebra R L) (h : ∀ x ∈ H, H ≤ engel R x) :
    LieAlgebra.IsNilpotent R H

(h : ∀ x ∈ H, H ≤ LieSubalgebra.engel R x)


/-- When `α` is compact, the bounded continuous maps `α →ᵇ β` are
equivalent to `C(α, β)`.
-/
@[simps (config := .asFn)]
def equivBoundedOfCompact : C(α, β) ≃ (α →ᵇ β)

(α : Type u_1)
(β : Type u_2)
[TopologicalSpace α]
[CompactSpace α]
[MetricSpace β]

⇑(ContinuousMap.equivBoundedOfCompact α β).symm = BoundedContinuousFunction.toContinuousMap


@[simp]
theorem coe_prod (f : M [⋀^ι]→ₗ[R] N) (g : M [⋀^ι]→ₗ[R] P) :
    (f.prod g : MultilinearMap R (fun _ : ι => M) (N × P)) = MultilinearMap.prod f g

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{P : Type u_4}
[AddCommMonoid P]
[Module R P]
{ι : Type u_7}
(f : M [⋀^ι]→ₗ[R] N)
(g : M [⋀^ι]→ₗ[R] P)


theorem MDifferentiable.prod_mk {f : M → M'} {g : M → M''} (hf : MDifferentiable I I' f)
    (hg : MDifferentiable I I'' g) : MDifferentiable I (I'.prod I'') fun x => (f x, g x)

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


/-- `Equiv.mulRight₀` as an `OrderIso` on a `LinearOrderedCommGroupWithZero.`.

Note that `OrderIso.mulRight₀` refers to the `LinearOrderedField` version. -/
@[simps! (config := { simpRhs := true }) apply toEquiv]
def OrderIso.mulRight₀' {a : α} (ha : a ≠ 0) : α ≃o α

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a : α}
(ha : a ≠ 0)
(x : α)


/-- An `n`-dimensional `InnerProductSpace` equipped with a decomposition as an internal direct
sum has an orthonormal basis indexed by `Fin n` and subordinate to that direct sum. This function
provides the mapping by which it is subordinate. -/
irreducible_def DirectSum.IsInternal.subordinateOrthonormalBasisIndex (a : Fin n)
    (hV' : OrthogonalFamily 𝕜 (fun i => V i) fun i => (V i).subtypeₗᵢ) : ι

(hn : FiniteDimensional.finrank 𝕜 E = n)

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

DirectSum.IsInternal.subordinateOrthonormalBasisIndex hn hV a hV' =
  ((DirectSum.IsInternal.sigmaOrthonormalBasisIndexEquiv hn hV hV').symm a).fst


/-- Any finite collection of objects in a filtered category has an object "to the right".
-/
theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.IsFiltered C]
(O : Finset C)

∃ S, ∀ {X : C}, X ∈ O → Nonempty (X ⟶ S)


theorem IsMatching.even_card [Fintype M.verts] (h : M.IsMatching) : Even M.verts.toFinset.card

{V : Type u_1}
{G : SimpleGraph V}
{M : G.Subgraph}
[Fintype ↑M.verts]
(h : M.IsMatching)


theorem map_sub_le_max : f (x - y) ≤ max (f x) (f y)

{E : Type u_4}
{F : Type u_5}
[AddGroup E]
[FunLike F E ℝ]
[NonarchAddGroupSeminormClass F E]
(f : F)
(x y : E)


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

{G : Type v}
[Group G]
[PseudoMetricSpace G]
[IsometricSMul G G]
(a b : G)
(r : ℝ)

(fun x => a * x) ⁻¹' Metric.closedBall b r = Metric.closedBall (a⁻¹ * b) r


/-- Pull back an `I`-indexed family of objects to a `J`-indexed family, along a function `J → I`.
-/
@[simps]
def comap (h : J → I) : (∀ i, C i) ⥤ (∀ j, C (h j))

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

(CategoryTheory.Pi.comap C h).obj f i = f (h i)


lemma mul_self_le_mul_self_of_le_of_neg_le
    [MulPosMono α] [PosMulMono α] [CovariantClass α α (· + ·) (· ≤ ·)]
    (h₁ : a ≤ b) (h₂ : -a ≤ b) : a * a ≤ b * b

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


protected theorem map_smulₛₗ (c : R) (x : M) : e (c • x) = (σ : R → S) c • e x

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_S_M₂ : Module S M₂}
{σ : R →+* S}
{σ' : S →+* R}
{re₁ : RingHomInvPair σ σ'}
{re₂ : RingHomInvPair σ' σ}
(e : M ≃ₛₗ[σ] M₂)
(c : R)
(x : M)


@[simp]
theorem aeval_X (s : σ) : aeval f (X s : MvPolynomial _ R) = f s

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
[Algebra R S₁]
(f : σ → S₁)
(s : σ)

(MvPolynomial.aeval f) (MvPolynomial.X s) = f s


theorem forall_mem_insert {P : α → Prop} {a : α} {s : Set α} :
    (∀ x ∈ insert a s, P x) ↔ P a ∧ ∀ x ∈ s, P x

{α : Type u}
{P : α → Prop}
{a : α}
{s : Set α}


@[simp] lemma predAbove_zero_of_ne_zero [NeZero n] {i : Fin (n + 1)} (hi : i ≠ 0) :
    predAbove 0 i = i.pred hi

{n : ℕ}
[NeZero n]
{i : Fin (n + 1)}
(hi : i ≠ 0)


theorem LinearIsometry.im_apply_eq_im {f : ℂ →ₗᵢ[ℝ] ℂ} (h : f 1 = 1) (z : ℂ) :
    z + conj z = f z + conj (f z)

z + (starRingEnd ℂ) z = f z + (starRingEnd ℂ) (f z)


theorem Encoding.encode_injective {α : Type u} (e : Encoding α) : Function.Injective e.encode

{α : Type u}
(e : Computability.Encoding α)


@[to_additive (attr := simp)]
theorem ker_one : (1 : G →* M).ker = ⊤

{G : Type u_1}
[AddGroup G]
{M : Type u_7}
[AddZeroClass M]


@[simp, norm_cast]
theorem coe_eq_empty : (s : Set α) = ∅ ↔ s = ⊤

↑s = ∅ ↔ s = ⊤


@[to_additive]
lemma isSquare_op_iff {a : α} : IsSquare (op a) ↔ IsSquare a

IsSquare (MulOpposite.op a) ↔ IsSquare a


/-- An `M : IndepMatroid α` gives a `Matroid α` whose bases are the maximal `M`-independent sets. -/
@[simps] protected def matroid (M : IndepMatroid α) : Matroid α


@[simp]
theorem R_mul {G : Type*} [Semigroup G] [TopologicalSpace G] [ChartedSpace H G] [SmoothMul I G]
    (g h : G) : 𝑹 I (g * h) = (𝑹 I h).comp (𝑹 I g)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(I : ModelWithCorners 𝕜 E H)
{G : Type u_8}
[Semigroup G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
(g h : G)

smoothRightMul I (g * h) = (smoothRightMul I h).comp (smoothRightMul I g)


@[to_additive]
theorem _root_.Group.mulRight_bijective (a : G) : Function.Bijective (· * a)


@[simp]
theorem leadingCoeff_X_pow_sub_one {n : ℕ} (hn : 0 < n) : (X ^ n - 1 : R[X]).leadingCoeff = 1

{R : Type u}
[Ring R]
{n : ℕ}
(hn : 0 < n)


/-- A version of the layer cake formula for bounded continuous functions and finite measures:
∫ f dμ = ∫ t in (0, ‖f‖], μ {x | f(x) ≥ t} dt. -/
lemma BoundedContinuousFunction.integral_eq_integral_meas_le
    {α : Type*} [MeasurableSpace α] [TopologicalSpace α] [OpensMeasurableSpace α]
    (f : α →ᵇ ℝ) (μ : Measure α) [IsFiniteMeasure μ] (f_nn : 0 ≤ᵐ[μ] f) :
    ∫ ω, f ω ∂μ = ∫ t in Ioc 0 ‖f‖, ENNReal.toReal (μ {a : α | t ≤ f a})

{α : Type u_3}
[MeasurableSpace α]
[TopologicalSpace α]
[OpensMeasurableSpace α]
(f : BoundedContinuousFunction α ℝ)
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure μ]
(f_nn : 0 ≤ᵐ[μ] ⇑f)

∫ (ω : α), f ω ∂μ = ∫ (t : ℝ) in Set.Ioc 0 ‖f‖, (μ {a | t ≤ f a}).toReal


theorem neg (hφ : IsHomogeneous φ n) : IsHomogeneous (-φ) n

{R : Type u_5}
{σ : Type u_6}
[CommRing R]
{φ : MvPolynomial σ R}
{n : ℕ}
(hφ : φ.IsHomogeneous n)


/-- Linear equivalence between vectors in `M² = Fin 2 → M` and `M × M`. -/
@[simps! (config := .asFn)]
def finTwoArrow : (Fin 2 → M) ≃ₗ[R] M × M

(R : Type u)
(M : Type v)
[Semiring R]
[AddCommMonoid M]
[Module R M]

⇑(LinearEquiv.finTwoArrow R M) = fun f => (f 0, f 1)


@[norm_cast]
theorem coe_multiset_sum (s : Multiset ℝ≥0) : ((s.sum : ℝ≥0) : ℝ) = (s.map (↑)).sum

↑s.sum = (Multiset.map NNReal.toReal s).sum


/-- The inner content of a union of sets is at most the sum of the individual inner contents.
  This is the "unbundled" version of `innerContent_iSup_nat`.
  It is required for the API of `inducedOuterMeasure`. -/
theorem innerContent_iUnion_nat [R1Space G] ⦃U : ℕ → Set G⦄
    (hU : ∀ i : ℕ, IsOpen (U i)) :
    μ.innerContent ⟨⋃ i : ℕ, U i, isOpen_iUnion hU⟩ ≤ ∑' i : ℕ, μ.innerContent ⟨U i, hU i⟩

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
[R1Space G]
⦃U : ℕ → Set G⦄
(hU : ∀ (i : ℕ), IsOpen (U i))

μ.innerContent { carrier := ⋃ i, U i, is_open' := ⋯ } ≤ ∑' (i : ℕ), μ.innerContent { carrier := U i, is_open' := ⋯ }


@[to_additive (attr := simp)]
theorem freeGroupCongr_refl : freeGroupCongr (Equiv.refl α) = MulEquiv.refl _

FreeAddGroup.freeAddGroupCongr (Equiv.refl α) = AddEquiv.refl (FreeAddGroup α)


@[to_additive]
theorem coe_smul {α M : Type*} [MulOneClass M] [SMul α M] [IsScalarTower α M M] (c : Con M)
    (a : α) (x : M) : (↑(a • x) : c.Quotient) = a • (x : c.Quotient)

{α : Type u_4}
{M : Type u_5}
[AddZeroClass M]
[VAdd α M]
[VAddAssocClass α M M]
(c : AddCon M)
(a : α)
(x : M)


@[fun_prop]
theorem DifferentiableWithinAt.mul (ha : DifferentiableWithinAt 𝕜 a s x)
    (hb : DifferentiableWithinAt 𝕜 b s x) : DifferentiableWithinAt 𝕜 (fun y => a y * b y) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s : Set E}
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a b : E → 𝔸}
(ha : DifferentiableWithinAt 𝕜 a s x)
(hb : DifferentiableWithinAt 𝕜 b s x)


theorem Algebra.coe_norm_int : (Algebra.norm ℤ x : ℚ) = Algebra.norm ℚ (x : K)

{K : Type u_1}
[Field K]
[NumberField K]
(x : 𝓞 K)

↑((Algebra.norm ℤ) x) = (Algebra.norm ℚ) ↑x


theorem tendsto_pure_pure (f : α → β) (a : α) : Tendsto f (pure a) (pure (f a))

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


@[to_additive sum_eq_zero_iff_of_nonpos]
theorem prod_eq_one_iff_of_le_one' :
    (∀ i ∈ s, f i ≤ 1) → ((∏ i ∈ s, f i) = 1 ↔ ∀ i ∈ s, f i = 1)

{ι : Type u_1}
{N : Type u_5}
[OrderedAddCommMonoid N]
{f : ι → N}
{s : Finset ι}

(∀ i ∈ s, f i ≤ 0) → (∑ i ∈ s, f i = 0 ↔ ∀ i ∈ s, f i = 0)


/-- Reversed version of **Fubini's Theorem** (symmetric version). -/
theorem integral_integral_symm {f : α → β → E} (hf : Integrable (uncurry f) (μ.prod ν)) :
    ∫ x, ∫ y, f x y ∂ν ∂μ = ∫ z, f z.2 z.1 ∂ν.prod μ

(hf : MeasureTheory.Integrable (Function.uncurry f) (μ.prod ν))

∫ (x : α), ∫ (y : β), f x y ∂ν ∂μ = ∫ (z : β × α), f z.2 z.1 ∂ν.prod μ


theorem IsClosed.measurableSet (h : IsClosed s) : MeasurableSet s

{α : Type u_1}
{s : Set α}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
(h : IsClosed s)


lemma map_iso_commute (g : M₀ →ₗ[R] M₁) : (map S f₀ f₁) g ∘ₗ (iso S f₀) =
    (iso S f₁) ∘ₗ (map S (mkLinearMap S M₀) (mkLinearMap S M₁)) g

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M₀ : Type u_6}
{M₀' : Type u_9}
[AddCommGroup M₀]
[AddCommGroup M₀']
[Module R M₀]
[Module R M₀']
(f₀ : M₀ →ₗ[R] M₀')
[IsLocalizedModule S f₀]
{M₁ : Type u_7}
{M₁' : Type u_8}
[AddCommGroup M₁]
[AddCommGroup M₁']
[Module R M₁]
[Module R M₁']
(f₁ : M₁ →ₗ[R] M₁')
[IsLocalizedModule S f₁]
(g : M₀ →ₗ[R] M₁)

(IsLocalizedModule.map S f₀ f₁) g ∘ₗ ↑(IsLocalizedModule.iso S f₀) =
  ↑(IsLocalizedModule.iso S f₁) ∘ₗ
    (IsLocalizedModule.map S (LocalizedModule.mkLinearMap S M₀) (LocalizedModule.mkLinearMap S M₁)) g


@[simp]
theorem star_univ [Star α] : (univ : Set α)⋆ = univ


@[simp] protected theorem not_lt {a b : Nat} : ¬ a < b ↔ b ≤ a


theorem condCount_univ [Fintype Ω] {s : Set Ω} :
    condCount Set.univ s = Measure.count s / Fintype.card Ω

{Ω : Type u_1}
[MeasurableSpace Ω]
[Fintype Ω]
{s : Set Ω}

(ProbabilityTheory.condCount Set.univ) s = MeasureTheory.Measure.count s / ↑(Fintype.card Ω)


/-- A permutation `σ` equals `sort f` if and only if the map `i ↦ (f (σ i), σ i)` is
strictly monotone (w.r.t. the lexicographic ordering on the target). -/
theorem eq_sort_iff' : σ = sort f ↔ StrictMono (σ.trans <| graphEquiv₁ f)

{n : ℕ}
{α : Type u_1}
[LinearOrder α]
{f : Fin n → α}
{σ : Equiv.Perm (Fin n)}

σ = Tuple.sort f ↔ StrictMono ⇑(Equiv.trans σ (Tuple.graphEquiv₁ f))


lemma changeLevel_eq_cast_of_dvd {m : ℕ} (hm : n ∣ m) (a : Units (ZMod m)) :
    (changeLevel hm χ) a = χ (ZMod.cast (a : ZMod m))

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
(χ : DirichletCharacter R n)
{m : ℕ}
(hm : n ∣ m)
(a : (ZMod m)ˣ)

((DirichletCharacter.changeLevel hm) χ) ↑a = χ (↑a).cast


theorem nhds_compactOpen_eq_iInf_nhds_induced (f : C(X, Y)) :
    𝓝 f = ⨅ (s) (hs : IsCompact s), (𝓝 (f.restrict s)).comap (ContinuousMap.restrict s)

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(f : C(X, Y))

𝓝 f = ⨅ s, ⨅ (_ : IsCompact s), Filter.comap (ContinuousMap.restrict s) (𝓝 (ContinuousMap.restrict s f))


theorem strictConvex_Icc (r s : β) : StrictConvex 𝕜 (Icc r s)

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


theorem image_lowerBounds_subset_upperBounds_image (Hf : AntitoneOn f t) (Hst : s ⊆ t) :
    f '' (lowerBounds s ∩ t) ⊆ upperBounds (f '' s)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{s t : Set α}
(Hf : AntitoneOn f t)
(Hst : s ⊆ t)


protected theorem _root_.Inducing.firstCountableTopology {β : Type*}
    [TopologicalSpace β] [FirstCountableTopology β] {f : α → β} (hf : Inducing f) :
    FirstCountableTopology α

{α : Type u}
[t : TopologicalSpace α]
{β : Type u_1}
[TopologicalSpace β]
[FirstCountableTopology β]
{f : α → β}
(hf : Inducing f)


theorem smeval_ascPochhammer_neg_add (n : ℕ) : ∀ k : ℕ,
    smeval (ascPochhammer ℕ (n + k + 1)) (-n : ℤ) = 0

(ascPochhammer ℕ (n + k + 1)).smeval (-↑n) = 0


/-- If the submodule generated by a set `s` is dense in the ambient module, then two continuous
linear maps equal on `s` are equal. -/
theorem ext_on [T2Space M₂] {s : Set M₁} (hs : Dense (Submodule.span R₁ s : Set M₁))
    {f g : M₁ →SL[σ₁₂] M₂} (h : Set.EqOn f g s) : f = g

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
[T2Space M₂]
{s : Set M₁}
(hs : Dense ↑(Submodule.span R₁ s))
{f g : M₁ →SL[σ₁₂] M₂}
(h : Set.EqOn (⇑f) (⇑g) s)


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

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


lemma smul_def (q : ℚ≥0) (a : α) : q • a = q * a

{α : Type u_1}
[DivisionSemiring α]
(q : ℚ≥0)
(a : α)


theorem eq_of_subset_of_ncard_le (h : s ⊆ t) (h' : t.ncard ≤ s.ncard)
    (ht : t.Finite := by toFinite_tac) : s = t

{α : Type u_1}
{s t : Set α}
(h : s ⊆ t)
(h' : t.ncard ≤ s.ncard)
(ht : t.Finite := by toFinite_tac)


theorem isBigO_sub (x : E) :
    (fun x' => f (x' - x)) =O[l] fun x' => x' - x

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_5}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)
(l : Filter E)
(x : E)


theorem u_compact_support : HasCompactSupport (u : E → ℝ)

(E : Type u_1)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]


theorem wEquiv_map {α β : TypeVec n} (g : α ⟹ β) (x y : q.P.W α) :
    WEquiv x y → WEquiv (g <$$> x) (g <$$> y)

{n : ℕ}
{F : TypeVec.{u} (n + 1) → Type u}
[q : MvQPF F]
{α β : TypeVec.{u} n}
(g : α.Arrow β)
(x y : (MvQPF.P F).W α)

MvQPF.WEquiv x y → MvQPF.WEquiv (MvFunctor.map g x) (MvFunctor.map g y)


/-- A split mono which is epi is an iso. -/
theorem isIso_of_epi_of_isSplitMono {X Y : C} (f : X ⟶ Y) [IsSplitMono f] [Epi f] : IsIso f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
(f : X ⟶ Y)
[CategoryTheory.IsSplitMono f]
[CategoryTheory.Epi f]


lemma quasiIso_iff_isIso_descOpcycles (φ : S₁ ⟶ S₂)
    (hg₁ : S₁.g = 0) (hf₂ : S₂.f = 0) (hg₂ : S₂.g = 0) :
    QuasiIso φ ↔ IsIso (S₁.descOpcycles φ.τ₂ (by rw [← φ.comm₁₂, hf₂, comp_zero]))

CategoryTheory.ShortComplex.QuasiIso φ ↔ CategoryTheory.IsIso (S₁.descOpcycles φ.τ₂ ⋯)


theorem biUnion_eq_iUnion (s : Set α) (t : ∀ x ∈ s, Set β) :
    ⋃ x ∈ s, t x ‹_› = ⋃ x : s, t x x.2

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


theorem map_inv {R : Type*} [DivisionRing R] (v : Valuation R Γ₀) : ∀ x, v x⁻¹ = (v x)⁻¹

{Γ₀ : Type u_4}
[LinearOrderedCommGroupWithZero Γ₀]
{R : Type u_7}
[DivisionRing R]
(v : Valuation R Γ₀)
(x : R)


theorem T_zpow_width_invariant (N : ℕ) (k n : ℤ) (f : SlashInvariantForm (Gamma N) k) (z : ℍ) :
    f (((ModularGroup.T ^ (N * n))) • z) = f z

(f : SlashInvariantForm (CongruenceSubgroup.Gamma N) k)


lemma gaussianPDFReal_def (μ : ℝ) (v : ℝ≥0) :
    gaussianPDFReal μ v =
      fun x ↦ (Real.sqrt (2 * π * v))⁻¹ * rexp (- (x - μ)^2 / (2 * v))

ProbabilityTheory.gaussianPDFReal μ v = fun x => (√(2 * π * ↑v))⁻¹ * rexp (-(x - μ) ^ 2 / (2 * ↑v))


@[simp, norm_cast] lemma coe_sup (f g : C(α, β)) : ⇑(f ⊔ g) = ⇑f ⊔ g

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


theorem le_of_top_imp_top_of_toNNReal_le {a b : ℝ≥0∞} (h : a = ⊤ → b = ⊤)
    (h_nnreal : a ≠ ⊤ → b ≠ ⊤ → a.toNNReal ≤ b.toNNReal) : a ≤ b


@[to_additive] lemma isMulFreimanIso_id : IsMulFreimanIso n A A id

{α : Type u_2}
[AddCommMonoid α]
{A : Set α}
{n : ℕ}


@[to_additive (attr := simp)]
theorem smul_apply [SMul K β] (k : K) (f : α →ₛ β) (a : α) : (k • f) a = k • f a

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{K : Type u_5}
[SMul K β]
(k : K)
(f : MeasureTheory.SimpleFunc α β)
(a : α)


theorem add_bmod (a b : Int) (n : Nat) : (a + b).bmod n = (a.bmod n + b.bmod n).bmod n


lemma linfty_opNorm_eq_opNorm (A : Matrix m n α) :
    ‖A‖ = ‖ContinuousLinearMap.mk (Matrix.mulVecLin A)‖

{m : Type u_3}
{n : Type u_4}
{α : Type u_5}
[Fintype m]
[Fintype n]
[NontriviallyNormedField α]
[NormedAlgebra ℝ α]
(A : Matrix m n α)

‖A‖ = ‖{ toLinearMap := A.mulVecLin, cont := ⋯ }‖


/-- In a group of exponent two, every element is its own inverse. -/
@[to_additive]
lemma inv_eq_self_of_exponent_two (hG : Monoid.exponent G = 2) (x : G) :
    x⁻¹ = x

{G : Type u}
[AddGroup G]
(hG : AddMonoid.exponent G = 2)
(x : G)


theorem sign_coe_nonneg_of_nonneg_of_le_pi {θ : ℝ} (h0 : 0 ≤ θ) (hpi : θ ≤ π) :
    0 ≤ (θ : Angle).sign


@[simp]
lemma vecMul_fromColumns (B₁ : Matrix m n₁ R) (B₂ : Matrix m n₂ R) (v : m → R) :
    v ᵥ* fromColumns B₁ B₂ = Sum.elim (v ᵥ* B₁) (v ᵥ* B₂)

{R : Type u_1}
{m : Type u_2}
{n₁ : Type u_6}
{n₂ : Type u_7}
[Fintype m]
[Semiring R]
(B₁ : Matrix m n₁ R)
(B₂ : Matrix m n₂ R)
(v : m → R)

Matrix.vecMul v (B₁.fromColumns B₂) = Sum.elim (Matrix.vecMul v B₁) (Matrix.vecMul v B₂)


lemma one_le_thickenedIndicator_apply (X : Type _) [PseudoEMetricSpace X]
    {δ : ℝ} (δ_pos : 0 < δ) {F : Set X} {x : X} (hxF : x ∈ F) :
    1 ≤ thickenedIndicator δ_pos F x

(X : Type u_2)
[PseudoEMetricSpace X]
{δ : ℝ}
(δ_pos : 0 < δ)
{F : Set X}
{x : X}
(hxF : x ∈ F)


@[simp]
theorem mem_map {n : ℕ} {f : α → β} {b : β} {l : Sym α n} :
    b ∈ Sym.map f l ↔ ∃ a, a ∈ l ∧ f a = b

{α : Type u_1}
{β : Type u_2}
{n : ℕ}
{f : α → β}
{b : β}
{l : Sym α n}


@[to_additive (attr := ext)]
theorem ext {f g : LocalizationMap S N} (h : ∀ x, f.toMap x = g.toMap x) : f = g

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{f g : S.LocalizationMap N}
(h : ∀ (x : M), f.toMap x = g.toMap x)


/-- Two ring isomorphisms agree if they are defined by the
    same underlying function. -/
@[ext]
theorem ext {f g : R ≃+* S} (h : ∀ x, f x = g x) : f = g

{R : Type u_4}
{S : Type u_5}
[Mul R]
[Mul S]
[Add R]
[Add S]
{f g : R ≃+* S}
(h : ∀ (x : R), f x = g x)


theorem image_inter (s t : Set α) : r.image (s ∩ t) ⊆ r.image s ∩ r.image t

{α : Type u_1}
{β : Type u_2}
(r : Rel α β)
(s t : Set α)


theorem final_of_initial_op (F : C ⥤ D) [Initial F.op] : Final F

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


/-- Composition on the right as a `MonoidHom`. Similar to `MonoidHom.compHom'`. -/
@[to_additive (attr := simps)
      "Composition on the right as an `AddMonoidHom`. Similar to `AddMonoidHom.compHom'`."]
def compMonoidHom' {γ : Type*} [TopologicalSpace γ] [MulOneClass γ] [ContinuousMul γ]
    (g : C(α, β)) : C(β, γ) →* C(α, γ)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{γ : Type u_3}
[TopologicalSpace γ]
[AddZeroClass γ]
[ContinuousAdd γ]
(g : C(α, β))
(f : C(β, γ))


theorem isOpen_iff {s : Set (CofiniteTopology X)} : IsOpen s ↔ s.Nonempty → sᶜ.Finite

{X : Type u}
{s : Set (CofiniteTopology X)}


/-- The n-ary version of `Set.image_mul_prod`. -/
@[to_additive "The n-ary version of `Set.add_image_prod`. "]
theorem image_finset_prod_pi (l : Finset ι) (S : ι → Set α) :
    (fun f : ι → α => ∏ i ∈ l, f i) '' (l : Set ι).pi S = ∏ i ∈ l, S i

{ι : Type u_1}
{α : Type u_2}
[CommMonoid α]
(l : Finset ι)
(S : ι → Set α)

(fun f => ∏ i ∈ l, f i) '' (↑l).pi S = ∏ i ∈ l, S i


theorem mapM_eq_mapM_data [Monad m] [LawfulMonad m] (f : α → m β) (arr : Array α) :
    arr.mapM f = return mk (← arr.data.mapM f)

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
[LawfulMonad m]
(f : α → m β)
(arr : Array α)

Array.mapM f arr = do
  let __do_lift ← List.mapM f arr.data
  pure { data := __do_lift }


theorem Formula.isAtomic_graph (f : L.Functions n) : (Formula.graph f).IsAtomic

{L : FirstOrder.Language}
{n : ℕ}
(f : L.Functions n)


/-- An arrow of `S.pullback f` gives rise to an arrow of `S`. -/
@[simps]
def Arrow.base {f : Y ⟶ X} {S : J.Cover X} (I : (S.pullback f).Arrow) : S.Arrow

{J : CategoryTheory.GrothendieckTopology C}


/-- Let `f : ℕ → α → β` be a sequence of functions on a topological space. Suppose
that the family of sets `s n = {x | f (n + 1) x ≠ f n x}` is locally finite. Then there exists a
function `F :  α → β` such that for any `x`, for sufficiently large values of `n`, we have
`f n =ᶠ[𝓝 x] F`. -/
theorem exists_forall_eventually_atTop_eventuallyEq {f : ℕ → X → α}
    (hf : LocallyFinite fun n => { x | f (n + 1) x ≠ f n x }) :
    ∃ F : X → α, ∀ x, ∀ᶠ n : ℕ in atTop, f n =ᶠ[𝓝 x] F

(hf : LocallyFinite fun n => {x | f (n + 1) x ≠ f n x})

∃ F, ∀ (x : X), ∀ᶠ (n : ℕ) in Filter.atTop, f n =ᶠ[𝓝 x] F


theorem ae_eq_of_forall_setIntegral_eq_of_sigmaFinite' (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
    {f g : α → F'} (hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn f s μ)
    (hg_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn g s μ)
    (hfg_eq : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ)
    (hfm : AEStronglyMeasurable' m f μ) (hgm : AEStronglyMeasurable' m g μ) : f =ᵐ[μ] g

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

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

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

(hfm : MeasureTheory.AEStronglyMeasurable' m f μ)

(hgm : MeasureTheory.AEStronglyMeasurable' m g μ)


/-- If `x` is close to `y` and `y` is close to `z`, then `x` and `z` are at least as close. -/
theorem cardPowDegree_anti_archimedean {x y z : Fq[X]} {a : ℤ} (hxy : cardPowDegree (x - y) < a)
    (hyz : cardPowDegree (y - z) < a) : cardPowDegree (x - z) < a

(hxy : Polynomial.cardPowDegree (x - y) < a)

(hyz : Polynomial.cardPowDegree (y - z) < a)


theorem trans_assoc (ePP₂ : P ≃ᵃⁱ[𝕜] P₂) (eP₂G : P₂ ≃ᵃⁱ[𝕜] P₃) (eGG' : P₃ ≃ᵃⁱ[𝕜] P₄) :
    ePP₂.trans (eP₂G.trans eGG') = (ePP₂.trans eP₂G).trans eGG'

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{V₃ : Type u_6}
{V₄ : Type u_7}
{P : Type u_10}
{P₂ : Type u_11}
{P₃ : Type u_12}
{P₄ : Type u_13}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
[SeminormedAddCommGroup V₃]
[NormedSpace 𝕜 V₃]
[PseudoMetricSpace P₃]
[NormedAddTorsor V₃ P₃]
[SeminormedAddCommGroup V₄]
[NormedSpace 𝕜 V₄]
[PseudoMetricSpace P₄]
[NormedAddTorsor V₄ P₄]
(ePP₂ : P ≃ᵃⁱ[𝕜] P₂)
(eP₂G : P₂ ≃ᵃⁱ[𝕜] P₃)
(eGG' : P₃ ≃ᵃⁱ[𝕜] P₄)


/-- Right-multiplying by `γ ∈ SL(2, ℤ)` sends `gammaSet N a` to `gammaSet N (a ᵥ* γ)`. -/
lemma vecMul_SL2_mem_gammaSet {v : Fin 2 → ℤ} (hv : v ∈ gammaSet N a) (γ : SL(2, ℤ)) :
    v ᵥ* γ ∈ gammaSet N (a ᵥ* γ)

(hv : v ∈ EisensteinSeries.gammaSet N a)

v ᵥ* ↑γ ∈ EisensteinSeries.gammaSet N (a ᵥ* ↑((Matrix.SpecialLinearGroup.map (Int.castRingHom (ZMod N))) γ))


theorem fderivWithin_const_add (hxs : UniqueDiffWithinAt 𝕜 s x) (c : F) :
    fderivWithin 𝕜 (fun y => c + f y) s x = fderivWithin 𝕜 f s x

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


theorem mem_sup_right {S T : Subalgebra R A} : ∀ {x : A}, x ∈ T → x ∈ S ⊔ T

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{S T : Subalgebra R A}
{x : A}


@[simp]
theorem length (n m : ℕ) : length (Ico n m) = m - n


@[simp]
theorem toFinset_card {α : Type*} (s : Set α) [Fintype s] : s.toFinset.card = Fintype.card s


/-- One can reformulate differentiability within a set at a point as continuity within this set at
this point, and differentiability in any chart containing that point. -/
theorem mdifferentiableWithinAt_iff_of_mem_source {x' : M} {y : M'}
    (hx : x' ∈ (chartAt H x).source) (hy : f x' ∈ (chartAt H' y).source) :
    MDifferentiableWithinAt I I' f s x' ↔
      ContinuousWithinAt f s x' ∧
        DifferentiableWithinAt 𝕜 (extChartAt I' y ∘ f ∘ (extChartAt I x).symm)
          ((extChartAt I x).symm ⁻¹' s ∩ Set.range I) ((extChartAt I x) x')

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{x : M}
{s : Set M}
[Is : SmoothManifoldWithCorners I M]
[I's : SmoothManifoldWithCorners I' M']
{x' : M}
{y : M'}
(hx : x' ∈ (chartAt H x).source)
(hy : f x' ∈ (chartAt H' y).source)

MDifferentiableWithinAt I I' f s x' ↔
  ContinuousWithinAt f s x' ∧
    DifferentiableWithinAt 𝕜 (↑(extChartAt I' y) ∘ f ∘ ↑(extChartAt I x).symm)
      (↑(extChartAt I x).symm ⁻¹' s ∩ Set.range ↑I) (↑(extChartAt I x) x')


/-- If `α` has a unique term, then the type of function `α → β` is equivalent to `β`. -/
@[simps! (config := .asFn) apply symm_apply]
def funUnique (α β) [Unique.{u} α] : (α → β) ≃ β

⇑(Equiv.funUnique α β).symm = uniqueElim


theorem inf_covBy_of_covBy_sup_left : a ⋖ a ⊔ b → a ⊓ b ⋖ b

{α : Type u_1}
[Lattice α]
[IsLowerModularLattice α]
{a b : α}


theorem Memℒp.const_inner (c : E) {f : α → E} (hf : Memℒp f p μ) : Memℒp (fun a => ⟪c, f a⟫) p μ

{α : Type u_1}
{m : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
{E : Type u_2}
{𝕜 : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(c : E)
{f : α → E}
(hf : MeasureTheory.Memℒp f p μ)

MeasureTheory.Memℒp (fun a => ⟪c, f a⟫_𝕜) p μ


@[to_additive addIndex_elim]
theorem index_elim {K V : Set G} (hK : IsCompact K) (hV : (interior V).Nonempty) :
    ∃ t : Finset G, (K ⊆ ⋃ g ∈ t, (fun h => g * h) ⁻¹' V) ∧ Finset.card t = index K V

{G : Type u_1}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
{K V : Set G}
(hK : IsCompact K)
(hV : (interior V).Nonempty)

∃ t, K ⊆ ⋃ g ∈ t, (fun h => g * h) ⁻¹' V ∧ t.card = MeasureTheory.Measure.haar.index K V


@[simp]
theorem ofNat_encode (a) : ofNat α (encode a) = a

Denumerable.ofNat α (Encodable.encode a) = a


@[simp]
theorem truncate_truncate {n₁ n₂ n₃ : ℕ} (h1 : n₁ ≤ n₂) (h2 : n₂ ≤ n₃)
    (x : TruncatedWittVector p n₃ R) :
    (truncate h1) (truncate h2 x) = truncate (h1.trans h2) x

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{R : Type u_1}
[CommRing R]
{n₁ n₂ n₃ : ℕ}
(h1 : n₁ ≤ n₂)
(h2 : n₂ ≤ n₃)
(x : TruncatedWittVector p n₃ R)

(TruncatedWittVector.truncate h1) ((TruncatedWittVector.truncate h2) x) = (TruncatedWittVector.truncate ⋯) x


@[measurability, fun_prop]
theorem AEMeasurable.coe_nnreal_real {f : α → ℝ≥0} {μ : Measure α} (hf : AEMeasurable f μ) :
    AEMeasurable (fun x => (f x : ℝ)) μ

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


/-- Rotating triangles gives an auto-equivalence on the category of triangles in `C`.
-/
@[simps]
def triangleRotation : Equivalence (Triangle C) (Triangle C)

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(CategoryTheory.Pretriangulated.triangleRotation C).inverse = CategoryTheory.Pretriangulated.invRotate C


@[to_additive]
theorem MonoidHom.map_finprod {f : α → M} (g : M →* N) (hf : (mulSupport f).Finite) :
    g (∏ᶠ i, f i) = ∏ᶠ i, g (f i)

{α : Type u_1}
{M : Type u_5}
{N : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
{f : α → M}
(g : M →+ N)
(hf : (Function.support f).Finite)

g (∑ᶠ (i : α), f i) = ∑ᶠ (i : α), g (f i)


protected theorem NeBot.eq_pure_iff (hf : f.NeBot) {x : α} :
    f = pure x ↔ {x} ∈ f

{α : Type u}
{f : Filter α}
(hf : f.NeBot)
{x : α}


@[simp]
lemma zero_comp {m : ℕ} (β : Ext Y Z m) (p : ℕ) (h : n + m = p) :
    (0 : Ext X Y n).comp β h = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
(X : C)
{Y Z : C}
(n : ℕ)
{m : ℕ}
(β : CategoryTheory.Abelian.Ext Y Z m)
(p : ℕ)
(h : n + m = p)

CategoryTheory.Abelian.Ext.comp 0 β h = 0


@[to_additive (attr := simp)]
theorem toLex_mul [Mul α] (a b : α) : toLex (a * b) = toLex a * toLex b


theorem sSameSide_iff_exists_right {s : AffineSubspace R P} {x y p₂ : P} (h : p₂ ∈ s) :
    s.SSameSide x y ↔ x ∉ s ∧ y ∉ s ∧ ∃ p₁ ∈ s, SameRay R (x -ᵥ p₁) (y -ᵥ p₂)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y p₂ : P}
(h : p₂ ∈ s)


{M₀ : Type u_2}
{G₀ : Type u_3}
{F : Type u_6}
[MonoidWithZero M₀]
[GroupWithZero G₀]
[Nontrivial M₀]
[FunLike F G₀ M₀]
[MonoidWithZeroHomClass F G₀ M₀]
(f : F)
{a : G₀}


lemma coe_restrictScalars (f : A →⋆ₙₐ[S] B) : (f.restrictScalars R : A →ₙ+* B) = f

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

↑(NonUnitalStarAlgHom.restrictScalars R f) = ↑f


/-- In a locally compact regular space, given a compact set `K` inside an open set `U`, we can find
an open set `V` between these sets with compact closure: `K ⊆ V` and the closure of `V` is
inside `U`. -/
theorem exists_open_between_and_isCompact_closure [LocallyCompactSpace X] [RegularSpace X]
    {K U : Set X} (hK : IsCompact K) (hU : IsOpen U) (hKU : K ⊆ U) :
    ∃ V, IsOpen V ∧ K ⊆ V ∧ closure V ⊆ U ∧ IsCompact (closure V)

{X : Type u_1}
[TopologicalSpace X]
[LocallyCompactSpace X]
[RegularSpace X]
{K U : Set X}
(hK : IsCompact K)
(hU : IsOpen U)
(hKU : K ⊆ U)


theorem indep_iSup_of_monotone [SemilatticeSup ι] {Ω} {m : ι → MeasurableSpace Ω}
    {m' m0 : MeasurableSpace Ω} {κ : Kernel α Ω} {μ : Measure α} [IsMarkovKernel κ]
    (h_indep : ∀ i, Indep (m i) m' κ μ) (h_le : ∀ i, m i ≤ m0) (h_le' : m' ≤ m0)
    (hm : Monotone m) :
    Indep (⨆ i, m i) m' κ μ

(h_indep : ∀ (i : ι), ProbabilityTheory.Kernel.Indep (m i) m' κ μ)

ProbabilityTheory.Kernel.Indep (⨆ i, m i) m' κ μ


@[to_additive]
theorem IsLowerSet.smul_subset (hs : IsLowerSet s) (hx : x ≤ 1) : x • s ⊆ s

{α : Type u_1}
[OrderedCommMonoid α]
{s : Set α}
{x : α}
(hs : IsLowerSet s)
(hx : x ≤ 1)


theorem mapRange_sub [SubNegZeroMonoid G] [SubNegZeroMonoid H] {f : G → H} {hf : f 0 = 0}
    (hf' : ∀ x y, f (x - y) = f x - f y) (v₁ v₂ : α →₀ G) :
    mapRange f hf (v₁ - v₂) = mapRange f hf v₁ - mapRange f hf v₂

(hf' : ∀ (x y : G), f (x - y) = f x - f y)

Finsupp.mapRange f hf (v₁ - v₂) = Finsupp.mapRange f hf v₁ - Finsupp.mapRange f hf v₂


theorem _root_.MeasureTheory.Integrable.hasSum_intervalIntegral (hfi : Integrable f μ) (y : ℝ) :
    HasSum (fun n : ℤ => ∫ x in y + n..y + n + 1, f x ∂μ) (∫ x, f x ∂μ)

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{μ : MeasureTheory.Measure ℝ}
{f : ℝ → E}
(hfi : MeasureTheory.Integrable f μ)
(y : ℝ)

HasSum (fun n => ∫ (x : ℝ) in y + ↑n..y + ↑n + 1, f x ∂μ) (∫ (x : ℝ), f x ∂μ)


theorem min_const (hf : LocallyLipschitz f) (a : ℝ) : LocallyLipschitz fun x => min (f x) a

{α : Type u}
[PseudoEMetricSpace α]
{f : α → ℝ}
(hf : LocallyLipschitz f)
(a : ℝ)


/-- The `LSeries` of the arithmetic function `ζ` is the same as the `LSeries` associated
to the constant sequence `1`. -/
lemma LSeries_zeta_eq : L ↗ζ = L 1

(L fun n => ↑(ArithmeticFunction.zeta n)) = L 1


/-- A `Group` is simple when it has exactly two normal `Subgroup`s. -/
class IsSimpleGroup extends Nontrivial G : Prop where
  /-- Any normal subgroup is either `⊥` or `⊤` -/
  eq_bot_or_eq_top_of_normal : ∀ H : Subgroup G, H.Normal → H = ⊥ ∨ H = ⊤

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


lemma sup_sequence_lt_omega1 {α} [Countable α] (o : α → Ordinal) (ho : ∀ n, o n < ω₁) :
    sup o < ω₁

(ho : ∀ (n : α), o n < (Cardinal.aleph 1).ord)


/-- An open subgroup of a nonarchimedean ring contains the square of another one. -/
theorem mul_subset (U : OpenAddSubgroup R) : ∃ V : OpenAddSubgroup R, (V : Set R) * V ⊆ U

{R : Type u_1}
[Ring R]
[TopologicalSpace R]
[NonarchimedeanRing R]
(U : OpenAddSubgroup R)


theorem nhdsWithin_Iio_eq_bot_iff {a : α} : 𝓝[<] a = ⊥ ↔ IsBot a ∨ ∃ b, b ⋖ a

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}


theorem coe_prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : ⇑(f.prod g) = Pi.prod f g

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[Semiring C]
[Algebra R C]
(f : A →ₐ[R] B)
(g : A →ₐ[R] C)


@[to_additive]
theorem mul_ciSup (hf : BddAbove (range f)) (a : G) : (a * ⨆ i, f i) = ⨆ i, a * f i

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


theorem foldr_eq_foldr_data (f : α → β → β) (init : β) (arr : Array α) :
    arr.foldr f init = arr.data.foldr f init

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

Array.foldr f init arr arr.size = List.foldr f init arr.data


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


theorem HasBasis.eq_biInf (h : l.HasBasis p s) : l = ⨅ (i) (_ : p i), 𝓟 (s i)

{α : Type u_1}
{ι : Sort u_4}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}
(h : l.HasBasis p s)


@[to_additive]
theorem smul_aeeqFun_aeeq (c : Mᵈᵐᵃ) (f : α →ₘ[μ] β) :
    c • f =ᵐ[μ] (f <| mk.symm c • ·)

[MeasureTheory.SMulInvariantMeasure M α μ]

↑(c • f) =ᵐ[μ] fun x => ↑f (DomMulAct.mk.symm c • x)


lemma monotone_defaultRatCDF : Monotone defaultRatCDF


theorem colorable_of_isEmpty [IsEmpty V] (n : ℕ) : G.Colorable n

{V : Type u}
(G : SimpleGraph V)
[IsEmpty V]
(n : ℕ)


@[simp]
theorem coe_toHomeomorph (e : M₁ ≃SL[σ₁₂] M₂) : ⇑e.toHomeomorph = e

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


lemma predicateShift_LE (a n n' : ℤ) (hn' : a + n = n') :
    (PredicateShift (t.LE n) a) = t.LE n'

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(t : CategoryTheory.Triangulated.TStructure C)

CategoryTheory.PredicateShift (t.LE n) a = t.LE n'


lemma coe_map_Δ' : (E.map φ).Δ' = φ E.Δ'

{R : Type u}
[CommRing R]
(E : EllipticCurve R)
{A : Type v}
[CommRing A]
(φ : R →+* A)


theorem subset_insert (a : α) (l : List α) : l ⊆ l.insert a

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


lemma iSup_basicOpen_eq_top_iff {ι : Type*} {f : ι → R} :
    (⨆ i : ι, PrimeSpectrum.basicOpen (f i)) = ⊤ ↔ Ideal.span (Set.range f) = ⊤

{R : Type u}
[CommSemiring R]
{ι : Type u_1}
{f : ι → R}

⨆ i, PrimeSpectrum.basicOpen (f i) = ⊤ ↔ Ideal.span (Set.range f) = ⊤


/-- When considering functions between manifolds, this statement shows up often. It entails
the unique differential of the pullback in extended charts of the set where the function can
be read in the charts. -/
theorem UniqueMDiffOn.uniqueDiffOn_inter_preimage (hs : UniqueMDiffOn I s) (x : M) (y : M')
    {f : M → M'} (hf : ContinuousOn f s) :
    UniqueDiffOn 𝕜
      ((extChartAt I x).target ∩ (extChartAt I x).symm ⁻¹' (s ∩ f ⁻¹' (extChartAt I' y).source))

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{s : Set M}
(hs : UniqueMDiffOn I s)
(x : M)
(y : M')
{f : M → M'}
(hf : ContinuousOn f s)

UniqueDiffOn 𝕜 ((extChartAt I x).target ∩ ↑(extChartAt I x).symm ⁻¹' (s ∩ f ⁻¹' (extChartAt I' y).source))


@[simp]
theorem Real.logDeriv_sin : logDeriv (Real.sin) = Real.cot


/-- Given three points on a circle, the center of that circle may be expressed explicitly as a
multiple (by half the inverse of the tangent of the angle at one of those points) of a `π / 2`
rotation of the vector between the other two points, plus the midpoint of those points. -/
theorem inv_tan_div_two_smul_rotation_pi_div_two_vadd_midpoint_eq_center {s : Sphere P}
    {p₁ p₂ p₃ : P} (hp₁ : p₁ ∈ s) (hp₂ : p₂ ∈ s) (hp₃ : p₃ ∈ s) (hp₁p₂ : p₁ ≠ p₂) (hp₁p₃ : p₁ ≠ p₃)
    (hp₂p₃ : p₂ ≠ p₃) :
    ((Real.Angle.tan (∡ p₁ p₂ p₃))⁻¹ / 2) • o.rotation (π / 2 : ℝ) (p₃ -ᵥ p₁) +ᵥ midpoint ℝ p₁ p₃ =
      s.center

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

((∡ p₁ p₂ p₃).tan⁻¹ / 2) • (EuclideanGeometry.o.rotation ↑(π / 2)) (p₃ -ᵥ p₁) +ᵥ midpoint ℝ p₁ p₃ = s.center


theorem map_comp (f : α → β) (g : β → γ) : ∀ s : Seq α, map (g ∘ f) s = map g (map f s)

{α : Type u}
{β : Type v}
{γ : Type w}
(f : α → β)
(g : β → γ)
(s : Stream'.Seq α)

Stream'.Seq.map (g ∘ f) s = Stream'.Seq.map g (Stream'.Seq.map f s)


theorem HasIntegral.smul (hf : HasIntegral I l f vol y) (c : ℝ) :
    HasIntegral I l (c • f) vol (c • y)

(hf : BoxIntegral.HasIntegral I l f vol y)

BoxIntegral.HasIntegral I l (c • f) vol (c • y)


theorem intersecting_insert :
    (insert a s).Intersecting ↔ s.Intersecting ∧ a ≠ ⊥ ∧ ∀ b ∈ s, ¬Disjoint a b

{α : Type u_1}
[SemilatticeInf α]
[OrderBot α]
{s : Set α}
{a : α}


/-- The functor from the skeleton of `C` to `C`. -/
@[simps!]
noncomputable def fromSkeleton : Skeleton C ⥤ C

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

∀ (a : Quotient (CategoryTheory.isIsomorphicSetoid C)), (CategoryTheory.fromSkeleton C).obj a = a.out


theorem not_nodup_cons_of_mem : a ∈ l → ¬Nodup (a :: l)


/-- Continuous linear equivalence between dependent functions `(i : Fin 2) → M i` and `M 0 × M 1`.
-/
@[simps! (config := .asFn) apply symm_apply]
def piFinTwo (M : Fin 2 → Type*) [∀ i, AddCommMonoid (M i)] [∀ i, Module R (M i)]
    [∀ i, TopologicalSpace (M i)] : ((i : _) → M i) ≃L[R] M 0 × M 1

(R : Type u_2)
[Semiring R]
(M : Fin 2 → Type u_4)
[(i : Fin 2) → AddCommMonoid (M i)]
[(i : Fin 2) → Module R (M i)]
[(i : Fin 2) → TopologicalSpace (M i)]

⇑(ContinuousLinearEquiv.piFinTwo R M) = fun f => (f 0, f 1)


@[to_additive]
theorem singleton_mul_mem_nhds_of_nhds_one (a : α) (h : s ∈ 𝓝 (1 : α)) : {a} * s ∈ 𝓝 a

{α : Type u}
[TopologicalSpace α]
[AddGroup α]
[ContinuousConstVAdd α α]
{s : Set α}
(a : α)
(h : s ∈ 𝓝 0)


@[simp]
theorem add_apply (g₁ g₂ : ⨁ i, β i) (i : ι) : (g₁ + g₂) i = g₁ i + g₂ i

{ι : Type v}
{β : ι → Type w}
[(i : ι) → AddCommMonoid (β i)]
(g₁ g₂ : DirectSum ι fun i => β i)
(i : ι)


@[simp]
theorem _root_.PNat.succPNat_natPred (n : ℕ+) : n.natPred.succPNat = n


@[simp, norm_cast]
theorem cast_add : ∀ m n, ((m + n : ℤ) : R) = m + n

{R : Type u}
[AddGroupWithOne R]
(m n : ℤ)


theorem map_mkQ_eq {N₁ N₂ : Submodule R M} (h : N₁ ≤ N₂) (h' : N₂.FG) :
    N₁.map (Submodule.mkQ (𝔪 • N₂)) = N₂.map (Submodule.mkQ (𝔪 • N₂)) ↔ N₁ = N₂

{R : Type u_1}
[CommRing R]
[LocalRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N₁ N₂ : Submodule R M}
(h : N₁ ≤ N₂)
(h' : N₂.FG)

Submodule.map (LocalRing.maximalIdeal R • N₂).mkQ N₁ = Submodule.map (LocalRing.maximalIdeal R • N₂).mkQ N₂ ↔ N₁ = N₂


theorem iInf_coe [InfSet β] (f : α → β) (s : Finset α) : ⨅ x ∈ (↑s : Set α), f x = ⨅ x ∈ s, f x

{α : Type u_2}
{β : Type u_3}
[InfSet β]
(f : α → β)
(s : Finset α)


lemma gammaCDFReal_eq_lintegral {a r : ℝ} (ha : 0 < a) (hr : 0 < r) (x : ℝ) :
    gammaCDFReal a r x = ENNReal.toReal (∫⁻ x in Iic x, gammaPDF a r x)

↑(ProbabilityTheory.gammaCDFReal a r) x = (∫⁻ (x : ℝ) in Set.Iic x, ProbabilityTheory.gammaPDF a r x).toReal


@[to_additive (attr := simp)]
theorem iUnion_inv_smul : ⋃ g : α, g⁻¹ • s = ⋃ g : α, g • s

{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[AddAction α β]
{s : Set β}


lemma shiftLeft'_sub (b m) : ∀ {n k}, k ≤ n → shiftLeft' b m (n - k) = (shiftLeft' b m n) >>> k

k ≤ n → Nat.shiftLeft' b m (n - k) = Nat.shiftLeft' b m n >>> k


theorem two_mul_count_bool_of_even (hl : Chain' (· ≠ ·) l) (h2 : Even (length l)) (b : Bool) :
    2 * count b l = length l

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


/--
Let `M₁ᵢ` and `M₁ᵢ'` be two families of `R`-modules and `M₂` an `R`-module.
Let us denote `Π i, M₁ᵢ` and `Π i, M₁ᵢ'` by `M` and `M'` respectively.
If `g` is a multilinear map `M' → M₂`, then `g` can be reinterpreted as a multilinear
map from `Π i, M₁ᵢ ⟶ M₁ᵢ'` to `M ⟶ M₂` via `(fᵢ) ↦ v ↦ g(fᵢ vᵢ)`.
-/
@[simps!] def piLinearMap :
    MultilinearMap R M₁' M₂ →ₗ[R]
    MultilinearMap R (fun i ↦ M₁ i →ₗ[R] M₁' i) (MultilinearMap R M₁ M₂)

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[CommSemiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
{M₁' : ι → Type u_1}
[(i : ι) → AddCommMonoid (M₁' i)]
[(i : ι) → Module R (M₁' i)]
(g : MultilinearMap R M₁' M₂)

∀ (a : (i : ι) → (fun i => M₁ i →ₗ[R] M₁' i) i) (m : (i : ι) → M₁ i),
  ((MultilinearMap.piLinearMap g) a) m = g fun i => (a i) (m i)


theorem range_eq_range' (n : Nat) : range n = range' 0 n


/-- The `StarSubalgebra` obtained from `S : Subalgebra R A` by taking the smallest subalgebra
containing both `S` and `star S`. -/
@[simps!]
def starClosure (S : Subalgebra R A) : StarSubalgebra R A

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

↑S.starClosure = ⋂ t, ⋂ (_ : Set.range ⇑(algebraMap R A) ⊆ ↑t ∧ ↑S ⊆ ↑t ∧ star ↑S ⊆ ↑t), ↑t


theorem cast_commute (n : ℕ) (x : α) : Commute (n : α) x

{α : Type u_1}
[NonAssocSemiring α]
(n : ℕ)
(x : α)


@[simp]
theorem neg_coe_pi : -(π : Angle) = π


@[mono]
theorem coe_strictMono : StrictMono (SetLike.coe : A → Set B)

{A : Type u_1}
{B : Type u_2}
[i : SetLike A B]


@[simp]
theorem hom_inv_id_apply {X Y : Type u} (f : X ≅ Y) (x : X) : f.inv (f.hom x) = x


@[simp]
theorem verts_iSup {f : ι → G.Subgraph} : (⨆ i, f i).verts = ⋃ i, (f i).verts

{ι : Sort u_1}
{V : Type u}
{G : SimpleGraph V}
{f : ι → G.Subgraph}


theorem lhopital_zero_right_on_Ioo (hdf : DifferentiableOn ℝ f (Ioo a b))
    (hg' : ∀ x ∈ Ioo a b, 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 : DifferentiableOn ℝ f (Set.Ioo a b))

(hg' : ∀ x ∈ Set.Ioo a b, 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


@[ext]
theorem ext : (∀ i j, M i j = N i j) → M = N

{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
{M N : DMatrix m n α}

(∀ (i : m) (j : n), M i j = N i j) → M = N


/-- The Gamma function does not vanish on `ℝ` (except at non-positive integers, where the function
is mathematically undefined and we set it to `0` by convention). -/
theorem Gamma_ne_zero {s : ℝ} (hs : ∀ m : ℕ, s ≠ -m) : Gamma s ≠ 0


theorem Monotone.mul_strictMono [PosMulStrictMono α] [MulPosMono α]
    (hf : Monotone f) (hg : StrictMono g) (hf₀ : ∀ x, 0 < f x)
    (hg₀ : ∀ x, 0 ≤ g x) : StrictMono (f * g)

{α : Type u}
{β : Type u_1}
[Semiring α]
[PartialOrder α]
[Preorder β]
{f g : β → α}
[PosMulStrictMono α]
[MulPosMono α]
(hf : Monotone f)
(hg : StrictMono g)
(hf₀ : ∀ (x : β), 0 < f x)
(hg₀ : ∀ (x : β), 0 ≤ g x)


@[simp]
theorem restrict_restrict (hs : MeasurableSet s) : (μ.restrict t).restrict s = μ.restrict (s ∩ t)

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


theorem exists_mem_or_left :
    (∃ (x : _) (_ : p x ∨ q x), r x) ↔ (∃ (x : _) (_ : p x), r x) ∨ ∃ (x : _) (_ : q x), r x

(∃ x x_1, r x) ↔ (∃ x x_1, r x) ∨ ∃ x x_1, r x


@[simp]
theorem comp_lineMap (f : P1 →ᵃ[k] P2) (p₀ p₁ : P1) :
    f.comp (lineMap p₀ p₁) = lineMap (f p₀) (f p₁)

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]
(f : P1 →ᵃ[k] P2)
(p₀ p₁ : P1)

f.comp (AffineMap.lineMap p₀ p₁) = AffineMap.lineMap (f p₀) (f p₁)


theorem exists_unique_equiv_nat (a : ℤ) {b : ℤ} (hb : 0 < b) : ∃ z : ℕ, ↑z < b ∧ ↑z ≡ a [ZMOD b]


protected theorem dvd_add_iff_left {k m n : Nat} (h : k ∣ n) : k ∣ m ↔ k ∣ m + n


/-- The set of points `a : α` such that `κ a ≪ η a` is measurable. -/
@[measurability]
lemma measurableSet_absolutelyContinuous (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η] :
    MeasurableSet {a | κ a ≪ η a}

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]


theorem bit_val (b n) : bit b n = 2 * n + cond b 1 0

Int.bit b n = 2 * n + bif b then 1 else 0


@[simp] theorem balance1_All {l : RBNode α} {v : α} {r : RBNode α} :
    (balance1 l v r).All p ↔ p v ∧ l.All p ∧ r.All p

{α : Type u_1}
{p : α → Prop}
{l : Batteries.RBNode α}
{v : α}
{r : Batteries.RBNode α}

Batteries.RBNode.All p (l.balance1 v r) ↔ p v ∧ Batteries.RBNode.All p l ∧ Batteries.RBNode.All p r


lemma iteratedDeriv_neg (n : ℕ) (f : 𝕜 → F) (a : 𝕜) :
    iteratedDeriv n (fun x ↦ -(f x)) a = -(iteratedDeriv n f a)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(n : ℕ)
(f : 𝕜 → F)
(a : 𝕜)

iteratedDeriv n (fun x => -f x) a = -iteratedDeriv n f a


theorem inter_right (hC : IsExposed 𝕜 B C) (hCA : C ⊆ A) : IsExposed 𝕜 (A ∩ B) C

{𝕜 : Type u_1}
{E : Type u_2}
[TopologicalSpace 𝕜]
[OrderedRing 𝕜]
[AddCommMonoid E]
[TopologicalSpace E]
[Module 𝕜 E]
{A B C : Set E}
(hC : IsExposed 𝕜 B C)
(hCA : C ⊆ A)


@[simp]
theorem curryFinFinset_symm_apply_piecewise_const_aux {k l n : ℕ} {s : Finset (Fin n)}
    (hk : s.card = k) (hl : sᶜ.card = l)
    (f : MultilinearMap R (fun _ : Fin k => M') (MultilinearMap R (fun _ : Fin l => M') M₂))
    (x y : M') :
      ((⇑f fun _ => x) (fun i => (Finset.piecewise s (fun _ => x) (fun _ => y)
          ((sᶜ.orderEmbOfFin hl) i))) = f (fun _ => x) fun _ => y)

(f : MultilinearMap R (fun x => M') (MultilinearMap R (fun x => M') M₂))

((f fun x_1 => x) fun i => s.piecewise (fun x_1 => x) (fun x => y) ((sᶜ.orderEmbOfFin hl) i)) =
  (f fun x_1 => x) fun x => y


/-- Definition of a (Pre)Galois category. Lenstra, Def 3.1, (G1)-(G3) -/
class PreGaloisCategory (C : Type u₁) [Category.{u₂, u₁} C] : Prop where
  /-- `C` has a terminal object (G1). -/
  hasTerminal : HasTerminal C := by infer_instance
  /-- `C` has pullbacks (G1). -/
  hasPullbacks : HasPullbacks C := by infer_instance
  /-- `C` has finite coproducts (G2). -/
  hasFiniteCoproducts : HasFiniteCoproducts C := by infer_instance
  /-- `C` has quotients by finite groups (G2). -/
  hasQuotientsByFiniteGroups (G : Type u₂) [Group G] [Finite G] :
    HasColimitsOfShape (SingleObj G) C := by infer_instance
  /-- Every monomorphism in `C` induces an isomorphism on a direct summand (G3). -/
  monoInducesIsoOnDirectSummand {X Y : C} (i : X ⟶ Y) [Mono i] : ∃ (Z : C) (u : Z ⟶ Y),
    Nonempty (IsColimit (BinaryCofan.mk i u))

[self : CategoryTheory.PreGaloisCategory C]

∃ Z u, Nonempty (CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.BinaryCofan.mk i u))


/-- If a set of functions is equicontinuous, its closure for the product topology is also
equicontinuous. -/
protected theorem Set.Equicontinuous.closure {A : Set <| X → α} (hA : A.Equicontinuous) :
    (closure A).Equicontinuous

{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{A : Set (X → α)}
(hA : A.Equicontinuous)


theorem braiding_naturality_left {X Y : Dial C} (f : X ⟶ Y) (Z : Dial C) :
    tensorHom f (𝟙 Z) ≫ (braiding Y Z).hom = (braiding X Z).hom ≫ tensorHom (𝟙 Z) f

CategoryTheory.CategoryStruct.comp (CategoryTheory.Dial.tensorHom f (CategoryTheory.CategoryStruct.id Z))
    (Y.braiding Z).hom =
  CategoryTheory.CategoryStruct.comp (X.braiding Z).hom
    (CategoryTheory.Dial.tensorHom (CategoryTheory.CategoryStruct.id Z) f)


@[norm_cast] lemma coe_iInf [Nonempty ι] : ↑(⨅ i, f i) = ⨅ i, (f i : ℕ∞)


theorem tr_eval {σ₁ σ₂ f₁ f₂} {tr : σ₁ → σ₂ → Prop} (H : Respects f₁ f₂ tr) {a₁ b₁ a₂}
    (aa : tr a₁ a₂) (ab : b₁ ∈ eval f₁ a₁) : ∃ b₂, tr b₁ b₂ ∧ b₂ ∈ eval f₂ a₂

{σ₁ : Type u_1}
{σ₂ : Type u_2}
{f₁ : σ₁ → Option σ₁}
{f₂ : σ₂ → Option σ₂}
{tr : σ₁ → σ₂ → Prop}
(H : Turing.Respects f₁ f₂ tr)
{a₁ b₁ : σ₁}
{a₂ : σ₂}
(aa : tr a₁ a₂)
(ab : b₁ ∈ Turing.eval f₁ a₁)


@[simp]
theorem subsingletonEquiv_apply_tprod [Subsingleton ι] (i : ι) (f : ι → M) :
    subsingletonEquiv i (tprod R f) = f i

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{M : Type u_8}
[AddCommMonoid M]
[Module R M]
[Subsingleton ι]
(i : ι)
(f : ι → M)

(PiTensorProduct.subsingletonEquiv i) ((PiTensorProduct.tprod R) f) = f i


theorem range_pow_padicValNat_subset_divisors' {n : ℕ} [hp : Fact p.Prime] :
    ((Finset.range (padicValNat p n)).image fun t => p ^ (t + 1)) ⊆ n.divisors.erase 1

Finset.image (fun t => p ^ (t + 1)) (Finset.range (padicValNat p n)) ⊆ n.divisors.erase 1


/-- The natural isomorphism between a pullback cone and the corresponding pullback cone
reconstructed using `PullbackCone.mk`. -/
@[simps!]
def eta (t : PullbackCone f g) : t ≅ mk t.fst t.snd t.condition

(t : CategoryTheory.Limits.PullbackCone f g)


/-- Let `p` and `q` be two seminorms on a vector space over a `NontriviallyNormedField`.
If we have `q x ≤ C * p x` on some shell of the form `{x | ε/‖c‖ ≤ p x < ε}` (where `ε > 0`
and `‖c‖ > 1`), then we also have `q x ≤ C * p x` for all `x` such that `p x ≠ 0`. -/
lemma bound_of_shell
    (p q : Seminorm 𝕜 E) {ε C : ℝ} (ε_pos : 0 < ε) {c : 𝕜} (hc : 1 < ‖c‖)
    (hf : ∀ x, ε / ‖c‖ ≤ p x → p x < ε → q x ≤ C * p x) {x : E} (hx : p x ≠ 0) :
    q x ≤ C * p x

(hf : ∀ (x : E), ε / ‖c‖ ≤ p x → p x < ε → q x ≤ C * p x)


@[to_additive]
theorem tprod_mul (hf : Multipliable f) (hg : Multipliable g) :
    ∏' b, (f b * g b) = (∏' b, f b) * ∏' b, g b

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f g : β → α}
[T2Space α]
[ContinuousMul α]
(hf : Multipliable f)
(hg : Multipliable g)


@[simp]
theorem linearProjOfIsCompl_ker (h : IsCompl p q) : ker (linearProjOfIsCompl p q h) = q

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

LinearMap.ker (p.linearProjOfIsCompl q h) = q


theorem coe_injective [T0Space α] : Function.Injective ((↑) : α → Completion α)

(α : Type u_1)
[UniformSpace α]
[T0Space α]


theorem hasDerivWithinAt_zpow (m : ℤ) (x : 𝕜) (h : x ≠ 0 ∨ 0 ≤ m) (s : Set 𝕜) :
    HasDerivWithinAt (fun x => x ^ m) ((m : 𝕜) * x ^ (m - 1)) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(m : ℤ)
(x : 𝕜)
(h : x ≠ 0 ∨ 0 ≤ m)
(s : Set 𝕜)

HasDerivWithinAt (fun x => x ^ m) (↑m * x ^ (m - 1)) s x


@[simp]
theorem augment_d_zero_one (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 0) :
    (augment C f w).d 0 1 = f


/-- A category is (finitary) extensive if it has finite coproducts,
and binary coproducts are van Kampen. -/
class FinitaryExtensive (C : Type u) [Category.{v} C] : Prop where
  [hasFiniteCoproducts : HasFiniteCoproducts C]
  [hasPullbacksOfInclusions : HasPullbacksOfInclusions C]
  /-- In a finitary extensive category, all coproducts are van Kampen-/
  van_kampen' : ∀ {X Y : C} (c : BinaryCofan X Y), IsColimit c → IsVanKampenColimit c

[self : CategoryTheory.FinitaryExtensive C]

(c : CategoryTheory.Limits.BinaryCofan X Y)

CategoryTheory.Limits.IsColimit c → CategoryTheory.IsVanKampenColimit c


@[simp]
theorem ListBlank.head_mk {Γ} [Inhabited Γ] (l : List Γ) :
    ListBlank.head (ListBlank.mk l) = l.headI

{Γ : Type u_1}
[Inhabited Γ]
(l : List Γ)


theorem eventually_isUnit_resolvent (a : A) : ∀ᶠ z in cobounded 𝕜, IsUnit (resolvent a z)

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
(a : A)

∀ᶠ (z : 𝕜) in Bornology.cobounded 𝕜, IsUnit (resolvent a z)


/-- Transport a monoidal structure along an equivalence of (plain) categories.
-/
@[simps]
def transportStruct (e : C ≌ D) : MonoidalCategoryStruct.{v₂} D

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

∀ {X₁ Y₁ X₂ Y₂ : D} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂), f ⊗ g = e.functor.map (e.inverse.map f ⊗ e.inverse.map g)


theorem normal_separation [NormalSpace X] {s t : Set X} (H1 : IsClosed s) (H2 : IsClosed t)
    (H3 : Disjoint s t) : SeparatedNhds s t

{X : Type u_1}
[TopologicalSpace X]
[NormalSpace X]
{s t : Set X}
(H1 : IsClosed s)
(H2 : IsClosed t)
(H3 : Disjoint s t)


theorem copy_eq (f : TopHom α β) (f' : α → β) (h : f' = f) : f.copy f' h = f

{α : Type u_2}
{β : Type u_3}
[Top α]
[Top β]
(f : TopHom α β)
(f' : α → β)
(h : f' = ⇑f)


@[simp]
theorem trans_toCoalgEquiv :
    (e₁₂.trans e₂₃ : A ≃ₗc[R] C) = (e₁₂ : A ≃ₗc[R] B).trans (e₂₃ : B ≃ₗc[R] C)

{R : Type u}
{A : Type v}
{B : Type w}
{C : Type u₁}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Semiring C]
[Algebra R A]
[Algebra R B]
[Algebra R C]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
[CoalgebraStruct R C]
{e₁₂ : A ≃ₐc[R] B}
{e₂₃ : B ≃ₐc[R] C}


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


@[to_additive]
theorem sup_eq_closure (N N' : Submonoid M) : N ⊔ N' = closure ((N : Set M) ∪ (N' : Set M))

{M : Type u_1}
[AddZeroClass M]
(N N' : AddSubmonoid M)

N ⊔ N' = AddSubmonoid.closure (↑N ∪ ↑N')


theorem subsingleton_of_einfsep_eq_top (hs : s.einfsep = ∞) : s.Subsingleton

{α : Type u_1}
[PseudoMetricSpace α]
{s : Set α}
(hs : s.einfsep = ⊤)


theorem chain_singleton (r : α → α → Prop) (a : α) : Chain r [a] ↔ r a a

{α : Type u_1}
(r : α → α → Prop)
(a : α)


@[csimp] theorem filter_eq_filterTR : @filter = @filterTR


/-- If a section `f` is a unit in each stalk, `f` must be a unit. -/
theorem isUnit_of_isUnit_germ (U : Opens X) (f : X.presheaf.obj (op U))
    (h : ∀ x : U, IsUnit (X.presheaf.germ x f)) : IsUnit f

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

(h : ∀ (x : ↥U), IsUnit ((X.presheaf.germ x) f))


theorem fromPadicInt_comp_toPadicInt_ext (x) :
    (fromPadicInt p).comp (toPadicInt p) x = RingHom.id (𝕎 (ZMod p)) x

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(x : 𝕎 (ZMod p))

((WittVector.fromPadicInt p).comp (WittVector.toPadicInt p)) x = (RingHom.id (𝕎 (ZMod p))) x


theorem comp_holderOnWith {Cg rg : ℝ≥0} {g : Y → Z} (hg : HolderWith Cg rg g) {Cf rf : ℝ≥0}
    {f : X → Y} {s : Set X} (hf : HolderOnWith Cf rf f s) :
    HolderOnWith (Cg * Cf ^ (rg : ℝ)) (rg * rf) (g ∘ f) s

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
[PseudoEMetricSpace Z]
{Cg rg : ℝ≥0}
{g : Y → Z}
(hg : HolderWith Cg rg g)
{Cf rf : ℝ≥0}
{f : X → Y}
{s : Set X}
(hf : HolderOnWith Cf rf f s)

HolderOnWith (Cg * Cf ^ ↑rg) (rg * rf) (g ∘ f) s


lemma X_pow_sub_C_eq_prod {R : Type*} [CommRing R] [IsDomain R]
    {n : ℕ} {ζ : R} (hζ : IsPrimitiveRoot ζ n) {α a : R} (hn : 0 < n) (e : α ^ n = a) :
    (X ^ n - C a) = ∏ i ∈ Finset.range n, (X - C (ζ ^ i * α))

{R : Type u_1}
[CommRing R]
[IsDomain R]
{n : ℕ}
{ζ : R}
(hζ : IsPrimitiveRoot ζ n)
{α a : R}
(hn : 0 < n)
(e : α ^ n = a)

Polynomial.X ^ n - Polynomial.C a = ∏ i ∈ Finset.range n, (Polynomial.X - Polynomial.C (ζ ^ i * α))


@[reassoc]
theorem kernelComparison_comp_kernel_map {X' Y' : C} [HasKernel f] [HasKernel (G.map f)]
    (g : X' ⟶ Y') [HasKernel g] [HasKernel (G.map g)] (p : X ⟶ X') (q : Y ⟶ Y')
    (hpq : f ≫ q = p ≫ g) :
    kernelComparison f G ≫
        kernel.map (G.map f) (G.map g) (G.map p) (G.map q) (by rw [← G.map_comp, hpq, G.map_comp]) =
      G.map (kernel.map f g p q hpq) ≫ kernelComparison g G

CategoryTheory.Limits.kernelComparison f G ≫
    CategoryTheory.Limits.kernel.map (G.map f) (G.map g) (G.map p) (G.map q) ⋯ =
  G.map (CategoryTheory.Limits.kernel.map f g p q hpq) ≫ CategoryTheory.Limits.kernelComparison g G


@[ext] lemma ext {X Y : Bimon_ C} {f g : X ⟶ Y} (w : f.hom.hom = g.hom.hom) : f = g

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
{X Y : Bimon_ C}
{f g : X ⟶ Y}
(w : f.hom.hom = g.hom.hom)


theorem exp_half (x : ℝ) : exp (x / 2) = √(exp x)


@[to_additive zsmul_zero_sub]
lemma one_div_zpow (a : α) (n : ℤ) : (1 / a) ^ n = 1 / a ^ n

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


theorem rev_pred {i : Fin (n + 1)} (h : i ≠ 0) (h' := rev_ne_iff.mpr ((rev_last _).symm ▸ h)) :
    rev (pred i h) = castPred (rev i) h'

{n : ℕ}
{i : Fin (n + 1)}
(h : i ≠ 0)
(h' : i.rev ≠ Fin.last n := ⋯)


@[simp]
theorem zero_update : update 0 a b = single a b

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

Finsupp.update 0 a b = Finsupp.single a b


theorem measure_biUnion_toMeasurable {I : Set β} (hc : I.Countable) (s : β → Set α) :
    μ (⋃ b ∈ I, toMeasurable μ (s b)) = μ (⋃ b ∈ I, s b)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{I : Set β}
(hc : I.Countable)
(s : β → Set α)

μ (⋃ b ∈ I, MeasureTheory.toMeasurable μ (s b)) = μ (⋃ b ∈ I, s b)


theorem cmp_to_nat_lemma {m n : PosNum} : (m : ℕ) < n → (bit1 m : ℕ) < bit0 n


@[simp]
theorem mem_top : x ∈ (⊤ : L.DefinableSet A α)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{A : Set M}
{α : Type u₁}
{x : α → M}


theorem tendsto_sub_atTop_nat (k : ℕ) : Tendsto (fun a => a - k) atTop atTop

Filter.Tendsto (fun a => a - k) Filter.atTop Filter.atTop


nonrec theorem HasFDerivAt.isBigO_sub {f : E → F} {x₀ : E} {f' : E →L[𝕜] F}
    (h : HasFDerivAt f f' x₀) : (f · - f x₀) =O[𝓝 x₀] (· - x₀)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x₀ : E}
{f' : E →L[𝕜] F}
(h : HasFDerivAt f f' x₀)

(fun x => f x - f x₀) =O[𝓝 x₀] fun x => x - x₀


theorem map_add_ofNat [AddMonoidWithOne G] [AddMonoidWithOne H] [AddConstMapClass F G H 1 1]
    (f : F) (x : G) (n : ℕ) [n.AtLeastTwo] :
    f (x + OfNat.ofNat n) = f x + OfNat.ofNat n

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
[AddMonoidWithOne G]
[AddMonoidWithOne H]
[AddConstMapClass F G H 1 1]
(f : F)
(x : G)
(n : ℕ)
[n.AtLeastTwo]


/-- If `f : ℝ → ℝ` is strictly convex on `S` and differentiable at `y ∈ S`, then the slope of any
secant line with right endpoint at `y` is strictly less than the left derivative at `y`. -/
lemma slope_lt_of_hasDerivWithinAt_Iio (hfc : StrictConvexOn ℝ S f)
    (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y) (hf' : HasDerivWithinAt f f' (Iio y) y)  :
    slope f x y < f'

(hf' : HasDerivWithinAt f f' (Set.Iio y) y)


@[norm_cast, simp]
theorem coe_linearMap_comp (f : N →ₗ⁅R,L⁆ P) (g : M →ₗ⁅R,L⁆ N) :
    (f.comp g : M →ₗ[R] P) = (f : N →ₗ[R] P).comp (g : M →ₗ[R] N)

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
{P : Type w₂}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
[LieRingModule L M]
[LieRingModule L N]
[LieRingModule L P]
(f : N →ₗ⁅R,L⁆ P)
(g : M →ₗ⁅R,L⁆ N)


theorem diam_le_of_subset_closedBall {r : ℝ} (hr : 0 ≤ r) (h : s ⊆ closedBall x r) :
    diam s ≤ 2 * r

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x : α}
{r : ℝ}
(hr : 0 ≤ r)
(h : s ⊆ Metric.closedBall x r)


@[simp] theorem mk_le_mk {x y : Nat} {hx hy} : (⟨x, hx⟩ : Fin n) ≤ ⟨y, hy⟩ ↔ x ≤ y


theorem embedding_prod_map {W X Y Z : TopCat.{u}} {f : W ⟶ X} {g : Y ⟶ Z} (hf : Embedding f)
    (hg : Embedding g) : Embedding (Limits.prod.map f g)

{W X Y Z : TopCat}
{f : W ⟶ X}
{g : Y ⟶ Z}
(hf : Embedding ⇑f)
(hg : Embedding ⇑g)

Embedding ⇑(CategoryTheory.Limits.prod.map f g)


@[simp] theorem ForInStep.done_bindList [Monad m]
    (f : α → β → m (ForInStep β)) (a l) :
    (ForInStep.done a).bindList f l = pure (.done a)

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(f : α → β → m (ForInStep β))
(a : β)
(l : List α)

ForInStep.bindList f l (ForInStep.done a) = pure (ForInStep.done a)


@[simp] theorem oneCocycles_map_one (f : oneCocycles A) : f.1 1 = 0

{k G : Type u}
[CommRing k]
[Group G]
{A : Rep k G}
(f : ↥(groupCohomology.oneCocycles A))


/-- The inner product of two weighted sums, where the weights in each
sum add to 0, in terms of the norms of pairwise differences. -/
theorem inner_sum_smul_sum_smul_of_sum_eq_zero {ι₁ : Type*} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ}
    (v₁ : ι₁ → F) (h₁ : ∑ i ∈ s₁, w₁ i = 0) {ι₂ : Type*} {s₂ : Finset ι₂} {w₂ : ι₂ → ℝ}
    (v₂ : ι₂ → F) (h₂ : ∑ i ∈ s₂, w₂ i = 0) :
    ⟪∑ i₁ ∈ s₁, w₁ i₁ • v₁ i₁, ∑ i₂ ∈ s₂, w₂ i₂ • v₂ i₂⟫_ℝ =
      (-∑ i₁ ∈ s₁, ∑ i₂ ∈ s₂, w₁ i₁ * w₂ i₂ * (‖v₁ i₁ - v₂ i₂‖ * ‖v₁ i₁ - v₂ i₂‖)) / 2

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{ι₁ : Type u_4}
{s₁ : Finset ι₁}
{w₁ : ι₁ → ℝ}
(v₁ : ι₁ → F)
(h₁ : ∑ i ∈ s₁, w₁ i = 0)
{ι₂ : Type u_5}
{s₂ : Finset ι₂}
{w₂ : ι₂ → ℝ}
(v₂ : ι₂ → F)
(h₂ : ∑ i ∈ s₂, w₂ i = 0)


@[simp]
theorem image_Ioi (e : α ≃o β) (a : α) : e '' Ioi a = Ioi (e a)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(e : α ≃o β)
(a : α)


/-- `a : α` is a Stieltjes point for `f : α → ℚ → ℝ` if `f a` is monotone with limit 0 at -∞
and 1 at +∞ and satisfies a continuity property. -/
structure IsRatStieltjesPoint (f : α → ℚ → ℝ) (a : α) : Prop where
  mono : Monotone (f a)
  tendsto_atTop_one : Tendsto (f a) atTop (𝓝 1)
  tendsto_atBot_zero : Tendsto (f a) atBot (𝓝 0)
  iInf_rat_gt_eq : ∀ t : ℚ, ⨅ r : Ioi t, f a r = f a t

{f : α → ℚ → ℝ}

(self : ProbabilityTheory.IsRatStieltjesPoint f a)


@[simp]
theorem insert_empty (a) (b : β a) : insert a b ∅ = singleton a b

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(b : β a)

AList.insert a b ∅ = AList.singleton a b


@[simp]
theorem coe_codRestrict (f : A →⋆ₐ[R] B) (S : StarSubalgebra R B) (hf : ∀ x, f x ∈ S) (x : A) :
    ↑(f.codRestrict S hf x) = f x

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[Semiring B]
[Algebra R B]
[StarRing B]
[StarModule R B]
(f : A →⋆ₐ[R] B)
(S : StarSubalgebra R B)
(hf : ∀ (x : A), f x ∈ S)
(x : A)


theorem sin_nonneg_of_mem_Icc {x : ℝ} (hx : x ∈ Icc 0 π) : 0 ≤ sin x


theorem isFractionRing_iff [ValuationRing 𝒪] :
    IsFractionRing 𝒪 K ↔
      (∀ (x : K), ∃ a : 𝒪, x = algebraMap 𝒪 K a ∨ x⁻¹ = algebraMap 𝒪 K a) ∧
        Function.Injective (algebraMap 𝒪 K)

{𝒪 : Type u}
{K : Type v}
[CommRing 𝒪]
[IsDomain 𝒪]
[Field K]
[Algebra 𝒪 K]
[ValuationRing 𝒪]

IsFractionRing 𝒪 K ↔
  (∀ (x : K), ∃ a, x = (algebraMap 𝒪 K) a ∨ x⁻¹ = (algebraMap 𝒪 K) a) ∧ Function.Injective ⇑(algebraMap 𝒪 K)


@[ext]
theorem ext {f f' : MultilinearMap R M₁ M₂} (H : ∀ x, f x = f' x) : f = f'

(H : ∀ (x : (i : ι) → M₁ i), f x = f' x)


/-- A cofan over `f : β → C` consists of a collection of maps from every `f b` to an object `P`. -/
@[simps! pt ι_app]
def Cofan.mk {f : β → C} (P : C) (p : ∀ b, f b ⟶ P) : Cofan f

{β : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f : β → C}
(P : C)
(p : (b : β) → f b ⟶ P)

(CategoryTheory.Limits.Cofan.mk P p).pt = P