theorem midpoint_eq_midpoint_iff_vsub_eq_vsub {x x' y y' : P} :
    midpoint R x y = midpoint R x' y' ↔ x -ᵥ x' = y' -ᵥ y

(R : Type u_1)
{V : Type u_2}
{P : Type u_4}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x x' y y' : P}


/-- (Impl) A preliminary definition to avoid timeouts. -/
@[simps]
def conesEquivInverse (B : C) {J : Type w} (F : Discrete J ⥤ Over B) :
    Cone F ⥤ Cone (widePullbackDiagramOfDiagramOver B F)

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

(CategoryTheory.Over.ConstructProducts.conesEquivInverse B F).obj c =
  CategoryTheory.Over.ConstructProducts.conesEquivInverseObj B F c


@[to_additive]
theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N]
    (f : M →* N) (hf : Continuous f) : Continuous (Units.map f)

{M : Type u_3}
{N : Type u_4}
[Monoid M]
[Monoid N]
[TopologicalSpace M]
[TopologicalSpace N]
(f : M →* N)
(hf : Continuous ⇑f)


@[simp] lemma partition_one_parts (p : Partition 1) : p.parts = {1}


theorem diagonal_pullback_fst {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    diagonal (pullback.fst f g) =
      (pullbackSymmetry _ _).hom ≫
        ((Over.pullback f).map
              (Over.homMk (diagonal g) : Over.mk g ⟶ Over.mk (pullback.snd _ _ ≫ g))).left ≫
          (diagonalObjPullbackFstIso f g).inv

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Limits.HasPullbacks C]
{X Y Z : C}
(f : X ⟶ Z)
(g : Y ⟶ Z)

CategoryTheory.Limits.pullback.diagonal (CategoryTheory.Limits.pullback.fst f g) =
  (CategoryTheory.Limits.pullbackSymmetry f (CategoryTheory.Over.mk g).hom).hom ≫
    ((CategoryTheory.Over.pullback f).map
          (CategoryTheory.Over.homMk (CategoryTheory.Limits.pullback.diagonal g) ⋯)).left ≫
      (CategoryTheory.Limits.diagonalObjPullbackFstIso f g).inv


/-- An `R`-algebra `A` is unramified if it is formally unramified and of finite type.

Note that the Stacks project has a different definition of unramified, and tag
<https://stacks.math.columbia.edu/tag/00UU> shows that their definition is the
same as this one.
-/
class Unramified : Prop where
  formallyUnramified : FormallyUnramified R A := by infer_instance
  finiteType : FiniteType R A := by infer_instance

{R : Type u}
[CommSemiring R]
{A : Type u}
[Semiring A]
[Algebra R A]
[self : Algebra.Unramified R A]


theorem nontrivial_iff_card [Finite G] : Nontrivial G ↔ ∃ n > 0, Nat.card G = p ^ n

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


/-- The `p`-adic value of an integer `z ≠ 0` is its `p`-adic value as a rational. -/
@[simp]
theorem of_nat {n : ℕ} : padicValRat p n = padicValNat p n


@[to_additive]
theorem alternatingProd_append :
    ∀ l₁ l₂ : List α,
      alternatingProd (l₁ ++ l₂) = alternatingProd l₁ * alternatingProd l₂ ^ (-1 : ℤ) ^ length l₁

{α : Type u_2}
[CommGroup α]
(l₁ l₂ : List α)

(l₁ ++ l₂).alternatingProd = l₁.alternatingProd * l₂.alternatingProd ^ (-1) ^ l₁.length


theorem coeff_X_pow [DecidableEq σ] (m : σ →₀ ℕ) (s : σ) (n : ℕ) :
    coeff R m ((X s : MvPowerSeries σ R) ^ n) = if m = single s n then 1 else 0

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
[DecidableEq σ]
(m : σ →₀ ℕ)
(s : σ)
(n : ℕ)

(MvPowerSeries.coeff R m) (MvPowerSeries.X s ^ n) = if m = Finsupp.single s n then 1 else 0


theorem map_comap_le (f : P₁ →ᵃ[k] P₂) (s : AffineSubspace k P₂) : (s.comap f).map f ≤ s

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(f : P₁ →ᵃ[k] P₂)
(s : AffineSubspace k P₂)

AffineSubspace.map f (AffineSubspace.comap f s) ≤ s


theorem preimage_comp (s : Rel β γ) (t : Set γ) :
    preimage (r • s) t = preimage r (preimage s t)

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

(r.comp s).preimage t = r.preimage (s.preimage t)


theorem IsCompact.finite_of_discrete [DiscreteTopology X] (hs : IsCompact s) : s.Finite

{X : Type u}
[TopologicalSpace X]
{s : Set X}
[DiscreteTopology X]
(hs : IsCompact s)


@[simp]
theorem range_val (n : ℕ) : (range n).1 = Multiset.range n


theorem finrank_lt_of_rank_lt {n : ℕ} (h : Module.rank R M < ↑n) : finrank R M < n

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
{n : ℕ}
(h : Module.rank R M < ↑n)


theorem Frequently.forall_exists_of_atBot [SemilatticeInf α] [Nonempty α] {p : α → Prop}
    (h : ∃ᶠ x in atBot, p x) : ∀ a, ∃ b ≤ a, p b

{α : Type u_3}
[SemilatticeInf α]
[Nonempty α]
{p : α → Prop}
(h : ∃ᶠ (x : α) in Filter.atBot, p x)
(a : α)


theorem div_nonpos_iff : a / b ≤ 0 ↔ 0 ≤ a ∧ b ≤ 0 ∨ a ≤ 0 ∧ 0 ≤ b

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


@[simp]
theorem beth_le {o₁ o₂ : Ordinal} : beth o₁ ≤ beth o₂ ↔ o₁ ≤ o₂

Cardinal.beth o₁ ≤ Cardinal.beth o₂ ↔ o₁ ≤ o₂


theorem comap_coe_eq_uniformity :
    ((𝓤 _).comap fun p : α × α => ((p.1 : Completion α), (p.2 : Completion α))) = 𝓤 α

Filter.comap (fun p => (↑α p.1, ↑α p.2)) (𝓤 (UniformSpace.Completion α)) = 𝓤 α


@[simp]
theorem μ_hom_inv_id (X Y : C) : F.μ X Y ≫ (F.μIso X Y).inv = 𝟙 _

(F : CategoryTheory.MonoidalFunctor C D)

F.μ X Y ≫ (F.μIso X Y).inv = 𝟙 (CategoryTheory.MonoidalCategory.tensorObj (F.obj X) (F.obj Y))


@[simp]
theorem valuation_of_unit_mod_eq (n : ℕ) (x : Rˣ) :
    v.valuationOfNeZeroMod n (Units.map (algebraMap R K : R →* K) x : K/n) = 1

(v : IsDedekindDomain.HeightOneSpectrum R)

(v.valuationOfNeZeroMod n) ↑((Units.map ↑(algebraMap R K)) x) = 1


@[simp] theorem forall_eq_or_imp : (∀ a, a = a' ∨ q a → p a) ↔ p a' ∧ ∀ a, q a → p a

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

(∀ (a : α), a = a' ∨ q a → p a) ↔ p a' ∧ ∀ (a : α), q a → p a


@[simp, norm_cast]
theorem coe_bot : ⇑(⊥ : RingCon R) = Eq


/-- `IsIntegralClosure A R B` is the characteristic predicate stating `A` is
the integral closure of `R` in `B`,
i.e. that an element of `B` is integral over `R` iff it is an element of (the image of) `A`.
-/
class IsIntegralClosure (A R B : Type*) [CommRing R] [CommSemiring A] [CommRing B] [Algebra R B]
  [Algebra A B] : Prop where
  algebraMap_injective' : Function.Injective (algebraMap A B)
  isIntegral_iff : ∀ {x : B}, IsIntegral R x ↔ ∃ y, algebraMap A B y = x

{A : Type u_1}
(R : Type u_2)
{B : Type u_3}
[CommRing R]
[CommSemiring A]
[CommRing B]
[Algebra R B]
[Algebra A B]
[self : IsIntegralClosure A R B]


theorem antivaryOn_const_left (g : ι → β) (a : α) (s : Set ι) : AntivaryOn (const ι a) g s

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


theorem lmapDomain_total (f : α → α') (g : M →ₗ[R] M') (h : ∀ i, g (v i) = v' (f i)) :
    (Finsupp.total α' M' R v').comp (lmapDomain R R f) = g.comp (Finsupp.total α M R v)

{α : Type u_1}
{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α' : Type u_7}
{M' : Type u_8}
[AddCommMonoid M']
[Module R M']
{v : α → M}
{v' : α' → M'}
(f : α → α')
(g : M →ₗ[R] M')
(h : ∀ (i : α), g (v i) = v' (f i))

Finsupp.total α' M' R v' ∘ₗ Finsupp.lmapDomain R R f = g ∘ₗ Finsupp.total α M R v


/-- The canonical comparison functor between the indexing category of the presentation and the
    comma category `CostructuredArrow yoneda A`. This functor is always final. -/
@[simps! obj_left obj_right_as obj_hom map_left]
def toCostructuredArrow : P.I ⥤ CostructuredArrow yoneda A

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

(P : CategoryTheory.Limits.IndObjectPresentation A)

(P.toCostructuredArrow.obj X).left = P.F.obj X


@[simp] theorem UInt16.toUInt32_toNat (x : UInt16) : x.toUInt32.toNat = x.toNat


@[simp]
theorem coe_one : ⇑(1 : α →ᵈ α) = id


@[simp]
lemma monovaryOn_inv_right₀ (hg : ∀ i ∈ s, 0 < g i) : MonovaryOn f g⁻¹ s ↔ AntivaryOn f g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemifield α]
[LinearOrderedSemifield β]
{s : Set ι}
{f : ι → α}
{g : ι → β}
(hg : ∀ i ∈ s, 0 < g i)


@[simp]
theorem toIcoDiv_add_left' (a b : α) : toIcoDiv hp (p + a) b = toIcoDiv hp a b - 1

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


@[simp] theorem coe_map : (N.map f : Set M') = f '' N

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


/-- The inverse of a bijective `MonoidHom` is a `MonoidHom`. -/
@[to_additive (attr := simps)
  "The inverse of a bijective `AddMonoidHom` is an `AddMonoidHom`."]
def MonoidHom.inverse {A B : Type*} [Monoid A] [Monoid B] (f : A →* B) (g : B → A)
    (h₁ : Function.LeftInverse g f) (h₂ : Function.RightInverse g f) : B →* A

{A : Type u_12}
{B : Type u_13}
[AddMonoid A]
[AddMonoid B]
(f : A →+ B)
(g : B → A)
(h₁ : Function.LeftInverse g ⇑f)
(h₂ : Function.RightInverse g ⇑f)


@[simp]
theorem Matrix.toLin_one : Matrix.toLin v₁ v₁ 1 = LinearMap.id

{R : Type u_1}
[CommSemiring R]
{n : Type u_4}
[Fintype n]
[DecidableEq n]
{M₁ : Type u_5}
[AddCommMonoid M₁]
[Module R M₁]
(v₁ : Basis n R M₁)


/-- Power series terms are analytic as we vary the origin -/
theorem analyticAt_changeOrigin (p : FormalMultilinearSeries 𝕜 E F) (rp : p.radius > 0) (n : ℕ) :
    AnalyticAt 𝕜 (fun x ↦ p.changeOrigin x n) 0

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
(p : FormalMultilinearSeries 𝕜 E F)
(rp : p.radius > 0)
(n : ℕ)

AnalyticAt 𝕜 (fun x => p.changeOrigin x n) 0


/-- Any ring homomorphism `f : R →+* T` which respects a relation `r : R → R → Prop`
factors uniquely through a morphism `RingQuot r →+* T`.
-/
irreducible_def lift {r : R → R → Prop} :
  { f : R →+* T // ∀ ⦃x y⦄, r x y → f x = f y } ≃ (RingQuot r →+* T)

{R : Type u_1}
[Semiring R]
{T : Type u_2}
[Semiring T]
{r : R → R → Prop}

RingQuot.lift =
  { toFun := fun f => RingQuot.preLift ⋯, invFun := fun F => ⟨F.comp (RingQuot.mkRingHom r), ⋯⟩, left_inv := ⋯,
    right_inv := ⋯ }


@[to_additive]
theorem mulEquiv_symm_apply (e : α ≃ β) [Mul β] (b : β) :
    letI := Equiv.mul e
    (mulEquiv e).symm b = e.symm b

{α : Type u}
{β : Type v}
(e : α ≃ β)
[Add β]
(b : β)


/-- **Stirling's Formula**, formulated in terms of `Asymptotics.IsEquivalent`. -/
lemma factorial_isEquivalent_stirling :
    (fun n ↦ n ! : ℕ → ℝ) ~[atTop] fun n ↦ Real.sqrt (2 * n * π) * (n / exp 1) ^ n

(fun n => ↑n !) ~[Filter.atTop] fun n => √(2 * ↑n * π) * (↑n / rexp 1) ^ n


/-- A linear order is reflexive, transitive, antisymmetric and total relation `≤`.
We assume that every linear ordered type has decidable `(≤)`, `(<)`, and `(=)`. -/
class LinearOrder (α : Type u) extends PartialOrder α, Min α, Max α, Ord α :=
  /-- A linear order is total. -/
  le_total (a b : α) : a ≤ b ∨ b ≤ a
  /-- In a linearly ordered type, we assume the order relations are all decidable. -/
  decidableLE : DecidableRel (· ≤ · : α → α → Prop)
  /-- In a linearly ordered type, we assume the order relations are all decidable. -/
  decidableEq : DecidableEq α := @decidableEqOfDecidableLE _ _ decidableLE
  /-- In a linearly ordered type, we assume the order relations are all decidable. -/
  decidableLT : DecidableRel (· < · : α → α → Prop) :=
    @decidableLTOfDecidableLE _ _ decidableLE
  min := fun a b => if a ≤ b then a else b
  max := fun a b => if a ≤ b then b else a
  /-- The minimum function is equivalent to the one you get from `minOfLe`. -/
  min_def : ∀ a b, min a b = if a ≤ b then a else b := by intros; rfl
  /-- The minimum function is equivalent to the one you get from `maxOfLe`. -/
  max_def : ∀ a b, max a b = if a ≤ b then b else a := by intros; rfl
  compare a b := compareOfLessAndEq a b
  /-- Comparison via `compare` is equal to the canonical comparison given decidable `<` and `=`. -/
  compare_eq_compareOfLessAndEq : ∀ a b, compare a b = compareOfLessAndEq a b := by
    compareOfLessAndEq_rfl

{α : Type u}
[self : LinearOrder α]
(a b : α)


/-- Monotone convergence theorem for real-valued functions and Bochner integrals -/
lemma integral_tendsto_of_tendsto_of_monotone {μ : Measure α} {f : ℕ → α → ℝ} {F : α → ℝ}
    (hf : ∀ n, Integrable (f n) μ) (hF : Integrable F μ) (h_mono : ∀ᵐ x ∂μ, Monotone fun n ↦ f n x)
    (h_tendsto : ∀ᵐ x ∂μ, Tendsto (fun n ↦ f n x) atTop (𝓝 (F x))) :
    Tendsto (fun n ↦ ∫ x, f n x ∂μ) atTop (𝓝 (∫ x, F x ∂μ))

{f : ℕ → α → ℝ}

(hf : ∀ (n : ℕ), MeasureTheory.Integrable (f n) μ)

(h_mono : ∀ᵐ (x : α) ∂μ, Monotone fun n => f n x)

(h_tendsto : ∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => f n x) Filter.atTop (𝓝 (F x)))

Filter.Tendsto (fun n => ∫ (x : α), f n x ∂μ) Filter.atTop (𝓝 (∫ (x : α), F x ∂μ))


@[to_additive] -- Porting note (#10618): `simp` can prove this
theorem mul_mem_closedBall_mul_iff {c : E} : a * c ∈ closedBall (b * c) r ↔ a ∈ closedBall b r

{E : Type u_6}
[SeminormedCommGroup E]
{a b : E}
{r : ℝ}
{c : E}

a * c ∈ Metric.closedBall (b * c) r ↔ a ∈ Metric.closedBall b r


@[simp]
theorem map_empty (f : α ↪ β) : (∅ : Finset α).map f = ∅

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


theorem sup'_product_left {t : Finset γ} (h : (s ×ˢ t).Nonempty) (f : β × γ → α) :
    (s ×ˢ t).sup' h f = s.sup' h.fst fun i => t.sup' h.snd fun i' => f ⟨i, i'⟩

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeSup α]
{s : Finset β}
{t : Finset γ}
(h : (s ×ˢ t).Nonempty)
(f : β × γ → α)

(s ×ˢ t).sup' h f = s.sup' ⋯ fun i => t.sup' ⋯ fun i' => f (i, i')


/-- The image of an open set under a continuous map is analytic. -/
theorem _root_.IsOpen.analyticSet_image {β : Type*} [TopologicalSpace β] [PolishSpace β]
    {s : Set β} (hs : IsOpen s) {f : β → α} (f_cont : Continuous f) : AnalyticSet (f '' s)

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_3}
[TopologicalSpace β]
[PolishSpace β]
{s : Set β}
(hs : IsOpen s)
{f : β → α}
(f_cont : Continuous f)


theorem mem_iff {a : α} {s : Finmap β} : a ∈ s ↔ ∃ b, s.lookup a = some b

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{s : Finmap β}


theorem eval₂_map [Semiring T] (g : S →+* T) (x : T) :
    (p.map f).eval₂ g x = p.eval₂ (g.comp f) x

{R : Type u}
{S : Type v}
{T : Type w}
[Semiring R]
{p : R[X]}
[Semiring S]
(f : R →+* S)
[Semiring T]
(g : S →+* T)
(x : T)

Polynomial.eval₂ g x (Polynomial.map f p) = Polynomial.eval₂ (g.comp f) x p


theorem of_eq : ∀ s,
    s.str.1 = l ++ m ++ r →
    s.startPos.1 = utf8Len l →
    s.stopPos.1 = utf8Len l + utf8Len m →
    ValidFor l m r s

s.str.data = l ++ m ++ r →
  s.startPos.byteIdx = String.utf8Len l →
    s.stopPos.byteIdx = String.utf8Len l + String.utf8Len m → Substring.ValidFor l m r s


/-- The functor out of the category of elements which forgets the element. -/
@[simps]
def π : F.Elements ⥤ C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : CategoryTheory.Functor C (Type w))
(X : F.Elements)

(CategoryTheory.CategoryOfElements.π F).obj X = X.fst


theorem isLocalHomeomorph_iff_openEmbedding_restrict {f : X → Y} :
    IsLocalHomeomorph f ↔ ∀ x : X, ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}

IsLocalHomeomorph f ↔ ∀ (x : X), ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f)


theorem natAbs_lt_iff_sq_lt {a b : ℤ} : a.natAbs < b.natAbs ↔ a ^ 2 < b ^ 2


theorem isClopen_connectedComponent [LocallyConnectedSpace α] {x : α} :
    IsClopen (connectedComponent x)

{α : Type u}
[TopologicalSpace α]
[LocallyConnectedSpace α]
{x : α}


lemma toHomeomorph_apply (e : X ≃ Y) (he) (x : X) : e.toHomeomorph he x = e x

(he : ∀ (s : Set Y), IsOpen (⇑e ⁻¹' s) ↔ IsOpen s)


@[higher_order tfst_comp_tfst]
theorem comp_tfst {α₀ α₁ α₂ β} (f : α₀ → F α₁) (f' : α₁ → G α₂) (x : t α₀ β) :
    Comp.mk (tfst f' <$> tfst f x) = tfst (Comp.mk ∘ map f' ∘ f) x

{t : Type u → Type u → Type u}
[Bitraversable t]
{F G : Type u → Type u}
[Applicative F]
[Applicative G]
[LawfulBitraversable t]
[LawfulApplicative F]
[LawfulApplicative G]
{α₀ α₁ α₂ β : Type u}
(f : α₀ → F α₁)
(f' : α₁ → G α₂)

Functor.Comp.mk ∘ Functor.map (Bitraversable.tfst f') ∘ Bitraversable.tfst f =
  Bitraversable.tfst (Functor.Comp.mk ∘ Functor.map f' ∘ f)


theorem sup_le_lsub {ι : Type u} (f : ι → Ordinal.{max u v}) : sup.{_, v} f ≤ lsub.{_, v} f


/-- For functors out of a discrete category,
a natural transformation is just a collection of maps,
as the naturality squares are trivial.
-/
@[simps]
def natTrans {I : Type u₁} {F G : Discrete I ⥤ C} (f : ∀ i : Discrete I, F.obj i ⟶ G.obj i) :
    F ⟶ G

{F G : CategoryTheory.Functor (CategoryTheory.Discrete I) C}

(f : (i : CategoryTheory.Discrete I) → F.obj i ⟶ G.obj i)

(CategoryTheory.Discrete.natTrans f).app i = f i


/-- Homotopy to zero for maps constructed with `nullHomotopicMap'` -/
@[simps!]
def nullHomotopy' (h : ∀ i j, c.Rel j i → (C.X i ⟶ D.X j)) : Homotopy (nullHomotopicMap' h) 0

(h : (i j : ι) → c.Rel j i → (C.X i ⟶ D.X j))

(Homotopy.nullHomotopy' h).hom i j = dite (c.Rel j i) (h i j) fun x => 0


theorem Subset.antisymm {s₁ s₂ : Finset α} (H₁ : s₁ ⊆ s₂) (H₂ : s₂ ⊆ s₁) : s₁ = s₂

{α : Type u_1}
{s₁ s₂ : Finset α}
(H₁ : s₁ ⊆ s₂)
(H₂ : s₂ ⊆ s₁)


/-- A natural transformation `L₁ ⟶ L₂` induces a functor `Comma L₂ R ⥤ Comma L₁ R`. -/
@[simps]
def mapLeft (l : L₁ ⟶ L₂) : Comma L₂ R ⥤ Comma L₁ R

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

((CategoryTheory.Comma.mapLeft R l).obj X).right = X.right


@[deprecated mem_coclosedCompact_iff (since := "2024-02-16")]
theorem mem_coclosed_compact' : s ∈ coclosedCompact X ↔ ∃ t, IsClosed t ∧ IsCompact t ∧ sᶜ ⊆ t

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

s ∈ Filter.coclosedCompact X ↔ ∃ t, IsClosed t ∧ IsCompact t ∧ sᶜ ⊆ t


theorem closure.isSubfield : IsSubfield (closure S)


theorem AffineEquiv.pointReflection_midpoint_right (x y : P) :
    pointReflection R (midpoint R x y) y = x

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(x y : P)

(AffineEquiv.pointReflection R (midpoint R x y)) y = x


theorem splits_prod {ι : Type u} {s : ι → K[X]} {t : Finset ι} :
    (∀ j ∈ t, (s j).Splits i) → (∏ x ∈ t, s x).Splits i

{K : Type v}
{L : Type w}
[CommRing K]
[Field L]
(i : K →+* L)
{ι : Type u}
{s : ι → K[X]}
{t : Finset ι}

(∀ j ∈ t, Polynomial.Splits i (s j)) → Polynomial.Splits i (∏ x ∈ t, s x)


/-- **Tannery's theorem**: topological sums commute with termwise limits, when the norms of the
summands are eventually uniformly bounded by a summable function.

(This is the special case of the Lebesgue dominated convergence theorem for the counting measure
on a discrete set. However, we prove it under somewhat weaker assumptions than the general
measure-theoretic result, e.g. `G` is not assumed to be an `ℝ`-vector space or second countable,
and the limit is along an arbitrary filter rather than `atTop ℕ`.)

See also:
* `MeasureTheory.tendsto_integral_of_dominated_convergence` (for general integrals, but
  with more assumptions on `G`)
* `continuous_tsum` (continuity of infinite sums in a parameter)
-/
lemma tendsto_tsum_of_dominated_convergence {α β G : Type*} {𝓕 : Filter α}
    [NormedAddCommGroup G] [CompleteSpace G]
    {f : α → β → G} {g : β → G} {bound : β → ℝ} (h_sum : Summable bound)
    (hab : ∀ k : β, Tendsto (f · k) 𝓕 (𝓝 (g k)))
    (h_bound : ∀ᶠ n in 𝓕, ∀ k, ‖f n k‖ ≤ bound k) :
    Tendsto (∑' k, f · k) 𝓕 (𝓝 (∑' k, g k))

(hab : ∀ (k : β), Filter.Tendsto (fun x => f x k) 𝓕 (𝓝 (g k)))

(h_bound : ∀ᶠ (n : α) in 𝓕, ∀ (k : β), ‖f n k‖ ≤ bound k)

Filter.Tendsto (fun x => ∑' (k : β), f x k) 𝓕 (𝓝 (∑' (k : β), g k))


/-- The ring equiv `R/I ≃+* S/J` induced by a ring equiv `f : R ≃+* S`, where `J = f(I)`. -/
@[simps]
def quotientEquiv (I : Ideal R) (J : Ideal S) (f : R ≃+* S) (hIJ : J = I.map (f : R →+* S)) :
    R ⧸ I ≃+* S ⧸ J

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
(I : Ideal R)
(J : Ideal S)
(f : R ≃+* S)
(hIJ : J = Ideal.map (↑f) I)

∀ (a : R ⧸ I), (I.quotientEquiv J f hIJ) a = (↑↑(Ideal.quotientMap J ↑f ⋯)).toFun a


@[instance]
theorem ordConnected_Ioo {a b : α} : OrdConnected (Ioo a b)


protected theorem mul_div_mul_right {m : Nat} (n k : Nat) (H : 0 < m) :
    n * m / (k * m) = n / k


/-- `SatisfiesM` distributes over `<*`, general version. -/
protected theorem seqLeft [Applicative m] [LawfulApplicative m] {x : m α}
    (hx : SatisfiesM p₁ x) (hy : SatisfiesM p₂ y)
    (H : ∀ {a b}, p₁ a → p₂ b → q a) : SatisfiesM q (x <* y)

{m : Type u_1 → Type u_2}
{α : Type u_1}
{p₁ : α → Prop}

∀ {a : Type u_1} {p₂ : a → Prop} {y : m a} {q : α → Prop} [inst : Applicative m] [inst_1 : LawfulApplicative m]
  {x : m α},
  SatisfiesM p₁ x →
    SatisfiesM p₂ y → (∀ {a_1 : α} {b : a}, p₁ a_1 → p₂ b → q a_1) → SatisfiesM q (SeqLeft.seqLeft x fun x => y)


@[to_additive]
lemma isTorsionFree_iff_torsion_eq_bot {G} [CommGroup G] :
    IsTorsionFree G ↔ CommGroup.torsion G = ⊥

Monoid.IsTorsionFree G ↔ CommGroup.torsion G = ⊥


/-- A **corner** of a set `A` in an abelian group is a triple of points of the form
`(x, y), (x + d, y), (x, y + d)`. It is **nontrivial** if `d ≠ 0`.

Here we define it as triples `(x₁, y₁), (x₂, y₁), (x₁, y₂)` where `x₁ + y₂ = x₂ + y₁` in order for
the definition to make sense in commutative monoids, the motivating example being `ℕ`. -/
@[mk_iff]
structure IsCorner (A : Set (G × G)) (x₁ y₁ x₂ y₂ : G) : Prop where
  fst_fst_mem : (x₁, y₁) ∈ A
  fst_snd_mem : (x₁, y₂) ∈ A
  snd_fst_mem : (x₂, y₁) ∈ A
  add_eq_add : x₁ + y₂ = x₂ + y₁

{G : Type u_1}
[AddCommMonoid G]
(A : Set (G × G))
(x₁ y₁ x₂ y₂ : G)

IsCorner A x₁ y₁ x₂ y₂ ↔ (x₁, y₁) ∈ A ∧ (x₁, y₂) ∈ A ∧ (x₂, y₁) ∈ A ∧ x₁ + y₂ = x₂ + y₁


@[to_additive]
theorem _root_.hasCompactMulSupport_iff_eventuallyEq :
    HasCompactMulSupport f ↔ f =ᶠ[coclosedCompact α] 1

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[One β]
{f : α → β}

HasCompactMulSupport f ↔ f =ᶠ[Filter.coclosedCompact α] 1


@[simp]
lemma coe_toLinearMap_mul {e₁ e₂ : M ≃ₗ[R] M} :
    (↑(e₁ * e₂) : M →ₗ[R] M) = (e₁ : M →ₗ[R] M) * (e₂ : M →ₗ[R] M)

{R : Type u_1}
{M : Type u_8}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{e₁ e₂ : M ≃ₗ[R] M}


/-- A version of `EulerProduct.summable_and_hasSum_factoredNumbers_prod_filter_prime_geometric`
in terms of the value of the series. -/
lemma prod_filter_prime_geometric_eq_tsum_factoredNumbers {f : ℕ →* F} (hsum : Summable f)
    (s : Finset ℕ) :
    ∏ p ∈ s.filter Nat.Prime, (1 - f p)⁻¹ = ∑' m : factoredNumbers s, f m

{F : Type u_1}
[NormedField F]
[CompleteSpace F]
{f : ℕ →* F}
(hsum : Summable ⇑f)
(s : Finset ℕ)

∏ p ∈ Finset.filter Nat.Prime s, (1 - f p)⁻¹ = ∑' (m : ↑(Nat.factoredNumbers s)), f ↑m


theorem floor_add_one (ha : 0 ≤ a) : ⌊a + 1⌋₊ = ⌊a⌋₊ + 1

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
(ha : 0 ≤ a)


/-- Composition on the left by a (continuous) homomorphism of topological `R`-algebras, as an
`AlgHom`. Similar to `AlgHom.compLeft`. -/
@[simps!]
protected def AlgHom.compLeftContinuous {α : Type*} [TopologicalSpace α] (g : A →ₐ[R] A₂)
    (hg : Continuous g) : C(α, A) →ₐ[R] C(α, A₂)

(R : Type u_2)
[CommSemiring R]
{A : Type u_3}
[TopologicalSpace A]
[Semiring A]
[Algebra R A]
[TopologicalSemiring A]
{A₂ : Type u_4}
[TopologicalSpace A₂]
[Semiring A₂]
[Algebra R A₂]
[TopologicalSemiring A₂]
{α : Type u_5}
[TopologicalSpace α]
(g : A →ₐ[R] A₂)
(hg : Continuous ⇑g)
(f : C(α, A))

∀ (a : α), ((AlgHom.compLeftContinuous R g hg) f) a = g (f a)


@[simp]
theorem AlgHom.restrict_liftNormal (ϕ : K₁ →ₐ[F] K₁) [Normal F K₁] [Normal F E] :
    (ϕ.liftNormal E).restrictNormal K₁ = ϕ

{F : Type u_1}
{K₁ : Type u_3}
[Field F]
[Field K₁]
[Algebra F K₁]
(E : Type u_6)
[Field E]
[Algebra F E]
[Algebra K₁ E]
[IsScalarTower F K₁ E]
(ϕ : K₁ →ₐ[F] K₁)
[Normal F K₁]
[Normal F E]


theorem or_eq_of_eq_true_left {a b : Prop} (h : a = True) : (a ∨ b) = True


theorem zipLeft_cons_nil :
    zipLeft (a :: as) ([] : List β) = (a, none) :: as.map fun a => (a, none)

{α : Type u}
{β : Type v}
(a : α)
(as : List α)

(a :: as).zipLeft [] = (a, none) :: List.map (fun a => (a, none)) as


theorem disjoint_atTop_atBot [PartialOrder α] [Nontrivial α] : Disjoint (atTop : Filter α) atBot

{α : Type u_3}
[PartialOrder α]
[Nontrivial α]


theorem IsCompl.map (h : IsCompl a b) : IsCompl (f a) (f b)

{F : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Lattice α]
[BoundedOrder α]
[Lattice β]
[BoundedOrder β]
[FunLike F α β]
[BoundedLatticeHomClass F α β]
(f : F)
{a b : α}
(h : IsCompl a b)


@[simp]
theorem pointwise_smul_le_pointwise_smul_iff {a : M} {S T : Subsemiring R} :
    a • S ≤ a • T ↔ S ≤ T

{M : Type u_1}
{R : Type u_2}
[Group M]
[Semiring R]
[MulSemiringAction M R]
{a : M}
{S T : Subsemiring R}


@[to_additive (attr := simp)] theorem inv_symm : (inv G).symm = inv G

(G : Type v)
[AddGroup G]
[PseudoEMetricSpace G]
[IsometricVAdd G G]
[IsometricVAdd Gᵃᵒᵖ G]

(IsometryEquiv.neg G).symm = IsometryEquiv.neg G


@[simp]
theorem diagramIso_hom_app_left (i : D.J × D.J) :
    (D.diagramIso F).hom.app (WalkingMultispan.left i) = 𝟙 _

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

(D.diagramIso F).hom.app (CategoryTheory.Limits.WalkingMultispan.left i) =
  CategoryTheory.CategoryStruct.id ((D.diagram.multispan.comp F).obj (CategoryTheory.Limits.WalkingMultispan.left i))


/-- Two real exponents `p, q` are conjugate if they are `> 1` and satisfy the equality
`1/p + 1/q = 1`. This condition shows up in many theorems in analysis, notably related to `L^p`
norms. -/
@[mk_iff]
structure IsConjExponent (p q : ℝ) : Prop where
  one_lt : 1 < p
  inv_add_inv_conj : p⁻¹ + q⁻¹ = 1

p.IsConjExponent q ↔ 1 < p ∧ p⁻¹ + q⁻¹ = 1


theorem tr_respects :
    Respects (TM1.step M) (TM0.step (tr M)) fun (c₁ : Cfg₁) (c₂ : Cfg₁₀) ↦ trCfg M c₁ = c₂

{Γ : Type u_1}
[Inhabited Γ]
{Λ : Type u_2}
[Inhabited Λ]
{σ : Type u_3}
[Inhabited σ]
(M : Λ → Turing.TM1.Stmt Γ Λ σ)

Turing.Respects (Turing.TM1.step M) (Turing.TM0.step (Turing.TM1to0.tr M)) fun c₁ c₂ => Turing.TM1to0.trCfg M c₁ = c₂


@[simp]
theorem sublists_concat (l : List α) (a : α) :
    sublists (l ++ [a]) = sublists l ++ map (fun x => x ++ [a]) (sublists l)

(l ++ [a]).sublists = l.sublists ++ List.map (fun x => x ++ [a]) l.sublists


@[to_additive]
theorem prehaar_sup_eq {K₀ : PositiveCompacts G} {U : Set G} {K₁ K₂ : Compacts G}
    (hU : (interior U).Nonempty) (h : Disjoint (K₁.1 * U⁻¹) (K₂.1 * U⁻¹)) :
    prehaar (K₀ : Set G) U (K₁ ⊔ K₂) = prehaar (K₀ : Set G) U K₁ + prehaar (K₀ : Set G) U K₂

{K₀ : TopologicalSpace.PositiveCompacts G}

(h : Disjoint (K₁.carrier + -U) (K₂.carrier + -U))

MeasureTheory.Measure.haar.addPrehaar (↑K₀) U (K₁ ⊔ K₂) =
  MeasureTheory.Measure.haar.addPrehaar (↑K₀) U K₁ + MeasureTheory.Measure.haar.addPrehaar (↑K₀) U K₂


/-- Let `G` be a nonarchimedean multiplicative abelian group, and let `f : α → G` be a function that
tends to one on the filter of cofinite sets. For each finite subset of `α`, consider the partial
product of `f` on that subset. These partial products form a Cauchy filter. -/
@[to_additive "Let `G` be a nonarchimedean additive abelian group, and let `f : α → G` be a function
that tends to zero on the filter of cofinite sets. For each finite subset of `α`, consider the
partial sum of `f` on that subset. These partial sums form a Cauchy filter."]
theorem cauchySeq_prod_of_tendsto_cofinite_one {f : α → G} (hf : Tendsto f cofinite (𝓝 1)) :
    CauchySeq (fun s ↦ ∏ i ∈ s, f i)

(hf : Filter.Tendsto f Filter.cofinite (𝓝 1))


/-- A generalized co-Heyting algebra is a lattice with an additional binary
difference operation `\` such that `\ a` is right adjoint to `⊔ a`.

This generalizes `CoheytingAlgebra` by not requiring a top element. -/
class GeneralizedCoheytingAlgebra (α : Type*) extends Lattice α, OrderBot α, SDiff α where
  /-- `\ a` is right adjoint to `⊔ a` -/
  sdiff_le_iff (a b c : α) : a \ b ≤ c ↔ a ≤ b ⊔ c

{α : Type u_4}
[self : GeneralizedCoheytingAlgebra α]
(a b c : α)


lemma singularPart_compl_mutuallySingularSetSlice (κ η : Kernel α γ) [IsSFiniteKernel κ]
    [IsSFiniteKernel η] (a : α) :
    singularPart κ η a (mutuallySingularSetSlice κ η a)ᶜ = 0

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

((κ.singularPart η) a) (κ.mutuallySingularSetSlice η a)ᶜ = 0


@[simp]
theorem spanNorm_bot [Nontrivial S] [Module.Free R S] [Module.Finite R S] :
    spanNorm R (⊥ : Ideal S) = ⊥

(R : Type u_1)
[CommRing R]
{S : Type u_2}
[CommRing S]
[Algebra R S]
[Nontrivial S]
[Module.Free R S]
[Module.Finite R S]


theorem Path.cast_eq_iff_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (p : Path u v)
    (p' : Path u' v') : p.cast hu hv = p' ↔ HEq p p'

{U : Type u_1}
[Quiver U]
{u v u' v' : U}
(hu : u = u')
(hv : v = v')
(p : Quiver.Path u v)
(p' : Quiver.Path u' v')

Quiver.Path.cast hu hv p = p' ↔ HEq p p'


/-- The equivalence of categories `(J → C) ≌ (Discrete J ⥤ C)`. -/
@[simps]
def piEquivalenceFunctorDiscrete (J : Type u₂) (C : Type u₁) [Category.{v₁} C] :
    (J → C) ≌ (Discrete J ⥤ C)

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

(CategoryTheory.piEquivalenceFunctorDiscrete J C).functor.obj F = CategoryTheory.Discrete.functor F


@[simp] lemma dens_pos : 0 < dens s ↔ s.Nonempty

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


@[simp]
theorem add (hf : IntervalIntegrable f μ a b) (hg : IntervalIntegrable g μ a b) :
    IntervalIntegrable (fun x => f x + g x) μ a b

{E : Type u_3}
[NormedAddCommGroup E]
{f g : ℝ → E}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(hf : IntervalIntegrable f μ a b)
(hg : IntervalIntegrable g μ a b)


theorem TrailingMonic.def : TrailingMonic p ↔ trailingCoeff p = 1


theorem complex_d_comp (n : ℕ) :
    I.cocomplex.d n (n + 1) ≫ I.cocomplex.d (n + 1) (n + 2) = 0

(I : CategoryTheory.InjectiveResolution Z)

CategoryTheory.CategoryStruct.comp (I.cocomplex.d n (n + 1)) (I.cocomplex.d (n + 1) (n + 2)) = 0


lemma flat_iff_isClosed : M.Flat F ↔ ∃ h : F ⊆ M.E, M.subtypeClosure.IsClosed ⟨F, h⟩

{α : Type u_2}
{M : Matroid α}
{F : Set α}

M.Flat F ↔ ∃ (h : F ⊆ M.E), M.subtypeClosure.IsClosed ⟨F, h⟩


@[simp]
theorem map_coeff (f : R →+* S) (x : 𝕎 R) (n : ℕ) : (map f x).coeff n = f (x.coeff n)

{p : ℕ}
{R : Type u_1}
{S : Type u_2}
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CommRing S]
(f : R →+* S)
(x : 𝕎 R)
(n : ℕ)

((WittVector.map f) x).coeff n = f (x.coeff n)


lemma wellFounded_gt [LT α] [WellFoundedGT α] : @WellFounded α (· > ·)


theorem WithSeminorms.toLocallyConvexSpace {p : SeminormFamily 𝕜 E ι} (hp : WithSeminorms p) :
    LocallyConvexSpace ℝ E

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[Nonempty ι]
[NormedField 𝕜]
[NormedSpace ℝ 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Module ℝ E]
[IsScalarTower ℝ 𝕜 E]
[TopologicalSpace E]
{p : SeminormFamily 𝕜 E ι}
(hp : WithSeminorms p)


theorem smeval_X_pow_assoc (m n : ℕ) :
    x ^ m * x ^ n * p.smeval x = x ^ m * (x ^ n * p.smeval x)

(R : Type u_1)
[Semiring R]
(p : Polynomial R)
{S : Type u_2}
[NonAssocSemiring S]
[Module R S]
[SMulCommClass R S S]
[Pow S ℕ]
[NatPowAssoc S]
(x : S)
(m n : ℕ)


lemma isUnit_ne_iff_eq_neg (hu : IsUnit u) (hv : IsUnit v) : u ≠ v ↔ u = -v

{u v : ℤ}
(hu : IsUnit u)
(hv : IsUnit v)


theorem IsUltrahomogeneous.age_isFraisse [Countable M] (h : L.IsUltrahomogeneous M) :
    IsFraisse (L.age M)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
[Countable M]
(h : L.IsUltrahomogeneous M)


@[bv_toNat] theorem le_def (x y : BitVec n) :
  x ≤ y ↔ x.toNat ≤ y.toNat


lemma isBigO_atTop_F_int_one (a : UnitAddCircle) : ∃ p, 0 < p ∧
    F_int 1 a =O[atTop] fun t ↦ exp (-p * t)

∃ p, 0 < p ∧ HurwitzKernelBounds.F_int 1 a =O[Filter.atTop] fun t => rexp (-p * t)


@[to_additive (attr := simp)]
lemma max_mul_min (a b : α) : max a b * min a b = a * b

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


@[to_additive]
lemma prod_erase_of_comm [DecidableEq M] (ha : a ∈ l) (comm : ∀ x ∈ l, ∀ y ∈ l, x * y = y * x) :
    a * (l.erase a).prod = l.prod

(comm : ∀ x ∈ l, ∀ y ∈ l, x + y = y + x)


@[simp]
theorem cos_abs : cos |x| = cos x


@[ext]
lemma homCategory.ext {F G : 𝒳 ⥤ᵇ 𝒴} (α β : F ⟶ G) (h : α.toNatTrans = β.toNatTrans) : α = β

{𝒮 : Type u₁}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
{𝒳 : CategoryTheory.BasedCategory 𝒮}
{𝒴 : CategoryTheory.BasedCategory 𝒮}
{F G : CategoryTheory.BasedFunctor 𝒳 𝒴}
(α β : F ⟶ G)
(h : α.toNatTrans = β.toNatTrans)


theorem max_of_mem {s : Finset α} {a : α} (h : a ∈ s) : ∃ b : α, s.max = b

{α : Type u_2}
[LinearOrder α]
{s : Finset α}
{a : α}
(h : a ∈ s)


theorem Set.Finite.measurableSet_biUnion {f : β → Set α} {s : Set β} (hs : s.Finite)
    (h : ∀ b ∈ s, MeasurableSet (f b)) : MeasurableSet (⋃ b ∈ s, f b)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{f : β → Set α}
{s : Set β}
(hs : s.Finite)
(h : ∀ b ∈ s, MeasurableSet (f b))


/-- `orthogonal` gives a `GaloisConnection` between
`Submodule 𝕜 E` and its `OrderDual`. -/
theorem orthogonal_gc :
    @GaloisConnection (Submodule 𝕜 E) (Submodule 𝕜 E)ᵒᵈ _ _ orthogonal orthogonal

(𝕜 : Type u_1)
(E : Type u_2)
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]


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

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


/-- This is an auxiliary lemma giving information about the relation
of two triangles in an orthocentric system; it abstracts some
reasoning, with no geometric content, that is common to some other
lemmas.  Suppose the orthocentric system is generated by triangle `t`,
and we are given three points `p` in the orthocentric system.  Then
either we can find indices `i₁`, `i₂` and `i₃` for `p` such that `p
i₁` is the orthocenter of `t` and `p i₂` and `p i₃` are points `j₂`
and `j₃` of `t`, or `p` has the same points as `t`. -/
theorem exists_of_range_subset_orthocentricSystem {t : Triangle ℝ P}
    (ho : t.orthocenter ∉ Set.range t.points) {p : Fin 3 → P}
    (hps : Set.range p ⊆ insert t.orthocenter (Set.range t.points)) (hpi : Function.Injective p) :
    (∃ i₁ i₂ i₃ j₂ j₃ : Fin 3,
      i₁ ≠ i₂ ∧ i₁ ≠ i₃ ∧ i₂ ≠ i₃ ∧ (∀ i : Fin 3, i = i₁ ∨ i = i₂ ∨ i = i₃) ∧
        p i₁ = t.orthocenter ∧ j₂ ≠ j₃ ∧ t.points j₂ = p i₂ ∧ t.points j₃ = p i₃) ∨
      Set.range p = Set.range t.points

(∃ i₁ i₂ i₃ j₂ j₃,
    i₁ ≠ i₂ ∧
      i₁ ≠ i₃ ∧
        i₂ ≠ i₃ ∧
          (∀ (i : Fin 3), i = i₁ ∨ i = i₂ ∨ i = i₃) ∧
            p i₁ = t.orthocenter ∧ j₂ ≠ j₃ ∧ t.points j₂ = p i₂ ∧ t.points j₃ = p i₃) ∨
  Set.range p = Set.range t.points


theorem swap_def {φ : α → β → Sort u₃} (f : ∀ x y, φ x y) : swap f = fun y x => f x y

{α : Sort u₁}
{β : Sort u₂}
{φ : α → β → Sort u₃}
(f : (x : α) → (y : β) → φ x y)


theorem isCauSeq (f : CauSeq β abv) : IsCauSeq abv f

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


/-- A ring of sets `C` is a family of sets containing `∅`, stable by union and set difference.
It is then also stable by intersection (see `IsSetRing.inter_mem`). -/
structure IsSetRing (C : Set (Set α)) : Prop where
  empty_mem : ∅ ∈ C
  union_mem ⦃s t⦄ : s ∈ C → t ∈ C → s ∪ t ∈ C
  diff_mem ⦃s t⦄ : s ∈ C → t ∈ C → s \ t ∈ C

{α : Type u_1}
{C : Set (Set α)}
(self : MeasureTheory.IsSetRing C)
⦃s t : Set α⦄


theorem eq_some_iff (f : α ≃. β) : ∀ {a : α} {b : β}, f.symm b = some a ↔ f a = some b

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


lemma Continuous.mapPullback {X₁ X₂ Y₁ Y₂ Z₁ Z₂}
    [TopologicalSpace X₁] [TopologicalSpace X₂] [TopologicalSpace Z₁] [TopologicalSpace Z₂]
    {f₁ : X₁ → Y₁} {g₁ : Z₁ → Y₁} {f₂ : X₂ → Y₂} {g₂ : Z₂ → Y₂}
    {mapX : X₁ → X₂} (contX : Continuous mapX) {mapY : Y₁ → Y₂}
    {mapZ : Z₁ → Z₂} (contZ : Continuous mapZ)
    {commX : f₂ ∘ mapX = mapY ∘ f₁} {commZ : g₂ ∘ mapZ = mapY ∘ g₁} :
    Continuous (Function.mapPullback mapX mapY mapZ commX commZ)

{X₁ : Type u_1}
{X₂ : Type u_2}
{Y₁ : Sort u_3}
{Y₂ : Sort u_4}
{Z₁ : Type u_5}
{Z₂ : Type u_6}
[TopologicalSpace X₁]
[TopologicalSpace X₂]
[TopologicalSpace Z₁]
[TopologicalSpace Z₂]
{f₁ : X₁ → Y₁}
{g₁ : Z₁ → Y₁}
{f₂ : X₂ → Y₂}
{g₂ : Z₂ → Y₂}
{mapX : X₁ → X₂}
(contX : Continuous mapX)
{mapY : Y₁ → Y₂}
{mapZ : Z₁ → Z₂}
(contZ : Continuous mapZ)
{commX : f₂ ∘ mapX = mapY ∘ f₁}
{commZ : g₂ ∘ mapZ = mapY ∘ g₁}


@[simp] theorem zero_mod (b : Nat) : 0 % b = 0


theorem card_uIcc [LocallyFiniteOrder α] [LocallyFiniteOrder β]
    [DecidableRel ((· ≤ ·) : α × β → α × β → Prop)] (p q : α × β) :
    (Finset.uIcc p q).card = (Finset.uIcc p.1 q.1).card * (Finset.uIcc p.2 q.2).card

{α : Type u_1}
{β : Type u_2}
[Lattice α]
[Lattice β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
[DecidableRel fun x x_1 => x ≤ x_1]
(p q : α × β)


protected lemma Monotone.iSup (hf : ∀ i, Monotone (f i)) : Monotone (⨆ i, f i)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_9}
[Preorder α]
[CompleteLattice β]
{f : ι → α → β}
(hf : ∀ (i : ι), Monotone (f i))


theorem hom_ext (f g : X ⟶ Y) (h : ∀ n : ℕ, s.φ f n = s.φ g n) : f = g

{X Y : CategoryTheory.SimplicialObject C}


@[simp]
theorem map_obj (f : X ⟶ Y) (U) (p) : (map f).obj ⟨U, p⟩ = ⟨f ⁻¹' U, p.preimage f.continuous⟩

{X Y : TopCat}
(f : X ⟶ Y)
(U : Set ↑Y)
(p : IsOpen U)

(TopologicalSpace.Opens.map f).obj { carrier := U, is_open' := p } = { carrier := ⇑f ⁻¹' U, is_open' := ⋯ }


/-- `Equiv.funUnique` as an `IsometryEquiv`. -/
@[simps!]
def funUnique [Unique ι] [Fintype ι] : (ι → α) ≃ᵢ α

(ι : Type u_1)
(α : Type u)
[PseudoEMetricSpace α]
[Unique ι]
[Fintype ι]
(f : (i : ι) → (fun a => α) i)

(IsometryEquiv.funUnique ι α) f = f default


@[reassoc (attr := simp)]
theorem colimit.comp_coconePointUniqueUpToIso_inv {F : J ⥤ C} [HasColimit F] {c : Cocone F}
    (hc : IsColimit c) (j : J) :
    colimit.ι F j ≫ (IsColimit.coconePointUniqueUpToIso hc (colimit.isColimit _)).inv = c.ι.app j

(hc : CategoryTheory.Limits.IsColimit c)

CategoryTheory.Limits.colimit.ι F j ≫ (hc.coconePointUniqueUpToIso (CategoryTheory.Limits.colimit.isColimit F)).inv =
  c.ι.app j


/-- The closure of a sieve `S` is the largest closed sieve which contains `S` (justifying the name
"closure").
-/
theorem le_close_of_isClosed {X : C} {S T : Sieve X} (h : S ≤ T) (hT : J₁.IsClosed T) :
    J₁.close S ≤ T

(J₁ : CategoryTheory.GrothendieckTopology C)


theorem two_le_natDegree_subalgebra {B} [CommRing B] [Algebra A B] [Nontrivial B]
    {S : Subalgebra A B} {x : B} (int : IsIntegral S x) : 2 ≤ (minpoly S x).natDegree ↔ x ∉ S

{A : Type u_1}
[CommRing A]
{B : Type u_4}
[CommRing B]
[Algebra A B]
[Nontrivial B]
{S : Subalgebra A B}
{x : B}
(int : IsIntegral (↥S) x)


theorem IsProper.top_not_mem (hI : IsProper I) : ⊤ ∉ I

{P : Type u_1}
[LE P]
[OrderTop P]
{I : Order.Ideal P}
(hI : I.IsProper)


theorem GradeOrder.wellFoundedGT (𝕆 : Type*) [Preorder 𝕆] [GradeOrder 𝕆 α]
    [WellFoundedGT 𝕆] : WellFoundedGT α

{α : Type u_3}
[Preorder α]
(𝕆 : Type u_5)
[Preorder 𝕆]
[GradeOrder 𝕆 α]
[WellFoundedGT 𝕆]


@[simp] lemma sup_prodMap (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : κ → β) :
    sup (s ×ˢ t) (Prod.map f g) = (sup s f, sup t g)

{ι : Type u_7}
{κ : Type u_8}
{α : Type u_9}
{β : Type u_10}
[SemilatticeSup α]
[SemilatticeSup β]
[OrderBot α]
[OrderBot β]
{s : Finset ι}
{t : Finset κ}
(hs : s.Nonempty)
(ht : t.Nonempty)
(f : ι → α)
(g : κ → β)

(s ×ˢ t).sup (Prod.map f g) = (s.sup f, t.sup g)


@[simp]
theorem mem_atTop_sets [Nonempty α] [SemilatticeSup α] {s : Set α} :
    s ∈ (atTop : Filter α) ↔ ∃ a : α, ∀ b ≥ a, b ∈ s

{α : Type u_3}
[Nonempty α]
[SemilatticeSup α]
{s : Set α}


theorem rpow_le_one_iff_of_pos (hx : 0 < x) : x ^ y ≤ 1 ↔ 1 ≤ x ∧ y ≤ 0 ∨ x ≤ 1 ∧ 0 ≤ y


lemma left_deriv_lt_slope (hfc : StrictConcaveOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hfd : DifferentiableWithinAt ℝ f (Iio y) y) :
    derivWithin f (Iio y) y < slope f x y

(hfd : DifferentiableWithinAt ℝ f (Set.Iio y) y)

derivWithin f (Set.Iio y) y < slope f x y


/-- A bounded continuous function on a finite-measure space is in `Lp`. -/
theorem mem_Lp (f : α →ᵇ E) : f.toContinuousMap.toAEEqFun μ ∈ Lp E p μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[TopologicalSpace α]
[BorelSpace α]
[SecondCountableTopologyEither α E]
[MeasureTheory.IsFiniteMeasure μ]
(f : α →ᵇ E)

ContinuousMap.toAEEqFun μ f.toContinuousMap ∈ MeasureTheory.Lp E p μ


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

{α : Type u_1}
{E : Type u_3}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{f : α → E}
{l : Filter α}
{c : α}
(h : IsMaxFilter (norm ∘ f) l c)


theorem left_inv (M : A ⊗[R] Matrix n n R) : invFun R A n (toFunAlgHom R A n M) = M

(R : Type u)
[CommSemiring R]
(A : Type v)
[Semiring A]
[Algebra R A]
(n : Type w)
[DecidableEq n]
[Fintype n]
(M : A ⊗[R] Matrix n n R)

MatrixEquivTensor.invFun R A n ((MatrixEquivTensor.toFunAlgHom R A n) M) = M


@[simp]
theorem mul_nonneg_iff_of_pos_right [MulPosStrictMono α]
    (h : 0 < c) : 0 ≤ b * c ↔ 0 ≤ b

{α : Type u}
[Semiring α]
[LinearOrder α]
{b c : α}
[MulPosStrictMono α]
(h : 0 < c)


@[simp]
theorem preimage_union [DecidableEq α] [DecidableEq β] {f : α → β} {s t : Finset β} (hst) :
    preimage (s ∪ t) f hst =
      (preimage s f fun x₁ hx₁ x₂ hx₂ => hst (mem_union_left _ hx₁) (mem_union_left _ hx₂)) ∪
        preimage t f fun x₁ hx₁ x₂ hx₂ => hst (mem_union_right _ hx₁) (mem_union_right _ hx₂)

{α : Type u}
{β : Type v}
[DecidableEq α]
[DecidableEq β]
{f : α → β}
{s t : Finset β}
(hst : Set.InjOn f (f ⁻¹' ↑(s ∪ t)))

(s ∪ t).preimage f hst = s.preimage f ⋯ ∪ t.preimage f ⋯


/-- Every `x : I ⊗ M` is the image of some `y : J ⊗ M`, where `J ≤ I` is finitely generated,
under the tensor product of `J.inclusion ‹J ≤ I› : J → I` and the identity `M → M`. -/
theorem exists_fg_le_eq_rTensor_inclusion {R M N : Type*} [CommRing R] [AddCommGroup M]
    [AddCommGroup N] [Module R M] [Module R N] {I : Submodule R N} (x : I ⊗ M) :
      ∃ (J : Submodule R N) (_ : J.FG) (hle : J ≤ I) (y : J ⊗ M),
        x = rTensor M (J.inclusion hle) y

{R : Type u_4}
{M : Type u_5}
{N : Type u_6}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
{I : Submodule R N}
(x : TensorProduct R (↥I) M)

∃ J, ∃ (_ : J.FG) (hle : J ≤ I), ∃ y, x = (LinearMap.rTensor M (Submodule.inclusion hle)) y


@[to_additive two_nsmul_inf_eq_add_sub_abs_sub]
lemma inf_sq_eq_mul_div_mabs_div (a b : α) : (a ⊓ b) ^ 2 = a * b / |b / a|ₘ

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


@[to_additive (attr := simp)]
theorem coe_inv_interval : (↑(s⁻¹) : Interval α) = (↑s)⁻¹

{α : Type u_2}
[OrderedCommGroup α]
(s : NonemptyInterval α)

↑s⁻¹ = (↑s)⁻¹


theorem rightMoves_mul_cases {x y : PGame} (k) {P : (x * y).RightMoves → Prop}
    (hl : ∀ ix jy, P <| toRightMovesMul (Sum.inl ⟨ix, jy⟩))
    (hr : ∀ jx iy, P <| toRightMovesMul (Sum.inr ⟨jx, iy⟩)) : P k

(hl : ∀ (ix : x.LeftMoves) (jy : y.RightMoves), P (SetTheory.PGame.toRightMovesMul (Sum.inl (ix, jy))))

(hr : ∀ (jx : x.RightMoves) (iy : y.LeftMoves), P (SetTheory.PGame.toRightMovesMul (Sum.inr (jx, iy))))


/-- A nonempty preorder with no minimal element is infinite. This is not an instance to avoid
a cycle with `Infinite α → Nontrivial α → Nonempty α`. -/
theorem NoMinOrder.infinite [Nonempty α] [NoMinOrder α] : Infinite α

{α : Type u_1}
[Preorder α]
[Nonempty α]
[NoMinOrder α]


@[to_additive (attr := simp)]
theorem coe_rangeRestrict (f : G →* N) (g : G) : (f.rangeRestrict g : N) = f g

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


theorem AntivaryOn.comp_right (h : AntivaryOn f g s) (k : ι' → ι) :
    AntivaryOn (f ∘ k) (g ∘ k) (k ⁻¹' s)

{ι : Type u_1}
{ι' : Type u_2}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
{s : Set ι}
(h : AntivaryOn f g s)
(k : ι' → ι)


@[to_additive]
theorem prod_concat : (l.concat a).prod = l.prod * a

{M : Type u_4}
[Monoid M]
{l : List M}
{a : M}


theorem sup'_mul_le_mul_sup'_of_nonneg (s : Finset ι) (H : s.Nonempty) (ha : ∀ i ∈ s, 0 ≤ a i)
    (hb : ∀ i ∈ s, 0 ≤ b i) : s.sup' H (a * b) ≤ s.sup' H a * s.sup' H b

{ι : Type u_1}
{R : Type u_2}
[LinearOrderedSemiring R]
{a b : ι → R}
(s : Finset ι)
(H : s.Nonempty)
(ha : ∀ i ∈ s, 0 ≤ a i)
(hb : ∀ i ∈ s, 0 ≤ b i)


theorem nfpFamily_monotone (hf : ∀ i, Monotone (f i)) : Monotone (nfpFamily.{u, v} f)

{f : ι → Ordinal.{max u v} → Ordinal.{max u v}}


theorem cycleType_prime_order {σ : Perm α} (hσ : (orderOf σ).Prime) :
    ∃ n : ℕ, σ.cycleType = Multiset.replicate (n + 1) (orderOf σ)

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

∃ n, σ.cycleType = Multiset.replicate (n + 1) (orderOf σ)


theorem map_normNoninc (hf : ψ.comp f₁ = f₂.comp φ) (hg : ψ.comp g₁ = g₂.comp φ)
    (hφ : φ.NormNoninc) : (map φ ψ hf hg).NormNoninc

{V₁ : Type u_3}
{V₂ : Type u_4}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
{W₁ : Type u_6}
{W₂ : Type u_7}
[SeminormedAddCommGroup W₁]
[SeminormedAddCommGroup W₂]
{f₁ g₁ : NormedAddGroupHom V₁ W₁}
{f₂ g₂ : NormedAddGroupHom V₂ W₂}
{φ : NormedAddGroupHom V₁ V₂}
{ψ : NormedAddGroupHom W₁ W₂}
(hf : ψ.comp f₁ = f₂.comp φ)
(hg : ψ.comp g₁ = g₂.comp φ)
(hφ : φ.NormNoninc)

(NormedAddGroupHom.Equalizer.map φ ψ hf hg).NormNoninc


@[simp]
theorem List.applyId_cons [DecidableEq α] (xs : List (α × α)) (x y z : α) :
    List.applyId ((y, z)::xs) x = if y = x then z else List.applyId xs x

{α : Type u}
[DecidableEq α]
(xs : List (α × α))
(x y z : α)

SlimCheck.InjectiveFunction.List.applyId ((y, z) :: xs) x =
  if y = x then z else SlimCheck.InjectiveFunction.List.applyId xs x


/-- This cannot be an instance because it can cause infinite loops whenever the `SMul` arguments
are still metavariables. -/
@[to_additive
"This cannot be an instance because it can cause infinite loops whenever the `VAdd` arguments
are still metavariables."]
lemma comp.smulCommClass' [SMul β α] [SMulCommClass β M α] (g : N → M) :
    haveI := comp α g
    SMulCommClass β N α

{M : Type u_1}
{N : Type u_2}
{α : Type u_7}
{β : Type u_8}
[VAdd M α]
[VAdd β α]
[VAddCommClass β M α]
(g : N → M)


theorem forall_mem_empty_iff (p : α → Prop) : (∀ x, x ∈ (∅ : Finset α) → p x) ↔ True


theorem qRight_zero_left (θ : I) : qRight (0, θ) = 0


theorem IsPicardLindelof.norm_le₀ {E : Type*} [NormedAddCommGroup E] {v : ℝ → E → E}
    {tMin t₀ tMax : ℝ} {x₀ : E} {C R : ℝ} {L : ℝ≥0}
    (hpl : IsPicardLindelof v tMin t₀ tMax x₀ L R C) : ‖v t₀ x₀‖ ≤ C

‖v t₀ x₀‖ ≤ C


/-- If `K / E / F` is a field extension tower such that `K / F` is purely inseparable,
then `K / E` is also purely inseparable. -/
theorem IsPurelyInseparable.tower_top [Algebra E K] [IsScalarTower F E K]
    [h : IsPurelyInseparable F K] : IsPurelyInseparable E K

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type w)
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]
[h : IsPurelyInseparable F K]


/-- If `f` is an affine map, then its linear part is continuous iff `f` is continuous. -/
theorem AffineMap.continuous_linear_iff {f : P →ᵃ[𝕜] P₂} : Continuous f.linear ↔ Continuous f

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
{f : P →ᵃ[𝕜] P₂}


/-- Isometric equivalences are isometric maps -/
@[simps]
def toIsometry (g : Q₁.IsometryEquiv Q₂) : Q₁ →qᵢ Q₂

{R : Type u_2}
{M₁ : Type u_5}
{M₂ : Type u_6}
{N : Type u_9}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid N]
[Module R M₁]
[Module R M₂]
[Module R N]
{Q₁ : QuadraticMap R M₁ N}
{Q₂ : QuadraticMap R M₂ N}
(g : Q₁.IsometryEquiv Q₂)
(x : M₁)


/-- The measure associated to a Stieltjes function, giving mass `f b - f a` to the
interval `(a, b]`. -/
protected irreducible_def measure : Measure ℝ

f.measure = { toOuterMeasure := f.outer, m_iUnion := ⋯, trim_le := ⋯ }


theorem periodic_mod (a : ℕ) : Periodic (fun n => n % a) a


theorem Ideal.IsHomogeneous.mul {I J : Ideal A} (HI : I.IsHomogeneous 𝒜) (HJ : J.IsHomogeneous 𝒜) :
    (I * J).IsHomogeneous 𝒜

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[CommSemiring A]
[DecidableEq ι]
[AddMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[GradedRing 𝒜]
{I J : Ideal A}
(HI : Ideal.IsHomogeneous 𝒜 I)
(HJ : Ideal.IsHomogeneous 𝒜 J)


theorem exists_swap {p : α → β → Prop} : (∃ x y, p x y) ↔ ∃ y x, p x y

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


@[ext]
theorem AddMonoidHom.ext_nat [AddMonoid A] {f g : ℕ →+ A} : f 1 = g 1 → f = g

{A : Type u_3}
[AddMonoid A]
{f g : ℕ →+ A}


@[to_additive]
lemma surjective_smul (x : α) : Surjective fun c : M ↦ c • x

(M : Type u_1)
{α : Type u_7}
[SMul M α]
[MulAction.IsPretransitive M α]
(x : α)


/-- A charted space is a topological space endowed with an atlas, i.e., a set of local
homeomorphisms taking value in a model space `H`, called charts, such that the domains of the charts
cover the whole space. We express the covering property by choosing for each `x` a member
`chartAt x` of the atlas containing `x` in its source: in the smooth case, this is convenient to
construct the tangent bundle in an efficient way.
The model space is written as an explicit parameter as there can be several model spaces for a
given topological space. For instance, a complex manifold (modelled over `ℂ^n`) will also be seen
sometimes as a real manifold over `ℝ^(2n)`.
-/
@[ext]
class ChartedSpace (H : Type*) [TopologicalSpace H] (M : Type*) [TopologicalSpace M] where
  /-- The atlas of charts in the `ChartedSpace`. -/
  protected atlas : Set (PartialHomeomorph M H)
  /-- The preferred chart at each point in the charted space. -/
  protected chartAt : M → PartialHomeomorph M H
  protected mem_chart_source : ∀ x, x ∈ (chartAt x).source
  protected chart_mem_atlas : ∀ x, chartAt x ∈ atlas

{H : Type u_5}
[TopologicalSpace H]
{M : Type u_6}
[TopologicalSpace M]
[self : ChartedSpace H M]
(x : M)

ChartedSpace.chartAt x ∈ ChartedSpace.atlas


theorem inter_pos_of_cond_ne_zero (hms : MeasurableSet s) (hcst : μ[t|s] ≠ 0) : 0 < μ (s ∩ t)

(hcst : (ProbabilityTheory.cond μ s) t ≠ 0)


/-- If a group `G` acts on `α` by measurable maps, then each element `c : G` defines a measurable
automorphism of `α`. -/
@[to_additive (attr := simps! (config := .asFn) toEquiv apply)
      "If an additive group `G` acts on `α` by measurable maps, then each element `c : G`
      defines a measurable automorphism of `α`." ]
def smul (c : G) : α ≃ᵐ α

{G : Type u_1}
{α : Type u_3}
[MeasurableSpace G]
[MeasurableSpace α]
[AddGroup G]
[AddAction G α]
[MeasurableVAdd G α]
(c : G)

⇑(MeasurableEquiv.vadd c) = fun x => c +ᵥ x


@[simp]
theorem coe_of (V : Type u) [SeminormedAddCommGroup V] : (SemiNormedGrp.of V : Type u) = V


theorem CPolynomialOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) :
    CPolynomialOn 𝕜 f s ↔ CPolynomialOn 𝕜 g s

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


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

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


theorem antilipschitz : AntilipschitzWith (ratio f)⁻¹ (f : α → β)

{α : Type u_1}
{β : Type u_2}
{F : Type u_4}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[FunLike F α β]
[DilationClass F α β]
(f : F)

AntilipschitzWith (Dilation.ratio f)⁻¹ ⇑f


@[simp] lemma antitone_vecEmpty : Antitone (vecCons a vecEmpty)


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

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


theorem dvd_generator_iff {I : Ideal R} [I.IsPrincipal] {x : R} (hx : x ∈ I) :
    x ∣ generator I ↔ I = Ideal.span {x}

{R : Type u_2}
[CommRing R]
[IsDomain R]
{I : Ideal R}
[Submodule.IsPrincipal I]
{x : R}
(hx : x ∈ I)

x ∣ Submodule.IsPrincipal.generator I ↔ I = Ideal.span {x}


@[simp]
theorem repr_sub : ∀ (o₁ o₂) [NF o₁] [NF o₂], repr (o₁ - o₂) = repr o₁ - repr o₂


theorem inf_mem (s : Set α) (w₁ : ⊤ ∈ s) (w₂ : ∀ᵉ (x ∈ s) (y ∈ s), x ⊓ y ∈ s)
    {ι : Type*} (t : Finset ι) (p : ι → α) (h : ∀ i ∈ t, p i ∈ s) : t.inf p ∈ s

{α : Type u_2}
[SemilatticeInf α]
[OrderTop α]
(s : Set α)
(w₁ : ⊤ ∈ s)
(w₂ : ∀ x ∈ s, ∀ y ∈ s, x ⊓ y ∈ s)
{ι : Type u_7}
(t : Finset ι)
(p : ι → α)
(h : ∀ i ∈ t, p i ∈ s)


@[reassoc (attr := simp)]
theorem pentagon_inv_hom_hom_hom_inv :
    (α_ (W ⊗ X) Y Z).inv ≫ (α_ W X Y).hom ▷ Z ≫ (α_ W (X ⊗ Y) Z).hom =
      (α_ W X (Y ⊗ Z)).hom ≫ W ◁ (α_ X Y Z).inv

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

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.associator (CategoryTheory.MonoidalCategory.tensorObj W X) Y Z).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.associator W X Y).hom Z)
      (CategoryTheory.MonoidalCategory.associator W (CategoryTheory.MonoidalCategory.tensorObj X Y) Z).hom) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.associator W X (CategoryTheory.MonoidalCategory.tensorObj Y Z)).hom
    (CategoryTheory.MonoidalCategory.whiskerLeft W (CategoryTheory.MonoidalCategory.associator X Y Z).inv)


@[simp] lemma adj_sndOfNotNil {p : G.Walk v w} (hp : ¬ p.Nil) :
    G.Adj v (p.sndOfNotNil hp)

{V : Type u}
{G : SimpleGraph V}
{v w : V}
{p : G.Walk v w}
(hp : ¬p.Nil)


theorem inner_sub_left (x y z : E) : ⟪x - y, z⟫ = ⟪x, z⟫ - ⟪y, z⟫

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


@[simp]
theorem leftAdjointUniq_refl {F : C ⥤ D} {G : D ⥤ C} (adj1 : F ⊣ G) :
    (leftAdjointUniq adj1 adj1).hom = 𝟙 _

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{F : C ⥤ D}
{G : D ⥤ C}
(adj1 : F ⊣ G)


/-- Lagrange's **four squares theorem** for a prime number. Use `Nat.sum_four_squares` instead. -/
protected theorem Prime.sum_four_squares {p : ℕ} (hp : p.Prime) :
    ∃ a b c d : ℕ, a ^ 2 + b ^ 2 + c ^ 2 + d ^ 2 = p


theorem left_invariance {s : Set H} {x : H} {f : H → H'} {e' : PartialHomeomorph H' H'}
    (he' : e' ∈ G') (hfs : ContinuousWithinAt f s x) (hxe' : f x ∈ e'.source) :
    P (e' ∘ f) s x ↔ P f s x

{H : Type u_1}
{H' : Type u_3}
[TopologicalSpace H]
[TopologicalSpace H']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
(hG : G.LocalInvariantProp G' P)
{s : Set H}
{x : H}
{f : H → H'}
{e' : PartialHomeomorph H' H'}
(he' : e' ∈ G')
(hfs : ContinuousWithinAt f s x)
(hxe' : f x ∈ e'.source)


theorem hom_right_act_hom' :
    ((regular R).tensorBimod P).actRight ≫ hom P = (hom P ▷ S.X) ≫ P.actRight

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁} (CategoryTheory.MonoidalCategory.tensorLeft X)]

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁}
      (CategoryTheory.MonoidalCategory.tensorRight X)]

((Bimod.regular R).tensorBimod P).actRight ≫ Bimod.LeftUnitorBimod.hom P =
  Bimod.LeftUnitorBimod.hom P ▷ S.X ≫ P.actRight


@[to_additive]
theorem map_eq_map_iff {f : G →* N} {H K : Subgroup G} :
    H.map f = K.map f ↔ H ⊔ f.ker = K ⊔ f.ker

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

AddSubgroup.map f H = AddSubgroup.map f K ↔ H ⊔ f.ker = K ⊔ f.ker


lemma prod_map_sum {s : Multiset (Multiset α)} :
    prod (s.map sum) = sum ((Sections s).map prod)

{α : Type u_2}
[CommSemiring α]
{s : Multiset (Multiset α)}

(Multiset.map Multiset.sum s).prod = (Multiset.map Multiset.prod s.Sections).sum


theorem C_mul : (C (a * a') : MvPolynomial σ R) = C a * C a'

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

MvPolynomial.C (a * a') = MvPolynomial.C a * MvPolynomial.C a'


@[reassoc (attr := simp)]
lemma IsSheaf.amalgamateOfArrows_map (i : I) :
    hP.amalgamateOfArrows f hf x hx ≫ P.map (f i).op = x i

{J : CategoryTheory.GrothendieckTopology C}

(hP : CategoryTheory.Presheaf.IsSheaf J P)

(hf : CategoryTheory.Sieve.ofArrows X f ∈ J.sieves S)

(x : (i : I) → E ⟶ P.obj (Opposite.op (X i)))

(hx :
  ∀ ⦃W : C⦄ ⦃i j : I⦄ (a : W ⟶ X i) (b : W ⟶ X j),
    CategoryTheory.CategoryStruct.comp a (f i) = CategoryTheory.CategoryStruct.comp b (f j) →
      CategoryTheory.CategoryStruct.comp (x i) (P.map a.op) = CategoryTheory.CategoryStruct.comp (x j) (P.map b.op))

CategoryTheory.CategoryStruct.comp (hP.amalgamateOfArrows f hf x hx) (P.map (f i).op) = x i


theorem Base.eq_of_subset_indep (hB : M.Base B) (hI : M.Indep I) (hBI : B ⊆ I) : B = I

{α : Type u_1}
{M : Matroid α}
{B I : Set α}
(hB : M.Base B)
(hI : M.Indep I)
(hBI : B ⊆ I)


theorem degree_T_le (n : ℤ) : (T n : R[T;T⁻¹]).degree ≤ n


theorem nhdsWithin_le_iff {s t : Set α} {x : α} : 𝓝[s] x ≤ 𝓝[t] x ↔ t ∈ 𝓝[s] x

{α : Type u_1}
[TopologicalSpace α]
{s t : Set α}
{x : α}


theorem le_rank_iff_exists_linearIndependent_finset
    [Module.Free K V] {n : ℕ} : ↑n ≤ Module.rank K V ↔
    ∃ s : Finset V, s.card = n ∧ LinearIndependent K ((↑) : ↥(s : Set V) → V)

{K : Type u}
{V : Type v}
[Ring K]
[StrongRankCondition K]
[AddCommGroup V]
[Module K V]
[Module.Free K V]
{n : ℕ}

↑n ≤ Module.rank K V ↔ ∃ s, s.card = n ∧ LinearIndependent (ι := { x // x ∈ ↑s }) K Subtype.val


theorem add_eq_right_addition (f g : X ⟶ Y) : f + g = biprod.lift (𝟙 X) (𝟙 X) ≫ biprod.desc f g

f + g = CategoryTheory.Limits.biprod.lift (𝟙 X) (𝟙 X) ≫ CategoryTheory.Limits.biprod.desc f g


@[to_additive]
lemma inf_mul_sup [CovariantClass α α (· * ·) (· ≤ ·)] (a b : α) : (a ⊓ b) * (a ⊔ b) = a * b

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


@[simp]
theorem liftLinear_apply {f : OuterMeasure α →ₗ[ℝ≥0∞] OuterMeasure β} (hf) {s : Set β}
    (hs : MeasurableSet s) : liftLinear f hf μ s = f μ.toOuterMeasure s

{f : MeasureTheory.OuterMeasure α →ₗ[ENNReal] MeasureTheory.OuterMeasure β}

(hf : ∀ (μ : MeasureTheory.Measure α), inst✝ ≤ (f μ.toOuterMeasure).caratheodory)

((MeasureTheory.Measure.liftLinear f hf) μ) s = (f μ.toOuterMeasure) s


/-- If a functor `G` has the same collection of cones as a functor `F`
which has a limit, then `G` also has a limit. -/
theorem HasLimit.ofConesIso {J K : Type u₁} [Category.{v₁} J] [Category.{v₂} K] (F : J ⥤ C)
    (G : K ⥤ C) (h : F.cones ≅ G.cones) [HasLimit F] : HasLimit G

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{J K : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
[CategoryTheory.Category.{v₂, u₁} K]
(F : J ⥤ C)
(G : K ⥤ C)
(h : F.cones ≅ G.cones)
[CategoryTheory.Limits.HasLimit F]


@[simp] theorem UInt8.toNat_ofNat (n) :
    (no_index (OfNat.ofNat n) : UInt8).toNat = n % UInt8.size


theorem continuousAt_subtype_val {p : X → Prop} {x : Subtype p} :
    ContinuousAt ((↑) : Subtype p → X) x

{X : Type u}
[TopologicalSpace X]
{p : X → Prop}
{x : Subtype p}


theorem coe_lineMap (p₀ p₁ : P1) : (lineMap p₀ p₁ : k → P1) = fun c => c • (p₁ -ᵥ p₀) +ᵥ p₀

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
(p₀ p₁ : P1)

⇑(AffineMap.lineMap p₀ p₁) = fun c => c • (p₁ -ᵥ p₀) +ᵥ p₀


lemma hasFiniteColimits_of_hasColimitsOfSize [HasColimitsOfSize.{v', u'} C] :
    HasFiniteColimits C

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


theorem trivial_iff_lower_central_eq_bot : IsTrivial L M ↔ lowerCentralSeries R L M 1 = ⊥

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]

LieModule.IsTrivial L M ↔ LieModule.lowerCentralSeries R L M 1 = ⊥


@[to_additive]
theorem apply_mulSingle (f' : ∀ i, f i → g i) (hf' : ∀ i, f' i 1 = 1) (i : I) (x : f i) (j : I) :
    f' j (mulSingle i x j) = mulSingle i (f' i x) j

{I : Type u}
{f : I → Type v₁}
{g : I → Type v₂}
[DecidableEq I]
[(i : I) → Zero (f i)]
[(i : I) → Zero (g i)]
(f' : (i : I) → f i → g i)
(hf' : ∀ (i : I), f' i 0 = 0)
(i : I)
(x : f i)
(j : I)

f' j (Pi.single i x j) = Pi.single i (f' i x) j


lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) :
    ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n)

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
[IsNoetherian R M]
(f : M →ₗ[R] M)

∀ᶠ (n : ℕ) in Filter.atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n)


/-- Given a `Homotopy f₀ f₁`, we can define a `Homotopy f₁ f₀` by reversing the homotopy.
-/
@[simps]
def symm {f₀ f₁ : C(X, Y)} (F : Homotopy f₀ f₁) : Homotopy f₁ f₀

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ : C(X, Y)}
(F : f₀.Homotopy f₁)
(x : ↑I × X)


theorem mk.inj_right {α β : Type*} (b : β) :
    Function.Injective (fun a ↦ Prod.mk a b : α → α × β)


@[simp]
theorem ofUnitHom_eq (χ : Rˣ →* R'ˣ) : ofUnitHom χ = equivToUnitHom.symm χ

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

MulChar.ofUnitHom χ = MulChar.equivToUnitHom.symm χ


theorem vectorAllP_iff_forall (p : α → Prop) (v : Vector3 α n) :
    VectorAllP p v ↔ ∀ i, p (v i)

{α : Type u_1}
{n : ℕ}
(p : α → Prop)
(v : Vector3 α n)

VectorAllP p v ↔ ∀ (i : Fin2 n), p (v i)


theorem succ_iterate (a : ℤ) : ∀ n, succ^[n] a = a + n


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


lemma Injective.factorsThrough (hf : Injective f) (g : α → γ) : g.FactorsThrough f

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
(hf : Function.Injective f)
(g : α → γ)


/-- Orthogonal projection onto the `Submodule.map` of a subspace. -/
theorem orthogonalProjection_map_apply {E E' : Type*} [NormedAddCommGroup E]
    [NormedAddCommGroup E'] [InnerProductSpace 𝕜 E] [InnerProductSpace 𝕜 E'] (f : E ≃ₗᵢ[𝕜] E')
    (p : Submodule 𝕜 E) [HasOrthogonalProjection p] (x : E') :
    (orthogonalProjection (p.map (f.toLinearEquiv : E →ₗ[𝕜] E')) x : E') =
      f (orthogonalProjection p (f.symm x))

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_4}
{E' : Type u_5}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 E']
(f : E ≃ₗᵢ[𝕜] E')
(p : Submodule 𝕜 E)
[HasOrthogonalProjection p]
(x : E')

↑((orthogonalProjection (Submodule.map (↑f.toLinearEquiv) p)) x) = f ↑((orthogonalProjection p) (f.symm x))


@[simp]
theorem filter_subset (l : List α) : filter p l ⊆ l

{α : Type u}
{p : α → Bool}
(l : List α)


/-- The functor which sends `S : SnakeInput C` to `S.L₂'` which is
`S.L₀.X₃ ⟶ S.L₃.X₁ ⟶ S.L₃.X₂`. -/
@[simps]
noncomputable def functorL₂' : SnakeInput C ⥤ ShortComplex C

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]

∀ {X Y : CategoryTheory.ShortComplex.SnakeInput C} (f : X ⟶ Y),
  (CategoryTheory.ShortComplex.SnakeInput.functorL₂'.map f).τ₂ = f.f₃.τ₁


/-- The image of a tangent cone under the differential of a map is included in the tangent cone to
the image. -/
theorem HasFDerivWithinAt.mapsTo_tangent_cone {x : E} (h : HasFDerivWithinAt f f' s x) :
    MapsTo f' (tangentConeAt 𝕜 s x) (tangentConeAt 𝕜 (f '' s) (f x))

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

Set.MapsTo (⇑f') (tangentConeAt 𝕜 s x) (tangentConeAt 𝕜 (f '' s) (f x))


theorem hσ'_eq_zero {q n m : ℕ} (hnq : n < q) (hnm : c.Rel m n) :
    (hσ' q n m hnm : X _[n] ⟶ X _[m]) = 0

(hnm : AlgebraicTopology.DoldKan.c.Rel m n)

AlgebraicTopology.DoldKan.hσ' q n m hnm = 0


lemma proj_comp_transitionMapLE {n m : ℕ} (h : n ≤ m) :
    S.proj m ≫ S.diagram.map ⟨homOfLE h⟩ = S.proj n

(S : LightProfinite)
{n m : ℕ}
(h : n ≤ m)

S.proj m ≫ S.diagram.map (Opposite.op (CategoryTheory.homOfLE h)) = S.proj n


theorem iInf_eq_of_forall_le_of_tendsto {x : R} {as : ι → R} (x_le : ∀ i, x ≤ as i) {F : Filter ι}
    [Filter.NeBot F] (as_lim : Filter.Tendsto as F (𝓝 x)) : ⨅ i, as i = x

{ι : Type u_1}
{R : Type u_4}
[CompleteLinearOrder R]
[TopologicalSpace R]
[OrderTopology R]
{x : R}
{as : ι → R}
(x_le : ∀ (i : ι), x ≤ as i)
{F : Filter ι}
[F.NeBot]
(as_lim : Filter.Tendsto as F (𝓝 x))


/-- Combine two `PartialEquiv`s using `Set.piecewise`. The source of the new `PartialEquiv` is
`s.ite e.source e'.source = e.source ∩ s ∪ e'.source \ s`, and similarly for target.  The function
sends `e.source ∩ s` to `e.target ∩ t` using `e` and `e'.source \ s` to `e'.target \ t` using `e'`,
and similarly for the inverse function. The definition assumes `e.isImage s t` and
`e'.isImage s t`. -/
@[simps (config := .asFn)]
def piecewise (e e' : PartialEquiv α β) (s : Set α) (t : Set β) [∀ x, Decidable (x ∈ s)]
    [∀ y, Decidable (y ∈ t)] (H : e.IsImage s t) (H' : e'.IsImage s t) :
    PartialEquiv α β

{α : Type u_1}
{β : Type u_2}
(e e' : PartialEquiv α β)
(s : Set α)
(t : Set β)
[(x : α) → Decidable (x ∈ s)]
[(y : β) → Decidable (y ∈ t)]
(H : e.IsImage s t)
(H' : e'.IsImage s t)

↑(e.piecewise e' s t H H') = s.piecewise ↑e ↑e'


lemma _root_.CovBy.exists_multiset_cons (h : s ⋖ t) : ∃ a, a ::ₘ s = t

{α : Type u_1}
{s t : Multiset α}
(h : s ⋖ t)


/-- `orderEmbOfFin {a} h` sends any argument to `a`. -/
@[simp]
theorem orderEmbOfFin_singleton (a : α) (i : Fin 1) :
    orderEmbOfFin {a} (card_singleton a) i = a

{α : Type u_1}
[LinearOrder α]
(a : α)
(i : Fin 1)


lemma trace_toEnd_weightSpaceChain_eq_zero
    (hp : weightSpace M (p • α + χ) = ⊥)
    (hq : weightSpace M (q • α + χ) = ⊥)
    {x : H} (hx : x ∈ corootSpace α) :
    LinearMap.trace R _ (toEnd R H (weightSpaceChain M α χ p q) x) = 0

(hp : LieModule.weightSpace M (p • α + χ) = ⊥)

(hq : LieModule.weightSpace M (q • α + χ) = ⊥)

(LinearMap.trace R ↥↑(LieModule.weightSpaceChain M α χ p q))
    ((LieModule.toEnd R ↥H ↥↑(LieModule.weightSpaceChain M α χ p q)) x) =
  0


theorem continuous_ofAdd : Continuous (ofAdd : X → Multiplicative X)


@[simp]
theorem idealX_span : (idealX K).asIdeal = Ideal.span {X}

(Polynomial.idealX K).asIdeal = Ideal.span {Polynomial.X}


/-- A vector in `Kᗮ` is orthogonal to one in `K`. -/
theorem inner_left_of_mem_orthogonal {u v : E} (hu : u ∈ K) (hv : v ∈ Kᗮ) : ⟪v, u⟫ = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
{u v : E}
(hu : u ∈ K)
(hv : v ∈ Kᗮ)


@[to_additive]
protected theorem Inducing.topologicalGroup {F : Type*} [Group H] [TopologicalSpace H]
    [FunLike F H G] [MonoidHomClass F H G] (f : F) (hf : Inducing f) : TopologicalGroup H

{G : Type w}
{H : Type x}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{F : Type u_1}
[Group H]
[TopologicalSpace H]
[FunLike F H G]
[MonoidHomClass F H G]
(f : F)
(hf : Inducing ⇑f)


lemma jacobian_eq_jacobiMatrix_det : P.jacobian = algebraMap P.Ring S P.jacobiMatrix.det

(P : Algebra.PreSubmersivePresentation R S)

P.jacobian = (algebraMap P.Ring S) P.jacobiMatrix.det


@[to_additive]
theorem smul_one_smul (r : R) (x : X[S⁻¹]) : (r • 1 : M) • x = r • x

{R : Type u_1}
{M : Type u_3}
{X : Type u_4}
[Monoid M]
{S : Submonoid M}
[OreLocalization.OreSet S]
[MulAction M X]
[SMul R X]
[SMul R M]
[IsScalarTower R M M]
[IsScalarTower R M X]
(r : R)
(x : OreLocalization S X)


lemma inl_desc :
    (inl φ).comp (Cochain.ofHom (desc φ α β eq)) (add_zero _) = α

(α : CochainComplex.HomComplex.Cochain F K (-1))

(eq : CochainComplex.HomComplex.δ (-1) 0 α = CochainComplex.HomComplex.Cochain.ofHom (φ ≫ β))

(CochainComplex.mappingCone.inl φ).comp
    (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.desc φ α β eq)) ⋯ =
  α


/-- A multiplicative character is nontrivial iff it is not the trivial character. -/
@[deprecated (since := "2024-06-16")]
theorem isNontrivial_iff (χ : MulChar R R') : χ.IsNontrivial ↔ χ ≠ 1

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
(χ : MulChar R R')


lemma trace_submatrix_succ {n : ℕ} [NonUnitalNonAssocSemiring R]
    (M : Matrix (Fin n.succ) (Fin n.succ) R) :
    M 0 0 + trace (submatrix M Fin.succ Fin.succ) = trace M

M 0 0 + (M.submatrix Fin.succ Fin.succ).trace = M.trace


/-- Construct an isomorphism in `SingleFunctors C D A` by giving
level-wise isomorphisms and checking compatibility only in the forward direction. -/
@[simps]
def isoMk (iso : ∀ a, (F.functor a ≅ G.functor a))
    (comm : ∀ (n a a' : A) (ha' : n + a = a'), (F.shiftIso n a a' ha').hom ≫ (iso a).hom =
      whiskerRight (iso a').hom (shiftFunctor D n) ≫ (G.shiftIso n a a' ha').hom) :
    F ≅ G

{F G : CategoryTheory.SingleFunctors C D A}

(iso : (a : A) → F.functor a ≅ G.functor a)

(comm :
  ∀ (n a a' : A) (ha' : n + a = a'),
    (F.shiftIso n a a' ha').hom ≫ (iso a).hom =
      CategoryTheory.whiskerRight (iso a').hom (CategoryTheory.shiftFunctor D n) ≫ (G.shiftIso n a a' ha').hom)

(CategoryTheory.SingleFunctors.isoMk iso comm).inv.hom a = (iso a).inv


/-- The "most used" implication of `mul_and_mul_iff`, with split hypotheses, instead of `∧`. -/
@[to_additive "The \"most used\" implication of `add_and_add_iff`, with split
hypotheses, instead of `∧`."]
theorem IsRegular.and_of_mul_of_mul (ab : IsRegular (a * b)) (ba : IsRegular (b * a)) :
    IsRegular a ∧ IsRegular b

{R : Type u_1}
[Semigroup R]
{a b : R}
(ab : IsRegular (a * b))
(ba : IsRegular (b * a))


theorem toReal_mono' (h : a ≤ b) (ht : b = ∞ → a = ∞) : a.toReal ≤ b.toReal

{a b : ℝ≥0∞}
(h : a ≤ b)
(ht : b = ⊤ → a = ⊤)


theorem le_untop'_iff {a : WithTop α} {b c : α} (h : a = ⊤ → c ≤ b) :
    c ≤ a.untop' b ↔ c ≤ a

{α : Type u_1}
[LE α]
{a : WithTop α}
{b c : α}
(h : a = ⊤ → c ≤ b)


/-- **Divergence theorem** for a family of functions `f : Fin (n + 1) → ℝⁿ⁺¹ → E`. See also
`MeasureTheory.integral_divergence_of_hasFDerivWithinAt_off_countable'` for a version formulated
in terms of a vector-valued function `f : ℝⁿ⁺¹ → Eⁿ⁺¹`. -/
theorem integral_divergence_of_hasFDerivWithinAt_off_countable' (hle : a ≤ b)
    (f : Fin (n + 1) → ℝⁿ⁺¹ → E)
    (f' : Fin (n + 1) → ℝⁿ⁺¹ → ℝⁿ⁺¹ →L[ℝ] E) (s : Set ℝⁿ⁺¹)
    (hs : s.Countable) (Hc : ∀ i, ContinuousOn (f i) (Icc a b))
    (Hd : ∀ x ∈ (pi Set.univ fun i => Ioo (a i) (b i)) \ s, ∀ (i), HasFDerivAt (f i) (f' i x) x)
    (Hi : IntegrableOn (fun x => ∑ i, f' i x (e i)) (Icc a b)) :
    (∫ x in Icc a b, ∑ i, f' i x (e i)) =
      ∑ i : Fin (n + 1), ((∫ x in face i, f i (frontFace i x)) -
        ∫ x in face i, f i (backFace i x))

(f : Fin (n + 1) → (Fin (n + 1) → ℝ) → E)

(f' : Fin (n + 1) → (Fin (n + 1) → ℝ) → (Fin (n + 1) → ℝ) →L[ℝ] E)

(Hc : ∀ (i : Fin (n + 1)), ContinuousOn (f i) (Set.Icc a b))

(Hd : ∀ x ∈ (Set.univ.pi fun i => Set.Ioo (a i) (b i)) \ s, ∀ (i : Fin (n + 1)), HasFDerivAt (f i) (f' i x) x)

(Hi :
  MeasureTheory.IntegrableOn (fun x => ∑ i : Fin (n + 1), (f' i x) (Pi.single i 1)) (Set.Icc a b) MeasureTheory.volume)

∫ (x : Fin (n + 1) → ℝ) in Set.Icc a b, ∑ i : Fin (n + 1), (f' i x) (Pi.single i 1) =
  ∑ i : Fin (n + 1),
    ((∫ (x : Fin n → ℝ) in Set.Icc (a ∘ i.succAbove) (b ∘ i.succAbove), f i (i.insertNth (b i) x)) -
      ∫ (x : Fin n → ℝ) in Set.Icc (a ∘ i.succAbove) (b ∘ i.succAbove), f i (i.insertNth (a i) x))


@[to_additive]
lemma image_coe_inj {s t : Set G} : ((↑) : G → Q) '' s = ((↑) : G → Q) '' t ↔ ↑N * s = N * t

{G : Type u}
[AddGroup G]
(N : AddSubgroup G)
[nN : N.Normal]
{s t : Set G}

QuotientAddGroup.mk '' s = QuotientAddGroup.mk '' t ↔ ↑N + s = ↑N + t


@[simp]
theorem hnot_boundary (a : α) : ￢∂ a = ⊤

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


@[aesop safe destruct] theorem not_prime_zero : ¬Prime 0


theorem map_extChartAt_nhdsWithin_eq_image' {x y : M} (hy : y ∈ (extChartAt I x).source) :
    map (extChartAt I x) (𝓝[s] y) =
      𝓝[extChartAt I x '' ((extChartAt I x).source ∩ s)] extChartAt I x y

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

Filter.map (↑(extChartAt I x)) (𝓝[s] y) = 𝓝[↑(extChartAt I x) '' ((extChartAt I x).source ∩ s)] ↑(extChartAt I x) y


@[to_additive]
theorem index_map_dvd {f : G →* G'} (hf : Function.Surjective f) :
    (H.map f).index ∣ H.index

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


@[simp]
theorem equivPair_tail {i} (p : Pair M i) :
    equivPair i p.tail = ⟨1, p.tail, p.fstIdx_ne⟩

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
[(i : ι) → DecidableEq (M i)]
[DecidableEq ι]
{i : ι}
(p : Monoid.CoprodI.Word.Pair M i)

(Monoid.CoprodI.Word.equivPair i) p.tail = { head := 1, tail := p.tail, fstIdx_ne := ⋯ }


theorem _root_.MeasureTheory.Memℒp.evariance_lt_top [IsFiniteMeasure μ] (hX : Memℒp X 2 μ) :
    evariance X μ < ∞

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{X : Ω → ℝ}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
(hX : MeasureTheory.Memℒp X 2 μ)


theorem starConvex_sInter {S : Set (Set E)} (h : ∀ s ∈ S, StarConvex 𝕜 x s) :
    StarConvex 𝕜 x (⋂₀ S)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{x : E}
{S : Set (Set E)}
(h : ∀ s ∈ S, StarConvex 𝕜 x s)


theorem rpow_two (x : ℝ≥0) : x ^ (2 : ℝ) = x ^ 2


theorem IsPath.mk' {u v : V} {p : G.Walk u v} (h : p.support.Nodup) : p.IsPath

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


/-- Any morphism of light profinite spaces is a closed map. -/
theorem isClosedMap : IsClosedMap f


/-- If a continuous multilinear map is constructed from a multilinear map via the constructor
`mkContinuous`, then its norm is bounded by the bound given to the constructor if it is
nonnegative. -/
theorem MultilinearMap.mkContinuous_norm_le (f : MultilinearMap 𝕜 E G) {C : ℝ} (hC : 0 ≤ C)
    (H : ∀ m, ‖f m‖ ≤ C * ∏ i, ‖m i‖) : ‖f.mkContinuous C H‖ ≤ C

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

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


/-- Suppose we have a commutative square of functors

      Q
    A → B
  U ↓   ↓ V
    C → D
      R

where `U` has a left adjoint, `A` has reflexive coequalizers and `V` has a left adjoint such that
each component of the counit is a regular epi.
Then `Q` has a left adjoint if `R` has a left adjoint.

See https://ncatlab.org/nlab/show/adjoint+lifting+theorem
-/
lemma adjointSquareLift (Q : A ⥤ B) (V : B ⥤ D) (U : A ⥤ C) (R : C ⥤ D)
    (comm : U ⋙ R ≅ Q ⋙ V) [U.IsRightAdjoint] [V.IsRightAdjoint] [R.IsRightAdjoint]
    [∀ X, RegularEpi ((Adjunction.ofIsRightAdjoint V).counit.app X)] [HasReflexiveCoequalizers A] :
    Q.IsRightAdjoint

[(X : B) → CategoryTheory.RegularEpi ((CategoryTheory.Adjunction.ofIsRightAdjoint V).counit.app X)]


@[simp]
theorem forget₂_algebra_map (X Y : BialgebraCat R) (f : X ⟶ Y) :
    (forget₂ (BialgebraCat R) (AlgebraCat R)).map f = (f.toBialgHom : X →ₐ[R] Y)

{R : Type u}
[CommRing R]
(X Y : BialgebraCat R)
(f : X ⟶ Y)

(CategoryTheory.forget₂ (BialgebraCat R) (AlgebraCat R)).map f = ↑f.toBialgHom


protected theorem Adj.ne {H : G.Subgraph} {u v : V} (h : H.Adj u v) : u ≠ v

{V : Type u}
{G : SimpleGraph V}
{H : G.Subgraph}
{u v : V}
(h : H.Adj u v)


/-- A set is meagre iff it is contained in a countable union of nowhere dense sets. -/
lemma isMeagre_iff_countable_union_isNowhereDense {s : Set X} :
    IsMeagre s ↔ ∃ S : Set (Set X), (∀ t ∈ S, IsNowhereDense t) ∧ S.Countable ∧ s ⊆ ⋃₀ S

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

IsMeagre s ↔ ∃ S, (∀ t ∈ S, IsNowhereDense t) ∧ S.Countable ∧ s ⊆ ⋃₀ S


theorem ne_of_gt {i₁ i₂ : Pos} (h : i₁ < i₂) : i₂ ≠ i₁


/-- **Legendre's Theorem**

The `p`-adic valuation of `n!` is the sum of the quotients `n / p ^ i`. This sum is expressed
over the finset `Ico 1 b` where `b` is any bound greater than `log p n`. -/
theorem padicValNat_factorial {n b : ℕ} [hp : Fact p.Prime] (hnb : log p n < b) :
    padicValNat p (n !) = ∑ i ∈ Finset.Ico 1 b, n / p ^ i

{p n b : ℕ}
[hp : Fact (Nat.Prime p)]
(hnb : Nat.log p n < b)

padicValNat p n ! = ∑ i ∈ Finset.Ico 1 b, n / p ^ i


theorem extChartAt_target (x : M) :
    (extChartAt I x).target = I.symm ⁻¹' (chartAt H x).target ∩ range I

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

(extChartAt I x).target = ↑I.symm ⁻¹' (chartAt H x).target ∩ Set.range ↑I


@[simp]
theorem coe_mk (f : C(α, β)) (h : HasCompactSupport f) : ⇑(⟨f, h⟩ : C_c(α, β)) = f

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]
(f : C(α, β))
(h : HasCompactSupport ⇑f)

⇑{ toContinuousMap := f, hasCompactSupport' := h } = ⇑f


lemma IsPointwiseLeftKanExtensionAt.hasPointwiseLeftKanExtensionAt
    {Y : D} (h : E.IsPointwiseLeftKanExtensionAt Y) :
    HasPointwiseLeftKanExtensionAt L F Y

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Category.{u_6, u_3} H]
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
{E : L.LeftExtension F}
{Y : D}
(h : E.IsPointwiseLeftKanExtensionAt Y)


@[simp]
theorem extend_hom_app (α : (inducedFunctor B).op ⋙ F ⟶ (inducedFunctor B).op ⋙ F'.1) (i : ι) :
    (restrictHomEquivHom F F' h α).app (op (B i)) = α.app (op i)

(h : TopologicalSpace.Opens.IsBasis (Set.range B))

(α : (CategoryTheory.inducedFunctor B).op ⋙ F ⟶ (CategoryTheory.inducedFunctor B).op ⋙ F'.val)

((TopCat.Sheaf.restrictHomEquivHom F F' h) α).app (Opposite.op (B i)) = α.app (Opposite.op i)


@[to_additive]
nonrec theorem QuotientGroup.measurable_from_quotient {G} [Group G] [MeasurableSpace G]
    {S : Subgroup G} {f : G ⧸ S → α} : Measurable f ↔ Measurable (f ∘ ((↑) : G → G ⧸ S))

{α : Type u_1}
[MeasurableSpace α]
{G : Type u_6}
[Group G]
[MeasurableSpace G]
{S : Subgroup G}
{f : G ⧸ S → α}

Measurable f ↔ Measurable (f ∘ QuotientGroup.mk)


theorem wronskian_neg_left (a b : R[X]) : wronskian (-a) b = -wronskian a b

{R : Type u_1}
[CommRing R]
(a b : R[X])


theorem summable_condensed_iff {f : ℕ → ℝ≥0} (hf : ∀ ⦃m n⦄, 0 < m → m ≤ n → f n ≤ f m) :
    (Summable fun k : ℕ => (2 : ℝ≥0) ^ k * f (2 ^ k)) ↔ Summable f

(hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m)

(Summable fun k => 2 ^ k * f (2 ^ k)) ↔ Summable f


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

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

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

CategoryTheory.Bicategory.whiskerLeft (CategoryTheory.CategoryStruct.id a) η =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.leftUnitor f).hom
    (CategoryTheory.CategoryStruct.comp η (CategoryTheory.Bicategory.leftUnitor g).inv)


theorem SeparationQuotient.dist_mk {α : Type u} [PseudoMetricSpace α] (p q : α) :
    dist (mk p) (mk q) = dist p q

dist (SeparationQuotient.mk p) (SeparationQuotient.mk q) = dist p q


theorem arrowCongr_trans {M₁ M₂ M₃ N₁ N₂ N₃ : Sort _} [AddCommMonoid M₁] [Module R M₁]
    [AddCommMonoid M₂] [Module R M₂] [AddCommMonoid M₃] [Module R M₃] [AddCommMonoid N₁]
    [Module R N₁] [AddCommMonoid N₂] [Module R N₂] [AddCommMonoid N₃] [Module R N₃]
    (e₁ : M₁ ≃ₗ[R] M₂) (e₂ : N₁ ≃ₗ[R] N₂) (e₃ : M₂ ≃ₗ[R] M₃) (e₄ : N₂ ≃ₗ[R] N₃) :
    (arrowCongr e₁ e₂).trans (arrowCongr e₃ e₄) = arrowCongr (e₁.trans e₃) (e₂.trans e₄)

{R : Type u_1}
[CommSemiring R]
{M₁ : Type u_17}
{M₂ : Type u_18}
{M₃ : Type u_19}
{N₁ : Type u_20}
{N₂ : Type u_21}
{N₃ : Type u_22}
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
[AddCommMonoid M₃]
[Module R M₃]
[AddCommMonoid N₁]
[Module R N₁]
[AddCommMonoid N₂]
[Module R N₂]
[AddCommMonoid N₃]
[Module R N₃]
(e₁ : M₁ ≃ₗ[R] M₂)
(e₂ : N₁ ≃ₗ[R] N₂)
(e₃ : M₂ ≃ₗ[R] M₃)
(e₄ : N₂ ≃ₗ[R] N₃)

e₁.arrowCongr e₂ ≪≫ₗ e₃.arrowCongr e₄ = (e₁ ≪≫ₗ e₃).arrowCongr (e₂ ≪≫ₗ e₄)


@[simp]
protected theorem div_zero (n : ZNum) : n / 0 = 0


lemma isIso_iff_of_hasLeftResolutions [Φ.HasLeftResolutions] {F G : D₂ ⥤ H} (α : F ⟶ G) :
    IsIso α ↔ ∀ (X₁ : C₁), IsIso (α.app (L₂.obj (Φ.functor.obj X₁)))

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

CategoryTheory.IsIso α ↔ ∀ (X₁ : C₁), CategoryTheory.IsIso (α.app (L₂.obj (Φ.functor.obj X₁)))


theorem IsRelPrime.prod_right : (∀ i ∈ t, IsRelPrime x (s i)) → IsRelPrime x (∏ i ∈ t, s i)

{α : Type u_2}
{I : Type u_1}
[CommMonoid α]
[DecompositionMonoid α]
{x : α}
{s : I → α}
{t : Finset I}


theorem image_subset_image2_left (hb : b ∈ t) : (fun a => f a b) '' s ⊆ image2 f s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s : Set α}
{t : Set β}
{b : β}
(hb : b ∈ t)

(fun a => f a b) '' s ⊆ Set.image2 f s t


@[simp]
theorem coeff_smul {S : Type*} [Semiring S] [Module R S] (n : ℕ) (φ : PowerSeries S) (a : R) :
    coeff S n (a • φ) = a • coeff S n φ

{R : Type u_1}
[Semiring R]
{S : Type u_2}
[Semiring S]
[Module R S]
(n : ℕ)
(φ : PowerSeries S)
(a : R)

(PowerSeries.coeff S n) (a • φ) = a • (PowerSeries.coeff S n) φ


theorem le_nhds_iff_adhp_of_cauchy {f : Filter α} {x : α} (hf : Cauchy f) :
    f ≤ 𝓝 x ↔ ClusterPt x f

{α : Type u}
[uniformSpace : UniformSpace α]
{f : Filter α}
{x : α}
(hf : Cauchy f)


theorem or_iff_left_of_imp  (hb : b → a) : (a ∨ b) ↔ a


@[simp]
theorem compl_union (s t : Finset α) : (s ∪ t)ᶜ = sᶜ ∩ tᶜ

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


@[simp]
theorem mk'_eq_coe {l u : ι → ℝ} : mk' l u = I ↔ l = I.lower ∧ u = I.upper

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{l u : ι → ℝ}

BoxIntegral.Box.mk' l u = ↑I ↔ l = I.lower ∧ u = I.upper


/-- The function `UniformFun.filter α β : Filter (β × β) → Filter ((α →ᵤ β) × (α →ᵤ β))`
has a lower adjoint `l` (in the sense of `GaloisConnection`). The exact definition of `l` is not
interesting; we will only use that it exists (in `UniformFun.mono` and
`UniformFun.iInf_eq`) and that
`l (Filter.map (Prod.map f f) 𝓕) = Filter.map (Prod.map ((∘) f) ((∘) f)) (l 𝓕)` for each
`𝓕 : Filter (γ × γ)` and `f : γ → α` (in `UniformFun.comap_eq`). -/
protected theorem gc : GaloisConnection lowerAdjoint fun 𝓕 => UniformFun.filter α β 𝓕

GaloisConnection (fun 𝓐 => Filter.map (UniformFun.phi α β) (𝓐 ×ˢ ⊤)) fun 𝓕 => UniformFun.filter α β 𝓕


@[simp]
theorem cons_bagInter_of_pos (l₁ : List α) (h : a ∈ l₂) :
    (a :: l₁).bagInter l₂ = a :: l₁.bagInter (l₂.erase a)

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


theorem prod_nat_mod (s : Multiset ℕ) (n : ℕ) : s.prod % n = (s.map (· % n)).prod % n

s.prod % n = (Multiset.map (fun x => x % n) s).prod % n


@[simp]
theorem sumLexAssoc_symm_apply_inr_inr : (sumLexAssoc α β γ).symm (inr (inr c)) = inr c

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

(OrderIso.sumLexAssoc α β γ).symm (Sum.inr (Sum.inr c)) = Sum.inr c


@[to_additive]
theorem mk_le_mk : mk a₁ a₂ ≤ mk b₁ b₂ ↔ ↑b₂ * a₁ ≤ a₂ * b₁

{α : Type u_1}
[OrderedCancelAddCommMonoid α]
{s : AddSubmonoid α}
{a₁ b₁ : α}
{a₂ b₂ : ↥s}

AddLocalization.mk a₁ a₂ ≤ AddLocalization.mk b₁ b₂ ↔ ↑b₂ + a₁ ≤ ↑a₂ + b₁


@[to_additive (attr := simp)]
theorem mrange_mk : MonoidHom.mrange (@mk M N _ _) = ⊤

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

AddMonoidHom.mrange AddMonoid.Coprod.mk = ⊤


theorem toFun_eq_coe {f : CoheytingHom α β} : f.toFun = (f : α → β)

{α : Type u_2}
{β : Type u_3}
[CoheytingAlgebra α]
[CoheytingAlgebra β]
{f : CoheytingHom α β}


@[simp]
theorem head_eval (v) : head.eval v = pure [v.headI]

Turing.ToPartrec.Code.head.eval v = pure [v.headI]


theorem nth_lt_nth (hf : (setOf p).Infinite) {k n} : nth p k < nth p n ↔ k < n

{p : ℕ → Prop}
(hf : (setOf p).Infinite)
{k n : ℕ}


/-- Vector of length from a list `v`
with witness that `v` has length `n` maps to `v` under `toList`.  -/
@[simp]
theorem toList_mk (v : List α) (P : List.length v = n) : toList (Subtype.mk v P) = v

{α : Type u}
{n : ℕ}
(v : List α)
(P : v.length = n)


/-- A characterization of `enumOrd`: it is the unique strict monotonic function with range `S`. -/
theorem eq_enumOrd (f : Ordinal → Ordinal) (hS : Unbounded (· < ·) S) :
    StrictMono f ∧ range f = S ↔ f = enumOrd S

(hS : Set.Unbounded (fun x x_1 => x < x_1) S)

StrictMono f ∧ Set.range f = S ↔ f = Ordinal.enumOrd S


theorem ι_injective (i : D.J) : Function.Injective (𝖣.ι i)


/-- The isomorphism `S.X₂ ≅ S.X₁ ⊞ S.X₃` induced by a splitting of the short complex `S`. -/
@[simps]
noncomputable def isoBinaryBiproduct (h : Splitting S) [HasBinaryBiproduct S.X₁ S.X₃] :
    S.X₂ ≅ S.X₁ ⊞ S.X₃

h.isoBinaryBiproduct.hom = CategoryTheory.Limits.biprod.lift h.r S.g


theorem ite_eq_iff' : ite P a b = c ↔ (P → a = c) ∧ (¬P → b = c)

{α : Sort u_1}
{P : Prop}
[Decidable P]
{a b c : α}

(if P then a else b) = c ↔ (P → a = c) ∧ (¬P → b = c)


theorem rpow_lt_one_iff' {x y : ℝ} (hx : 0 ≤ x) (hy : 0 < y) :
    x ^ y < 1 ↔ x < 1


lemma hasHomology_of_epi_of_isIso_of_mono' (φ : S₁ ⟶ S₂) [HasHomology S₂]
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] : HasHomology S₁


theorem differentiableOn_dslope {f : ℂ → E} {s : Set ℂ} {c : ℂ} (hc : s ∈ 𝓝 c) :
    DifferentiableOn ℂ (dslope f c) s ↔ DifferentiableOn ℂ f s

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[CompleteSpace E]
{f : ℂ → E}
{s : Set ℂ}
{c : ℂ}
(hc : s ∈ 𝓝 c)


@[simp]
theorem mem_valuationSubring_iff (x : K) : x ∈ v.valuationSubring ↔ v x ≤ 1

{K : Type u}
[Field K]
{Γ : Type u_1}
[LinearOrderedCommGroupWithZero Γ]
(v : Valuation K Γ)
(x : K)


@[simp]
theorem cokernelIsoOfEq_trans {f g h : X ⟶ Y} [HasCokernel f] [HasCokernel g] [HasCokernel h]
    (w₁ : f = g) (w₂ : g = h) :
    cokernelIsoOfEq w₁ ≪≫ cokernelIsoOfEq w₂ = cokernelIsoOfEq (w₁.trans w₂)

CategoryTheory.Limits.cokernelIsoOfEq w₁ ≪≫ CategoryTheory.Limits.cokernelIsoOfEq w₂ =
  CategoryTheory.Limits.cokernelIsoOfEq ⋯


@[to_additive (attr := simp)]
theorem units_inv_right_iff : Commute a ↑u⁻¹ ↔ Commute a u

{M : Type u_1}
[AddMonoid M]
{a : M}
{u : AddUnits M}


theorem image_sup_product (s t : Finset α) : (s ×ˢ t).image (uncurry (· ⊔ ·)) = s ⊻ t

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

Finset.image (Function.uncurry fun x x_1 => x ⊔ x_1) (s ×ˢ t) = s ⊻ t


@[simp]
theorem sumArrowLequivProdArrow_symm_apply_inl {α β} (f : α → M) (g : β → M) (a : α) :
    ((sumArrowLequivProdArrow α β R M).symm (f, g)) (Sum.inl a) = f a

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_5}
{β : Type u_6}
(f : α → M)
(g : β → M)
(a : α)

(LinearEquiv.sumArrowLequivProdArrow α β R M).symm (f, g) (Sum.inl a) = f a


@[to_additive]
theorem _root_.Set.mulIndicator_ae_eq_one {M : Type*} [One M] {f : α → M} {s : Set α} :
    s.mulIndicator f =ᵐ[μ] 1 ↔ μ (s ∩ f.mulSupport) = 0

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{M : Type u_4}
[Zero M]
{f : α → M}
{s : Set α}

s.indicator f =ᵐ[μ] 0 ↔ μ (s ∩ Function.support f) = 0


@[simp]
theorem toLieEquiv_apply (x : A₁) : e.toLieEquiv x = e x

{R : Type u}
{A₁ : Type v}
{A₂ : Type w}
[CommRing R]
[Ring A₁]
[Ring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)
(x : A₁)


@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{P' : Type u_3}
[CommRing P']
[Algebra R P']
(g : P →ₐ[R] P')


lemma comapOn_base_iff_of_surjOn (h : SurjOn f E N.E) :
    (N.comapOn E f).Base B ↔ (N.Base (f '' B) ∧ InjOn f B ∧ B ⊆ E)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{N : Matroid β}
{E B : Set α}
(h : Set.SurjOn f E N.E)

(N.comapOn E f).Base B ↔ N.Base (f '' B) ∧ Set.InjOn f B ∧ B ⊆ E


theorem isGLB_quotient_norm {S : AddSubgroup M} (x : M ⧸ S) :
    IsGLB (norm '' { m | mk' S m = x }) (‖x‖)

{M : Type u_1}
[SeminormedAddCommGroup M]
{S : AddSubgroup M}
(x : M ⧸ S)

IsGLB (norm '' {m | (QuotientAddGroup.mk' S) m = x}) ‖x‖


@[reassoc (attr := simp)]
theorem PInfty_f_idem (n : ℕ) : (PInfty.f n : X _[n] ⟶ _) ≫ PInfty.f n = PInfty.f n

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : CategoryTheory.SimplicialObject C}
(n : ℕ)

AlgebraicTopology.DoldKan.PInfty.f n ≫ AlgebraicTopology.DoldKan.PInfty.f n = AlgebraicTopology.DoldKan.PInfty.f n


/-- A set is residual (comeagre) if and only if it includes a dense `Gδ` set. -/
theorem mem_residual {s : Set X} : s ∈ residual X ↔ ∃ t ⊆ s, IsGδ t ∧ Dense t

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


@[simp]
theorem _root_.AffineIsometry.angle_map {V₂ P₂ : Type*} [NormedAddCommGroup V₂]
    [InnerProductSpace ℝ V₂] [MetricSpace P₂] [NormedAddTorsor V₂ P₂]
    (f : P →ᵃⁱ[ℝ] P₂) (p₁ p₂ p₃ : P) : ∠ (f p₁) (f p₂) (f p₃) = ∠ p₁ p₂ p₃

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{V₂ : Type u_3}
{P₂ : Type u_4}
[NormedAddCommGroup V₂]
[InnerProductSpace ℝ V₂]
[MetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(f : P →ᵃⁱ[ℝ] P₂)
(p₁ p₂ p₃ : P)

EuclideanGeometry.angle (f p₁) (f p₂) (f p₃) = EuclideanGeometry.angle p₁ p₂ p₃


theorem unitization_injective (h1 : (1 : A) ∉ s) : Function.Injective (unitization s)

{R : Type u_1}
{S : Type u_2}
{A : Type u_3}
[Field R]
[StarRing R]
[Ring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
[SetLike S A]
[hSA : NonUnitalSubringClass S A]
[hSRA : SMulMemClass S R A]
[StarMemClass S A]
(s : S)
(h1 : 1 ∉ s)


@[simp]
theorem left_eq_inf : a = a ⊓ b ↔ a ≤ b

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


@[to_additive]
theorem Multipliable.nat_tprod_vanishing {f : ℕ → G} (hf : Multipliable f) ⦃e : Set G⦄
    (he : e ∈ 𝓝 1) : ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∏' n : t, f n) ∈ e

{G : Type u_2}
[CommGroup G]
[TopologicalSpace G]
[TopologicalGroup G]
{f : ℕ → G}
(hf : Multipliable f)
⦃e : Set G⦄
(he : e ∈ 𝓝 1)

∃ N, ∀ t ⊆ {n | N ≤ n}, ∏' (n : ↑t), f ↑n ∈ e


theorem differentiableOn_univ : DifferentiableOn 𝕜 f univ ↔ Differentiable 𝕜 f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}

DifferentiableOn 𝕜 f Set.univ ↔ Differentiable 𝕜 f


/-- The restriction of a regular measure to a set of finite measure is regular. -/
theorem restrict_of_measure_ne_top [R1Space α] [BorelSpace α] [Regular μ]
    {A : Set α} (h'A : μ A ≠ ∞) : Regular (μ.restrict A)

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[R1Space α]
[BorelSpace α]
[μ.Regular]
{A : Set α}
(h'A : μ A ≠ ⊤)


theorem inseparable_iff_eq [T0Space X] {x y : X} : Inseparable x y ↔ x = y

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


theorem unop_sSup (S : Set (Subring Rᵐᵒᵖ)) : (sSup S).unop = sSup (.op ⁻¹' S)

{R : Type u_2}
[Ring R]
(S : Set (Subring Rᵐᵒᵖ))


theorem irreducible_iff_prime [DecompositionMonoid α] {a : α} : Irreducible a ↔ Prime a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[DecompositionMonoid α]
{a : α}


@[simp]
theorem norm_unit_eq {x : PUnit} : normUnit x = 1


/-- Given two composable morphisms `f : X₁ ⟶ X₂` and `g : X₂ ⟶ X₃` in the category
of cochain complexes, this is the canonical triangle
`mappingCone f ⟶ mappingCone (f ≫ g) ⟶ mappingCone g ⟶ (mappingCone f)⟦1⟧`. -/
@[simps! mor₁ mor₂ mor₃ obj₁ obj₂ obj₃]
noncomputable def mappingConeCompTriangle : Triangle (CochainComplex C ℤ)

(CochainComplex.mappingConeCompTriangle f g).mor₃ =
  (CochainComplex.mappingCone.triangle g).mor₃ ≫
    (CategoryTheory.shiftFunctor (CochainComplex C ℤ) 1).map (CochainComplex.mappingCone.inr f)


/-- If all multiplications cancel on the left then every element is left-regular. -/
@[to_additive "If all additions cancel on the left then every element is add-left-regular."]
theorem IsLeftRegular.all [Mul R] [IsLeftCancelMul R] (g : R) : IsLeftRegular g

{R : Type u_1}
[Mul R]
[IsLeftCancelMul R]
(g : R)


@[ext]
theorem ext {f g : A →⋆ₙ+* B} (h : ∀ x, f x = g x) : f = g

{A : Type u_1}
{B : Type u_2}
[NonUnitalNonAssocSemiring A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Star B]
{f g : A →⋆ₙ+* B}
(h : ∀ (x : A), f x = g x)


theorem vars_mul [DecidableEq σ] (φ ψ : MvPolynomial σ R) : (φ * ψ).vars ⊆ φ.vars ∪ ψ.vars

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


/-- A Cauchy sequence on the natural numbers is bounded. -/
theorem cauchySeq_bdd {u : ℕ → α} (hu : CauchySeq u) : ∃ R > 0, ∀ m n, dist (u m) (u n) < R

{α : Type u}
[PseudoMetricSpace α]
{u : ℕ → α}
(hu : CauchySeq u)

∃ R > 0, ∀ (m n : ℕ), dist (u m) (u n) < R


theorem carrier_eq_coe (s : NonemptyCompacts α) : s.carrier = s

(s : TopologicalSpace.NonemptyCompacts α)


@[to_additive]
theorem mulSupport_comp_eq_of_range_subset {g : M → N} {f : α → M}
    (hg : ∀ {x}, x ∈ range f → (g x = 1 ↔ x = 1)) :
    mulSupport (g ∘ f) = mulSupport f

(hg : ∀ {x : M}, x ∈ Set.range f → (g x = 0 ↔ x = 0))

Function.support (g ∘ f) = Function.support f


/-- Two finite-dimensional topological vector spaces over a complete normed field are continuously
linearly equivalent if and only if they have the same (finite) dimension. -/
theorem FiniteDimensional.nonempty_continuousLinearEquiv_iff_finrank_eq :
    Nonempty (E ≃L[𝕜] F) ↔ finrank 𝕜 E = finrank 𝕜 F

{𝕜 : Type u}
[hnorm : NontriviallyNormedField 𝕜]
{E : Type v}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
{F : Type w}
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousSMul 𝕜 F]
[CompleteSpace 𝕜]
[T2Space E]
[T2Space F]
[FiniteDimensional 𝕜 E]
[FiniteDimensional 𝕜 F]

Nonempty (E ≃L[𝕜] F) ↔ FiniteDimensional.finrank 𝕜 E = FiniteDimensional.finrank 𝕜 F


theorem iso_iff {P Q : C} (i : P ≅ Q) : Projective P ↔ Projective Q

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P Q : C}
(i : P ≅ Q)

CategoryTheory.Projective P ↔ CategoryTheory.Projective Q


@[to_additive (attr := simp) negPart_pos_iff] lemma one_lt_ltOnePart_iff : 1 < a⁻ᵐ ↔ a < 1

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


theorem hitting_mono {m₁ m₂ : ι} (hm : m₁ ≤ m₂) : hitting u s n m₁ ω ≤ hitting u s n m₂ ω

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
[ConditionallyCompleteLinearOrder ι]
{u : ι → Ω → β}
{s : Set β}
{n : ι}
{ω : Ω}
{m₁ m₂ : ι}
(hm : m₁ ≤ m₂)

MeasureTheory.hitting u s n m₁ ω ≤ MeasureTheory.hitting u s n m₂ ω


lemma intCast_injective : Injective (Int.cast : ℤ → ℚ)


@[simp]
theorem comp_dualTensorHom (f : Module.Dual R M) (n : N) (g : Module.Dual R N) (p : P) :
    dualTensorHom R N P (g ⊗ₜ[R] p) ∘ₗ dualTensorHom R M N (f ⊗ₜ[R] n) =
      g n • dualTensorHom R M P (f ⊗ₜ p)

{R : Type u}
{M : Type v₁}
{N : Type v₂}
{P : Type v₃}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(f : Module.Dual R M)
(n : N)
(g : Module.Dual R N)
(p : P)

(dualTensorHom R N P) (g ⊗ₜ[R] p) ∘ₗ (dualTensorHom R M N) (f ⊗ₜ[R] n) = g n • (dualTensorHom R M P) (f ⊗ₜ[R] p)


/-- If a monotone sequence of functions has an upper bound and the sequence of integrals of these
functions tends to the integral of the upper bound, then the sequence of functions converges
almost everywhere to the upper bound. -/
lemma tendsto_of_integral_tendsto_of_monotone {μ : Measure α} {f : ℕ → α → ℝ} {F : α → ℝ}
    (hf_int : ∀ n, Integrable (f n) μ) (hF_int : Integrable F μ)
    (hf_tendsto : Tendsto (fun i ↦ ∫ a, f i a ∂μ) atTop (𝓝 (∫ a, F a ∂μ)))
    (hf_mono : ∀ᵐ a ∂μ, Monotone (fun i ↦ f i a))
    (hf_bound : ∀ᵐ a ∂μ, ∀ i, f i a ≤ F a) :
    ∀ᵐ a ∂μ, Tendsto (fun i ↦ f i a) atTop (𝓝 (F a))

{f : ℕ → α → ℝ}

(hf_int : ∀ (n : ℕ), MeasureTheory.Integrable (f n) μ)

(hf_tendsto : Filter.Tendsto (fun i => ∫ (a : α), f i a ∂μ) Filter.atTop (𝓝 (∫ (a : α), F a ∂μ)))

(hf_mono : ∀ᵐ (a : α) ∂μ, Monotone fun i => f i a)

(hf_bound : ∀ᵐ (a : α) ∂μ, ∀ (i : ℕ), f i a ≤ F a)

∀ᵐ (a : α) ∂μ, Filter.Tendsto (fun i => f i a) Filter.atTop (𝓝 (F a))