@[ext]
lemma hom_ext₃ {f g : ComposableArrows C 3} {φ φ' : f ⟶ g}
    (h₀ : app' φ 0 = app' φ' 0) (h₁ : app' φ 1 = app' φ' 1) (h₂ : app' φ 2 = app' φ' 2)
    (h₃ : app' φ 3 = app' φ' 3) :
    φ = φ'

{f g : CategoryTheory.ComposableArrows C 3}

(h₀ : CategoryTheory.ComposableArrows.app' φ 0 ⋯ = CategoryTheory.ComposableArrows.app' φ' 0 ⋯)

(h₁ : CategoryTheory.ComposableArrows.app' φ 1 ⋯ = CategoryTheory.ComposableArrows.app' φ' 1 ⋯)

(h₂ : CategoryTheory.ComposableArrows.app' φ 2 ⋯ = CategoryTheory.ComposableArrows.app' φ' 2 ⋯)

(h₃ : CategoryTheory.ComposableArrows.app' φ 3 ⋯ = CategoryTheory.ComposableArrows.app' φ' 3 ⋯)


@[simp] lemma Odd.neg_one_pow (h : Odd n) : (-1 : α) ^ n = -1

{α : Type u_2}
[Monoid α]
[HasDistribNeg α]
{n : ℕ}
(h : Odd n)


/-- If `K / E / F` is a field extension tower, `L` is an intermediate field of `K / F`, such that
either `E / F` or `L / F` is algebraic, then `E(L) = E[L]`. -/
theorem adjoin_toSubalgebra_of_isAlgebraic (L : IntermediateField F K)
    (halg : Algebra.IsAlgebraic F E ∨ Algebra.IsAlgebraic F L) :
    (adjoin E (L : Set K)).toSubalgebra = Algebra.adjoin E (L : Set K)

(halg : Algebra.IsAlgebraic F E ∨ Algebra.IsAlgebraic F ↥L)

(IntermediateField.adjoin E ↑L).toSubalgebra = Algebra.adjoin E ↑L


protected theorem surjective (h : X ≃ₜ Y) : Function.Surjective h

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)


/-- The embedding of `Preord` into `Cat`.
-/
@[simps]
def preordToCat : Preord.{u} ⥤ Cat

preordToCat.obj X = CategoryTheory.Cat.of ↑X


theorem measurable_kernel_prod_mk_left [IsSFiniteKernel κ] {t : Set (α × β)}
    (ht : MeasurableSet t) : Measurable fun a => κ a (Prod.mk a ⁻¹' t)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ : ProbabilityTheory.Kernel α β}
[ProbabilityTheory.IsSFiniteKernel κ]
{t : Set (α × β)}
(ht : MeasurableSet t)

Measurable fun a => (κ a) (Prod.mk a ⁻¹' t)


theorem get_insertNth_of_lt (l : List α) (x : α) (n k : ℕ) (hn : k < n) (hk : k < l.length)
    (hk' : k < (insertNth n x l).length := hk.trans_le (length_le_length_insertNth _ _ _)) :
    (insertNth n x l).get ⟨k, hk'⟩ = l.get ⟨k, hk⟩

(hk' : k < (List.insertNth n x l).length := ⋯)

(List.insertNth n x l).get ⟨k, hk'⟩ = l.get ⟨k, hk⟩


/-- On a set with unique differentiability, any choice of iterated differential has to coincide
with the one we have chosen in `iteratedFDerivWithin 𝕜 m f s`. -/
theorem HasFTaylorSeriesUpToOn.eq_iteratedFDerivWithin_of_uniqueDiffOn
    (h : HasFTaylorSeriesUpToOn n f p s) {m : ℕ} (hmn : (m : ℕ∞) ≤ n) (hs : UniqueDiffOn 𝕜 s)
    (hx : x ∈ s) : p x m = iteratedFDerivWithin 𝕜 m f s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ∞}
{p : E → FormalMultilinearSeries 𝕜 E F}
(h : HasFTaylorSeriesUpToOn n f p s)
{m : ℕ}
(hmn : ↑m ≤ n)
(hs : UniqueDiffOn 𝕜 s)
(hx : x ∈ s)


/-- `colimit F` is functorial in `F`, when `C` has all colimits of shape `J`. -/
@[simps] -- Porting note: simps on all fields now
def colim : (J ⥤ C) ⥤ C

∀ {X Y : J ⥤ C} (α : X ⟶ Y), CategoryTheory.Limits.colim.map α = CategoryTheory.Limits.colimMap α


@[simp]
theorem differentiableAt_star_iff :
    DifferentiableAt 𝕜 (fun y => star (f y)) x ↔ DifferentiableAt 𝕜 f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[StarRing 𝕜]
[TrivialStar 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[StarAddMonoid F]
[NormedSpace 𝕜 F]
[StarModule 𝕜 F]
[ContinuousStar F]
{f : E → F}
{x : E}


theorem infinitesimal_inv_of_infinite {x : ℝ*} : Infinite x → Infinitesimal x⁻¹


theorem conv_eq_num_div_den : g.convs n = g.nums n / g.dens n

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


@[to_additive]
protected theorem left_comm (h : IsMulCentral a) (b c) : a * (b * c) = b * (a * c)

{M : Type u_1}
{a : M}
[Mul M]
(h : IsMulCentral a)
(b c : M)


/-- If a non-zero polynomial splits, then it has no repeated roots on that field
if and only if it is separable. -/
theorem nodup_roots_iff_of_splits {f : F[X]} (hf : f ≠ 0) (h : f.Splits (RingHom.id F)) :
    f.roots.Nodup ↔ f.Separable

(h : Polynomial.Splits (RingHom.id F) f)


lemma Sigma.map'_comp_map {f : α → C} {g h : β → C} [HasCoproduct f] [HasCoproduct g]
    [HasCoproduct h] (p : α → β) (q : ∀ (a : α), f a ⟶ g (p a)) (q' : ∀ (b : β), g b ⟶ h b) :
    Sigma.map' p q ≫ Sigma.map q' = Sigma.map' p (fun a => q a ≫ q' (p a))

{β : Type w}
{α : Type w₂}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f : α → C}
{g h : β → C}
[CategoryTheory.Limits.HasCoproduct f]
[CategoryTheory.Limits.HasCoproduct g]
[CategoryTheory.Limits.HasCoproduct h]
(p : α → β)
(q : (a : α) → f a ⟶ g (p a))
(q' : (b : β) → g b ⟶ h b)

CategoryTheory.Limits.Sigma.map' p q ≫ CategoryTheory.Limits.Sigma.map q' =
  CategoryTheory.Limits.Sigma.map' p fun a => q a ≫ q' (p a)


/-- If n is odd, then the Dihedral group of order $2n$ has $n(n+3)$ pairs of commuting elements. -/
lemma card_commute_odd (hn : Odd n) :
    Nat.card { p : DihedralGroup n × DihedralGroup n // Commute p.1 p.2 } = n * (n + 3)

Nat.card { p // Commute p.1 p.2 } = n * (n + 3)


theorem adjoint_apply_of_dense (y : T†.domain) : T† y = adjointAux hT y

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
{T : E →ₗ.[𝕜] F}
(hT : Dense ↑T.domain)
[CompleteSpace E]
(y : ↥T.adjoint.domain)

↑T.adjoint y = (LinearPMap.adjointAux hT) y


theorem geometric_hahn_banach_open_open (hs₁ : Convex ℝ s) (hs₂ : IsOpen s) (ht₁ : Convex ℝ t)
    (ht₃ : IsOpen t) (disj : Disjoint s t) :
    ∃ (f : E →L[ℝ] ℝ) (u : ℝ), (∀ a ∈ s, f a < u) ∧ ∀ b ∈ t, u < f b

{E : Type u_2}
[TopologicalSpace E]
[AddCommGroup E]
[TopologicalAddGroup E]
[Module ℝ E]
[ContinuousSMul ℝ E]
{s t : Set E}
(hs₁ : Convex ℝ s)
(hs₂ : IsOpen s)
(ht₁ : Convex ℝ t)
(ht₃ : IsOpen t)
(disj : Disjoint s t)

∃ f u, (∀ a ∈ s, f a < u) ∧ ∀ b ∈ t, u < f b


@[simp]
theorem iSupLift_comp_inclusion {i : ι} (h : K i ≤ T) :
    (iSupLift K dir f hf T hT).comp (inclusion h) = f i

{dir : Directed (fun x x_1 => x ≤ x_1) K}

{hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (NonUnitalSubalgebra.inclusion h)}

(NonUnitalSubalgebra.iSupLift K dir f hf T hT).comp (NonUnitalSubalgebra.inclusion h) = f i


@[to_additive]
protected theorem NeBot.inv : f.NeBot → f⁻¹.NeBot


theorem nonempty_denumerable_iff {α : Type*} :
    Nonempty (Denumerable α) ↔ Countable α ∧ Infinite α


lemma two_mul_ediv_two_of_odd (h : Odd n) : 2 * (n / 2) = n - 1


theorem natAbs_gcd (i j : ℤ) : natAbs (GCDMonoid.gcd i j) = Int.gcd i j


@[to_additive]
lemma mulIndicator_apply_le_one (h : a ∈ s → f a ≤ 1) : mulIndicator s f a ≤ 1

{α : Type u_2}
{M : Type u_4}
[Preorder M]
[Zero M]
{s : Set α}
{f : α → M}
{a : α}
(h : a ∈ s → f a ≤ 0)


/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : X.Opens} (hU : IsCompact U.1) (x f : Γ(X, U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0

(X : AlgebraicGeometry.Scheme)
{U : X.Opens}
(hU : IsCompact U.carrier)
(x f : ↑Γ(X, U))
(H : (x |_ X.basicOpen f) ⋯ = 0)


/-- For all `ε > 0` and finite families `A`, we can partition the remainders of `A` mod `b`
into `abv.card ε` sets, such that all elements in each part of remainders are close together. -/
theorem exists_partition {ι : Type*} [Finite ι] {ε : ℝ} (hε : 0 < ε) {b : R} (hb : b ≠ 0)
    (A : ι → R) (h : abv.IsAdmissible) : ∃ t : ι → Fin (h.card ε),
      ∀ i₀ i₁, t i₀ = t i₁ → (abv (A i₁ % b - A i₀ % b) : ℝ) < abv b • ε

{R : Type u_1}
[EuclideanDomain R]
{abv : AbsoluteValue R ℤ}
{ι : Type u_2}
[Finite ι]
{ε : ℝ}
(hε : 0 < ε)
{b : R}
(hb : b ≠ 0)
(A : ι → R)
(h : abv.IsAdmissible)

∃ t, ∀ (i₀ i₁ : ι), t i₀ = t i₁ → ↑(abv (A i₁ % b - A i₀ % b)) < abv b • ε


lemma bddBelow_range_pi {F : ι → ∀ a, π a} :
    BddBelow (range F) ↔ ∀ a, BddBelow (range fun i ↦ F i a)

{α : Type u}
{ι : Sort x}
{π : α → Type u_1}
[(a : α) → Preorder (π a)]
{F : ι → (a : α) → π a}

BddBelow (Set.range F) ↔ ∀ (a : α), BddBelow (Set.range fun i => F i a)


theorem ceil_nonneg (ha : 0 ≤ a) : 0 ≤ ⌈a⌉

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{a : α}
(ha : 0 ≤ a)


@[to_additive (attr := simp)]
theorem inv_le_inv (S T : Submonoid G) : S⁻¹ ≤ T⁻¹ ↔ S ≤ T

{G : Type u_2}
[Group G]
(S T : Submonoid G)

S⁻¹ ≤ T⁻¹ ↔ S ≤ T


theorem StateT.goto_mkLabel {α β σ : Type u} (x : Label (α × σ) m (β × σ)) (i : α) :
    goto (StateT.mkLabel x) i = StateT.mk (fun s => goto x (i, s))

{m : Type u → Type v}
{α β σ : Type u}
(x : ContT.Label (α × σ) m (β × σ))
(i : α)

ContT.goto (StateT.mkLabel x) i = StateT.mk fun s => ContT.goto x (i, s)


theorem to_ofList (l : List (Lists α)) : toList (ofList l) = l


/-- If `E / F` is a separable extension of exponential characteristic `q`, if `{ u_i }` is a
family of elements of `E` which is `F`-linearly independent, then `{ u_i ^ (q ^ n) }` is also
`F`-linearly independent for any natural number `n`. -/
theorem LinearIndependent.map_pow_expChar_pow_of_isSeparable [Algebra.IsSeparable F E]
    (h : LinearIndependent F v) : LinearIndependent F (v · ^ q ^ n)

{F : Type u}
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
(q n : ℕ)
[hF : ExpChar F q]
{ι : Type u_1}
{v : ι → E}
[Algebra.IsSeparable F E]
(h : LinearIndependent F v)

LinearIndependent F fun x => v x ^ q ^ n


@[simp]
theorem ofLinearMap_toLinearMap (map_one) (map_mul) :
    ofLinearMap φ.toLinearMap map_one map_mul = φ

(map_mul : ∀ (x y : A), φ.toLinearMap (x * y) = φ.toLinearMap x * φ.toLinearMap y)

AlgHom.ofLinearMap φ.toLinearMap map_one map_mul = φ


theorem finite_of_discr_bdd_of_isReal :
    {K : { F : IntermediateField ℚ A // FiniteDimensional ℚ F} |
      haveI :  NumberField K := @NumberField.mk _ _ inferInstance K.prop
      {w : InfinitePlace K | IsReal w}.Nonempty ∧ |discr K| ≤ N }.Finite

(A : Type u_2)
[Field A]
[CharZero A]
(N : ℕ)

{K | {w | w.IsReal}.Nonempty ∧ |NumberField.discr ↥↑K| ≤ ↑N}.Finite


theorem div_tendsto_zero_iff_degree_lt (hQ : Q ≠ 0) :
    Tendsto (fun x => eval x P / eval x Q) atTop (𝓝 0) ↔ P.degree < Q.degree

{𝕜 : Type u_1}
[NormedLinearOrderedField 𝕜]
(P Q : 𝕜[X])
[OrderTopology 𝕜]
(hQ : Q ≠ 0)

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


@[reassoc (attr := simp)]
theorem appIso_inv_naturality {U V : X.Opens} (i : op U ⟶ op V) :
    X.presheaf.map i ≫ (f.appIso V).inv =
      (f.appIso U).inv ≫ Y.presheaf.map (f.opensFunctor.op.map i)

[H : AlgebraicGeometry.IsOpenImmersion f]


@[to_additive]
theorem op_smul_set_mul_eq_mul_smul_set (a : α) (s : Set α) (t : Set α) :
    op a • s * t = s * a • t

{α : Type u_2}
[Semigroup α]
(a : α)
(s t : Set α)


@[fun_prop]
theorem Differentiable.clm_apply (hc : Differentiable 𝕜 c) (hu : Differentiable 𝕜 u) :
    Differentiable 𝕜 fun y => (c y) (u y)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{H : Type u_6}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{c : E → G →L[𝕜] H}
{u : E → G}
(hc : Differentiable 𝕜 c)
(hu : Differentiable 𝕜 u)


/-- Two equivalence relations are equal iff their equivalence classes are equal. -/
theorem classes_inj {r₁ r₂ : Setoid α} : r₁ = r₂ ↔ r₁.classes = r₂.classes


theorem coeff_monomial_mul (p : R[X]) (n d : ℕ) (r : R) :
    coeff (monomial n r * p) (d + n) = r * coeff p d

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

((Polynomial.monomial n) r * p).coeff (d + n) = r * p.coeff d


/--The `i`th canonical injection, from `A i` to the free product.-/
irreducible_def ι (i : I) : A i →ₐ[R] FreeProduct R A

{I : Type u_1}
[DecidableEq I]
(R : Type u_2)
[CommSemiring R]
(A : I → Type u_3)
[(i : I) → Semiring (A i)]
[(i : I) → Algebra R (A i)]
(i : I)

LinearAlgebra.FreeProduct.ι R A i = AlgHom.ofLinearMap (LinearAlgebra.FreeProduct.ι' R A ∘ₗ DirectSum.lof R I A i) ⋯ ⋯


theorem exists_mem_map {f : α → β} {o : Option α} {p : β → Prop} :
    (∃ y ∈ o.map f, p y) ↔ ∃ x ∈ o, p (f x)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{o : Option α}
{p : β → Prop}

(∃ y, y ∈ Option.map f o ∧ p y) ↔ ∃ x, x ∈ o ∧ p (f x)


@[simp]
theorem mul_nonsing_inv_cancel_left (B : Matrix n m α) (h : IsUnit A.det) : A * (A⁻¹ * B) = B

{m : Type u}
{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)
(B : Matrix n m α)
(h : IsUnit A.det)


/-- The **extreme value theorem**: a continuous function realizes its maximum on a compact set. -/
@[deprecated IsCompact.exists_isMaxOn (since := "2023-02-06")]
theorem IsCompact.exists_forall_ge [ClosedIciTopology α] {s : Set β} (hs : IsCompact s)
    (ne_s : s.Nonempty) {f : β → α} (hf : ContinuousOn f s) : ∃ x ∈ s, ∀ y ∈ s, f y ≤ f x

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIciTopology α]
{s : Set β}
(hs : IsCompact s)
(ne_s : s.Nonempty)
{f : β → α}
(hf : ContinuousOn f s)


@[to_additive]
theorem UniformGroup.mk' {α} [UniformSpace α] [Group α]
    (h₁ : UniformContinuous fun p : α × α => p.1 * p.2) (h₂ : UniformContinuous fun p : α => p⁻¹) :
    UniformGroup α

(h₁ : UniformContinuous fun p => p.1 * p.2)


/-- The reduction step does not change the product vector. -/
theorem step_v (hr : u.r ≠ 0) : u.step.v = u.v.swap


@[to_additive MeasureTheory.NullMeasurableSet.addFundamentalFrontier]
protected theorem NullMeasurableSet.fundamentalFrontier (hs : NullMeasurableSet s μ) :
    NullMeasurableSet (fundamentalFrontier G s) μ

[MeasureTheory.VAddInvariantMeasure G α μ]

(hs : MeasureTheory.NullMeasurableSet s μ)

MeasureTheory.NullMeasurableSet (MeasureTheory.addFundamentalFrontier G s) μ


@[to_additive]
theorem prodMap_comap_prod {G' : Type*} {N' : Type*} [Group G'] [Group N'] (f : G →* N)
    (g : G' →* N') (S : Subgroup N) (S' : Subgroup N') :
    (S.prod S').comap (prodMap f g) = (S.comap f).prod (S'.comap g)

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{G' : Type u_8}
{N' : Type u_9}
[Group G']
[Group N']
(f : G →* N)
(g : G' →* N')
(S : Subgroup N)
(S' : Subgroup N')

Subgroup.comap (f.prodMap g) (S.prod S') = (Subgroup.comap f S).prod (Subgroup.comap g S')


/-- If the angle between three points is `-π / 2`, the first and third points are not equal. -/
theorem left_ne_right_of_oangle_eq_neg_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = (-π / 2 : ℝ)) :
    p₁ ≠ p₃

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


@[to_additive (attr := simp)]
theorem mulSupport_inv : (mulSupport fun x => (f x)⁻¹) = mulSupport f

{α : Type u_1}
{G : Type u_9}
[SubtractionMonoid G]
(f : α → G)

(Function.support fun x => -f x) = Function.support f


theorem map_csSup (e : α ≃o β) {s : Set α} (hne : s.Nonempty) (hbdd : BddAbove s) :
    e (sSup s) = ⨆ x : s, e x

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
[ConditionallyCompleteLattice β]
(e : α ≃o β)
{s : Set α}
(hne : s.Nonempty)
(hbdd : BddAbove s)


@[to_additive (attr := simp)]
lemma inf_inv [SemilatticeInf β] [OrderTop β] (s : Finset α) (f : α → β) :
    inf s⁻¹ f = inf s (f ·⁻¹)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Inv α]
[SemilatticeInf β]
[OrderTop β]
(s : Finset α)
(f : α → β)


@[simp]
theorem fderiv_ccos (hc : DifferentiableAt ℂ f x) :
    fderiv ℂ (fun x => Complex.cos (f x)) x = -Complex.sin (f x) • fderiv ℂ f x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
(hc : DifferentiableAt ℂ f x)


lemma cfc_real_eq_complex {a : A} (f : ℝ → ℝ) (ha : IsSelfAdjoint a := by cfc_tac)  :
    cfc f a = cfc (fun x ↦ f x.re : ℂ → ℂ) a


theorem finBddDistLat_dual_comp_forget_to_bddDistLat :
    FinBddDistLat.dual ⋙ forget₂ FinBddDistLat BddDistLat =
      forget₂ FinBddDistLat BddDistLat ⋙ BddDistLat.dual

FinBddDistLat.dual ⋙ CategoryTheory.forget₂ FinBddDistLat BddDistLat =
  CategoryTheory.forget₂ FinBddDistLat BddDistLat ⋙ BddDistLat.dual


theorem Continuous.connectedComponentsMap_continuous {β : Type*} [TopologicalSpace β] {f : α → β}
    (h : Continuous f) : Continuous h.connectedComponentsMap

{α : Type u}
[TopologicalSpace α]
{β : Type u_3}
[TopologicalSpace β]
{f : α → β}
(h : Continuous f)


theorem not_mem_sInter_of_not_mem {x y z : ZFSet} (hy : ¬y ∈ z) (hz : z ∈ x) : ¬y ∈ ⋂₀ x

{x y z : ZFSet}
(hy : y ∉ z)
(hz : z ∈ x)


@[to_additive] lemma MonovaryOn.pow_right (hfg : MonovaryOn f g s) (n : ℕ) :
    MonovaryOn f (g ^ n) s

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


/-- If a linear order does not contain any triple of elements `x < y < z`, then this type
is finite. -/
lemma Finite.of_forall_not_lt_lt (h : ∀ ⦃x y z : α⦄, x < y → y < z → False) : Finite α


@[simp]
theorem snd_comp_prod : (snd S T).comp (f.prod g) = g

{R : Type u_3}
{S : Type u_5}
{T : Type u_7}
[NonAssocSemiring R]
[NonAssocSemiring S]
[NonAssocSemiring T]
(f : R →+* S)
(g : R →+* T)


/-- If `n` is odd and `a` is even, then `n % a` is odd. -/
lemma Odd.mod_even (hn : Odd n) (ha : Even a) : Odd (n % a)


@[simp]
theorem gcd_eq_zero_iff [GCDMonoid α] (a b : α) : gcd a b = 0 ↔ a = 0 ∧ b = 0

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


theorem card_edgeFinset_eq [Fintype G.edgeSet] [Fintype G'.edgeSet] :
    G.edgeFinset.card = G'.edgeFinset.card

{V : Type u_1}
{G : SimpleGraph V}
{W : Type u_2}
{G' : SimpleGraph W}
(f : G ≃g G')
[Fintype ↑G.edgeSet]
[Fintype ↑G'.edgeSet]


theorem algHom_ext {F : Type*}
    [FunLike F (Unitization R A) B] [AlgHomClass F S (Unitization R A) B] {φ ψ : F}
    (h : ∀ a : A, φ a = ψ a)
    (h' : ∀ r, φ (algebraMap R (Unitization R A) r) = ψ (algebraMap R (Unitization R A) r)) :
    φ = ψ

(h' : ∀ (r : R), φ ((algebraMap R (Unitization R A)) r) = ψ ((algebraMap R (Unitization R A)) r))


@[simp]
theorem ForgetEnrichment.to_of (X : C) : ForgetEnrichment.to W (ForgetEnrichment.of W X) = X

{C : Type u₁}
(W : Type (v + 1))
[CategoryTheory.Category.{v, v + 1} W]
[CategoryTheory.MonoidalCategory W]
[CategoryTheory.EnrichedCategory W C]
(X : C)

CategoryTheory.ForgetEnrichment.to W (CategoryTheory.ForgetEnrichment.of W X) = X


/-- `TensorProduct.assoc` preserves tensor products of quadratic forms. -/
@[simps toLinearEquiv]
def tensorAssoc (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) (Q₃ : QuadraticForm R M₃) :
    ((Q₁.tmul Q₂).tmul Q₃).IsometryEquiv (Q₁.tmul (Q₂.tmul Q₃))

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

(Q₁.tensorAssoc Q₂ Q₃).toLinearEquiv = TensorProduct.assoc R M₁ M₂ M₃


@[ext]
theorem ext {f g : R →ₑ+*[φ] S} : (∀ x, f x = g x) → f = g

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{R : Type u_10}
[Semiring R]
[MulSemiringAction M R]
{S : Type u_12}
[Semiring S]
[MulSemiringAction N S]
{f g : R →ₑ+*[φ] S}


@[simp] theorem apply_inv_self (e : α ≃ᵢ α) (x : α) : e (e⁻¹ x) = x

{α : Type u}
[PseudoEMetricSpace α]
(e : α ≃ᵢ α)
(x : α)


theorem lpMeasToLpTrim_ae_eq (hm : m ≤ m0) (f : lpMeas F 𝕜 m p μ) :
    lpMeasToLpTrim F 𝕜 p μ hm f =ᵐ[μ] f

{α : Type u_1}
{F : Type u_3}
{𝕜 : Type u_5}
{p : ℝ≥0∞}
[RCLike 𝕜]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(hm : m ≤ m0)
(f : ↥(MeasureTheory.lpMeas F 𝕜 m p μ))

↑↑(MeasureTheory.lpMeasToLpTrim F 𝕜 p μ hm f) =ᵐ[μ] ↑↑↑f


@[to_additive]
theorem noncommProd_eq_prod {β : Type*} [CommMonoid β] (s : Finset α) (f : α → β) :
    (noncommProd s f fun _ _ _ _ _ => Commute.all _ _) = s.prod f

{α : Type u_3}
{β : Type u_6}
[CommMonoid β]
(s : Finset α)
(f : α → β)


@[to_additive (attr := simp)]
lemma fiberEquivKer_apply (f : α →* H) (a : α) (g : f ⁻¹' {f a}) : f.fiberEquivKer a g = a⁻¹ * g

{α : Type u_1}
[Group α]
{H : Type u_2}
[Group H]
(f : α →* H)
(a : α)
(g : ↑(⇑f ⁻¹' {f a}))


/-- This lemma reorders the elements of a triangle in the tripartite graph. It turns a triangle
`{x, y, z}` into a triangle `{a, b, c}` where `a : α `, `b : β`, `c : γ`. -/
 lemma graph_triple ⦃x y z⦄ :
  (graph t).Adj x y → (graph t).Adj x z → (graph t).Adj y z → ∃ a b c,
    ({in₀ a, in₁ b, in₂ c} : Finset (α ⊕ β ⊕ γ)) = {x, y, z} ∧ (graph t).Adj (in₀ a) (in₁ b) ∧
      (graph t).Adj (in₀ a) (in₂ c) ∧ (graph t).Adj (in₁ b) (in₂ c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{t : Finset (α × β × γ)}
[DecidableEq α]
[DecidableEq β]
[DecidableEq γ]
⦃x y z : α ⊕ β ⊕ γ⦄

(SimpleGraph.TripartiteFromTriangles.graph t).Adj x y →
  (SimpleGraph.TripartiteFromTriangles.graph t).Adj x z →
    (SimpleGraph.TripartiteFromTriangles.graph t).Adj y z →
      ∃ a b c,
        {Sum3.in₀ a, Sum3.in₁ b, Sum3.in₂ c} = {x, y, z} ∧
          (SimpleGraph.TripartiteFromTriangles.graph t).Adj (Sum3.in₀ a) (Sum3.in₁ b) ∧
            (SimpleGraph.TripartiteFromTriangles.graph t).Adj (Sum3.in₀ a) (Sum3.in₂ c) ∧
              (SimpleGraph.TripartiteFromTriangles.graph t).Adj (Sum3.in₁ b) (Sum3.in₂ c)


theorem sInf_le_of_le (hb : b ∈ s) (h : b ≤ a) : sInf s ≤ a

{α : Type u_1}
[CompleteSemilatticeInf α]
{s : Set α}
{a b : α}
(hb : b ∈ s)
(h : b ≤ a)


@[to_additive (attr := simp)]
lemma mulEnergy_univ_left : Eₘ[univ, t] = Fintype.card α * t.card ^ 2

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

Finset.univ.mulEnergy t = Fintype.card α * t.card ^ 2


theorem closure_le_toAddSubmonoid_span {s : Set M} :
    AddSubmonoid.closure s ≤ (span R s).toAddSubmonoid

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s : Set M}

AddSubmonoid.closure s ≤ (Submodule.span R s).toAddSubmonoid


protected theorem comm : AEDisjoint μ s t ↔ AEDisjoint μ t s

{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}

MeasureTheory.AEDisjoint μ s t ↔ MeasureTheory.AEDisjoint μ t s


theorem image_eq_preimage (e : R ≃+* S) (s : Set R) : e '' s = e.symm ⁻¹' s

{R : Type u_4}
{S : Type u_5}
[Mul R]
[Mul S]
[Add R]
[Add S]
(e : R ≃+* S)
(s : Set R)


@[simp] lemma _root_.zsmul_eq_mul (a : α) : ∀ n : ℤ, n • a = n * a

{α : Type u_3}
[NonAssocRing α]
(a : α)
(n : ℤ)


@[to_additive]
lemma isOpenMap_div_right (a : G) : IsOpenMap (· / a)

{G : Type w}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
(a : G)


@[to_additive]
theorem eventually_div_right_iff (μ : Measure G) [IsMulRightInvariant μ] (t : G) {p : G → Prop} :
    (∀ᵐ x ∂μ, p (x / t)) ↔ ∀ᵐ x ∂μ, p x

{G : Type u_2}
[MeasurableSpace G]
[Group G]
[MeasurableMul G]
(μ : MeasureTheory.Measure G)
[μ.IsMulRightInvariant]
(t : G)
{p : G → Prop}

(∀ᵐ (x : G) ∂μ, p (x / t)) ↔ ∀ᵐ (x : G) ∂μ, p x


/-- If the first vector passed to `oangle` is 0, the result is 0. -/
@[simp]
theorem oangle_zero_left (x : V) : o.oangle 0 x = 0

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


theorem X_eq : (X : R⟦X⟧) = monomial R 1 1

PowerSeries.X = (PowerSeries.monomial R 1) 1


/-- In a non-trivial module, zero is not non-degenerate. -/
theorem not_nondegenerate_zero [Nontrivial M] : ¬(0 : BilinForm R M).Nondegenerate

(R : Type u_1)
(M : Type u_2)
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[Nontrivial M]


theorem Nat.cauchy_induction_mul (h : ∀ (n : ℕ), P (n + 1) → P n) (k seed : ℕ) (hk : 1 < k)
    (hs : P seed.succ) (hm : ∀ x, seed < x → P x → P (k * x)) (n : ℕ) : P n

(hm : ∀ (x : ℕ), seed < x → P x → P (k * x))


theorem edgeFinset_card : G.edgeFinset.card = Fintype.card G.edgeSet

{V : Type u_1}
{G : SimpleGraph V}
[Fintype ↑G.edgeSet]

G.edgeFinset.card = Fintype.card ↑G.edgeSet


@[simp]
theorem map_sub {X Y : C} {f g : X ⟶ Y} : F.map (f - g) = F.map f - F.map g

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Preadditive C]
[CategoryTheory.Preadditive D]
(F : CategoryTheory.Functor C D)
[F.Additive]
{X Y : C}
{f g : X ⟶ Y}


/-- One half of the quivalence between `C` and `ULiftHom C`. -/
@[simps]
def ULiftHom.down : ULiftHom C ⥤ C

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

∀ {X Y : CategoryTheory.ULiftHom C} (f : X ⟶ Y), CategoryTheory.ULiftHom.down.map f = f.down


@[simp, norm_cast] lemma cast_one : ((1 : ℚ≥0) : α) = 1


@[to_additive (attr := simp)]
theorem quotientQuotientEquivQuotientAux_mk (x : G ⧸ N) :
    quotientQuotientEquivQuotientAux N M h x = QuotientGroup.map N M (MonoidHom.id G) h x

{G : Type u}
[AddGroup G]
(N : AddSubgroup G)
[nN : N.Normal]
(M : AddSubgroup G)
[nM : M.Normal]
(h : N ≤ M)
(x : G ⧸ N)

(QuotientAddGroup.quotientQuotientEquivQuotientAux N M h) ↑x = (QuotientAddGroup.map N M (AddMonoidHom.id G) h) x


@[simp] theorem emptyOn_dual_eq : (emptyOn α)✶ = emptyOn α

(Matroid.emptyOn α)✶ = Matroid.emptyOn α


/-- The diagonal map from the total space of the fiberwise product of two fiber bundles
`E₁`, `E₂` into `TotalSpace F₁ E₁ × TotalSpace F₂ E₂` is `Inducing`. -/
theorem FiberBundle.Prod.inducing_diag :
    Inducing (fun p ↦ (⟨p.1, p.2.1⟩, ⟨p.1, p.2.2⟩) :
      TotalSpace (F₁ × F₂) (E₁ ×ᵇ E₂) → TotalSpace F₁ E₁ × TotalSpace F₂ E₂)

[TopologicalSpace (Bundle.TotalSpace F₁ E₁)]

[TopologicalSpace (Bundle.TotalSpace F₂ E₂)]

Inducing fun p => ({ proj := p.proj, snd := p.snd.1 }, { proj := p.proj, snd := p.snd.2 })


theorem isLindelof_iff_LindelofSpace : IsLindelof s ↔ LindelofSpace s

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


/-- The `i`th cycles functor `HomologicalComplex C c ⥤ C`. -/
@[simps]
noncomputable def cyclesFunctor [CategoryWithHomology C] : HomologicalComplex C c ⥤ C

(HomologicalComplex.cyclesFunctor C c i).obj K = K.cycles i


/-- A variant of `app_invApp` that gives an `eqToHom` instead of `homOfLE`. -/
@[reassoc]
theorem app_invApp' (U) (hU : U ≤ f.opensRange) :
    f.app U ≫ (f.appIso (f ⁻¹ᵁ U)).inv =
      Y.presheaf.map (eqToHom (Opens.ext <| by simpa [Set.image_preimage_eq_inter_range])).op

[H : AlgebraicGeometry.IsOpenImmersion f]

f.app U ≫ (f.appIso ((TopologicalSpace.Opens.map f.val.base).obj U)).inv = Y.presheaf.map (CategoryTheory.eqToHom ⋯).op


theorem tendsto_intCast_atTop_atTop [StrictOrderedRing R] [Archimedean R] :
    Tendsto ((↑) : ℤ → R) atTop atTop

{R : Type u_2}
[StrictOrderedRing R]
[Archimedean R]

Filter.Tendsto Int.cast Filter.atTop Filter.atTop


theorem monotoneOn_dual_iff : MonotoneOn (toDual ∘ f ∘ ofDual : αᵒᵈ → βᵒᵈ) s ↔ MonotoneOn f s

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{s : Set α}

MonotoneOn (⇑OrderDual.toDual ∘ f ∘ ⇑OrderDual.ofDual) s ↔ MonotoneOn f s


@[to_additive (attr := simp, norm_cast)]
theorem coe_inv [Inv G] (f : α → G) : ↑f⁻¹ = (f⁻¹ : Germ l G)

{α : Type u_1}
{l : Filter α}
{G : Type u_6}
[Neg G]
(f : α → G)


theorem asymm [IsAsymm α r] {a b : α} : a ≺ b → ¬b ≺ a

{α : Sort u}
{r : α → α → Prop}
[IsAsymm α r]
{a b : α}


theorem hnot_anti : Antitone (hnot : α → α)


/-- A continuous antitone function between (conditionally) complete linear ordered spaces sends a
`Filter.limsup` to the `Filter.liminf` of the images (if the filter is bounded from above and
frequently bounded from below). -/
theorem Antitone.map_limsup_of_continuousAt {f : R → S} (f_decr : Antitone f) (a : ι → R)
    (f_cont : ContinuousAt f (F.limsup a))
    (bdd_above : F.IsBoundedUnder (· ≤ ·) a := by isBoundedDefault)
    (cobdd : F.IsCoboundedUnder (· ≤ ·) a := by isBoundedDefault) :
    f (F.limsup a) = F.liminf (f ∘ a)

(f_cont : ContinuousAt f (Filter.limsup a F))

(bdd_above : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) F a := by isBoundedDefault)

(cobdd : Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) F a := by isBoundedDefault)

f (Filter.limsup a F) = Filter.liminf (f ∘ a) F


@[simp]
theorem toPartENat_natCast (n : ℕ) : toPartENat n = n


/-- A linear map is convex. -/
theorem LinearMap.convexOn (f : E →ₗ[𝕜] β) {s : Set E} (hs : Convex 𝕜 s) : ConvexOn 𝕜 s f

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
(f : E →ₗ[𝕜] β)
{s : Set E}
(hs : Convex 𝕜 s)


/-- Coercion to a function as a `MonoidHom`. Similar to `MonoidHom.coeFn`. -/
@[to_additive (attr := simps) "Coercion to a function as an `AddMonoidHom`.
  Similar to `AddMonoidHom.coeFn`."]
def coeFnMonoidHom {G : Type*} [Monoid G] [TopologicalSpace G] [ChartedSpace H' G]
    [SmoothMul I' G] : C^∞⟮I, N; I', G⟯ →* N → G

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{H' : Type u_5}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{G : Type u_10}
[Monoid G]
[TopologicalSpace G]
[ChartedSpace H' G]
[SmoothMul I' G]

∀ (a : C^⊤⟮I, N; I', G⟯) (a_1 : N), SmoothMap.coeFnMonoidHom a a_1 = a a_1


theorem sbtw_midpoint_of_ne {x y : P} (h : x ≠ y) : Sbtw R x (midpoint R x y) y

(R : Type u_1)
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y : P}
(h : x ≠ y)


@[simp]
theorem sumArrowEquivProdArrow_apply_snd (f : α ⊕ β → γ) (b : β) :
    (sumArrowEquivProdArrow α β γ f).2 b = f (inr b)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α ⊕ β → γ)
(b : β)

((Equiv.sumArrowEquivProdArrow α β γ) f).2 b = f (Sum.inr b)


lemma shiftFunctorAdd'_zero_add (a : A) :
    shiftFunctorAdd' C 0 a a (zero_add a) = (Functor.leftUnitor _).symm ≪≫
    isoWhiskerRight (shiftFunctorZero C A).symm (shiftFunctor C a)

(C : Type u)
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddMonoid A]
[CategoryTheory.HasShift C A]
(a : A)

CategoryTheory.shiftFunctorAdd' C 0 a a ⋯ =
  (CategoryTheory.shiftFunctor C a).leftUnitor.symm ≪≫
    CategoryTheory.isoWhiskerRight (CategoryTheory.shiftFunctorZero C A).symm (CategoryTheory.shiftFunctor C a)


/-- Postcomposing `f` with `Prod.fst` is `C^n` -/
theorem ContDiff.fst {f : E → F × G} (hf : ContDiff 𝕜 n f) : ContDiff 𝕜 n fun x => (f x).1

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{n : ℕ∞}
{f : E → F × G}
(hf : ContDiff 𝕜 n f)


@[simp]
theorem map_bijective [Nonempty α] [Nonempty β] {f : α → γ} {g : β → δ} :
    Bijective (map f g) ↔ Bijective f ∧ Bijective g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
[Nonempty α]
[Nonempty β]
{f : α → γ}
{g : β → δ}

Function.Bijective (Prod.map f g) ↔ Function.Bijective f ∧ Function.Bijective g


lemma dist_le_of_mem_pi_Icc (hx : x ∈ Icc x' y') (hy : y ∈ Icc x' y') : dist x y ≤ dist x' y'

{ι : Type u_1}
[Fintype ι]
{x y x' y' : ι → ℝ}
(hx : x ∈ Set.Icc x' y')
(hy : y ∈ Set.Icc x' y')


@[to_additive]
theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X}
    (h : ∀ i ∈ l, ContinuousOn (f i) t) :
    ContinuousOn (fun a => (l.map fun i => f i a).prod) t

{ι : Type u_1}
{M : Type u_3}
{X : Type u_5}
[TopologicalSpace X]
[TopologicalSpace M]
[Monoid M]
[ContinuousMul M]
{f : ι → X → M}
(l : List ι)
{t : Set X}
(h : ∀ i ∈ l, ContinuousOn (f i) t)

ContinuousOn (fun a => (List.map (fun i => f i a) l).prod) t


theorem interpolate_one (hvs : Set.InjOn v s) (hs : s.Nonempty) : interpolate s v 1 = 1

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
(hvs : Set.InjOn v ↑s)
(hs : s.Nonempty)


@[simp]
theorem map_union [DecidableEq β] {f : α → β} (finj : Function.Injective f) {s t : Multiset α} :
    map f (s ∪ t) = map f s ∪ map f t

{α : Type u_1}
{β : Type v}
[DecidableEq α]
[DecidableEq β]
{f : α → β}
(finj : Function.Injective f)
{s t : Multiset α}

Multiset.map f (s ∪ t) = Multiset.map f s ∪ Multiset.map f t


theorem Finite.iInf_biSup_of_monotone {ι ι' α : Type*} [Preorder ι'] [Nonempty ι']
    [IsDirected ι' (swap (· ≤ ·))] [Order.Coframe α] {s : Set ι} (hs : s.Finite) {f : ι → ι' → α}
    (hf : ∀ i ∈ s, Monotone (f i)) : ⨅ j, ⨆ i ∈ s, f i j = ⨆ i ∈ s, ⨅ j, f i j

[IsDirected ι' (Function.swap fun x x_1 => x ≤ x_1)]

{f : ι → ι' → α}


@[simp, norm_cast]
theorem cast_bit0 [One α] [Add α] (n : PosNum) : (n.bit0 : α) = (n : α) + n

{α : Type u_1}
[One α]
[Add α]
(n : PosNum)


theorem nhds_nhds (x : X) :
    𝓝 (𝓝 x) = ⨅ (s : Set X) (_ : IsOpen s) (_ : x ∈ s), 𝓟 (Iic (𝓟 s))

{X : Type u_4}
[TopologicalSpace X]
(x : X)

𝓝 (𝓝 x) = ⨅ s, ⨅ (_ : IsOpen s), ⨅ (_ : x ∈ s), 𝓟 (Set.Iic (𝓟 s))


protected theorem ciSup_add (c : Cardinal.{v}) : (⨆ i, f i) + c = ⨆ i, f i + c

{ι : Type u}
(f : ι → Cardinal.{v})
[Nonempty ι]
(hf : BddAbove (Set.range f))
(c : Cardinal.{v})


@[simp]
theorem ZMod.charpoly_pow_card {p : ℕ} [Fact p.Prime] (M : Matrix n n (ZMod p)) :
    (M ^ p).charpoly = M.charpoly

{n : Type u_1}
[DecidableEq n]
[Fintype n]
{p : ℕ}
[Fact (Nat.Prime p)]
(M : Matrix n n (ZMod p))


theorem Ici_subset_Icc_union_Ioi : Ici a ⊆ Icc a b ∪ Ioi b

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


@[simp]
theorem prod_projLeft_projRight (p : Path.Homotopic.Quotient (a₁, b₁) (a₂, b₂)) :
    prod (projLeft p) (projRight p) = p

Path.Homotopic.prod (Path.Homotopic.projLeft p) (Path.Homotopic.projRight p) = p


@[simp]
theorem dualLift_of_subtype {φ : Module.Dual K W} (w : W) : W.dualLift φ (w : V) = φ w

{K : Type u}
{V : Type v}
[Field K]
[AddCommGroup V]
[Module K V]
{W : Subspace K V}
{φ : Module.Dual K ↥W}
(w : ↥W)


lemma pullbackShiftFunctorZero_hom_app :
    (shiftFunctorZero _ A).hom.app X =
      (pullbackShiftIso C φ 0 0 (by simp)).hom.app X ≫ (shiftFunctorZero C B).hom.app X

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
{A : Type u_2}
{B : Type u_3}
[AddMonoid A]
[AddMonoid B]
(φ : A →+ B)
[CategoryTheory.HasShift C B]
(X : CategoryTheory.PullbackShift C φ)

(CategoryTheory.shiftFunctorZero (CategoryTheory.PullbackShift C φ) A).hom.app X =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.pullbackShiftIso C φ 0 0 ⋯).hom.app X)
    ((CategoryTheory.shiftFunctorZero C B).hom.app X)


/-- Flip the arguments of a bifunctor. See also `Currying.lean`. -/
@[simps]
protected def flip (F : C ⥤ D ⥤ E) : D ⥤ C ⥤ E

(F : CategoryTheory.Functor C (CategoryTheory.Functor D E))

∀ {X Y : D} (f : X ⟶ Y) (j : C), (F.flip.map f).app j = (F.obj j).map f


@[to_additive (attr := simp, norm_cast)]
lemma one_eq_coe : 1 = (a : WithBot α) ↔ a = 1


@[simp]
theorem toFun_eq_coe {f : M →[L] N} : f.toFun = (f : M → N)

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
{f : L.Hom M N}


@[simp, mfld_simps]
theorem achart_val (x : M) : (achart H x).1 = chartAt H x

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


theorem finsum_weightedHomogeneousComponent :
    (finsum fun m => weightedHomogeneousComponent w m φ) = φ

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
{σ : Type u_3}
[AddCommMonoid M]
(w : σ → M)
(φ : MvPolynomial σ R)

∑ᶠ (m : M), (MvPolynomial.weightedHomogeneousComponent w m) φ = φ


@[to_additive (attr := simp)]
lemma subgroupCongr_apply (h : H = K) (x) :
    (MulEquiv.subgroupCongr h x : G) = x

{G : Type u_1}
[AddGroup G]
{H K : AddSubgroup G}
(h : H = K)
(x : ↥H)


@[simp]
theorem inter_get_eq [Inter α] (a b : Part α) (hab : Dom (a ∩ b)) :
    (a ∩ b).get hab = a.get (left_dom_of_inter_dom hab) ∩ b.get (right_dom_of_inter_dom hab)

{α : Type u_1}
[Inter α]
(a b : Part α)
(hab : (a ∩ b).Dom)


/-- For a reduced ring, surjectivity of the Frobenius map is a sufficient condition for perfection.
-/
lemma PerfectRing.ofSurjective (R : Type*) (p : ℕ) [CommRing R] [ExpChar R p]
    [IsReduced R] (h : Surjective <| frobenius R p) : PerfectRing R p

(h : Function.Surjective ⇑(frobenius R p))


theorem decode_encodeNat : ∀ n, decodeNat (encodeNat n) = n

Computability.decodeNat (Computability.encodeNat n) = n


theorem zpow_eq_zpow_emod' {x : G} (m : ℤ) {n : ℕ} (h : x ^ n = 1) :
    x ^ m = x ^ (m % (n : ℤ))


theorem getOrElse_of_not_dom (a : Part α) (h : ¬a.Dom) [Decidable a.Dom] (d : α) :
    getOrElse a d = d

{α : Type u_1}
(a : Part α)
(h : ¬a.Dom)
[Decidable a.Dom]
(d : α)


theorem deriv_lt_ord {f : Ordinal.{u} → Ordinal} {c} (hc : IsRegular c) (hc' : c ≠ ℵ₀)
    (hf : ∀ i < c.ord, f i < c.ord) {a} : a < c.ord → deriv f a < c.ord

{f : Ordinal.{u} → Ordinal.{u}}
{c : Cardinal.{u}}
(hc : c.IsRegular)
(hc' : c ≠ ℵ₀)
(hf : ∀ i < c.ord, f i < c.ord)
{a : Ordinal.{u}}


/-- The truncated and non-truncated versions of `Xᵢ` have the same asymptotic behavior, as they
almost surely coincide at all but finitely many steps. This follows from a probability computation
and Borel-Cantelli. -/
theorem strong_law_aux5 :
    ∀ᵐ ω, (fun n : ℕ => ∑ i ∈ range n, truncation (X i) i ω - ∑ i ∈ range n, X i ω) =o[atTop]
    fun n : ℕ => (n : ℝ)

(X : ℕ → Ω → ℝ)

(hint : MeasureTheory.Integrable (X 0) ℙ)

(hident : ∀ (i : ℕ), ProbabilityTheory.IdentDistrib (X i) (X 0) ℙ ℙ)

(hnonneg : ∀ (i : ℕ) (ω : Ω), 0 ≤ X i ω)

∀ᵐ (ω : Ω),
  (fun n =>
      ∑ i ∈ Finset.range n, ProbabilityTheory.truncation (X i) (↑i) ω - ∑ i ∈ Finset.range n, X i ω) =o[Filter.atTop]
    fun n => ↑n


@[to_additive (attr := simp)]
theorem mul_left_inv : ∀ a : G, a⁻¹ * a = 1


@[simp] lemma clog_zero_right (b : ℕ) : clog b 0 = 0


theorem Set.Finite.lt_csInf_iff (hs : s.Finite) (h : s.Nonempty) : a < sInf s ↔ ∀ x ∈ s, a < x

{α : Type u_2}
[ConditionallyCompleteLinearOrder α]
{s : Set α}
{a : α}
(hs : s.Finite)
(h : s.Nonempty)


@[simp]
lemma toSingle₀Equiv_symm_apply_f_zero {C : ChainComplex V ℕ} {X : V}
    (f : C.X 0 ⟶ X) (hf : C.d 1 0 ≫ f = 0) :
    ((toSingle₀Equiv C X).symm ⟨f, hf⟩).f 0 = f

((C.toSingle₀Equiv X).symm ⟨f, hf⟩).f 0 = f


theorem or_or_distrib_right : (a ∨ b) ∨ c ↔ (a ∨ c) ∨ b ∨ c


/-- The type of finitary infimum-preserving homomorphisms from `α` to `β`. -/
structure InfTopHom (α β : Type*) [Inf α] [Inf β] [Top α] [Top β] extends InfHom α β where
  /-- An `InfTopHom` preserves the top element. -/
  map_top' : toFun ⊤ = ⊤

{α : Type u_7}
{β : Type u_8}
[Inf α]
[Inf β]
[Top α]
[Top β]
(self : InfTopHom α β)


@[simp]
theorem coe_of {M : Type w} [L.Structure M] [Nonempty M] (h : M ⊨ T) : (h.bundled : Type w) = M

{L : FirstOrder.Language}
{T : L.Theory}
{M : Type w}
[L.Structure M]
[Nonempty M]
(h : M ⊨ T)


theorem mk_eq_localization_mk (p : K[X]) {q : K[X]} (hq : q ≠ 0) :
    RatFunc.mk p q =
      ofFractionRing (Localization.mk p ⟨q, mem_nonZeroDivisors_iff_ne_zero.mpr hq⟩)

{K : Type u}
[CommRing K]
[IsDomain K]
(p : K[X])
{q : K[X]}
(hq : q ≠ 0)

RatFunc.mk p q = { toFractionRing := Localization.mk p ⟨q, ⋯⟩ }


@[simp]
lemma ofReal_lt_ofNat {p : ℝ} {n : ℕ} [n.AtLeastTwo] :
    ENNReal.ofReal p < no_index (OfNat.ofNat n) ↔ p < OfNat.ofNat n

ENNReal.ofReal p < OfNat.ofNat n ↔ p < OfNat.ofNat n


theorem mem_support_multiset_sum [AddCommMonoid M] {s : Multiset (α →₀ M)} (a : α) :
    a ∈ s.sum.support → ∃ f ∈ s, a ∈ (f : α →₀ M).support

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{s : Multiset (α →₀ M)}
(a : α)

a ∈ s.sum.support → ∃ f ∈ s, a ∈ f.support


theorem one_lt_last [NeZero n] : 1 < last (n + 1)


@[simp] lemma map_snd_prod : (μ.prod ν).map Prod.snd = μ univ • ν

{α : Type u_1}
[MeasurableSpace α]
{β : Type u_2}
[MeasurableSpace β]
(μ : MeasureTheory.FiniteMeasure α)
(ν : MeasureTheory.FiniteMeasure β)

(μ.prod ν).map Prod.snd = μ Set.univ • ν


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

{α : Type u_2}
{β : Type u_4}
{γ : Type u_5}
[TopologicalSpace α]
[Zero β]
[Zero γ]
{g : β → γ}
{f : α → β}
(hf : HasCompactSupport f)
(hg : g 0 = 0)


@[simp]
theorem mem_spanSingleton {x y : P} : x ∈ spanSingleton S y ↔ ∃ z : R, z • y = x

{R : Type u_1}
[CommRing R]
(S : Submonoid R)
{P : Type u_2}
[CommRing P]
[Algebra R P]
[loc : IsLocalization S P]
{x y : P}

x ∈ FractionalIdeal.spanSingleton S y ↔ ∃ z, z • y = x


theorem support_monomial [h : Decidable (a = 0)] :
    (monomial s a).support = if a = 0 then ∅ else {s}

{R : Type u}
{σ : Type u_1}
{a : R}
{s : σ →₀ ℕ}
[CommSemiring R]
[h : Decidable (a = 0)]

((MvPolynomial.monomial s) a).support = if a = 0 then ∅ else {s}


/-- Only finitely many maximal ideals of `R` divide a given nonzero ideal. -/
theorem Ideal.finite_factors {I : Ideal R} (hI : I ≠ 0) :
    {v : HeightOneSpectrum R | v.asIdeal ∣ I}.Finite

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


theorem ExtensionOfMaxAdjoin.eqn {y : N} (x : supExtensionOfMaxSingleton i f y) :
    ↑x = ↑(ExtensionOfMaxAdjoin.fst i x) + ExtensionOfMaxAdjoin.snd i x • y

(x : ↥(Module.Baer.supExtensionOfMaxSingleton i f y))

↑x = ↑(Module.Baer.ExtensionOfMaxAdjoin.fst i x) + Module.Baer.ExtensionOfMaxAdjoin.snd i x • y


lemma δ_leftUnshift {a n' : ℤ} (γ : Cochain (K⟦a⟧) L n') (n : ℤ) (hn : n + a = n')
    (m m' : ℤ) (hm' : m + a = m') :
    δ n m (γ.leftUnshift n hn) = a.negOnePow • (δ n' m' γ).leftUnshift m hm'

(γ : CochainComplex.HomComplex.Cochain ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) a).obj K) L n')

CochainComplex.HomComplex.δ n m (γ.leftUnshift n hn) =
  a.negOnePow • (CochainComplex.HomComplex.δ n' m' γ).leftUnshift m hm'


@[to_additive]
theorem Bornology.IsBounded.mul (hs : IsBounded s) (ht : IsBounded t) : IsBounded (s * t)

{E : Type u_1}
[SeminormedGroup E]
{s t : Set E}
(hs : Bornology.IsBounded s)
(ht : Bornology.IsBounded t)


theorem dropn_tail (s : Seq α) (n) : drop (tail s) n = drop s (n + 1)

{α : Type u}
(s : Stream'.Seq α)
(n : ℕ)


@[simp]
lemma map_isoClosure (P : MorphismProperty C) (F : C ⥤ D) :
    P.isoClosure.map F = P.map F

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u_1}
[CategoryTheory.Category.{u_2, u_1} D]
(P : CategoryTheory.MorphismProperty C)
(F : C ⥤ D)


/-- for a series of `NNReal` version. -/
theorem summable_schlomilch_iff {C : ℕ} {u : ℕ → ℕ} {f : ℕ → ℝ≥0}
    (hf : ∀ ⦃m n⦄, 0 < m → m ≤ n → f n ≤ f m)
    (h_pos : ∀ n, 0 < u n) (hu_strict : StrictMono u)
    (hC_nonzero : C ≠ 0) (h_succ_diff : SuccDiffBounded C u) :
    (Summable fun k : ℕ => (u (k + 1) - (u k : ℝ≥0)) * f (u k)) ↔ Summable f

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

(Summable fun k => (↑(u (k + 1)) - ↑(u k)) * f (u k)) ↔ Summable f


theorem toMatrix_update [DecidableEq ι'] (x : M) :
    e.toMatrix (Function.update v j x) = Matrix.updateColumn (e.toMatrix v) j (e.repr x)

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_5}
{M : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(e : Basis ι R M)
(v : ι' → M)
(j : ι')
[DecidableEq ι']
(x : M)

e.toMatrix (Function.update v j x) = (e.toMatrix v).updateColumn j ⇑(e.repr x)


theorem adjointAux_inner_left (A : E →L[𝕜] F) (x : E) (y : F) : ⟪adjointAux A y, x⟫ = ⟪y, A x⟫

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 F]
[CompleteSpace E]
(A : E →L[𝕜] F)
(x : E)
(y : F)

⟪(ContinuousLinearMap.adjointAux A) y, x⟫_𝕜 = ⟪y, A x⟫_𝕜


@[simp]
theorem image₂_curry (f : α × β → γ) (s : Finset α) (t : Finset β) :
    image₂ (curry f) s t = (s ×ˢ t).image f

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

Finset.image₂ (Function.curry f) s t = Finset.image f (s ×ˢ t)


theorem count_eq_card_filter_range (n : ℕ) : count p n = ((range n).filter p).card

(p : ℕ → Prop)
[DecidablePred p]
(n : ℕ)

Nat.count p n = (Finset.filter p (Finset.range n)).card


@[simp]
theorem lowerBounds_upperClosure : lowerBounds (upperClosure s : Set α) = lowerBounds s

lowerBounds ↑(upperClosure s) = lowerBounds s


/-- A family `𝓕 : ι → X → α` is equicontinuous on `S` iff the function `swap 𝓕 : X → ι → α` is
continuous on `S` *when `ι → α` is equipped with the topology of uniform convergence*. This is
very useful for developping the equicontinuity API, but it should not be used directly for other
purposes. -/
theorem equicontinuousOn_iff_continuousOn {F : ι → X → α} {S : Set X} :
    EquicontinuousOn F S ↔ ContinuousOn (ofFun ∘ Function.swap F : X → ι →ᵤ α) S

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{F : ι → X → α}
{S : Set X}

EquicontinuousOn F S ↔ ContinuousOn (⇑UniformFun.ofFun ∘ Function.swap F) S


theorem proj_stdBasis_ne (i j : ι) (h : i ≠ j) : (proj i).comp (stdBasis R φ j) = 0

(R : Type u_1)
{ι : Type u_2}
[Semiring R]
(φ : ι → Type u_3)
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
[DecidableEq ι]
(i j : ι)
(h : i ≠ j)

LinearMap.proj i ∘ₗ LinearMap.stdBasis R φ j = 0


@[simp]
theorem mapL_apply (x : ⨂[𝕜] i, E i) : mapL f x = map (fun i ↦ (f i).toLinearMap) x

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

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

(PiTensorProduct.mapL f) x = (PiTensorProduct.map fun i => ↑(f i)) x


/-- The associator for functors, a natural isomorphism `((F ⋙ G) ⋙ H) ≅ (F ⋙ (G ⋙ H))`.

(In fact, `iso.refl _` will work here, but it tends to make Lean slow later,
and it's usually best to insert explicit associators.)
-/
@[simps]
def associator (F : A ⥤ B) (G : B ⥤ C) (H : C ⥤ D) :
    (F ⋙ G) ⋙ H ≅ F ⋙ G ⋙ H

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(F : CategoryTheory.Functor A B)
(G : CategoryTheory.Functor B C)
(H : CategoryTheory.Functor C D)

∀ (x : A), (F.associator G H).hom.app x = CategoryTheory.CategoryStruct.id (((F.comp G).comp H).obj x)


theorem id_whiskerLeft_bimod {X Y : Mon_ C} {M N : Bimod X Y} (f : M ⟶ N) :
    whiskerLeft (regular X) f = (leftUnitorBimod M).hom ≫ f ≫ (leftUnitorBimod N).inv

[(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 X).whiskerLeft f = M.leftUnitorBimod.hom ≫ f ≫ N.leftUnitorBimod.inv


theorem mem_lookup_union {a} {b : β a} {s₁ s₂ : AList β} :
    b ∈ lookup a (s₁ ∪ s₂) ↔ b ∈ lookup a s₁ ∨ a ∉ s₁ ∧ b ∈ lookup a s₂

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{s₁ s₂ : AList β}

b ∈ AList.lookup a (s₁ ∪ s₂) ↔ b ∈ AList.lookup a s₁ ∨ a ∉ s₁ ∧ b ∈ AList.lookup a s₂


@[simp]
theorem sublists_nil : sublists (@nil α) = [[]]


@[simp]
theorem mk_quotientEquivOfIsCompl_apply (h : IsCompl p q) (x : E ⧸ p) :
    (Quotient.mk (quotientEquivOfIsCompl p q h x) : E ⧸ p) = x

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

Submodule.Quotient.mk ↑((p.quotientEquivOfIsCompl q h) x) = x


/-- If `f` is integrable on a box `I`, then it is integrable on any subbox of `I`. -/
theorem to_subbox (h : Integrable I l f vol) (hJ : J ≤ I) : Integrable J l f vol

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I J : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{f : (ι → ℝ) → E}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}
[CompleteSpace F]
(h : BoxIntegral.Integrable I l f vol)
(hJ : J ≤ I)


/-- If `X` is a paracompact normal topological space and `U` is an open covering of a closed set
`s`, then there exists a `PartitionOfUnity ι X s` that is subordinate to `U`. -/
theorem exists_isSubordinate [NormalSpace X] [ParacompactSpace X] (hs : IsClosed s) (U : ι → Set X)
    (ho : ∀ i, IsOpen (U i)) (hU : s ⊆ ⋃ i, U i) :
    ∃ f : PartitionOfUnity ι X s, f.IsSubordinate U

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
[NormalSpace X]
[ParacompactSpace X]
(hs : IsClosed s)
(U : ι → Set X)
(ho : ∀ (i : ι), IsOpen (U i))
(hU : s ⊆ ⋃ i, U i)


private theorem disjoint_filter_pairs_lt_filter_pairs_eq (k : ℕ) :
    Disjoint (filter (fun t ↦ card t.fst < k) (pairs σ k))
    (filter (fun t ↦ card t.fst = k) (pairs σ k))

(σ : Type u_1)
[Fintype σ]
[DecidableEq σ]
(k : ℕ)

Disjoint (Finset.filter (fun t => t.1.card < k) (MvPolynomial.NewtonIdentities.pairs σ k))
  (Finset.filter (fun t => t.1.card = k) (MvPolynomial.NewtonIdentities.pairs σ k))


@[to_additive]
theorem mem_centralizer_iff_commutator_eq_one {g : G} {s : Set G} :
    g ∈ centralizer s ↔ ∀ h ∈ s, h * g * h⁻¹ * g⁻¹ = 1

{G : Type u_1}
[AddGroup G]
{g : G}
{s : Set G}

g ∈ AddSubgroup.centralizer s ↔ ∀ h ∈ s, h + g + -h + -g = 0


protected theorem iInter {ι : Sort*} [Countable ι] {f : ι → Set α}
    (h : ∀ i, NullMeasurableSet (f i) μ) : NullMeasurableSet (⋂ i, f i) μ

(h : ∀ (i : ι), MeasureTheory.NullMeasurableSet (f i) μ)

MeasureTheory.NullMeasurableSet (⋂ i, f i) μ


theorem nhdsWithin_pi_univ_eq [Finite ι] (s : ∀ i, Set (π i)) (x : ∀ i, π i) :
    𝓝[pi univ s] x = ⨅ i, comap (fun x => x i) (𝓝[s i] x i)

{ι : Type u_5}
{π : ι → Type u_6}
[(i : ι) → TopologicalSpace (π i)]
[Finite ι]
(s : (i : ι) → Set (π i))
(x : (i : ι) → π i)

𝓝[Set.univ.pi s] x = ⨅ i, Filter.comap (fun x => x i) (𝓝[s i] x i)


/-- Change a cocone on `F.rightOp : J ⥤ Cᵒᵖ` to a cone on `F : Jᵒᵖ ⥤ C`. -/
@[simps]
def coneOfCoconeRightOp (c : Cocone F.rightOp) : Cone F

(c : CategoryTheory.Limits.Cocone F.rightOp)

(CategoryTheory.Limits.coneOfCoconeRightOp c).pt = Opposite.unop c.pt


protected lemma RingHom.map_pow (f : α →+* β) (a) : ∀ n : ℕ, f (a ^ n) = f a ^ n

{α : Type u_2}
{β : Type u_3}
[Semiring α]
[Semiring β]
(f : α →+* β)
(a : α)
(n : ℕ)


@[to_additive]
theorem Filter.HasBasis.nhds_of_one {ι : Sort*} {p : ι → Prop} {s : ι → Set G}
    (hb : HasBasis (𝓝 1 : Filter G) p s) (x : G) :
    HasBasis (𝓝 x) p fun i => { y | y / x ∈ s i }

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{ι : Sort u_1}
{p : ι → Prop}
{s : ι → Set G}
(hb : (𝓝 1).HasBasis p s)
(x : G)

(𝓝 x).HasBasis p fun i => {y | y / x ∈ s i}


lemma _root_.Function.HasTemperateGrowth.zero :
    Function.HasTemperateGrowth (fun _ : E ↦ (0 : F))

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


/-- The composition of `C^n` functions at points in domains is `C^n`. -/
theorem ContDiffWithinAt.comp' {s : Set E} {t : Set F} {g : F → G} {f : E → F} (x : E)
    (hg : ContDiffWithinAt 𝕜 n g t (f x)) (hf : ContDiffWithinAt 𝕜 n f s x) :
    ContDiffWithinAt 𝕜 n (g ∘ f) (s ∩ f ⁻¹' t) x

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


lemma tendsto_measure_Icc_nhdsWithin_right (b : ℝ) :
    Tendsto (fun δ ↦ μ (Icc (b - δ) (b + δ))) (𝓝[≥] (0 : ℝ)) (𝓝 (μ {b}))

Filter.Tendsto (fun δ => μ (Set.Icc (b - δ) (b + δ))) (𝓝[≥] 0) (𝓝 (μ {b}))


@[to_additive]
theorem image_mulSingle_Ioc_right (i : ι) (b : α i) :
    Pi.mulSingle i '' Ioc 1 b = Ioc 1 (Pi.mulSingle i b)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → Zero (α i)]
(i : ι)
(b : α i)

Pi.single i '' Set.Ioc 0 b = Set.Ioc 0 (Pi.single i b)


@[simp]
theorem currySum_apply (f : ContinuousMultilinearMap 𝕜 (fun _ : ι ⊕ ι' => G) G') (m : ι → G)
    (m' : ι' → G) : f.currySum m m' = f (Sum.elim m m')

(f : ContinuousMultilinearMap 𝕜 (fun x => G) G')


theorem source_preimage_target : e.source ⊆ e ⁻¹' e.target

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


theorem preimage_closure_subset_closure_preimage (hf : IsOpenMap f) {s : Set Y} :
    f ⁻¹' closure s ⊆ closure (f ⁻¹' s)

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : IsOpenMap f)
{s : Set Y}


theorem uniqueDiffWithinAt_Ioo {a b t : ℝ} (ht : t ∈ Set.Ioo a b) :
    UniqueDiffWithinAt ℝ (Set.Ioo a b) t


/-- Composition of morphisms between quivers. -/
@[simps]
def comp {U : Type*} [Quiver U] {V : Type*} [Quiver V] {W : Type*} [Quiver W]
    (F : Prefunctor U V) (G : Prefunctor V W) : Prefunctor U W

{U : Type u_1}
[Quiver U]
{V : Type u_2}
[Quiver V]
{W : Type u_3}
[Quiver W]
(F : U ⥤q V)
(G : V ⥤q W)
(X : U)


theorem comp_L : (X f).comp (𝑳 I g) = X (f.comp (𝑳 I g))

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
(g : G)
(X : LeftInvariantDerivation I G)
(f : C^⊤⟮I, G; 𝓘(𝕜, 𝕜), 𝕜⟯)


theorem zmod_congr_of_sub_mem_max_ideal (x : ℤ_[p]) (m n : ℕ) (hm : x - m ∈ maximalIdeal ℤ_[p])
    (hn : x - n ∈ maximalIdeal ℤ_[p]) : (m : ZMod p) = n

(hm : x - ↑m ∈ LocalRing.maximalIdeal ℤ_[p])

(hn : x - ↑n ∈ LocalRing.maximalIdeal ℤ_[p])


@[simp]
theorem linearProjOfIsCompl_apply_left (h : IsCompl p q) (x : p) :
    linearProjOfIsCompl p q h x = x

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


theorem toQuadraticMap_toBilin (Q : QuadraticMap R M N) (bm : Basis ι R M) :
    (Q.toBilin bm).toQuadraticMap = Q

{ι : Type u_4}
{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[LinearOrder ι]
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(Q : QuadraticMap R M N)
(bm : Basis ι R M)


theorem image_update_Ioc_left (f : ∀ i, α i) (i : ι) (a : α i) :
    update f i '' Ioc a (f i) = Ioc (update f i a) f

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

Function.update f i '' Set.Ioc a (f i) = Set.Ioc (Function.update f i a) f


@[simp]
theorem card_omega : card ω = ℵ₀


@[simp]
theorem measure_smul_average [IsFiniteMeasure μ] (f : α → E) :
    (μ univ).toReal • ⨍ x, f x ∂μ = ∫ x, f x ∂μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure μ]
(f : α → E)

(μ Set.univ).toReal • ⨍ (x : α), f x ∂μ = ∫ (x : α), f x ∂μ


@[simp]
theorem coe_smulRight (f : M₁ →ₗ[R] S) (x : M) : (smulRight f x : M₁ → M) = fun c => f c • x

{R : Type u_1}
{S : Type u_4}
{M : Type u_5}
{M₁ : Type u_6}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₁]
[Module R M]
[Module R M₁]
[Semiring S]
[Module R S]
[Module S M]
[IsScalarTower R S M]
(f : M₁ →ₗ[R] S)
(x : M)


theorem AntisymmRel.image {a b : α} (h : AntisymmRel (· ≤ ·) a b) {f : α → β} (hf : Monotone f) :
    AntisymmRel (· ≤ ·) (f a) (f b)

(h : AntisymmRel (fun x x_1 => x ≤ x_1) a b)

AntisymmRel (fun x x_1 => x ≤ x_1) (f a) (f b)


@[simp]
lemma opcyclesMap_smul : opcyclesMap (a • φ) = a • opcyclesMap φ

{R : Type u_1}
{C : Type u_2}
[Semiring R]
[CategoryTheory.Category.{u_3, u_2} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear R C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
(φ : S₁ ⟶ S₂)
(a : R)
[S₁.HasRightHomology]
[S₂.HasRightHomology]

CategoryTheory.ShortComplex.opcyclesMap (a • φ) = a • CategoryTheory.ShortComplex.opcyclesMap φ


theorem extract_loop_succ (as bs : Array α) (size start : Nat) (h : start < as.size) :
    extract.loop as (size+1) start bs = extract.loop as size (start+1) (bs.push as[start])

{α : Type u_1}
(as bs : Array α)
(size start : Nat)
(h : start < as.size)

Array.extract.loop as (size + 1) start bs = Array.extract.loop as size (start + 1) (bs.push as[start])


@[to_additive (attr := simp)]
theorem OneHom.comp_id [One M] [One N] (f : OneHom M N) : f.comp (OneHom.id M) = f

{M : Type u_4}
{N : Type u_5}
[One M]
[One N]
(f : OneHom M N)


@[simp]
theorem inf_prod : (s₁ ⊓ s₂) ×ˢ t = s₁ ×ˢ t ⊓ s₂ ×ˢ t

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(s₁ s₂ : LowerSet α)
(t : LowerSet β)

(s₁ ⊓ s₂) ×ˢ t = s₁ ×ˢ t ⊓ s₂ ×ˢ t


@[simp]
theorem realize_inf : (φ ⊓ ψ).Realize v xs ↔ φ.Realize v xs ∧ ψ.Realize v xs

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{l : ℕ}
{φ ψ : L.BoundedFormula α l}
{v : α → M}
{xs : Fin l → M}


theorem filter_apply_eq_zero_of_not_mem {a : α} (ha : a ∉ s) : (p.filter s h) a = 0

{α : Type u_1}
{p : PMF α}
{s : Set α}
(h : ∃ a ∈ s, a ∈ p.support)
{a : α}
(ha : a ∉ s)


lemma opShiftFunctorEquivalence_counitIso_inv_app_shift (X : Cᵒᵖ) (n : ℤ) :
    (opShiftFunctorEquivalence C n).counitIso.inv.app (X⟦n⟧) =
      ((opShiftFunctorEquivalence C n).unitIso.hom.app X)⟦n⟧'

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.HasShift C ℤ]
(X : Cᵒᵖ)
(n : ℤ)

(CategoryTheory.Pretriangulated.opShiftFunctorEquivalence C n).counitIso.inv.app
    ((CategoryTheory.shiftFunctor Cᵒᵖ n).obj X) =
  (CategoryTheory.shiftFunctor Cᵒᵖ n).map
    ((CategoryTheory.Pretriangulated.opShiftFunctorEquivalence C n).unitIso.hom.app X)


@[norm_cast]
theorem normSq_ratCast (q : ℚ) : normSq (q : ℍ[R]) = (q : ℍ[R]) ^ 2

{R : Type u_1}
[LinearOrderedField R]
(q : ℚ)


theorem Bounded.mem_lt : ∀ {t o} {x : α}, Bounded t o x → All (· < x) t

{α : Type u_1}
[Preorder α]
{t : Ordnode α}
{o : WithBot α}
{x : α}

t.Bounded o ↑x → Ordnode.All (fun x_1 => x_1 < x) t


/-- The distance from one point to itself is always zero.

This holds independent of `p` and does not require `[Fact (1 ≤ p)]`. We keep it separate
from `WithLp.instProdPseudoEMetricSpace` so it can be used also for `p < 1`. -/
theorem prod_edist_self (f : WithLp p (α × β)) : edist f f = 0

(p : ℝ≥0∞)
{α : Type u_2}
{β : Type u_3}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(f : WithLp p (α × β))


/-- The functor `RightExtension L' F ⥤ RightExtension L F`
induced by a natural transformation `L ⋙ G ⟶ L'`. -/
@[simps!]
def RightExtension.postcomp₁ (f : L ⋙ G ⟶ L') (F : C ⥤ H) :
    RightExtension L' F ⥤ RightExtension L F

{X Y : CategoryTheory.Comma ((CategoryTheory.whiskeringLeft C D' H).obj L') (CategoryTheory.Functor.fromPUnit F)}

((CategoryTheory.Functor.RightExtension.postcomp₁ G f F).map φ).right = CategoryTheory.CategoryStruct.id X.right


theorem Tape.exists_mk' {Γ} [Inhabited Γ] (T : Tape Γ) : ∃ L R, T = Tape.mk' L R

{Γ : Type u_1}
[Inhabited Γ]
(T : Turing.Tape Γ)


@[simp] theorem isEqv_nil_nil : isEqv ([] : List α) [] eqv = true


/-- The **Gagliardo-Nirenberg-Sobolev inequality**.  Let `u` be a continuously differentiable
compactly-supported function `u` on `ℝⁿ`, for `n ≥ 2`.  (More literally we encode `ℝⁿ` as
`ι → ℝ` where `n := #ι` is finite and at least 2.)  Then the Lebesgue integral of the pointwise
expression `|u x| ^ (n / (n - 1))` is bounded above by the `n / (n - 1)`-th power of the Lebesgue
integral of the Fréchet derivative of `u`.

For a basis-free version, see `lintegral_pow_le_pow_lintegral_fderiv`. -/
theorem lintegral_pow_le_pow_lintegral_fderiv_aux
    {p : ℝ} (hp : Real.IsConjExponent #ι p)
    {u : (ι → ℝ) → F} (hu : ContDiff ℝ 1 u)
    (h2u : HasCompactSupport u) :
    ∫⁻ x, (‖u x‖₊ : ℝ≥0∞) ^ p ≤ (∫⁻ x, ‖fderiv ℝ u x‖₊) ^ p

{ι : Type u_1}
[Fintype ι]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{p : ℝ}
(hp : (↑#ι).IsConjExponent p)
{u : (ι → ℝ) → F}
(hu : ContDiff ℝ 1 u)
(h2u : HasCompactSupport u)

∫⁻ (x : ι → ℝ), ↑‖u x‖₊ ^ p ≤ (∫⁻ (x : ι → ℝ), ↑‖fderiv ℝ u x‖₊) ^ p


theorem Surjective.bijective₂_of_injective {g : γ → α} (hf : Surjective f) (hg : Surjective g)
    (I : Injective (f ∘ g)) : Bijective f ∧ Bijective g

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

Function.Bijective f ∧ Function.Bijective g


theorem finite_of_discr_bdd_of_isComplex :
    {K : { F : IntermediateField ℚ A // FiniteDimensional ℚ F} |
      haveI :  NumberField K := @NumberField.mk _ _ inferInstance K.prop
      {w : InfinitePlace K | IsComplex w}.Nonempty ∧ |discr K| ≤ N }.Finite

(A : Type u_2)
[Field A]
[CharZero A]
(N : ℕ)

{K | {w | w.IsComplex}.Nonempty ∧ |NumberField.discr ↥↑K| ≤ ↑N}.Finite


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

{α : Type u_1}
[Monoid α]
{a : α}
(ha : a ≠ 1)
(ha' : IsOfFinOrder a)


@[simp, norm_cast] theorem ofNat_lt {n m : Nat} : (↑n : Int) < ↑m ↔ n < m


@[simp]
lemma blimsup_sup_not : blimsup u f p ⊔ blimsup u f (¬p ·) = limsup u f

{α : Type u_1}
{β : Type u_2}
[CompleteDistribLattice α]
{f : Filter β}
{p : β → Prop}
{u : β → α}

(Filter.blimsup u f p ⊔ Filter.blimsup u f fun x => ¬p x) = Filter.limsup u f


theorem not_lt_argminOn (s : Set α) {a : α} (ha : a ∈ s)
    (hs : s.Nonempty := Set.nonempty_of_mem ha) : ¬f a < f (argminOn f h s hs)

{α : Type u_1}
{β : Type u_2}
(f : α → β)
[LT β]
(h : WellFounded fun x x_1 => x < x_1)
(s : Set α)
{a : α}
(ha : a ∈ s)
(hs : s.Nonempty := ⋯)


theorem revLex_wf (ha : WellFounded r) (hb : WellFounded s) : WellFounded (RevLex r s)

{α : Sort u}
{β : Sort v}
{r : α → α → Prop}
{s : β → β → Prop}
(ha : WellFounded r)
(hb : WellFounded s)


theorem isSymm_iff_flip : B.IsSymm ↔ flipHom B = B

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}

B.IsSymm ↔ LinearMap.BilinForm.flipHom B = B


@[simp]
theorem symm_trans_self : e.symm.trans e = refl R₂ E₂

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

e.symm.trans e = LinearIsometryEquiv.refl R₂ E₂


/-- The equivalence `(ComposableArrows C n)ᵒᵖ ≌ ComposableArrows Cᵒᵖ n` obtained
by reversing the arrows. -/
@[simps!]
def opEquivalence : (ComposableArrows C n)ᵒᵖ ≌ ComposableArrows Cᵒᵖ n

(X : (CategoryTheory.Functor (Fin (n + 1)) C)ᵒᵖ)

∀ {X_1 Y : Fin (n + 1)} (f : X_1 ⟶ Y),
  ((CategoryTheory.ComposableArrows.opEquivalence C n).functor.obj X).map f =
    ((Opposite.unop X).map (⋯.functor.map (CategoryTheory.homOfLE ⋯))).op


theorem isUnit_neg_one [Monoid α] [HasDistribNeg α] : IsUnit (-1 : α)

{α : Type u}
[Monoid α]
[HasDistribNeg α]


@[to_additive]
theorem range_top_iff_surjective {N} [Group N] {f : G →* N} :
    f.range = (⊤ : Subgroup N) ↔ Function.Surjective f

{G : Type u_1}
[Group G]
{N : Type u_7}
[Group N]
{f : G →* N}


@[simp] theorem trunc_mul_trunc {n} (f g : R ⟦X⟧) :
    trunc n (f * (trunc n g) : R⟦X⟧) = trunc n (f * g)

{R : Type u_2}
[CommSemiring R]
{n : ℕ}
(f g : PowerSeries R)

PowerSeries.trunc n (f * ↑(PowerSeries.trunc n g)) = PowerSeries.trunc n (f * g)


@[simp]
theorem edgeSet_sInf (s : Set G.Subgraph) :
    (sInf s).edgeSet = (⋂ G' ∈ s, edgeSet G') ∩ G.edgeSet

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

(sInf s).edgeSet = (⋂ G' ∈ s, G'.edgeSet) ∩ G.edgeSet


theorem restrOpen_source (s : Set X) (hs : IsOpen s) : (e.restrOpen s hs).source = e.source ∩ s

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
(s : Set X)
(hs : IsOpen s)


theorem dense_covering : S ∈ dense X ↔ ∀ {Y} (f : Y ⟶ X), ∃ (Z : _) (g : Z ⟶ Y), S (g ≫ f)

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

S ∈ CategoryTheory.GrothendieckTopology.dense.sieves X ↔
  ∀ {Y : C} (f : Y ⟶ X), ∃ Z g, S.arrows (CategoryTheory.CategoryStruct.comp g f)


theorem degree_zero_le : degree (0 : R[X]) ≤ 0


lemma isSMulRegular_iff_torsionBy_eq_bot {R} (M : Type*)
    [CommRing R] [AddCommGroup M] [Module R M] (r : R) :
    IsSMulRegular M r ↔ Submodule.torsionBy R M r = ⊥

{R : Type u_2}
(M : Type u_1)
[CommRing R]
[AddCommGroup M]
[Module R M]
(r : R)


/-- Given a natural transformation `τ : F ⟶ G` between functors `C ⥤ D` which preserve
the left homology of a short complex `S`, and a left homology data for `S`,
this is the left homology map data for the morphism `S.mapNatTrans τ`
obtained by evaluating `τ`. -/
@[simps]
def LeftHomologyMapData.natTransApp (h : LeftHomologyData S) (τ : F ⟶ G) :
    LeftHomologyMapData (S.mapNatTrans τ) (h.map F) (h.map G)

(CategoryTheory.ShortComplex.LeftHomologyMapData.natTransApp h τ).φK = τ.app h.K


@[to_additive (attr := simp, norm_cast)]
theorem coe_inj {a b : α} : (a : WithOne α) = b ↔ a = b


/-- A function between linear orders which is neither monotone nor antitone makes a dent upright or
downright. -/
theorem not_monotoneOn_not_antitoneOn_iff_exists_le_le :
    ¬MonotoneOn f s ∧ ¬AntitoneOn f s ↔
      ∃ᵉ (a ∈ s) (b ∈ s) (c ∈ s), a ≤ b ∧ b ≤ c ∧
        (f a < f b ∧ f c < f b ∨ f b < f a ∧ f b < f c)

{α : Type u}
{β : Type v}
{s : Set α}
[LinearOrder α]
[LinearOrder β]
{f : α → β}

¬MonotoneOn f s ∧ ¬AntitoneOn f s ↔
  ∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, a ≤ b ∧ b ≤ c ∧ (f a < f b ∧ f c < f b ∨ f b < f a ∧ f b < f c)


@[simps!]
instance category : Category (Square C)

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

(CategoryTheory.CategoryStruct.id sq).τ₂ = CategoryTheory.CategoryStruct.id sq.X₂


theorem Continuous.comp_upperSemicontinuous_antitone {g : γ → δ} {f : α → γ} (hg : Continuous g)
    (hf : UpperSemicontinuous f) (gmon : Antitone g) : LowerSemicontinuous (g ∘ f)

{α : Type u_1}
[TopologicalSpace α]
{γ : Type u_3}
[LinearOrder γ]
[TopologicalSpace γ]
[OrderTopology γ]
{δ : Type u_4}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderTopology δ]
{g : γ → δ}
{f : α → γ}
(hg : Continuous g)
(hf : UpperSemicontinuous f)
(gmon : Antitone g)


theorem IsHausdorff.haus (_ : IsHausdorff I M) :
    ∀ x : M, (∀ n : ℕ, x ≡ 0 [SMOD (I ^ n • ⊤ : Submodule R M)]) → x = 0

{R : Type u_1}
[CommRing R]
{I : Ideal R}
{M : Type u_2}
[AddCommGroup M]
[Module R M]

IsHausdorff I M → ∀ (x : M), (∀ (n : ℕ), x ≡ 0 [SMOD I ^ n • ⊤]) → x = 0


@[simp]
theorem map_comp_map (f : M →ₗ[R] N) (g : N →ₗ[R] N') :
    AlgHom.comp (map g) (map f) = map (LinearMap.comp g f)

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{N : Type u4}
{N' : Type u5}
[AddCommGroup N]
[Module R N]
[AddCommGroup N']
[Module R N']
(f : M →ₗ[R] N)
(g : N →ₗ[R] N')

(ExteriorAlgebra.map g).comp (ExteriorAlgebra.map f) = ExteriorAlgebra.map (g ∘ₗ f)


@[to_additive]
lemma mulIndicator_prod (s : Finset ι) (t : Set κ) (f : ι → κ → β) :
    mulIndicator t (∏ i ∈ s, f i) = ∏ i ∈ s, mulIndicator t (f i)

{ι : Type u_1}
{β : Type u_4}
[CommMonoid β]
{κ : Type u_6}
(s : Finset ι)
(t : Set κ)
(f : ι → κ → β)

t.mulIndicator (∏ i ∈ s, f i) = ∏ i ∈ s, t.mulIndicator (f i)


/-- Any module is a quotient of a free module. This is stated as surjectivity of
`Finsupp.total M M R id : (M →₀ R) →ₗ[R] M`. -/
theorem total_id_surjective (M) [AddCommMonoid M] [Module R M] :
    Function.Surjective (Finsupp.total M M R _root_.id)

(R : Type u_5)
[Semiring R]
(M : Type u_9)
[AddCommMonoid M]
[Module R M]

Function.Surjective ⇑(Finsupp.total M M R id)


@[simp]
theorem contMDiffWithinAt_transDiffeomorph_left {f : M → M'} {x s} :
    ContMDiffWithinAt (I.transDiffeomorph e) I' n f s x ↔ ContMDiffWithinAt I I' n f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
(e : E ≃ₘ⟮𝓘(𝕜, E), 𝓘(𝕜, F)⟯ F)
{f : M → M'}
{x : M}
{s : Set M}


@[simp]
theorem preimage_const_mul_Iic (a : α) {c : α} (h : 0 < c) : (c * ·) ⁻¹' Iic a = Iic (a / c)

{α : Type u_1}
[LinearOrderedField α]
(a : α)
{c : α}
(h : 0 < c)

(fun x => c * x) ⁻¹' Set.Iic a = Set.Iic (a / c)


theorem eventually_iff {f : Filter α} {P : α → Prop} : (∀ᶠ x in f, P x) ↔ { x | P x } ∈ f

{α : Type u}
{f : Filter α}
{P : α → Prop}


/-- In a locally finite preorder, `<` is the transitive closure of `⋖`. -/
lemma lt_iff_transGen_covBy [Preorder α] [LocallyFiniteOrder α] {x y : α} :
    x < y ↔ TransGen (· ⋖ ·) x y

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{x y : α}

x < y ↔ Relation.TransGen (fun x x_1 => x ⋖ x_1) x y


@[to_additive Set.AddAntidiagonal.finite_of_isPWO]
theorem finite_of_isPWO (hs : s.IsPWO) (ht : t.IsPWO) (a) : (mulAntidiagonal s t a).Finite

{α : Type u_1}
[OrderedCancelAddCommMonoid α]
{s t : Set α}
(hs : s.IsPWO)
(ht : t.IsPWO)
(a : α)


@[simp]
theorem rec.constant {α : Sort u} {β : Type v} (b : β) :
    (@PLift.rec α (fun _ => β) fun _ => b) = fun _ => b


/-- The functor from augmented objects to arrows. -/
@[simps]
def toArrow : Augmented C ⥤ Arrow C

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

∀ {X Y : CategoryTheory.SimplicialObject.Augmented C} (η : X ⟶ Y),
  (CategoryTheory.SimplicialObject.Augmented.toArrow.map η).right =
    CategoryTheory.SimplicialObject.Augmented.point.map η


@[to_additive (attr := simp) top_prod_top]
theorem top_prod_top : (⊤ : Subgroup G).prod (⊤ : Subgroup N) = ⊤

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]


theorem comp₂_eq_pair (g : β → γ → δ) (hg : Continuous (uncurry g)) (f₁ : α →ₘ[μ] β)
    (f₂ : α →ₘ[μ] γ) : comp₂ g hg f₁ f₂ = comp _ hg (f₁.pair f₂)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
[TopologicalSpace γ]
[TopologicalSpace δ]
(g : β → γ → δ)
(hg : Continuous (Function.uncurry g))
(f₁ : α →ₘ[μ] β)
(f₂ : α →ₘ[μ] γ)

MeasureTheory.AEEqFun.comp₂ g hg f₁ f₂ = MeasureTheory.AEEqFun.comp (Function.uncurry g) hg (f₁.pair f₂)


@[simp]
theorem rdropWhile_eq_nil_iff : rdropWhile p l = [] ↔ ∀ x ∈ l, p x

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

List.rdropWhile p l = [] ↔ ∀ (x : α), x ∈ l → p x = true


@[to_additive]
lemma orderOf_eq_card_powers : orderOf x = Fintype.card (powers x : Set G)

{G : Type u_1}
[AddLeftCancelMonoid G]
[Fintype G]
{x : G}

addOrderOf x = Fintype.card ↑↑(AddSubmonoid.multiples x)


theorem AlgebraicIndependent.repr_ker :
    RingHom.ker (hx.repr : adjoin R (range x) →+* MvPolynomial ι R) = ⊥

{ι : Type u_1}
{R : Type u_3}
{A : Type u_5}
{x : ι → A}
[CommRing R]
[CommRing A]
[Algebra R A]
(hx : AlgebraicIndependent R x)


protected theorem add_left_cancel (h₁ : a ≡ b [MOD n]) (h₂ : a + c ≡ b + d [MOD n]) :
    c ≡ d [MOD n]

{n a b c d : ℕ}
(h₁ : a ≡ b [MOD n])
(h₂ : a + c ≡ b + d [MOD n])


@[simp]
theorem frontier_empty : frontier (∅ : Set X) = ∅


protected theorem countable_iff_exists_injective {s : Set α} :
    s.Countable ↔ ∃ f : s → ℕ, Injective f


lemma eq_mul_div_of_mul_eq_mul_of_dvd_left (hb : b ≠ 0) (hbc : b ∣ c) (h : b * a = c * d) :
    a = c / b * d

{a b c d : ℤ}
(hb : b ≠ 0)
(hbc : b ∣ c)
(h : b * a = c * d)


@[simp]
theorem sep_eq_self_iff_mem_true : { x ∈ s | p x } = s ↔ ∀ x ∈ s, p x


theorem exists_radical_pow_le_of_fg {R : Type*} [CommSemiring R] (I : Ideal R) (h : I.radical.FG) :
    ∃ n : ℕ, I.radical ^ n ≤ I

{R : Type u_3}
[CommSemiring R]
(I : Ideal R)
(h : I.radical.FG)


theorem nndist_vadd_cancel_left (v : V) (x y : P) : nndist (v +ᵥ x) (v +ᵥ y) = nndist x y

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(v : V)
(x y : P)


@[to_additive]
theorem IsOfFinOrder.fst {x : α × β} (hx : IsOfFinOrder x) : IsOfFinOrder x.1

{α : Type u_4}
{β : Type u_5}
[AddMonoid α]
[AddMonoid β]
{x : α × β}
(hx : IsOfFinAddOrder x)


@[simp] lemma coe_toHomeomorph (e : X ≃ Y) (he) : ⇑(e.toHomeomorph he) = e

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


@[simp] lemma support_div' (f g : ι → G₀) : support (f / g) = support f ∩ support g

{ι : Type u_1}
{G₀ : Type u_3}
[GroupWithZero G₀]
(f g : ι → G₀)

Function.support (f / g) = Function.support f ∩ Function.support g


@[to_additive]
protected lemma div_div_cancel (h : IsUnit a) : a / (a / b) = b

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


protected theorem nonempty : (F : Set P).Nonempty

{P : Type u_1}
[Preorder P]
(F : Order.PFilter P)


@[simp]
theorem im_neg (z : 𝔻) : (-z).im = -z.im


@[simp]
theorem mk_one [Monoid α] : Associates.mk (1 : α) = 1


/-- The algebra isomorphism `adjoin ℤ {ζ} ≃ₐ[ℤ] (𝓞 K)`, where `ζ` is a primitive `p`-th root of
unity and `K` is a `p`-th cyclotomic extension of `ℚ`. -/
@[simps!]
noncomputable def _root_.IsPrimitiveRoot.adjoinEquivRingOfIntegers'
    [hcycl : IsCyclotomicExtension {p} ℚ K] (hζ : IsPrimitiveRoot ζ p) :
    adjoin ℤ ({ζ} : Set K) ≃ₐ[ℤ] 𝓞 K

{p : ℕ+}
{K : Type u}
[Field K]
[CharZero K]
{ζ : K}
[hp : Fact (Nat.Prime ↑p)]
[hcycl : IsCyclotomicExtension {p} ℚ K]
(hζ : IsPrimitiveRoot ζ ↑p)
(a : 𝓞 K)

hζ.adjoinEquivRingOfIntegers'.symm a = (IsIntegralClosure.lift ℤ (↥(Algebra.adjoin ℤ {ζ})) K) a


theorem WithSeminorms.image_isVonNBounded_iff_seminorm_bounded (f : G → E) {s : Set G}
    (hp : WithSeminorms p) :
    Bornology.IsVonNBounded 𝕜 (f '' s) ↔ ∀ i : ι, ∃ r > 0, ∀ x ∈ s, p i (f x) < r

{𝕜 : Type u_1}
{E : Type u_5}
{G : Type u_7}
{ι : Type u_8}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
{p : SeminormFamily 𝕜 E ι}
[TopologicalSpace E]
(f : G → E)
{s : Set G}
(hp : WithSeminorms p)

Bornology.IsVonNBounded 𝕜 (f '' s) ↔ ∀ (i : ι), ∃ r > 0, ∀ x ∈ s, (p i) (f x) < r


@[simp]
theorem blockDiagonal'_neg [AddGroup α] (M : ∀ i, Matrix (m' i) (n' i) α) :
    blockDiagonal' (-M) = -blockDiagonal' M

{o : Type u_4}
{m' : o → Type u_7}
{n' : o → Type u_8}
{α : Type u_12}
[DecidableEq o]
[AddGroup α]
(M : (i : o) → Matrix (m' i) (n' i) α)

Matrix.blockDiagonal' (-M) = -Matrix.blockDiagonal' M


theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (n : ℕ) :
    ((cyclotomic (p ^ (n + 1)) ℤ).comp (X + 1)).IsEisensteinAt 𝓟

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

((Polynomial.cyclotomic (p ^ (n + 1)) ℤ).comp (Polynomial.X + 1)).IsEisensteinAt (Submodule.span ℤ {↑p})


/-- If `E / F` is a separable extension of exponential characteristic `q`, if `{ u_i }` is a family
of elements of `E` which `F`-linearly spans `E`, then `{ u_i ^ (q ^ n) }` also `F`-linearly spans
`E` for any natural number `n`. -/
theorem Field.span_map_pow_expChar_pow_eq_top_of_isSeparable [Algebra.IsSeparable F E]
    (h : Submodule.span F (Set.range v) = ⊤) :
    Submodule.span F (Set.range (v · ^ q ^ n)) = ⊤

Submodule.span F (Set.range fun x => v x ^ q ^ n) = ⊤


@[simp]
theorem eventually_false_iff_eq_bot {f : Filter α} : (∀ᶠ _ in f, False) ↔ f = ⊥


theorem ext_iff (v w : VectorMeasure α M) : v = w ↔ ∀ i : Set α, MeasurableSet i → v i = w i

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
(v w : MeasureTheory.VectorMeasure α M)

v = w ↔ ∀ (i : Set α), MeasurableSet i → ↑v i = ↑w i


@[local simp] theorem ofNat_add_ofNat (m n : Nat) : (↑m + ↑n : Int) = ↑(m + n)


@[to_additive]
lemma mul_inf (a b c : α) : c * (a ⊓ b) = c * a ⊓ c * b

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


protected theorem normalSpace [NormalSpace X] (h : X ≃ₜ Y) : NormalSpace Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[NormalSpace X]
(h : X ≃ₜ Y)


/-- The smallest congruence relation containing a binary relation `r` is contained in any
    congruence relation containing `r`. -/
@[to_additive addConGen_le "The smallest additive congruence relation containing a binary
relation `r` is contained in any additive congruence relation containing `r`."]
theorem conGen_le {r : M → M → Prop} {c : Con M} (h : ∀ x y, r x y → c x y) :
    conGen r ≤ c

{M : Type u_1}
[Add M]
{r : M → M → Prop}
{c : AddCon M}
(h : ∀ (x y : M), r x y → c x y)


theorem if_neg {c : Prop} {h : Decidable c} (hnc : ¬c) {α : Sort u} {t e : α} : (ite c t e) = e


@[simp] theorem maximals_Iic (a : α) : maximals (· ≤ ·) (Iic a) = {a}

maximals (fun x x_1 => x ≤ x_1) (Set.Iic a) = {a}


/-- For `r` strictly smaller than the radius of `p`, then `‖pₙ‖ rⁿ` tends to zero exponentially:
for some `0 < a < 1` and `C > 0`, `‖p n‖ * r ^ n ≤ C * a ^ n`. -/
theorem norm_mul_pow_le_mul_pow_of_lt_radius (h : ↑r < p.radius) :
    ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ n, ‖p n‖ * (r : ℝ) ^ n ≤ C * a ^ n

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
{r : ℝ≥0}
(h : ↑r < p.radius)

∃ a ∈ Set.Ioo 0 1, ∃ C > 0, ∀ (n : ℕ), ‖p n‖ * ↑r ^ n ≤ C * a ^ n


@[simp]
theorem continuousWithinAt_Icc_iff_Ici (h : a < b) :
    ContinuousWithinAt f (Icc a b) a ↔ ContinuousWithinAt f (Ici a) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
[TopologicalSpace β]
{a b : α}
{f : α → β}
(h : a < b)

ContinuousWithinAt f (Set.Icc a b) a ↔ ContinuousWithinAt f (Set.Ici a) a


theorem isOpen_target_of_mem_pretrivializationAtlas_inter (e e' : Pretrivialization F (π F E))
    (he' : e' ∈ a.pretrivializationAtlas) :
    IsOpen (e'.toPartialEquiv.target ∩ e'.toPartialEquiv.symm ⁻¹' e.source)

(e e' : Pretrivialization F Bundle.TotalSpace.proj)

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


/-- A set `s` is compact if and only if
for every open cover of `s`, there exists a finite subcover. -/
theorem isCompact_iff_finite_subcover :
    IsCompact s ↔ ∀ {ι : Type u} (U : ι → Set X),
      (∀ i, IsOpen (U i)) → (s ⊆ ⋃ i, U i) → ∃ t : Finset ι, s ⊆ ⋃ i ∈ t, U i

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

IsCompact s ↔ ∀ {ι : Type u} (U : ι → Set X), (∀ (i : ι), IsOpen (U i)) → s ⊆ ⋃ i, U i → ∃ t, s ⊆ ⋃ i ∈ t, U i


theorem range_evalᵢ [Finite σ] : range (evalᵢ σ K) = ⊤

(σ K : Type u)
[Fintype K]
[Field K]
[Finite σ]

LinearMap.range (MvPolynomial.evalᵢ σ K) = ⊤


@[to_additive]
theorem smul_mem_smul_finset : b ∈ s → a • b ∈ a • s

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[SMul α β]
{s : Finset β}
{a : α}
{b : β}


theorem reduceOption_length_eq_iff {l : List (Option α)} :
    l.reduceOption.length = l.length ↔ ∀ x ∈ l, Option.isSome x

l.reduceOption.length = l.length ↔ ∀ (x : Option α), x ∈ l → x.isSome = true


/-- The type of clopen sets of a topological space. -/
structure Clopens (α : Type*) [TopologicalSpace α] where
  /-- the carrier set, i.e. the points in this set -/
  carrier : Set α
  isClopen' : IsClopen carrier

{α : Type u_4}
[TopologicalSpace α]
(self : TopologicalSpace.Clopens α)


theorem supported_eq_span_single (s : Set α) :
    supported R R s = span R ((fun i => single i 1) '' s)

{α : Type u_1}
(R : Type u_5)
[Semiring R]
(s : Set α)

Finsupp.supported R R s = Submodule.span R ((fun i => Finsupp.single i 1) '' s)


@[simp] lemma top_ne_zero : (⊤ : ℕ∞) ≠ 0


theorem not_lt_zero_iff {z : ℂ} : ¬z < 0 ↔ 0 ≤ z.re ∨ z.im ≠ 0


lemma IsUnramifiedAtInfinitePlaces.top [h : IsUnramifiedAtInfinitePlaces k F] :
    IsUnramifiedAtInfinitePlaces K F

(k : Type u_1)
[Field k]
(K : Type u_2)
[Field K]
(F : Type u_3)
[Field F]
[Algebra k K]
[Algebra k F]
[Algebra K F]
[IsScalarTower k K F]
[h : IsUnramifiedAtInfinitePlaces k F]


@[norm_cast]
theorem coe_div : ∀ {x y : ℚ}, (↑(x / y) : ℚ_[p]) = ↑x / ↑y


theorem disjSups_right_comm : s ○ t ○ u = s ○ u ○ t

{α : Type u_2}
[DecidableEq α]
[DistribLattice α]
[OrderBot α]
[DecidableRel Disjoint]
(s t u : Finset α)

(s.disjSups t).disjSups u = (s.disjSups u).disjSups t


theorem exists_of_mem_map {b : β} : b ∈ c.map f → ∃ a, a ∈ c ∧ f a = b

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
(c : OmegaCompletePartialOrder.Chain α)
{f : α →o β}
{b : β}


@[reassoc]
theorem whiskerRight_comm {X₁ X₂ : Center C} (f : X₁ ⟶ X₂) (Y : Center C) (U : C) :
    f.f ▷ Y.1 ▷ U ≫ ((tensorObj X₂ Y).2.β U).hom =
      ((tensorObj X₁ Y).2.β U).hom ≫ U ◁ f.f ▷ Y.1

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

f.f ▷ Y.fst ▷ U ≫ ((X₂.tensorObj Y).snd.β U).hom = ((X₁.tensorObj Y).snd.β U).hom ≫ U ◁ f.f ▷ Y.fst


@[simp]
theorem _root_.LinearIsometryEquiv.piLpCongrRight_apply (e : ∀ i, α i ≃ₗᵢ[𝕜] β i) (x : PiLp p α) :
    LinearIsometryEquiv.piLpCongrRight p e x =
      (WithLp.equiv p _).symm (fun i => e i (x i))

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

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

(LinearIsometryEquiv.piLpCongrRight p e) x = (WithLp.equiv p ((i : ι) → β i)).symm fun i => (e i) (x i)


theorem norm_eval_le_injectiveSeminorm (f : ContinuousMultilinearMap 𝕜 E F) (x : ⨂[𝕜] i, E i) :
    ‖lift f.toMultilinearMap x‖ ≤ ‖f‖ * injectiveSeminorm x

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

‖(PiTensorProduct.lift f.toMultilinearMap) x‖ ≤ ‖f‖ * PiTensorProduct.injectiveSeminorm x


theorem setLintegral_compl {f : α → ℝ≥0∞} {s : Set α} (hsm : MeasurableSet s)
    (hfs : ∫⁻ x in s, f x ∂μ ≠ ∞) :
    ∫⁻ x in sᶜ, f x ∂μ = ∫⁻ x, f x ∂μ - ∫⁻ x in s, f x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
{s : Set α}
(hsm : MeasurableSet s)
(hfs : ∫⁻ (x : α) in s, f x ∂μ ≠ ⊤)

∫⁻ (x : α) in sᶜ, f x ∂μ = ∫⁻ (x : α), f x ∂μ - ∫⁻ (x : α) in s, f x ∂μ


theorem sin_add_nat_mul_pi (x : ℝ) (n : ℕ) : sin (x + n * π) = (-1) ^ n * sin x

Real.sin (x + ↑n * Real.pi) = (-1) ^ n * Real.sin x


@[simp]
theorem monomial_zero_eq_C : ⇑(monomial R 0) = C R

⇑(PowerSeries.monomial R 0) = ⇑(PowerSeries.C R)


/-- The converse to `GenLoop.homotopyTo`: a homotopy between two loops in the space of
  `n`-dimensional loops can be seen as a homotopy between two `n+1`-dimensional paths. -/
@[simps!] def homotopyFrom (i : N) {p q : Ω^ N X x} (H : (toLoop i p).Homotopy (toLoop i q)) :
    C(I × I^N, X)

(H : Path.Homotopy (GenLoop.toLoop i p) (GenLoop.toLoop i q))

∀ (a : ↑I × (N → ↑I)),
  (GenLoop.homotopyFrom i H) a =
    Function.uncurry (fun x_1 y => Function.uncurry (fun x_2 y => ↑(H (x_1, x_2)) y) y)
      (Prod.map id (⇑(Cube.splitAt i).toContinuousMap) a)


/-- `Set.image` is monotone. See `Set.image_subset` for the statement in terms of `⊆`. -/
lemma monotone_image {f : α → β} : Monotone (image f)

{α : Type u_1}
{β : Type u_2}
{f : α → β}


theorem enumOrd_surjective (hS : Unbounded (· < ·) S) : ∀ s ∈ S, ∃ a, enumOrd S a = s

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


@[norm_cast]
theorem coe_ofDigits (α : Type*) [Semiring α] (b : ℕ) (L : List ℕ) :
    ((ofDigits b L : ℕ) : α) = ofDigits (b : α) L

(α : Type u_1)
[Semiring α]
(b : ℕ)
(L : List ℕ)

↑(Nat.ofDigits b L) = Nat.ofDigits (↑b) L


theorem measure_diff_null' (h : μ (s₁ ∩ s₂) = 0) : μ (s₁ \ s₂) = μ s₁

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s₁ s₂ : Set α}
(h : μ (s₁ ∩ s₂) = 0)


/-- Turn a limit for `F : Jᵒᵖ ⥤ C` into a colimit for `F.rightOp : J ⥤ Cᵒᵖ`. -/
@[simps]
def isColimitCoconeRightOpOfCone (F : Jᵒᵖ ⥤ C) {c : Cone F} (hc : IsLimit c) :
    IsColimit (coconeRightOpOfCone c)

(s : CategoryTheory.Limits.Cocone F.rightOp)

(CategoryTheory.Limits.isColimitCoconeRightOpOfCone F hc).desc s =
  (hc.lift (CategoryTheory.Limits.coneOfCoconeRightOp s)).op


protected theorem AntitoneOn.Ico (hf : AntitoneOn f s) (hg : MonotoneOn g s) :
    MonotoneOn (fun x => Ico (f x) (g x)) s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f g : α → β}
{s : Set α}
(hf : AntitoneOn f s)
(hg : MonotoneOn g s)

MonotoneOn (fun x => Set.Ico (f x) (g x)) s


lemma LSeries_congr {f g : ℕ → ℂ} (s : ℂ) (h : ∀ {n}, n ≠ 0 → f n = g n) :
    LSeries f s = LSeries g s

{f g : ℕ → ℂ}
(s : ℂ)
(h : ∀ {n : ℕ}, n ≠ 0 → f n = g n)


theorem ContMDiff.clm_postcomp {f : M → F₂ →L[𝕜] F₃} (hf : ContMDiff I 𝓘(𝕜, F₂ →L[𝕜] F₃) n f) :
    ContMDiff I 𝓘(𝕜, (F₁ →L[𝕜] F₂) →L[𝕜] (F₁ →L[𝕜] F₃)) n
      (fun y ↦ (f y).postcomp F₁ : M → (F₁ →L[𝕜] F₂) →L[𝕜] (F₁ →L[𝕜] F₃))

ContMDiff I 𝓘(𝕜, (F₁ →L[𝕜] F₂) →L[𝕜] F₁ →L[𝕜] F₃) n fun y => ContinuousLinearMap.postcomp F₁ (f y)


@[simp]
theorem prod_Icc_factorial : ∀ n : ℕ, ∏ x ∈ Icc 1 n, x ! = sf n

∏ x ∈ Finset.Icc 1 n, x.factorial = n.superFactorial


/-- The mapping `toWeakDualBCNN` from finite Borel measures to the weak dual of `Ω →ᵇ ℝ≥0` is
injective, if in the underlying space `Ω`, indicator functions of closed sets have decreasing
approximations by sequences of continuous functions (in particular if `Ω` is pseudometrizable). -/
lemma injective_toWeakDualBCNN :
    Injective (toWeakDualBCNN : FiniteMeasure Ω → WeakDual ℝ≥0 (Ω →ᵇ ℝ≥0))

{Ω : Type u_1}
[MeasurableSpace Ω]
[TopologicalSpace Ω]
[HasOuterApproxClosed Ω]
[BorelSpace Ω]


theorem kernMap_principal {s : Set α} : kernMap m (𝓟 s) = 𝓟 (kernImage m s)

{α : Type u}
{β : Type v}
{m : α → β}
{s : Set α}

Filter.kernMap m (𝓟 s) = 𝓟 (Set.kernImage m s)


/-- Any element in the fiber of an object `X` is the evaluation of a morphism from a
Galois object. -/
lemma exists_hom_from_galois_of_fiber (X : C) (x : F.obj X) :
    ∃ (A : C) (f : A ⟶ X) (a : F.obj A), IsGalois A ∧ F.map f a = x

(F : CategoryTheory.Functor C FintypeCat)

∃ A f a, CategoryTheory.PreGaloisCategory.IsGalois A ∧ F.map f a = x


theorem map_lift_eq {m : β → γ} (hg : Monotone g) : map m (f.lift g) = f.lift (map m ∘ g)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : Filter α}
{g : Set α → Filter β}
{m : β → γ}
(hg : Monotone g)

Filter.map m (f.lift g) = f.lift (Filter.map m ∘ g)


@[simp]
theorem latticeBasis_apply [NumberField K] (i : Free.ChooseBasisIndex ℤ (𝓞 K)) :
    latticeBasis K i = (canonicalEmbedding K) (integralBasis K i)

(i : Module.Free.ChooseBasisIndex ℤ (NumberField.RingOfIntegers K))

(NumberField.canonicalEmbedding.latticeBasis K) i = (NumberField.canonicalEmbedding K) ((NumberField.integralBasis K) i)


lemma natCast_le_rank_iff_finset {n : ℕ} :
    n ≤ Module.rank R M ↔ ∃ s : Finset M, s.card = n ∧ LinearIndependent R ((↑) : s → M)

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

↑n ≤ Module.rank R M ↔ ∃ s, s.card = n ∧ LinearIndependent R Subtype.val


lemma isTriangulated_iff_of_iso {F₁ F₂ : C ⥤ D} (e : F₁ ≅ F₂) [F₁.CommShift ℤ] [F₂.CommShift ℤ]
    [NatTrans.CommShift e.hom ℤ] : F₁.IsTriangulated ↔ F₂.IsTriangulated

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

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


protected theorem add_left_neg (x : X[S⁻¹]) : -x + x = 0

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[AddGroup X]
[DistribMulAction R X]
(x : OreLocalization S X)


/-- We can decompose a sum of absolute value less than `n` into a sum of at most `n` signs. -/
theorem exists_signed_sum' {α : Type u_1} [Nonempty α] [DecidableEq α] (s : Finset α) (f : α → ℤ)
    (n : ℕ) (h : (∑ i ∈ s, (f i).natAbs) ≤ n) :
    ∃ (β : Type u_1) (_ : Fintype β) (sgn : β → SignType) (g : β → α),
      (∀ b, g b ∉ s → sgn b = 0) ∧
        Fintype.card β = n ∧ ∀ a ∈ s, (∑ i, if g i = a then (sgn i : ℤ) else 0) = f a

{α : Type u_1}
[Nonempty α]
[DecidableEq α]
(s : Finset α)
(f : α → ℤ)
(n : ℕ)
(h : ∑ i ∈ s, (f i).natAbs ≤ n)

∃ β x sgn g,
  (∀ (b : β), g b ∉ s → sgn b = 0) ∧ Fintype.card β = n ∧ ∀ a ∈ s, (∑ i : β, if g i = a then ↑(sgn i) else 0) = f a


/-- The recursive step of `scanl` splits a vector `x ::ᵥ v : Vector α (n + 1)`
into the provided starting value `b : β` and the recursed `scanl`
`f b x : β` as the starting value.

This lemma is the `cons` version of `scanl_get`.
-/
@[simp]
theorem scanl_cons (x : α) : scanl f b (x ::ᵥ v) = b ::ᵥ scanl f (f b x) v

{n : ℕ}
{α : Type u_1}
{β : Type u_2}
(f : β → α → β)
(b : β)
(v : Mathlib.Vector α n)
(x : α)

Mathlib.Vector.scanl f b (x ::ᵥ v) = b ::ᵥ Mathlib.Vector.scanl f (f b x) v


/-- A monoid is a decomposition monoid if every element is primal. An integral domain whose
multiplicative monoid is a decomposition monoid, is called a pre-Schreier domain; it is a
Schreier domain if it is moreover integrally closed. -/
@[mk_iff] class DecompositionMonoid : Prop where
  primal (a : α) : IsPrimal a

{α : Type u_1}
[Semigroup α]
[self : DecompositionMonoid α]
(a : α)


theorem closedPoint_mem_iff (U : TopologicalSpace.Opens <| PrimeSpectrum R) :
    closedPoint R ∈ U ↔ U = ⊤

(U : TopologicalSpace.Opens (PrimeSpectrum R))


theorem _root_.Set.Sized.card_le (h𝒜 : (𝒜 : Set (Finset α)).Sized r) :
    card 𝒜 ≤ (Fintype.card α).choose r

{α : Type u_1}
[Fintype α]
{𝒜 : Finset (Finset α)}
{r : ℕ}
(h𝒜 : Set.Sized r ↑𝒜)


@[simp]
theorem LinearMap.toMatrixAlgEquiv'_id :
    LinearMap.toMatrixAlgEquiv' (LinearMap.id : (n → R) →ₗ[R] n → R) = 1

{R : Type u_1}
[CommSemiring R]
{n : Type u_5}
[DecidableEq n]
[Fintype n]

LinearMap.toMatrixAlgEquiv' LinearMap.id = 1


theorem nearestPtInd_le (e : ℕ → α) (N : ℕ) (x : α) : nearestPtInd e N x ≤ N

{α : Type u_1}
[MeasurableSpace α]
[PseudoEMetricSpace α]
[OpensMeasurableSpace α]
(e : ℕ → α)
(N : ℕ)
(x : α)

↑(MeasureTheory.SimpleFunc.nearestPtInd e N) x ≤ N


theorem biprod.isIso_inl_iff_id_eq_fst_comp_inl (X Y : C) [HasBinaryBiproduct X Y] :
    IsIso (biprod.inl : X ⟶ X ⊞ Y) ↔ 𝟙 (X ⊞ Y) = biprod.fst ≫ biprod.inl

CategoryTheory.IsIso CategoryTheory.Limits.biprod.inl ↔
  𝟙 (X ⊞ Y) = CategoryTheory.Limits.biprod.fst ≫ CategoryTheory.Limits.biprod.inl


theorem comp (hg : ClosedEmbedding g) (hf : ClosedEmbedding f) :
    ClosedEmbedding (g ∘ f)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{f : X → Y}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(hg : ClosedEmbedding g)
(hf : ClosedEmbedding f)


private lemma Fintype.sum_div_mul_card_choose_card :
    ∑ s : Finset α, (card α / ((card α - s.card) * (card α).choose s.card) : ℚ) =
      card α * ∑ k ∈ range (card α), (↑k)⁻¹ + 1

∑ s : Finset α, ↑(Fintype.card α) / ((↑(Fintype.card α) - ↑s.card) * ↑((Fintype.card α).choose s.card)) =
  ↑(Fintype.card α) * ∑ k ∈ Finset.range (Fintype.card α), (↑k)⁻¹ + 1


theorem mem_image₂_iff (hf : Injective2 f) : f a b ∈ image₂ f s t ↔ a ∈ s ∧ b ∈ t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}
{a : α}
{b : β}
(hf : Function.Injective2 f)

f a b ∈ Finset.image₂ f s t ↔ a ∈ s ∧ b ∈ t


@[to_additive]
theorem _root_.isUnit_map_of_leftInverse [MonoidHomClass F M N] [MonoidHomClass G N M]
    {f : F} {x : M} (g : G) (hfg : Function.LeftInverse g f) :
    IsUnit (f x) ↔ IsUnit x

{F : Type u_1}
{G : Type u_2}
{M : Type u_4}
{N : Type u_5}
[FunLike F M N]
[FunLike G N M]
[Monoid M]
[Monoid N]
[MonoidHomClass F M N]
[MonoidHomClass G N M]
{f : F}
{x : M}
(g : G)
(hfg : Function.LeftInverse ⇑g ⇑f)


@[simp, nolint simpNF]
theorem zero_apply : (0 : PiLp p β) i = 0

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


theorem rescale_rescale (f : R⟦X⟧) (a b : R) :
    rescale b (rescale a f) = rescale (a * b) f

{R : Type u_1}
[CommSemiring R]
(f : PowerSeries R)
(a b : R)

(PowerSeries.rescale b) ((PowerSeries.rescale a) f) = (PowerSeries.rescale (a * b)) f


/-- Given families of generators `X ⊆ T` over `S` and `Y ⊆ S` over `R`,
there is a map of generators `R[X, Y] → S[X]`. -/
@[simps]
noncomputable
def ofComp (Q : Generators S T) (P : Generators R S) : Hom (Q.comp P) Q

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{T : Type u_1}
[CommRing T]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
(Q : Algebra.Generators S T)
(P : Algebra.Generators R S)
(i : (Q.comp P).vars)

(Q.ofComp P).val i = Sum.elim MvPolynomial.X (⇑MvPolynomial.C ∘ P.val) i


@[deprecated measure_union_null (since := "2024-05-14")]
theorem union_null (m : OuterMeasure α) {s₁ s₂ : Set α} (h₁ : m s₁ = 0) (h₂ : m s₂ = 0) :
    m (s₁ ∪ s₂) = 0

{α : Type u_1}
(m : MeasureTheory.OuterMeasure α)
{s₁ s₂ : Set α}
(h₁ : m s₁ = 0)
(h₂ : m s₂ = 0)


/-- The *identity principle* for analytic functions, global version: if two functions on a normed
field `𝕜` are analytic everywhere and coincide at points which accumulate to a point `z₀`, then
they coincide globally.
For higher-dimensional versions requiring that the functions coincide in a neighborhood of `z₀`,
see `AnalyticOn.eq_of_eventuallyEq`. -/
theorem eq_of_frequently_eq [ConnectedSpace 𝕜] (hf : AnalyticOn 𝕜 f univ) (hg : AnalyticOn 𝕜 g univ)
    (hfg : ∃ᶠ z in 𝓝[≠] z₀, f z = g z) : f = g

(hfg : ∃ᶠ (z : 𝕜) in 𝓝[≠] z₀, f z = g z)


theorem dart_edge_eq_mk'_iff' :
    ∀ {d : G.Dart} {u v : V},
      d.edge = s(u, v) ↔ d.fst = u ∧ d.snd = v ∨ d.fst = v ∧ d.snd = u

{V : Type u_1}
{G : SimpleGraph V}
{d : G.Dart}
{u v : V}

d.edge = s(u, v) ↔ d.toProd.1 = u ∧ d.toProd.2 = v ∨ d.toProd.1 = v ∧ d.toProd.2 = u


/-- **Equality case of the Rearrangement Inequality**: Pointwise multiplication of `f` and `g`,
which monovary together, is unchanged by a permutation if and only if `f ∘ σ` and `g` monovary
together. Stated by permuting the entries of `g`. -/
theorem Monovary.sum_comp_perm_mul_eq_sum_mul_iff (hfg : Monovary f g) :
    ∑ i, f (σ i) * g i = ∑ i, f i * g i ↔ Monovary (f ∘ σ) g

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

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


theorem all (f) : ∀ {s}, Valid s → s.all f = s.toString.1.all f

s.Valid → s.all f = s.toString.data.all f


theorem linearIndependent_le_span_aux' {ι : Type*} [Fintype ι] (v : ι → M)
    (i : LinearIndependent R v) (w : Set M) [Fintype w] (s : range v ≤ span R w) :
    Fintype.card ι ≤ Fintype.card w

(s : Set.range v ≤ ↑(Submodule.span R w))


@[to_additive nsmul_add] lemma mul_pow (a b : M) : ∀ n, (a * b) ^ n = a ^ n * b ^ n

{M : Type u_4}
[AddCommMonoid M]
(a b : M)
(n : ℕ)


/-- The ring equiv between the top element of `Subring R` and `R`. -/
@[simps!]
def topEquiv : (⊤ : Subring R) ≃+* R


theorem IsOpen.upperSemicontinuous_indicator (hs : IsOpen s) (hy : y ≤ 0) :
    UpperSemicontinuous (indicator s fun _x => y)

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{s : Set α}
{y : β}
[Zero β]
(hs : IsOpen s)
(hy : y ≤ 0)

UpperSemicontinuous (s.indicator fun _x => y)


theorem image_subset_range (f : α → β) (s) : f '' s ⊆ range f

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


lemma closure_insert_eq_of_mem_closure (he : e ∈ M.closure X) :
    M.closure (insert e X) = M.closure X

{α : Type u_2}
{M : Matroid α}
{X : Set α}
{e : α}
(he : e ∈ M.closure X)


@[to_additive IsAddCyclic.card_nsmul_eq_zero_le]
theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α] {n : ℕ} (hn0 : 0 < n) :
    (univ.filter fun a : α => a ^ n = 1).card ≤ n

{α : Type u}
[Group α]
[DecidableEq α]
[Fintype α]
[IsCyclic α]
{n : ℕ}
(hn0 : 0 < n)

(Finset.filter (fun a => a ^ n = 1) Finset.univ).card ≤ n


theorem opLinearEquiv_toAddEquiv : (opLinearEquiv R : M ≃ₗ[R] Mᵐᵒᵖ).toAddEquiv = opAddEquiv

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

(MulOpposite.opLinearEquiv R).toAddEquiv = MulOpposite.opAddEquiv


/-- A injective continuous and closed map is proper. -/
lemma isProperMap_of_isClosedMap_of_inj (f_cont : Continuous f) (f_inj : f.Injective)
    (f_closed : IsClosedMap f) : IsProperMap f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(f_cont : Continuous f)
(f_inj : Function.Injective f)
(f_closed : IsClosedMap f)


/-- If `f : X → Y` is an `Embedding`, the image `f '' s` of a set `s` is σ-compact
  if and only `s` is σ-compact. -/
lemma Embedding.isSigmaCompact_iff {f : X → Y} {s : Set X}
    (hf : Embedding f) : IsSigmaCompact s ↔ IsSigmaCompact (f '' s)

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


@[to_additive]
lemma IsClosed.mul_closure_one_eq {F : Set G} (hF : IsClosed F) :
    F * (closure {1} : Set G) = F

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
{F : Set G}
(hF : IsClosed F)


@[simp]
theorem coe_toOrderRingHom_refl : (OrderRingIso.refl α : α →+*o α) = OrderRingHom.id α

{α : Type u_2}
[NonAssocSemiring α]
[Preorder α]

↑(OrderRingIso.refl α) = OrderRingHom.id α


theorem MDifferentiableAt.differentiableWithinAt_writtenInExtChartAt {f : M → M'} {x : M}
    (hf : MDifferentiableAt I I' f x) :
    DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I' x f) (range I) ((extChartAt I x) x)

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

DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I' x f) (Set.range ↑I) (↑(extChartAt I x) x)


private theorem abs_nonneg' (z : ℂ) : 0 ≤ abs z


theorem frequently_imp_distrib {f : Filter α} {p q : α → Prop} :
    (∃ᶠ x in f, p x → q x) ↔ (∀ᶠ x in f, p x) → ∃ᶠ x in f, q x

{α : Type u}
{f : Filter α}
{p q : α → Prop}

(∃ᶠ (x : α) in f, p x → q x) ↔ (∀ᶠ (x : α) in f, p x) → ∃ᶠ (x : α) in f, q x


theorem smul_left {X : Cᵒᵖ} {Y : C} {r : End X} {f : unop X ⟶ Y} : r • f = r.unop ≫ f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : Cᵒᵖ}
{Y : C}
{r : CategoryTheory.End X}
{f : Opposite.unop X ⟶ Y}

r • f = CategoryTheory.CategoryStruct.comp (Quiver.Hom.unop r) f


lemma restrictScalars_eq :
    (toAlgHom K (normalClosure F K L) L).fieldRange.restrictScalars F = normalClosure F K L

(F : Type u_1)
(K : Type u_2)
(L : Type u_3)
[Field F]
[Field K]
[Field L]
[Algebra F K]
[Algebra F L]
[Algebra K L]
[IsScalarTower F K L]

IntermediateField.restrictScalars F (IsScalarTower.toAlgHom K (↥(normalClosure F K L)) L).fieldRange =
  normalClosure F K L


theorem isOrtho_iff_le {U V : Submodule 𝕜 E} : U ⟂ V ↔ U ≤ Vᗮ

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{U V : Submodule 𝕜 E}

U ⟂ V ↔ U ≤ Vᗮ


@[simp]
theorem left_mem_openSegment_iff [DenselyOrdered 𝕜] [NoZeroSMulDivisors 𝕜 E] :
    x ∈ openSegment 𝕜 x y ↔ x = y

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{x y : E}
[DenselyOrdered 𝕜]
[NoZeroSMulDivisors 𝕜 E]


/-- The duality equivalence `WalkingCospanᵒᵖ ≌ WalkingSpan` -/
@[simps!]
def walkingCospanOpEquiv : WalkingCospanᵒᵖ ≌ WalkingSpan

(X : (CategoryTheory.Limits.WidePullbackShape CategoryTheory.Limits.WalkingPair)ᵒᵖ)

CategoryTheory.Limits.walkingCospanOpEquiv.functor.obj X = Opposite.unop X


@[simp]
theorem rootsOfUnityEquivNthRoots_symm_apply (x : { x // x ∈ nthRoots k (1 : R) }) :
    (((rootsOfUnityEquivNthRoots R k).symm x : Rˣ) : R) = (x : R)

(x : { x // x ∈ Polynomial.nthRoots (↑k) 1 })

↑↑((rootsOfUnityEquivNthRoots R k).symm x) = ↑x


@[to_additive]
theorem smul_set_iUnion₂ (a : α) (s : ∀ i, κ i → Set β) :
    (a • ⋃ (i) (j), s i j) = ⋃ (i) (j), a • s i j

{α : Type u_2}
{β : Type u_3}
{ι : Sort u_5}
{κ : ι → Sort u_6}
[VAdd α β]
(a : α)
(s : (i : ι) → κ i → Set β)

a +ᵥ ⋃ i, ⋃ j, s i j = ⋃ i, ⋃ j, a +ᵥ s i j


@[simp]
theorem coe_toNNReal : ∀ {a : ℝ≥0∞}, a ≠ ∞ → ↑a.toNNReal = a


/-- `Quotient.mk'` as a relation homomorphism between the relation and the lift of a relation. -/
@[simps]
def Quotient.mkRelHom [Setoid α] {r : α → α → Prop}
    (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) : r →r Quotient.lift₂ r H

(Quotient.mkRelHom H) a = Quotient.mk' a


theorem IsWF.mono (h : IsWF t) (st : s ⊆ t) : IsWF s

{α : Type u_2}
[LT α]
{s t : Set α}
(h : t.IsWF)
(st : s ⊆ t)


theorem inf_id_set_eq_sInter (s : Finset (Set α)) : s.inf id = ⋂₀ ↑s


theorem Ico_coe_top : Ico (a : WithTop α) ⊤ = (Ici a).map Embedding.some

(α : Type u_1)
[PartialOrder α]
[OrderTop α]
[LocallyFiniteOrder α]
(a : α)

Finset.Ico ↑a ⊤ = Finset.map Function.Embedding.some (Finset.Ici a)