@[to_additive]
theorem range_eq_top_of_cancel {f : A →* B}
    (h : ∀ u v : B →* B ⧸ f.range, u.comp f = v.comp f → u = v) : f.range = ⊤

(h : ∀ (u v : B →+ B ⧸ f.range), u.comp f = v.comp f → u = v)


/-- A transcendental real number is irrational. -/
theorem Transcendental.irrational {r : ℝ} (tr : Transcendental ℚ r) : Irrational r


@[simp]
theorem AdditiveFunctor.ofExact_obj_fst (F : C ⥤ₑ D) :
    ((AdditiveFunctor.ofExact C D).obj F).obj = F.obj

((CategoryTheory.AdditiveFunctor.ofExact C D).obj F).obj = F.obj


/-- A bounded measurable function with compact support is in L^p. -/
theorem _root_.HasCompactSupport.memℒp_of_bound {f : X → E} (hf : HasCompactSupport f)
    (h2f : AEStronglyMeasurable f μ) (C : ℝ) (hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) : Memℒp f p μ

(h2f : MeasureTheory.AEStronglyMeasurable f μ)


theorem add_mul_ediv_left (a : Int) {b : Int}
    (c : Int) (H : b ≠ 0) : (a + b * c) / b = a / b + c


@[to_additive (attr := simp)]
lemma tprod_extend_one {γ : Type*} {g : γ → β} (hg : Injective g) (f : γ → α) :
    ∏' y, extend g f 1 y = ∏' x, f x

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{γ : Type u_5}
{g : γ → β}
(hg : Function.Injective g)
(f : γ → α)

∏' (y : β), Function.extend g f 1 y = ∏' (x : γ), f x


@[simp] lemma toNat_le {n : ℕ} : toNat m ≤ n ↔ m ≤ n


theorem mul_equiv_zero (g : CauSeq _ abv) {f : CauSeq _ abv} (hf : f ≈ 0) : g * f ≈ 0

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(g : CauSeq β abv)
{f : CauSeq β abv}
(hf : f ≈ 0)


/-- Given an algebra morphism whose carrier part is an isomorphism, we get an algebra isomorphism.
-/
theorem algebra_iso_of_iso {A B : Algebra T} (f : A ⟶ B) [IsIso f.f] : IsIso f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(T : CategoryTheory.Monad C)
{A B : T.Algebra}
(f : A ⟶ B)
[CategoryTheory.IsIso f.f]


theorem coeFn_comp (g : β → γ) (hg : Continuous g) (f : α →ₘ[μ] β) : comp g hg f =ᵐ[μ] g ∘ f

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

↑(MeasureTheory.AEEqFun.comp g hg f) =ᵐ[μ] g ∘ ↑f


lemma Pairwise.of_comp_of_surjective {f : β → α} (hr : Pairwise (r on f)) (hf : Surjective f) :
    Pairwise r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{f : β → α}
(hr : Pairwise (r on f))
(hf : Function.Surjective f)


/-- When a group acts, we can lift the action to the group of automorphisms. -/
@[simps]
def ρAut {G : Grp.{u}} (A : Action V (MonCat.of G)) : G ⟶ Grp.of (Aut A.V)

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : Grp}
(A : Action V (MonCat.of ↑G))
(g : ↑G)


/-- The number of embeddings of a number field is equal to its finrank. -/
theorem card : Fintype.card (K →+* A) = finrank ℚ K

(K : Type u_1)
[Field K]
[NumberField K]
(A : Type u_2)
[Field A]
[CharZero A]
[IsAlgClosed A]

Fintype.card (K →+* A) = FiniteDimensional.finrank ℚ K


@[simp]
theorem rowLen_transpose (μ : YoungDiagram) (i : ℕ) : μ.transpose.rowLen i = μ.colLen i


theorem prod_span {ι : Type*} (s : Finset ι) (M : ι → Set A) :
    (∏ i ∈ s, Submodule.span R (M i)) = Submodule.span R (∏ i ∈ s, M i)

{R : Type u}
[CommSemiring R]
{A : Type v}
[CommSemiring A]
[Algebra R A]
{ι : Type u_1}
(s : Finset ι)
(M : ι → Set A)

∏ i ∈ s, Submodule.span R (M i) = Submodule.span R (∏ i ∈ s, M i)


theorem coeNat_injective : Function.Injective (Coe.coe : PrimeMultiset → Multiset ℕ)


theorem continuous_const (x : β) : Continuous (OrderHom.const α x)

{α : Type u}
{β : Type v}
[OmegaCompletePartialOrder α]
[OmegaCompletePartialOrder β]
(x : β)

OmegaCompletePartialOrder.Continuous ((OrderHom.const α) x)


@[reassoc (attr := simp)]
lemma ι₀_desc : ι₀ K ≫ desc φ₀ φ₁ h = φ₀

[∀ (i : ι), CategoryTheory.Limits.HasBinaryBiproduct (K.X i) (K.X i)]

[HomologicalComplex.HasHomotopyCofiber (CategoryTheory.Limits.biprod.lift (𝟙 K) (-𝟙 K))]

(φ₀ φ₁ : K ⟶ F)

HomologicalComplex.cylinder.ι₀ K ≫ HomologicalComplex.cylinder.desc φ₀ φ₁ h = φ₀


theorem eventually_sub_nonneg [OrderedRing β] {l : Filter α} {f g : α → β} :
    0 ≤ᶠ[l] g - f ↔ f ≤ᶠ[l] g

{α : Type u}
{β : Type v}
[OrderedRing β]
{l : Filter α}
{f g : α → β}


theorem CovBy.Ioc_eq (h : a ⋖ b) : Ioc a b = {b}

{α : Type u_1}
[PartialOrder α]
{a b : α}
(h : a ⋖ b)


lemma nonsingular [Nontrivial R] {x y : R} (h : E.toAffine.Equation x y) :
    E.toAffine.Nonsingular x y

{R : Type u}
[CommRing R]
(E : EllipticCurve R)
[Nontrivial R]
{x y : R}
(h : E.toAffine.Equation x y)


theorem Filter.HasBasis.uniformContinuousOn_iff {ι'} [UniformSpace β] {p : ι → Prop}
    {s : ι → Set (α × α)} (ha : (𝓤 α).HasBasis p s) {q : ι' → Prop} {t : ι' → Set (β × β)}
    (hb : (𝓤 β).HasBasis q t) {f : α → β} {S : Set α} :
    UniformContinuousOn f S ↔
      ∀ i, q i → ∃ j, p j ∧ ∀ x, x ∈ S → ∀ y, y ∈ S → (x, y) ∈ s j → (f x, f y) ∈ t i

{α : Type ua}
{β : Type ub}
{ι : Sort u_1}
[UniformSpace α]
{ι' : Sort u_2}
[UniformSpace β]
{p : ι → Prop}
{s : ι → Set (α × α)}
(ha : (𝓤 α).HasBasis p s)
{q : ι' → Prop}
{t : ι' → Set (β × β)}
(hb : (𝓤 β).HasBasis q t)
{f : α → β}
{S : Set α}

UniformContinuousOn f S ↔ ∀ (i : ι'), q i → ∃ j, p j ∧ ∀ x ∈ S, ∀ y ∈ S, (x, y) ∈ s j → (f x, f y) ∈ t i


theorem length_wordProd_le (ω : List B) : ℓ (π ω) ≤ ω.length

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(ω : List B)


theorem coe_rpow_def (x : ℝ≥0) (y : ℝ) :
    (x : ℝ≥0∞) ^ y = if x = 0 ∧ y < 0 then ⊤ else ↑(x ^ y)

↑x ^ y = if x = 0 ∧ y < 0 then ⊤ else ↑(x ^ y)


theorem mapₗ_mk_apply_of_aemeasurable {f : α → β} (hf : AEMeasurable f μ) :
    mapₗ (hf.mk f) μ = map f μ

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{f : α → β}
(hf : AEMeasurable f μ)

(MeasureTheory.Measure.mapₗ (AEMeasurable.mk f hf)) μ = MeasureTheory.Measure.map f μ


theorem choose_natCast [NatPowAssoc R] (n k : ℕ) : choose (n : R) k = Nat.choose n k

{R : Type u_1}
[NonAssocRing R]
[Pow R ℕ]
[BinomialRing R]
[NatPowAssoc R]
(n k : ℕ)


/-- The abscissa of (absolute) convergence of the arithmetic function `ζ` is `1`. -/
lemma abscissaOfAbsConv_zeta : abscissaOfAbsConv ↗ζ = 1

(LSeries.abscissaOfAbsConv fun n => ↑(ArithmeticFunction.zeta n)) = 1


@[simp]
theorem LieIdeal.normalizer_eq_top {R : Type u} {L : Type v} [CommRing R] [LieRing L]
    [LieAlgebra R L] (I : LieIdeal R L) : (I : LieSubalgebra R L).normalizer = ⊤

(lieIdealSubalgebra R L I).normalizer = ⊤


theorem norm_integral_le (f : α →₁[μ] E) : ‖integral f‖ ≤ ‖f‖

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedSpace ℝ E]
[CompleteSpace E]
(f : ↥(MeasureTheory.Lp E 1 μ))


@[to_additive]
theorem mulSingle_injective (i : I) : Function.Injective (mulSingle i : f i → ∀ i, f i)

{I : Type u}
(f : I → Type v₁)
[DecidableEq I]
[(i : I) → Zero (f i)]
(i : I)


theorem disjoint_empty (x : Finmap β) : Disjoint ∅ x

{α : Type u}
{β : α → Type v}
(x : Finmap β)


theorem opNNNorm_eq_of_bounds {φ : E →SL[σ₁₂] F} (M : ℝ≥0) (h_above : ∀ x, ‖φ x‖₊ ≤ M * ‖x‖₊)
    (h_below : ∀ N, (∀ x, ‖φ x‖₊ ≤ N * ‖x‖₊) → M ≤ N) : ‖φ‖₊ = M

{σ₁₂ : 𝕜 →+* 𝕜₂}

(h_above : ∀ (x : E), ‖φ x‖₊ ≤ M * ‖x‖₊)

(h_below : ∀ (N : ℝ≥0), (∀ (x : E), ‖φ x‖₊ ≤ N * ‖x‖₊) → M ≤ N)


@[simp]
theorem Matrix.toLin'_symm :
    (Matrix.toLin'.symm : ((n → R) →ₗ[R] m → R) ≃ₗ[R] _) = LinearMap.toMatrix'

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


@[simp]
theorem kernel.lift_zero {W : C} {h} : kernel.lift f (0 : W ⟶ X) h = 0

CategoryTheory.Limits.kernel.lift f 0 h = 0


/-- If `𝔖 : Set (Set α)` is nonempty and directed, then the uniformity of `α →ᵤ[𝔖] β` admits the
family `{(f, g) | ∀ x ∈ S, (f x, g x) ∈ V}` for `S ∈ 𝔖` and `V ∈ 𝓤 β` as a filter basis. -/
protected theorem hasBasis_uniformity (h : 𝔖.Nonempty) (h' : DirectedOn (· ⊆ ·) 𝔖) :
    (𝓤 (α →ᵤ[𝔖] β)).HasBasis (fun SV : Set α × Set (β × β) => SV.1 ∈ 𝔖 ∧ SV.2 ∈ 𝓤 β) fun SV =>
      UniformOnFun.gen 𝔖 SV.1 SV.2

(h' : DirectedOn (fun x x_1 => x ⊆ x_1) 𝔖)

(𝓤 (α →ᵤ[𝔖] β)).HasBasis (fun SV => SV.1 ∈ 𝔖 ∧ SV.2 ∈ 𝓤 β) fun SV => UniformOnFun.gen 𝔖 SV.1 SV.2


/-- The canonical linear isometry from the `lp 2` of a mutually orthogonal family of subspaces of
`E` into E, has range the closure of the span of the subspaces. -/
protected theorem range_linearIsometry [∀ i, CompleteSpace (G i)] :
    LinearMap.range hV.linearIsometry.toLinearMap =
      (⨆ i, LinearMap.range (V i).toLinearMap).topologicalClosure

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[cplt : CompleteSpace E]
{G : ι → Type u_4}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
{V : (i : ι) → G i →ₗᵢ[𝕜] E}
(hV : OrthogonalFamily 𝕜 G V)
[∀ (i : ι), CompleteSpace (G i)]


lemma isLittleO_deriv_one_add_smoothingFn :
    deriv (fun x => 1 + ε x) =o[atTop] fun (x : ℝ) => x⁻¹

(deriv fun x => 1 + AkraBazziRecurrence.smoothingFn x) =o[Filter.atTop] fun x => x⁻¹


theorem sqLe_cancel {c d x y z w : ℕ} (zw : SqLe y d x c) (h : SqLe (x + z) c (y + w) d) :
    SqLe z c w d

{c d x y z w : ℕ}
(zw : Zsqrtd.SqLe y d x c)
(h : Zsqrtd.SqLe (x + z) c (y + w) d)


/-- Isometry between the tangent space `V` of a (semi)normed add torsor `P` and `P` given by
addition/subtraction of `x : P`. -/
@[simps!]
def IsometryEquiv.vaddConst (x : P) : V ≃ᵢ P

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

(IsometryEquiv.vaddConst x).symm p' = p' -ᵥ x


@[simp]
theorem mem_comap (S : Subalgebra R B) (f : A →ₐ[R] B) (x : A) : x ∈ S.comap f ↔ f x ∈ S

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
(S : Subalgebra R B)
(f : A →ₐ[R] B)
(x : A)


/-- **Artin-Rees lemma** -/
theorem Ideal.exists_pow_inf_eq_pow_smul [IsNoetherianRing R] [Module.Finite R M]
    (N : Submodule R M) : ∃ k : ℕ, ∀ n ≥ k, I ^ n • ⊤ ⊓ N = I ^ (n - k) • (I ^ k • ⊤ ⊓ N)

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
(I : Ideal R)
[IsNoetherianRing R]
[Module.Finite R M]
(N : Submodule R M)

∃ k, ∀ n ≥ k, I ^ n • ⊤ ⊓ N = I ^ (n - k) • (I ^ k • ⊤ ⊓ N)


theorem succ_pred_iterate_of_not_isMin (i : α) (n : ℕ) (hin : ¬IsMin (pred^[n - 1] i)) :
    succ^[n] (pred^[n] i) = i

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
[PredOrder α]
(i : α)
(n : ℕ)
(hin : ¬IsMin (Order.pred^[n - 1] i))


@[to_additive]
theorem ContMDiff.extend_one [T2Space M] [One M'] {n : ℕ∞} {U : Opens M} {f : U → M'}
    (supp : HasCompactMulSupport f) (diff : ContMDiff I I' n f) :
    ContMDiff I I' n (Subtype.val.extend f 1)

{𝕜 : 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']
[T2Space M]
[Zero M']
{n : ℕ∞}
{U : TopologicalSpace.Opens M}
{f : ↥U → M'}
(supp : HasCompactSupport f)
(diff : ContMDiff I I' n f)

ContMDiff I I' n (Function.extend Subtype.val f 0)


theorem isOrtho_def {B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M} {x y} : B.IsOrtho x y ↔ B x y = 0

{R : Type u_1}
{R₁ : Type u_2}
{R₂ : Type u_3}
{M : Type u_5}
{M₁ : Type u_6}
{M₂ : Type u_7}
[CommSemiring R]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
[AddCommMonoid M]
[Module R M]
{I₁ : R₁ →+* R}
{I₂ : R₂ →+* R}
{B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M}
{x : M₁}
{y : M₂}


theorem sInter_prod_sInter_subset (S : Set (Set α)) (T : Set (Set β)) :
    ⋂₀ S ×ˢ ⋂₀ T ⊆ ⋂ r ∈ S ×ˢ T, r.1 ×ˢ r.2

{α : Type u_1}
{β : Type u_2}
(S : Set (Set α))
(T : Set (Set β))

⋂₀ S ×ˢ ⋂₀ T ⊆ ⋂ r ∈ S ×ˢ T, r.1 ×ˢ r.2


@[simp]
theorem lcm_units_coe_right [NormalizedGCDMonoid α] (a : α) (u : αˣ) : lcm a ↑u = normalize a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
(a : α)
(u : αˣ)


theorem comp_lift (P₀ : Path x₀ x₁) (P₁ : Path x₁ x₂) : ⟦P₀.trans P₁⟧ = Quotient.comp ⟦P₀⟧ ⟦P₁⟧

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ x₂ : X}
(P₀ : Path x₀ x₁)
(P₁ : Path x₁ x₂)

⟦P₀.trans P₁⟧ = Path.Homotopic.Quotient.comp ⟦P₀⟧ ⟦P₁⟧


lemma Indep.closure_iInter_eq_biInter_closure_of_forall_subset [hι : Nonempty ι] {Js : ι → Set α}
    (hI : M.Indep I) (hJs : ∀ i, Js i ⊆ I) : M.closure (⋂ i, Js i) = ⋂ i, M.closure (Js i)

{α : Type u_2}
{M : Matroid α}
{ι : Sort u_3}
{I : Set α}
[hι : Nonempty ι]
{Js : ι → Set α}
(hI : M.Indep I)
(hJs : ∀ (i : ι), Js i ⊆ I)


@[to_additive (attr := simp)]
theorem invRev_invRev : invRev (invRev L₁) = L₁

FreeGroup.invRev (FreeGroup.invRev L₁) = L₁


theorem preVal_add (x y : ModP K v O hv p) :
    preVal K v O hv p (x + y) ≤ max (preVal K v O hv p x) (preVal K v O hv p y)

{K : Type u₁}
[Field K]
{v : Valuation K ℝ≥0}
{O : Type u₂}
[CommRing O]
[Algebra O K]
{hv : v.Integers O}
{p : ℕ}
(x y : ModP K v O hv p)

ModP.preVal K v O hv p (x + y) ≤ max (ModP.preVal K v O hv p x) (ModP.preVal K v O hv p y)


@[simp]
theorem embDomain_zero (f : α ↪ β) : (embDomain f 0 : β →₀ M) = 0

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[Zero M]
(f : α ↪ β)


theorem preimage_iterate {s : Set α} (h : IsFixedPt (Set.preimage f) s) (n : ℕ) :
    IsFixedPt (Set.preimage f^[n]) s

(h : Function.IsFixedPt (Set.preimage f) s)

Function.IsFixedPt (Set.preimage f^[n]) s


theorem hasDerivAt_tan {x : ℂ} (h : cos x ≠ 0) : HasDerivAt tan (1 / cos x ^ 2) x

HasDerivAt Complex.tan (1 / Complex.cos x ^ 2) x


@[simp] lemma toLinear_neg {α : Weight K H L} : (-α).toLinear = -α.toLinear

{K : Type u_2}
{L : Type u_3}
[LieRing L]
[Field K]
[LieAlgebra K L]
[FiniteDimensional K L]
[LieAlgebra.IsKilling K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
{α : LieModule.Weight K (↥H) L}

LieModule.Weight.toLinear K (↥H) L (-α) = -LieModule.Weight.toLinear K (↥H) L α


@[reassoc (attr := simp)]
lemma abelianImageToKernel_comp_kernel_ι :
    S.abelianImageToKernel ≫ kernel.ι S.g = Abelian.image.ι S.f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
(S : CategoryTheory.ShortComplex C)

CategoryTheory.CategoryStruct.comp S.abelianImageToKernel (CategoryTheory.Limits.kernel.ι S.g) =
  CategoryTheory.Abelian.image.ι S.f


theorem hasFDerivAt_iff_hasGradientAt {frechet : F →L[𝕜] 𝕜} :
    HasFDerivAt f frechet x ↔ HasGradientAt f ((toDual 𝕜 F).symm frechet) x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{x : F}
{frechet : F →L[𝕜] 𝕜}

HasFDerivAt f frechet x ↔ HasGradientAt f ((InnerProductSpace.toDual 𝕜 F).symm frechet) x


theorem ConcaveOn.convex_ge (hf : ConcaveOn 𝕜 s f) (r : β) : Convex 𝕜 ({ x ∈ s | r ≤ f x })

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConcaveOn 𝕜 s f)
(r : β)


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

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


@[simp, norm_cast] lemma lift_ofENat : ∀ m : ℕ∞, lift.{u, v} m = m


@[simp]
theorem mem_toSubsemigroup {s : NonUnitalSubring R} {x : R} : x ∈ s.toSubsemigroup ↔ x ∈ s

{R : Type u}
[NonUnitalNonAssocRing R]
{s : NonUnitalSubring R}
{x : R}


/-- Analogous construction of `FiberBundleCore` for vector bundles. This
construction gives a way to construct vector bundles from a structure registering how
trivialization changes act on fibers. -/
structure VectorBundleCore (ι : Type*) where
  baseSet : ι → Set B
  isOpen_baseSet : ∀ i, IsOpen (baseSet i)
  indexAt : B → ι
  mem_baseSet_at : ∀ x, x ∈ baseSet (indexAt x)
  coordChange : ι → ι → B → F →L[R] F
  coordChange_self : ∀ i, ∀ x ∈ baseSet i, ∀ v, coordChange i i x v = v
  continuousOn_coordChange : ∀ i j, ContinuousOn (coordChange i j) (baseSet i ∩ baseSet j)
  coordChange_comp : ∀ i j k, ∀ x ∈ baseSet i ∩ baseSet j ∩ baseSet k, ∀ v,
    (coordChange j k x) (coordChange i j x v) = coordChange i k x v

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
[NontriviallyNormedField R]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
{ι : Type u_5}
(self : VectorBundleCore R B F ι)
(i j k : ι)
(x : B)

x ∈ self.baseSet i ∩ self.baseSet j ∩ self.baseSet k →
  ∀ (v : F), (self.coordChange j k x) ((self.coordChange i j x) v) = (self.coordChange i k x) v


theorem image₂_inter_singleton [DecidableEq α] (s₁ s₂ : Finset α) (hf : Injective fun a => f a b) :
    image₂ f (s₁ ∩ s₂) {b} = image₂ f s₁ {b} ∩ image₂ f s₂ {b}

{f : α → β → γ}

(hf : Function.Injective fun a => f a b)

Finset.image₂ f (s₁ ∩ s₂) {b} = Finset.image₂ f s₁ {b} ∩ Finset.image₂ f s₂ {b}


@[simp]
theorem prod_eq_bot : s ×ˢ t = ⊥ ↔ s = ⊥ ∨ t = ⊥

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s : LowerSet α}
{t : LowerSet β}

s ×ˢ t = ⊥ ↔ s = ⊥ ∨ t = ⊥


theorem SeminormFamily.withSeminorms_of_nhds [TopologicalAddGroup E] (p : SeminormFamily 𝕜 E ι)
    (h : 𝓝 (0 : E) = p.moduleFilterBasis.toFilterBasis.filter) : WithSeminorms p

(h : 𝓝 0 = AddGroupFilterBasis.toFilterBasis.filter)


@[simp]
theorem frontier_setOf_re_le (a : ℝ) : frontier { z : ℂ | z.re ≤ a } = { z | z.re = a }

frontier {z | z.re ≤ a} = {z | z.re = a}


@[to_additive (attr := simp)]
theorem smul_finset_singleton (b : β) : a • ({b} : Finset β) = {a • b}

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[SMul α β]
{a : α}
(b : β)


theorem sub_inv_antitoneOn_Icc_right (ha : c < a) :
    AntitoneOn (fun x ↦ (x-c)⁻¹) (Set.Icc a b)

{α : Type u_2}
[LinearOrderedField α]
{a b c : α}
(ha : c < a)

AntitoneOn (fun x => (x - c)⁻¹) (Set.Icc a b)


protected theorem congr {f g : F} {x y : α} (h₁ : f = g) (h₂ : x = y) : f x = g y

{F : Sort u_1}
{α : Sort u_2}
{β : Sort u_3}
[i : FunLike F α β]
{f g : F}
{x y : α}
(h₁ : f = g)
(h₂ : x = y)


theorem comp.assoc (f : φ → δ) (g : β → φ) (h : α → β) : (f ∘ g) ∘ h = f ∘ g ∘ h

{α : Sort u₁}
{β : Sort u₂}
{φ : Sort u₃}
{δ : Sort u₄}
(f : φ → δ)
(g : β → φ)
(h : α → β)


@[to_additive (attr := simp)]
lemma mk_smul (g : M') (hg : g ∈ S) (a : α) : (⟨g, hg⟩ : S) • a = g • a

{M' : Type u_5}
{α : Type u_6}
[AddZeroClass M']
[VAdd M' α]
{S : AddSubmonoid M'}
(g : M')
(hg : g ∈ S)
(a : α)


theorem lt_iff_val_lt_val {a b : Char} : a < b ↔ a.val < b.val


private theorem map_add_smul_aux [DecidableEq ι] (i : ι) (x : Π i, s i) (u : s i →ₗ[R] t i) :
    (fun j ↦ update f i u j (x j)) = update (fun j ↦ (f j) (x j)) i (u (x i))

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
{t : ι → Type u_11}
[(i : ι) → AddCommMonoid (t i)]
[(i : ι) → Module R (t i)]
(f : (i : ι) → s i →ₗ[R] t i)
[DecidableEq ι]
(i : ι)
(x : (i : ι) → s i)
(u : s i →ₗ[R] t i)

(fun j => (Function.update f i u j) (x j)) = Function.update (fun j => (f j) (x j)) i (u (x i))


theorem sigmaFiniteTrim_mono {m m₂ m0 : MeasurableSpace α} {μ : Measure α} (hm : m ≤ m0)
    (hm₂ : m₂ ≤ m) [SigmaFinite (μ.trim (hm₂.trans hm))] : SigmaFinite (μ.trim hm)

{α : Type u_1}
{m m₂ m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(hm : m ≤ m0)
(hm₂ : m₂ ≤ m)
[MeasureTheory.SigmaFinite (μ.trim ⋯)]


theorem measurable_update_left {a : δ} [DecidableEq δ] {x : π a} :
    Measurable (update · a x)

{δ : Type u_4}
{π : δ → Type u_6}
[(a : δ) → MeasurableSpace (π a)]
{a : δ}
[DecidableEq δ]
{x : π a}

Measurable fun x_1 => Function.update x_1 a x


@[simp]
lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
    ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν

{α : Type u_1}
{m : MeasurableSpace α}
(μ ν : MeasureTheory.Measure α)
[μ.HaveLebesgueDecomposition ν]


@[to_additive]
theorem epi_iff_surjective : Epi f ↔ Function.Surjective f

CategoryTheory.Epi f ↔ Function.Surjective ⇑f


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

(CategoryTheory.ShortComplex.HomologyData.ofEpiOfIsIsoOfMono φ h).right =
  CategoryTheory.ShortComplex.RightHomologyData.ofEpiOfIsIsoOfMono φ h.right


theorem disjoint_of_subset_left (h : s ⊆ u) (d : Disjoint u t) : Disjoint s t

{α : Type u_1}
{s t u : Finset α}
(h : s ⊆ u)
(d : Disjoint u t)


@[to_additive]
lemma prod_of_injOn (e : ι → κ) (he : Set.InjOn e s) (hest : Set.MapsTo e s t)
    (h' : ∀ i ∈ t, i ∉ e '' s → g i = 1) (h : ∀ i ∈ s, f i = g (e i))  :
    ∏ i ∈ s, f i = ∏ j ∈ t, g j

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[CommMonoid α]
{s : Finset ι}
{t : Finset κ}
{f : ι → α}
{g : κ → α}
(e : ι → κ)
(he : Set.InjOn e ↑s)
(hest : Set.MapsTo e ↑s ↑t)
(h' : ∀ i ∈ t, i ∉ e '' ↑s → g i = 1)
(h : ∀ i ∈ s, f i = g (e i))


@[simp]
theorem toMeasure_ofFintype_apply [MeasurableSpace α] (hs : MeasurableSet s) :
    (ofFintype f h).toMeasure s = ∑' x, s.indicator f x

{α : Type u_1}
[Fintype α]
{f : α → ENNReal}
(h : ∑ a : α, f a = 1)
(s : Set α)
[MeasurableSpace α]
(hs : MeasurableSet s)

(PMF.ofFintype f h).toMeasure s = ∑' (x : α), s.indicator f x


theorem add_div_le_add_div (a b c : ℕ) : a / c + b / c ≤ (a + b) / c


@[simp, norm_cast]
theorem ofENat_le {x y : ℕ∞} : ofENat x ≤ ofENat y ↔ x ≤ y

↑x ≤ ↑y ↔ x ≤ y


@[simp] lemma bddBelow_preimage_toDual {s : Set αᵒᵈ} :
    BddBelow (toDual ⁻¹' s) ↔ BddAbove s

BddBelow (⇑OrderDual.toDual ⁻¹' s) ↔ BddAbove s


/-- Prefunctors between two `SingleObj` quivers correspond to functions between the corresponding
arrows types.
-/
@[simps]
def toPrefunctor : (α → β) ≃ SingleObj α ⥤q SingleObj β

(f : Quiver.SingleObj α ⥤q Quiver.SingleObj β)

Quiver.SingleObj.toPrefunctor.symm f a = f.map (Quiver.SingleObj.toHom a)


theorem compl_mem_cofinite : sᶜ ∈ μ.cofinite ↔ μ s < ∞

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}


lemma orbitRel_of_subMul (p : SubMulAction R M) :
    MulAction.orbitRel R p = (MulAction.orbitRel R M).comap Subtype.val

{R : Type u}
{M : Type v}
[Group R]
[MulAction R M]
(p : SubMulAction R M)

MulAction.orbitRel R ↥p = Setoid.comap Subtype.val (MulAction.orbitRel R M)


@[simp]
theorem integral_div {𝕜 : Type*} [RCLike 𝕜] (r : 𝕜) (f : ℝ → 𝕜) :
    ∫ x in a..b, f x / r ∂μ = (∫ x in a..b, f x ∂μ) / r

{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
{𝕜 : Type u_6}
[RCLike 𝕜]
(r : 𝕜)
(f : ℝ → 𝕜)

∫ (x : ℝ) in a..b, f x / r ∂μ = (∫ (x : ℝ) in a..b, f x ∂μ) / r


@[simp]
theorem realize_restrictVar [DecidableEq α] {t : L.Term α} {s : Set α} (h : ↑t.varFinset ⊆ s)
    {v : α → M} : (t.restrictVar (Set.inclusion h)).realize (v ∘ (↑)) = t.realize v

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
[DecidableEq α]
{t : L.Term α}
{s : Set α}
(h : ↑t.varFinset ⊆ s)
{v : α → M}

FirstOrder.Language.Term.realize (v ∘ Subtype.val) (t.restrictVar (Set.inclusion h)) =
  FirstOrder.Language.Term.realize v t


theorem cpow_def_of_ne_zero {x : ℂ} (hx : x ≠ 0) (y : ℂ) : x ^ y = exp (log x * y)


@[to_additive]
theorem submonoidMap_surjective (f : M →* N) (M' : Submonoid M) :
    Function.Surjective (f.submonoidMap M')

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(f : M →+ N)
(M' : AddSubmonoid M)


/-- Two morphisms into a subobject are equal exactly if
the morphisms into the ambient object are equal -/
@[ext]
theorem eq_of_comp_arrow_eq {X Y : C} {P : Subobject Y} {f g : X ⟶ P}
    (h : f ≫ P.arrow = g ≫ P.arrow) : f = g

{f g : X ⟶ CategoryTheory.Subobject.underlying.obj P}

(h : CategoryTheory.CategoryStruct.comp f P.arrow = CategoryTheory.CategoryStruct.comp g P.arrow)


/-- If a monic polynomial of separable degree one splits, then it is of form `(X - C y) ^ m` for
some non-zero natural number `m` and some element `y` of `F`. -/
theorem eq_X_sub_C_pow_of_natSepDegree_eq_one_of_splits (hm : f.Monic)
    (hs : f.Splits (RingHom.id F))
    (h : f.natSepDegree = 1) : ∃ (m : ℕ) (y : F), m ≠ 0 ∧ f = (X - C y) ^ m

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

∃ m y, m ≠ 0 ∧ f = (Polynomial.X - Polynomial.C y) ^ m


theorem map_subtype_embedding_Iic : (Iic a).map (Embedding.subtype p) = (Iic a : Finset α)

{α : Type u_1}
[Preorder α]
(p : α → Prop)
[DecidablePred p]
[LocallyFiniteOrderBot α]
(a : Subtype p)
(hp : ∀ ⦃a x : α⦄, x ≤ a → p a → p x)

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


theorem segment_translate_preimage (a b c : E) :
    (fun x => a + x) ⁻¹' [a + b -[𝕜] a + c] = [b -[𝕜] c]

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(a b c : E)


theorem T_eq (n : ℤ) : T R n = 2 * X * T R (n - 1) - T R (n - 2)

Polynomial.Chebyshev.T R n = 2 * Polynomial.X * Polynomial.Chebyshev.T R (n - 1) - Polynomial.Chebyshev.T R (n - 2)


/-- The explicit quotient construction of the colimit of `J : SingleObj G ⥤ Type u` is
equivalent to the quotient of `J.obj (SingleObj.star G)` by the induced action. -/
@[simps]
def Types.Quot.equivOrbitRelQuotient :
    Types.Quot J ≃ MulAction.orbitRel.Quotient G (J.obj (SingleObj.star G))

(J : CategoryTheory.Functor (CategoryTheory.SingleObj G) (Type u))

(CategoryTheory.Limits.SingleObj.Types.Quot.equivOrbitRelQuotient J).symm a =
  Quot.lift (fun x => Quot.mk (CategoryTheory.Limits.Types.Quot.Rel J) ⟨CategoryTheory.SingleObj.star G, x⟩) ⋯ a


@[to_additive]
theorem inv_smul_mem_iff : a⁻¹ • b ∈ s ↔ b ∈ a • s

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

a⁻¹ • b ∈ s ↔ b ∈ a • s


theorem pow_sub_le_descFactorial (n : ℕ) : ∀ k : ℕ, (n + 1 - k) ^ k ≤ n.descFactorial k


theorem leftLim_eq_of_tendsto [hα : TopologicalSpace α] [h'α : OrderTopology α] [T2Space β]
    {f : α → β} {a : α} {y : β} (h : 𝓝[<] a ≠ ⊥) (h' : Tendsto f (𝓝[<] a) (𝓝 y)) :
    leftLim f a = y

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[TopologicalSpace β]
[hα : TopologicalSpace α]
[h'α : OrderTopology α]
[T2Space β]
{f : α → β}
{a : α}
{y : β}
(h : 𝓝[<] a ≠ ⊥)
(h' : Filter.Tendsto f (𝓝[<] a) (𝓝 y))


/-- A multiplicative morphism property `W` has left calculus of fractions if
any right fraction can be turned into a left fraction and that two morphisms
that can be equalized by precomposition with a morphism in `W` can also
be equalized by postcomposition with a morphism in `W`. -/
class HasLeftCalculusOfFractions extends W.IsMultiplicative : Prop where
  exists_leftFraction ⦃X Y : C⦄ (φ : W.RightFraction X Y) :
    ∃ (ψ : W.LeftFraction X Y), φ.f ≫ ψ.s = φ.s ≫ ψ.f
  ext : ∀ ⦃X' X Y : C⦄ (f₁ f₂ : X ⟶ Y) (s : X' ⟶ X) (_ : W s)
    (_ : s ≫ f₁ = s ≫ f₂), ∃ (Y' : C) (t : Y ⟶ Y') (_ : W t), f₁ ≫ t = f₂ ≫ t

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[self : W.HasLeftCalculusOfFractions]
⦃X' X Y : C⦄
(f₁ f₂ : X ⟶ Y)
(s : X' ⟶ X)

W s →
  CategoryTheory.CategoryStruct.comp s f₁ = CategoryTheory.CategoryStruct.comp s f₂ →
    ∃ Y' t, ∃ (_ : W t), CategoryTheory.CategoryStruct.comp f₁ t = CategoryTheory.CategoryStruct.comp f₂ t


theorem IsCodetector.isCoseparator [HasCoequalizers C] {G : C} : IsCodetector G → IsCoseparator G

CategoryTheory.IsCodetector G → CategoryTheory.IsCoseparator G


theorem condexp_eq_zero_or_one_of_condIndepSet_self
    [StandardBorelSpace Ω] [Nonempty Ω]
    (hm : m ≤ m0) [hμ : IsFiniteMeasure μ] {t : Set Ω} (ht : MeasurableSet t)
    (h_indep : CondIndepSet m hm t t μ) :
    ∀ᵐ ω ∂μ, (μ⟦t | m⟧) ω = 0 ∨ (μ⟦t | m⟧) ω = 1

(h_indep : ProbabilityTheory.CondIndepSet m hm t t μ)

∀ᵐ (ω : Ω) ∂μ, (μ[t.indicator fun ω => 1|m]) ω = 0 ∨ (μ[t.indicator fun ω => 1|m]) ω = 1


@[to_additive (attr := simp)]
lemma card_inv (s : Set α) : Nat.card ↥(s⁻¹) = Nat.card s

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


nonrec theorem disjoint_iff : Disjoint f g ↔ Disjoint f.support g.support

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


theorem erase_eq_update_zero (f : α →₀ M) (a : α) : f.erase a = update f a 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
(f : α →₀ M)
(a : α)


lemma ConvexOn.mul_concaveOn' (hf : ConvexOn 𝕜 s f) (hg : ConcaveOn 𝕜 s g)
    (hf₀ : ∀ ⦃x⦄, x ∈ s → f x ≤ 0) (hg₀ : ∀ ⦃x⦄, x ∈ s → 0 ≤ g x) (hfg : MonovaryOn f g s) :
    ConvexOn 𝕜 s (f * g)

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedCommRing 𝕜]
[LinearOrderedCommRing E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set 𝕜}
[IsScalarTower 𝕜 E E]
[SMulCommClass 𝕜 E E]
{f g : 𝕜 → E}
(hf : ConvexOn 𝕜 s f)
(hg : ConcaveOn 𝕜 s g)
(hf₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → f x ≤ 0)
(hg₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → 0 ≤ g x)
(hfg : MonovaryOn f g s)


@[mono]
theorem induce_mono_left (hg : G' ≤ G'') : G'.induce s ≤ G''.induce s

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


@[reassoc (attr := simp)]
theorem left_comp_retraction (f g : A ⟶ B) [IsCoreflexivePair f g] :
    f ≫ commonRetraction f g = 𝟙 A

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{A B : C}
(f g : A ⟶ B)
[CategoryTheory.IsCoreflexivePair f g]

CategoryTheory.CategoryStruct.comp f (CategoryTheory.commonRetraction f g) = CategoryTheory.CategoryStruct.id A


theorem geom_sum_one (x : α) : ∑ i ∈ range 1, x ^ i = 1


theorem differentiableOn_neg : DifferentiableOn 𝕜 (Neg.neg : 𝕜 → 𝕜) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(s : Set 𝕜)


@[simp]
theorem isOrtho_iSup_left {ι : Sort*} {U : ι → Submodule 𝕜 E} {V : Submodule 𝕜 E} :
    iSup U ⟂ V ↔ ∀ i, U i ⟂ V

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Sort u_4}
{U : ι → Submodule 𝕜 E}
{V : Submodule 𝕜 E}


theorem Base.infinite_of_infinite (hB : M.Base B) (h : B.Infinite) (hB₁ : M.Base B₁) :
    B₁.Infinite

{α : Type u_1}
{M : Matroid α}
{B B₁ : Set α}
(hB : M.Base B)
(h : B.Infinite)
(hB₁ : M.Base B₁)


theorem HasFDerivAt.congr_fderiv (h : HasFDerivAt f f' x) (h' : f' = g') : HasFDerivAt f g' x

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


/--
Given surjections `⋯ ⟶ Xₙ₊₁ ⟶ Xₙ ⟶ ⋯ ⟶ X₀` in a concrete category whose forgetful functor
preserves sequential limits, the projection map `lim Xₙ ⟶ X₀` is surjective.
-/
lemma surjective_π_app_zero_of_surjective_map {C : Type u} [Category.{v} C] [ConcreteCategory.{v} C]
    [PreservesLimitsOfShape ℕᵒᵖ (forget C)] {F : ℕᵒᵖ ⥤ C} {c : Cone F}
    (hc : IsLimit c) (hF : ∀ n, Function.Surjective (F.map (homOfLE (Nat.le_succ n)).op)) :
    Function.Surjective (c.π.app ⟨0⟩)

[CategoryTheory.Limits.PreservesLimitsOfShape ℕᵒᵖ (CategoryTheory.forget C)]

(hF : ∀ (n : ℕ), Function.Surjective ⇑(F.map (CategoryTheory.homOfLE ⋯).op))

Function.Surjective ⇑(c.π.app (Opposite.op 0))


/-- If `f` is a nontrivial countably generated filter, then there exists a sequence that converges
to `f`. -/
theorem exists_seq_tendsto (f : Filter α) [IsCountablyGenerated f] [NeBot f] :
    ∃ x : ℕ → α, Tendsto x atTop f


/-- If the `vectorSpan` of a finite affinely independent
family lies in a submodule with dimension one less than its
cardinality, it equals that submodule. -/
theorem AffineIndependent.vectorSpan_eq_of_le_of_card_eq_finrank_add_one [Fintype ι] {p : ι → P}
    (hi : AffineIndependent k p) {sm : Submodule k V} [FiniteDimensional k sm]
    (hle : vectorSpan k (Set.range p) ≤ sm) (hc : Fintype.card ι = finrank k sm + 1) :
    vectorSpan k (Set.range p) = sm

(hc : Fintype.card ι = FiniteDimensional.finrank k ↥sm + 1)


@[to_additive (attr := simp)]
theorem nndist_smul [PseudoMetricSpace X] [SMul M X] [IsometricSMul M X] (c : M) (x y : X) :
    nndist (c • x) (c • y) = nndist x y

{M : Type u}
{X : Type w}
[PseudoMetricSpace X]
[SMul M X]
[IsometricSMul M X]
(c : M)
(x y : X)


@[simp]
theorem dropFun_of_subtype {α} (p : α ⟹ «repeat» (n + 1) Prop) :
    dropFun (ofSubtype p) = ofSubtype _

(p : α.Arrow (TypeVec.repeat (n + 1) Prop))

TypeVec.dropFun (TypeVec.ofSubtype p) = TypeVec.ofSubtype (TypeVec.dropFun p)


theorem Antiperiodic.neg_eq [AddGroup α] [InvolutiveNeg β] (h : Antiperiodic f c) :
    f (-c) = -f 0

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[AddGroup α]
[InvolutiveNeg β]
(h : Function.Antiperiodic f c)


theorem lim_eq_midpoint (c : CU P) (x : X) :
    c.lim x = midpoint ℝ (c.left.lim x) (c.right.lim x)

{X : Type u_1}
[TopologicalSpace X]
{P : Set X → Prop}
(c : Urysohns.CU P)
(x : X)


@[simp]
theorem lift_ι_apply' (x : L) :
    lift R f ((UniversalEnvelopingAlgebra.mkAlgHom R L) (ιₜ x)) = f x

(R : Type u₁)
{L : Type u₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{A : Type u₃}
[Ring A]
[Algebra R A]
(f : L →ₗ⁅R⁆ A)
(x : L)

((UniversalEnvelopingAlgebra.lift R) f) ((UniversalEnvelopingAlgebra.mkAlgHom R L) (ιₜ x)) = f x


@[to_additive]
theorem eventually_constant_prod {u : ℕ → β} {N : ℕ} (hu : ∀ n ≥ N, u n = 1) {n : ℕ} (hn : N ≤ n) :
    (∏ k ∈ range n, u k) = ∏ k ∈ range N, u k

{β : Type u_4}
[AddCommMonoid β]
{u : ℕ → β}
{N : ℕ}
(hu : ∀ n ≥ N, u n = 0)
{n : ℕ}
(hn : N ≤ n)

∑ k ∈ Finset.range n, u k = ∑ k ∈ Finset.range N, u k


@[to_additive (attr := simp)]
theorem alternatingProd_nil : alternatingProd ([] : List α) = 1


@[simp]
theorem union_univ (s : Set α) : s ∪ univ = univ


protected theorem sub_sub_eq_min : ∀ (a b : Nat), a - (a - b) = min a b


theorem ortho_smul_left {B : V₁ →ₛₗ[I₁] V₂ →ₛₗ[I₂] V} {x y} {a : K₁} (ha : a ≠ 0) :
    IsOrtho B x y ↔ IsOrtho B (a • x) y

{K : Type u_13}
{K₁ : Type u_14}
{K₂ : Type u_15}
{V : Type u_16}
{V₁ : Type u_17}
{V₂ : Type u_18}
[Field K]
[AddCommGroup V]
[Module K V]
[Field K₁]
[AddCommGroup V₁]
[Module K₁ V₁]
[Field K₂]
[AddCommGroup V₂]
[Module K₂ V₂]
{I₁ : K₁ →+* K}
{I₂ : K₂ →+* K}
{B : V₁ →ₛₗ[I₁] V₂ →ₛₗ[I₂] V}
{x : V₁}
{y : V₂}
{a : K₁}
(ha : a ≠ 0)


@[simp]
theorem Filter.cocompact_eq_bot [CompactSpace X] : Filter.cocompact X = ⊥

{X : Type u}
[TopologicalSpace X]
[CompactSpace X]


theorem CompleteOrthogonalIdempotents.of_ker_isNilpotent_of_isMulCentral
    (h : ∀ x ∈ RingHom.ker f, IsNilpotent x)
    (he : ∀ i, IsIdempotentElem (e i))
    (he' : ∀ i, IsMulCentral (e i))
    (he'' : CompleteOrthogonalIdempotents (f ∘ e)) :
    CompleteOrthogonalIdempotents e

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

(he'' : CompleteOrthogonalIdempotents (⇑f ∘ e))


theorem HasFTaylorSeriesUpTo.continuous (h : HasFTaylorSeriesUpTo n f p) : Continuous f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ∞}
{p : E → FormalMultilinearSeries 𝕜 E F}
(h : HasFTaylorSeriesUpTo n f p)


{x y : SetTheory.PGame}
(hx : x.Numeric)
(hy : y.Numeric)


@[simp]
theorem tensorHom {W X Y Z : C} (f : W ⟶ X) (g : Y ⟶ Z) : f ⊗ g = Limits.prod.map f g

CategoryTheory.MonoidalCategory.tensorHom f g = CategoryTheory.Limits.prod.map f g


/-- A product is `M`-regular if and only if the factors are. -/
theorem mul_iff : IsSMulRegular M (a * b) ↔ IsSMulRegular M a ∧ IsSMulRegular M b

{R : Type u_1}
{M : Type u_3}
{a b : R}
[CommSemigroup R]
[SMul R M]
[IsScalarTower R R M]


theorem translationNumber_eq_of_tendsto₀ {τ' : ℝ}
    (h : Tendsto (fun n : ℕ => f^[n] 0 / n) atTop (𝓝 τ')) : τ f = τ'

(h : Filter.Tendsto (fun n => (⇑f)^[n] 0 / ↑n) Filter.atTop (𝓝 τ'))


theorem map_prod_right_eq_zip {l : List α} (f : α → β) :
    (l.map fun x => (f x, x)) = (l.map f).zip l

{α : Type u}
{β : Type u_1}
{l : List α}
(f : α → β)

List.map (fun x => (f x, x)) l = (List.map f l).zip l


@[simp]
theorem hcast_def {X : TopCat} {x₀ x₁ : X} (hx₀ : x₀ = x₁) :
    hcast hx₀ = eqToHom (FundamentalGroupoid.ext _ _ hx₀)

{X : TopCat}
{x₀ x₁ : ↑X}
(hx₀ : x₀ = x₁)

ContinuousMap.Homotopy.hcast hx₀ = CategoryTheory.eqToHom ⋯


theorem mem_closure {x : M} : x ∈ closure L s ↔ ∀ S : L.Substructure M, s ⊆ S → x ∈ S

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{s : Set M}
{x : M}

x ∈ (FirstOrder.Language.Substructure.closure L).toFun s ↔ ∀ (S : L.Substructure M), s ⊆ ↑S → x ∈ S


theorem eq_of_forall_lt_iff [LinearOrder α] {a b : α} (h : ∀ c, c < a ↔ c < b) : a = b

{α : Type u_2}
[LinearOrder α]
{a b : α}
(h : ∀ (c : α), c < a ↔ c < b)


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

{R : Type u}
[NonUnitalNonAssocRing R]
(x : ↥⊤)


@[to_additive (attr := simp)]
theorem mem_mrange {f : F} {y : N} : y ∈ mrange f ↔ ∃ x, f x = y

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_5}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
{f : F}
{y : N}

y ∈ AddMonoidHom.mrange f ↔ ∃ x, f x = y


theorem shiftLeft'_ne_zero_left (b) {m} (h : m ≠ 0) (n) : shiftLeft' b m n ≠ 0


lemma Nondegenerate.flip {B : BilinForm K V} (hB : B.Nondegenerate) :
    B.flip.Nondegenerate

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{B : LinearMap.BilinForm K V}
(hB : B.Nondegenerate)


@[to_additive (attr := deprecated exists_mem_nhds_isCompact_isClosed (since := "2024-01-28"))]
theorem exists_isCompact_isClosed_nhds_one [WeaklyLocallyCompactSpace G] :
    ∃ K : Set G, IsCompact K ∧ IsClosed K ∧ K ∈ 𝓝 1

(G : Type w)
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
[WeaklyLocallyCompactSpace G]


/-- Taking the image of a morphism gives a functor `Over X ⥤ MonoOver X`.
-/
@[simps]
def image : Over X ⥤ MonoOver X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : C}
[CategoryTheory.Limits.HasImages C]
(f : CategoryTheory.Over X)

CategoryTheory.MonoOver.image.obj f = CategoryTheory.MonoOver.imageMonoOver f.hom


/--
This normalized a bitvec using `ofFin` to `ofNat`.
-/
theorem ofFin_eq_ofNat : @BitVec.ofFin w (Fin.mk x lt) = BitVec.ofNat w x


theorem map_eq_C_mul_X_pow_of_forall_coeff_mem {f : R[X]} {P : Ideal R}
    (hfP : ∀ n : ℕ, ↑n < f.degree → f.coeff n ∈ P) :
    map (mk P) f = C ((mk P) f.leadingCoeff) * X ^ f.natDegree

(hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P)

Polynomial.map (Ideal.Quotient.mk P) f =
  Polynomial.C ((Ideal.Quotient.mk P) f.leadingCoeff) * Polynomial.X ^ f.natDegree


@[simp]
theorem trans_bot (f : α ≃. β) : f.trans (⊥ : β ≃. γ) = ⊥

{α : Type u}
{β : Type v}
{γ : Type w}
(f : α ≃. β)


theorem liftp_iff_of_isUniform (h : q.IsUniform) {α : Type u} (x : F α) (p : α → Prop) :
    Liftp p x ↔ ∀ u ∈ supp x, p u

{F : Type u → Type u}
[q : QPF F]
(h : QPF.IsUniform)
{α : Type u}
(x : F α)
(p : α → Prop)

Functor.Liftp p x ↔ ∀ u ∈ Functor.supp x, p u


@[simp]
theorem map_comp_map (f : Q₂ →qᵢ Q₃) (g : Q₁ →qᵢ Q₂) :
    (map f).comp (map g) = map (f.comp g)

{R : Type u_1}
[CommRing R]
{M₁ : Type u_4}
{M₂ : Type u_5}
{M₃ : Type u_6}
[AddCommGroup M₁]
[AddCommGroup M₂]
[AddCommGroup M₃]
[Module R M₁]
[Module R M₂]
[Module R M₃]
{Q₁ : QuadraticForm R M₁}
{Q₂ : QuadraticForm R M₂}
{Q₃ : QuadraticForm R M₃}
(f : Q₂ →qᵢ Q₃)
(g : Q₁ →qᵢ Q₂)

(CliffordAlgebra.map f).comp (CliffordAlgebra.map g) = CliffordAlgebra.map (f.comp g)


@[simp]
theorem op_le_op_iff {S₁ S₂ : Subsemiring R} : S₁.op ≤ S₂.op ↔ S₁ ≤ S₂

{R : Type u_2}
[NonAssocSemiring R]
{S₁ S₂ : Subsemiring R}


/-- The measurable Besicovitch covering theorem. Assume that, for any `x` in a set `s`,
one is given a set of admissible closed balls centered at `x`, with arbitrarily small radii.
Then there exists a disjoint covering of almost all `s` by admissible closed balls centered at some
points of `s`.
This version requires that the underlying measure is sigma-finite, and that the space has the
Besicovitch covering property (which is satisfied for instance by normed real vector spaces).
It expresses the conclusion in a slightly awkward form (with a subset of `α × ℝ`) coming from the
proof technique.
For a version giving the conclusion in a nicer form, see `exists_disjoint_closedBall_covering_ae`.
-/
theorem exists_disjoint_closedBall_covering_ae_aux (μ : Measure α) [SFinite μ] (f : α → Set ℝ)
    (s : Set α) (hf : ∀ x ∈ s, ∀ δ > 0, (f x ∩ Ioo 0 δ).Nonempty) :
    ∃ t : Set (α × ℝ), t.Countable ∧ (∀ p ∈ t, p.1 ∈ s) ∧ (∀ p ∈ t, p.2 ∈ f p.1) ∧
      μ (s \ ⋃ (p : α × ℝ) (_ : p ∈ t), closedBall p.1 p.2) = 0 ∧
        t.PairwiseDisjoint fun p => closedBall p.1 p.2

(hf : ∀ x ∈ s, ∀ δ > 0, (f x ∩ Set.Ioo 0 δ).Nonempty)

∃ t,
  t.Countable ∧
    (∀ p ∈ t, p.1 ∈ s) ∧
      (∀ p ∈ t, p.2 ∈ f p.1) ∧
        μ (s \ ⋃ p ∈ t, Metric.closedBall p.1 p.2) = 0 ∧ t.PairwiseDisjoint fun p => Metric.closedBall p.1 p.2


theorem eqOn_of_preconnected_of_mem_closure (hf : AnalyticOn 𝕜 f U) (hg : AnalyticOn 𝕜 g U)
    (hU : IsPreconnected U) (h₀ : z₀ ∈ U) (hfg : z₀ ∈ closure ({z | f z = g z} \ {z₀})) :
    EqOn f g U


theorem disjoint_nhds_atTop (a : α) : Disjoint (𝓝 a) atTop

{α : Type u}
[Preorder α]
[NoTopOrder α]
[TopologicalSpace α]
[ClosedIciTopology α]
(a : α)


/-- Assume `k = l` and `k' = l'`.
If two functions `Fin k → Fin k' → α` and `Fin l → Fin l' → α` are equal on each pair,
then they coincide (in the heq sense). -/
protected theorem heq_fun₂_iff {α : Sort*} {k l k' l' : ℕ} (h : k = l) (h' : k' = l')
    {f : Fin k → Fin k' → α} {g : Fin l → Fin l' → α} :
    HEq f g ↔ ∀ (i : Fin k) (j : Fin k'), f i j = g ⟨(i : ℕ), h ▸ i.2⟩ ⟨(j : ℕ), h' ▸ j.2⟩

{α : Sort u_1}
{k l k' l' : ℕ}
(h : k = l)
(h' : k' = l')
{f : Fin k → Fin k' → α}
{g : Fin l → Fin l' → α}

HEq f g ↔ ∀ (i : Fin k) (j : Fin k'), f i j = g ⟨↑i, ⋯⟩ ⟨↑j, ⋯⟩


/-- In a topological space with sigma compact topology, if `f` is a function that sends each point
`x` of a closed set `s` to a neighborhood of `x` within `s`, then for some countable set `t ⊆ s`,
the neighborhoods `f x`, `x ∈ t`, cover the whole set `s`. -/
theorem countable_cover_nhdsWithin_of_sigma_compact {f : X → Set X} {s : Set X} (hs : IsClosed s)
    (hf : ∀ x ∈ s, f x ∈ 𝓝[s] x) : ∃ t ⊆ s, t.Countable ∧ s ⊆ ⋃ x ∈ t, f x

{X : Type u_1}
[TopologicalSpace X]
[SigmaCompactSpace X]
{f : X → Set X}
{s : Set X}
(hs : IsClosed s)
(hf : ∀ x ∈ s, f x ∈ 𝓝[s] x)


theorem ball_antitone {p q : Seminorm 𝕜 E} (h : q ≤ p) : p.ball x r ⊆ q.ball x r

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


theorem utf8GetAux?_of_valid (cs cs' : List Char) {i p : Nat} (hp : i + utf8Len cs = p) :
    utf8GetAux? (cs ++ cs') ⟨i⟩ ⟨p⟩ = cs'.head?

(cs cs' : List Char)
{i p : Nat}
(hp : i + String.utf8Len cs = p)

String.utf8GetAux? (cs ++ cs') { byteIdx := i } { byteIdx := p } = cs'.head?


theorem pred_mul (n m : Nat) : pred n * m = n * m - m


@[simp] theorem dot_cons₂ : dot (x::xs) (y::ys) = x * y + dot xs ys

{x : Int}
{xs : List Int}
{y : Int}
{ys : List Int}

Lean.Omega.IntList.dot (x :: xs) (y :: ys) = x * y + Lean.Omega.IntList.dot xs ys


lemma toColex_lt_toColex_iff_exists_forall_lt :
    toColex s < toColex t ↔ ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a

{α : Type u_1}
[LinearOrder α]
{s t : Finset α}

{ ofColex := s } < { ofColex := t } ↔ ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a


theorem Integrable.trim (hm : m ≤ m0) (hf_int : Integrable f μ') (hf : StronglyMeasurable[m] f) :
    Integrable f (μ'.trim hm)

(hf_int : MeasureTheory.Integrable f μ')

(hf : MeasureTheory.StronglyMeasurable f)


/-- An epimorphism is surjective on pseudoelements. -/
theorem pseudo_surjective_of_epi {P Q : C} (f : P ⟶ Q) [Epi f] : Function.Surjective f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P Q : C}
(f : P ⟶ Q)
[CategoryTheory.Epi f]


lemma floorDiv_zero (b : β) : b ⌊/⌋ (0 : α) = 0

{α : Type u_2}
{β : Type u_3}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMulZeroClass α β]
[FloorDiv α β]
(b : β)


@[to_additive]
theorem Monoid.fg_of_surjective {M' : Type*} [Monoid M'] [Monoid.FG M] (f : M →* M')
    (hf : Function.Surjective f) : Monoid.FG M'

{M : Type u_1}
[AddMonoid M]
{M' : Type u_3}
[AddMonoid M']
[AddMonoid.FG M]
(f : M →+ M')
(hf : Function.Surjective ⇑f)


theorem count_singleton (a b : α) : count a ({b} : Multiset α) = if a = b then 1 else 0

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

Multiset.count a {b} = if a = b then 1 else 0


theorem logDeriv_comp {f : 𝕜' → 𝕜'} {g : 𝕜 → 𝕜'} {x : 𝕜} (hf : DifferentiableAt 𝕜' f (g x))
    (hg : DifferentiableAt 𝕜 g x) : logDeriv (f ∘ g) x = logDeriv f (g x) * deriv g x

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{f : 𝕜' → 𝕜'}
{g : 𝕜 → 𝕜'}
{x : 𝕜}
(hf : DifferentiableAt 𝕜' f (g x))
(hg : DifferentiableAt 𝕜 g x)


@[simp]
theorem fderiv_id' : fderiv 𝕜 (fun x : E => x) x = ContinuousLinearMap.id 𝕜 E

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}

fderiv 𝕜 (fun x => x) x = ContinuousLinearMap.id 𝕜 E


/-- The obvious embedding from `up ℕ` to `up ℤ`. -/
@[simps!]
def embeddingUpNat : Embedding (up ℕ) (up ℤ)


theorem iIndepSets.indepSets {s : ι → Set (Set Ω)}
    (h_indep : iIndepSets s μ) {i j : ι} (hij : i ≠ j) : IndepSets (s i) (s j) μ

(h_indep : ProbabilityTheory.iIndepSets s μ)

ProbabilityTheory.IndepSets (s i) (s j) μ


protected theorem uniformEmbedding {E₁ E₂ : Type*} [UniformSpace E₁] [UniformSpace E₂]
    [AddCommGroup E₁] [AddCommGroup E₂] [Module R₁ E₁] [Module R₂ E₂] [UniformAddGroup E₁]
    [UniformAddGroup E₂] (e : E₁ ≃SL[σ₁₂] E₂) : UniformEmbedding e

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{E₁ : Type u_9}
{E₂ : Type u_10}
[UniformSpace E₁]
[UniformSpace E₂]
[AddCommGroup E₁]
[AddCommGroup E₂]
[Module R₁ E₁]
[Module R₂ E₂]
[UniformAddGroup E₁]
[UniformAddGroup E₂]
(e : E₁ ≃SL[σ₁₂] E₂)


theorem uniformly_extend_exists [CompleteSpace γ] (a : α) : ∃ c, Tendsto f (comap e (𝓝 a)) (𝓝 c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
{e : β → α}
(h_e : UniformInducing e)
(h_dense : DenseRange e)
{f : β → γ}
(h_f : UniformContinuous f)
[CompleteSpace γ]
(a : α)

∃ c, Filter.Tendsto f (Filter.comap e (𝓝 a)) (𝓝 c)


theorem div_add_one (h : b ≠ 0) : a / b + 1 = (a + b) / b

{α : Type u_1}
[DivisionSemiring α]
{a b : α}
(h : b ≠ 0)


@[to_additive]
lemma map_comp_div' [DivInvMonoid G] [DivInvMonoid H] [MonoidHomClass F G H] (f : F)
    (hf : ∀ a, f a⁻¹ = (f a)⁻¹) (g h : ι → G) : f ∘ (g / h) = f ∘ g / f ∘ h

{ι : Type u_1}
{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[DivInvMonoid G]
[DivInvMonoid H]
[MonoidHomClass F G H]
(f : F)
(hf : ∀ (a : G), f a⁻¹ = (f a)⁻¹)
(g h : ι → G)


/-- The set of solutions with `x` and `y` positive is closed under multiplication. -/
theorem y_mul_pos {a b : Solution₁ d} (hax : 0 < a.x) (hay : 0 < a.y) (hbx : 0 < b.x)
    (hby : 0 < b.y) : 0 < (a * b).y

{d : ℤ}
{a b : Pell.Solution₁ d}
(hax : 0 < a.x)
(hay : 0 < a.y)
(hbx : 0 < b.x)
(hby : 0 < b.y)


@[to_additive] lemma leOnePart_eq_ite : a⁻ᵐ = if a ≤ 1 then a⁻¹ else 1

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


theorem iUnion_Icc_zsmul : ⋃ n : ℤ, Icc (n • p) ((n + 1) • p) = univ

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

⋃ n, Set.Icc (n • p) ((n + 1) • p) = Set.univ


theorem ofDual_max' {s : Finset αᵒᵈ} (hs : s.Nonempty) :
    ofDual (max' s hs) = min' (s.image ofDual) (hs.image _)

{α : Type u_2}
[LinearOrder α]
{s : Finset αᵒᵈ}
(hs : s.Nonempty)

OrderDual.ofDual (s.max' hs) = (Finset.image (⇑OrderDual.ofDual) s).min' ⋯


theorem bind_le {f : Filter α} {g : α → Filter β} {l : Filter β} (h : ∀ᶠ x in f, g x ≤ l) :
    f.bind g ≤ l

{α : Type u}
{β : Type v}
{f : Filter α}
{g : α → Filter β}
{l : Filter β}
(h : ∀ᶠ (x : α) in f, g x ≤ l)


theorem uniqueDiffOn_Iio (a : ℝ) : UniqueDiffOn ℝ (Iio a)


theorem IsMax.snd (hx : IsMax x) : IsMax x.2

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{x : α × β}
(hx : IsMax x)


/-- `InfHomClass F α β` states that `F` is a type of `⊓`-preserving morphisms.

You should extend this class when you extend `InfHom`. -/
class InfHomClass (F α β : Type*) [Inf α] [Inf β] [FunLike F α β] : Prop where
  /-- An `InfHomClass` morphism preserves infima. -/
  map_inf (f : F) (a b : α) : f (a ⊓ b) = f a ⊓ f b

{F : Type u_7}
{α : Type u_8}
{β : Type u_9}
[Inf α]
[Inf β]
[FunLike F α β]
[self : InfHomClass F α β]
(f : F)
(a b : α)


theorem DifferentiableWithinAt.cexp (hf : DifferentiableWithinAt 𝕜 f s x) :
    DifferentiableWithinAt 𝕜 (fun x => Complex.exp (f x)) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[NormedAlgebra 𝕜 ℂ]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : E → ℂ}
{x : E}
{s : Set E}
(hf : DifferentiableWithinAt 𝕜 f s x)


lemma IsWellOrderLimitElement.bot_lt [OrderBot α] : ⊥ < a

{α : Type u_1}
[LinearOrder α]
(a : α)
[ha : IsWellOrderLimitElement a]
[OrderBot α]


lemma term_sum_one (N : ℕ) : term_sum 1 N = log (N + 1) - harmonic (N + 1) + 1

ZetaAsymptotics.term_sum 1 N = Real.log (↑N + 1) - ↑(harmonic (N + 1)) + 1


theorem iterateTR_loop_eq (f : α → α) (a : α) (n : ℕ) (l : List α) :
    iterateTR.loop f a n l = reverse l ++ iterate f a n

{α : Type u_1}
(f : α → α)
(a : α)
(n : ℕ)
(l : List α)

List.iterateTR.loop f a n l = l.reverse ++ List.iterate f a n


protected theorem of_dist_le' {K : ℝ} (h : ∀ x y, dist (f x) (f y) ≤ K * dist x y) :
    LipschitzWith (Real.toNNReal K) f

(h : ∀ (x y : α), dist (f x) (f y) ≤ K * dist x y)


lemma eq_compactlyGenerated {X : Type w} [t : TopologicalSpace X] [UCompactlyGeneratedSpace.{u} X] :
    t = compactlyGenerated.{u} X

{X : Type w}
[t : TopologicalSpace X]
[UCompactlyGeneratedSpace X]

t = TopologicalSpace.compactlyGenerated X


theorem mem_iInf_finset {s : Finset α} {f : α → Filter β} {t : Set β} :
    (t ∈ ⨅ a ∈ s, f a) ↔ ∃ p : α → Set β, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a

{α : Type u}
{β : Type v}
{s : Finset α}
{f : α → Filter β}
{t : Set β}

t ∈ ⨅ a ∈ s, f a ↔ ∃ p, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a


theorem mul_self_sub_mul_self_eq' [NonUnitalNonAssocRing R] {a b : R} (h : Commute a b) :
    a * a - b * b = (a - b) * (a + b)

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


lemma nonsingularLift_zero [Nontrivial R] : W.NonsingularLift ⟦![0, 1, 0]⟧

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


/-- An equivalence of bounded formulas given by an equivalence of terms and an equivalence of
relations. -/
@[simps]
def mapTermRelEquiv (ft : ∀ n, L.Term (α ⊕ (Fin n)) ≃ L'.Term (β ⊕ (Fin n)))
    (fr : ∀ n, L.Relations n ≃ L'.Relations n) {n} : L.BoundedFormula α n ≃ L'.BoundedFormula β n

(ft : (n : ℕ) → L.Term (α ⊕ Fin n) ≃ L'.Term (β ⊕ Fin n))

(fr : (n : ℕ) → L.Relations n ≃ L'.Relations n)

∀ (a : L.BoundedFormula α n),
  (FirstOrder.Language.BoundedFormula.mapTermRelEquiv ft fr) a =
    FirstOrder.Language.BoundedFormula.mapTermRel (fun n => ⇑(ft n)) (fun n => ⇑(fr n)) (fun x => id) a


@[simp]
theorem indexEquiv_apply_ofIsComplex_fst (w : {w : InfinitePlace K // IsComplex w}) :
    (indexEquiv K) (Sum.inr ⟨w, 0⟩) = w.val.embedding

{K : Type u_1}
[Field K]
[NumberField K]
(w : { w // w.IsComplex })

(NumberField.mixedEmbedding.indexEquiv K) (Sum.inr (w, 0)) = (↑w).embedding


theorem condexpL1CLM_indicatorConstLp (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : F') :
    (condexpL1CLM F' hm μ) (indicatorConstLp 1 hs hμs x) = condexpInd F' hm μ s x

{α : Type u_1}
{F' : Type u_4}
[NormedAddCommGroup F']
[NormedSpace ℝ F']
[CompleteSpace F']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]
{s : Set α}
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(x : F')

(MeasureTheory.condexpL1CLM F' hm μ) (MeasureTheory.indicatorConstLp 1 hs hμs x) =
  (MeasureTheory.condexpInd F' hm μ s) x


theorem MDifferentiableAt.continuousAt {f : M → M'} {x : M} (hf : MDifferentiableAt I I' f x) :
    ContinuousAt f 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)


/-- Given `F : J ⥤ PresheafOfModules.{v} R`, this is the `BundledCorePresheafOfModules R` which
corresponds to the presheaf of modules which sends `X` to the colimit of `F ⋙ evaluation R X`. -/
@[simps]
noncomputable def colimitBundledCore : BundledCorePresheafOfModules R

[{X Y : Cᵒᵖ} →
    (f : X ⟶ Y) →
      CategoryTheory.Limits.PreservesColimit (F ⋙ PresheafOfModules.evaluation R Y)
        (ModuleCat.restrictScalars (R.map f))]

[∀ (X : Cᵒᵖ), CategoryTheory.Limits.HasColimit (F ⋙ PresheafOfModules.evaluation R X)]

(PresheafOfModules.colimitBundledCore F).obj X = CategoryTheory.Limits.colimit (F ⋙ PresheafOfModules.evaluation R X)


theorem IsCycle.cycleOf_eq (hf : IsCycle f) (hx : f x ≠ x) : cycleOf f x = f

{α : Type u_2}
{f : Equiv.Perm α}
{x : α}
[DecidableRel f.SameCycle]
(hf : f.IsCycle)
(hx : f x ≠ x)


theorem mapAccumr₂_bisim_tail {ys : Vector β n} {f₁ : α → β → σ₁ → σ₁ × γ}
    {f₂ : α → β → σ₂ → σ₂ × γ} {s₁ : σ₁} {s₂ : σ₂}
    (h : ∃ R : σ₁ → σ₂ → Prop, R s₁ s₂ ∧
      ∀ {s q} a b, R s q → R (f₁ a b s).1 (f₂ a b q).1 ∧ (f₁ a b s).2 = (f₂ a b q).2) :
    (mapAccumr₂ f₁ xs ys s₁).2 = (mapAccumr₂ f₂ xs ys s₂).2

{f₁ : α → β → σ₁ → σ₁ × γ}

{f₂ : α → β → σ₂ → σ₂ × γ}

(h :
  ∃ R, R s₁ s₂ ∧ ∀ {s : σ₁} {q : σ₂} (a : α) (b : β), R s q → R (f₁ a b s).1 (f₂ a b q).1 ∧ (f₁ a b s).2 = (f₂ a b q).2)

(Mathlib.Vector.mapAccumr₂ f₁ xs ys s₁).2 = (Mathlib.Vector.mapAccumr₂ f₂ xs ys s₂).2


lemma le_iff_exists_nonneg_add
    [ExistsAddOfLE α] [ContravariantClass α α (· + ·) (· ≤ ·)] [CovariantClass α α (· + ·) (· ≤ ·)]
    (a b : α) : a ≤ b ↔ ∃ c ≥ 0, b = a + c

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

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


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

(CategoryTheory.ShortComplex.LeftHomologyData.ofEpiOfIsIsoOfMono' φ h).K = h.K


@[simp]
theorem coe_preimage_infty : ((↑) : X → OnePoint X) ⁻¹' {∞} = ∅


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

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

LinearMap.lTensor A Coalgebra.counit ∘ₗ Coalgebra.comul = (TensorProduct.mk R A R).flip 1


theorem hasProducts_of_finite_and_cofiltered [HasFiniteProducts C]
    [HasCofilteredLimitsOfSize.{w, w} C] : HasProducts.{w} C

[CategoryTheory.Limits.HasCofilteredLimitsOfSize.{w, w, v, u} C]


/-- A split coequalizer diagram consists of morphisms

      f   π
    X ⇉ Y → Z
      g

satisfying `f ≫ π = g ≫ π` together with morphisms

      t   s
    X ← Y ← Z

satisfying `s ≫ π = 𝟙 Z`, `t ≫ g = 𝟙 Y` and `t ≫ f = π ≫ s`.

The name "coequalizer" is appropriate, since any split coequalizer is a coequalizer, see
`CategoryTheory.IsSplitCoequalizer.isCoequalizer`.
Split coequalizers are also absolute, since a functor preserves all the structure above.
-/
structure IsSplitCoequalizer {Z : C} (π : Y ⟶ Z) where
  /-- A map from the coequalizer to `Y` -/
  rightSection : Z ⟶ Y
  /-- A map in the opposite direction to `f` and `g` -/
  leftSection : Y ⟶ X
  /-- Composition of `π` with `f` and with `g` agree -/
  condition : f ≫ π = g ≫ π := by aesop_cat
  /-- `rightSection` splits `π` -/
  rightSection_π : rightSection ≫ π = 𝟙 Z := by aesop_cat
  /-- `leftSection` splits `g` -/
  leftSection_bottom : leftSection ≫ g = 𝟙 Y := by aesop_cat
  /-- `leftSection` composed with `f` is `pi` composed with `rightSection` -/
  leftSection_top : leftSection ≫ f = π ≫ rightSection := by aesop_cat

(self : CategoryTheory.IsSplitCoequalizer f g π)

CategoryTheory.CategoryStruct.comp self.leftSection g = CategoryTheory.CategoryStruct.id Y


/-- Pointwise `Singleton.singleton` bundled as a `Finsupp`. -/
@[simps]
def rangeSingleton (f : ι →₀ α) : ι →₀ Finset α

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


/-- An angle in a non-degenerate right-angled triangle is less than `π / 2`, version subtracting
vectors. -/
theorem angle_sub_lt_pi_div_two_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) (h0 : x ≠ 0) :
    angle x (x - y) < π / 2

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)
(h0 : x ≠ 0)

InnerProductGeometry.angle x (x - y) < π / 2


theorem hom_comp_eq_id (α : X ≅ Y) {f : Y ⟶ X} : α.hom ≫ f = 𝟙 X ↔ f = α.inv

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

CategoryTheory.CategoryStruct.comp α.hom f = CategoryTheory.CategoryStruct.id X ↔ f = α.inv


/--
If `L` preserves the appropriate colimit, then given a colimit cocone for `F ⋙ fst L R : J ⥤ L` and
a cocone for `F ⋙ snd L R : J ⥤ R` we can build a cocone for `F` which will turn out to be a
colimit cocone.
-/
@[simps]
def coconeOfPreserves [PreservesColimit (F ⋙ fst L R) L] {c₁ : Cocone (F ⋙ fst L R)}
    (t₁ : IsColimit c₁) (c₂ : Cocone (F ⋙ snd L R)) : Cocone F

(F : CategoryTheory.Functor J (CategoryTheory.Comma L R))

[CategoryTheory.Limits.PreservesColimit (F.comp (CategoryTheory.Comma.fst L R)) L]

{c₁ : CategoryTheory.Limits.Cocone (F.comp (CategoryTheory.Comma.fst L R))}

(t₁ : CategoryTheory.Limits.IsColimit c₁)

(c₂ : CategoryTheory.Limits.Cocone (F.comp (CategoryTheory.Comma.snd L R)))

(CategoryTheory.Comma.coconeOfPreserves F t₁ c₂).pt.hom =
  (CategoryTheory.Limits.isColimitOfPreserves L t₁).desc (CategoryTheory.Comma.colimitAuxiliaryCocone F c₂)


/-- An associative unital `R`-algebra is a semiring `A` equipped with a map into its center `R → A`.

See the implementation notes in this file for discussion of the details of this definition.
-/
-- Porting note(#5171): unsupported @[nolint has_nonempty_instance]
class Algebra (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] extends SMul R A,
  R →+* A where
  commutes' : ∀ r x, toRingHom r * x = x * toRingHom r
  smul_def' : ∀ r x, r • x = toRingHom r * x

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[self : Algebra R A]
(r : R)
(x : A)


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

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

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

[self : IncidenceGeometry]
(a b : IncidenceGeometry.Point)

a ≠ b → ∃ C, IncidenceGeometry.centerCircle a C ∧ IncidenceGeometry.onCircle b C


/-- A set is a neighborhood of `a` within `(-∞, a]` if and only if it contains an interval `(l, a]`
with `l < a`, provided `a` is not a bottom element. -/
theorem mem_nhdsWithin_Iic_iff_exists_Ioc_subset' {a l' : α} {s : Set α} (hl' : l' < a) :
    s ∈ 𝓝[≤] a ↔ ∃ l ∈ Iio a, Ioc l a ⊆ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a l' : α}
{s : Set α}
(hl' : l' < a)

s ∈ 𝓝[≤] a ↔ ∃ l ∈ Set.Iio a, Set.Ioc l a ⊆ s


/-- If `edist (f n) (f (n+1))` is bounded by `C * 2^-n`, then `f` is a Cauchy sequence. -/
theorem cauchySeq_of_edist_le_geometric_two : CauchySeq f


theorem dite_val {n : Nat} {c : Prop} [Decidable c] {x y : Fin n} :
    (if c then x else y).val = if c then x.val else y.val

↑(if c then x else y) = if c then ↑x else ↑y


theorem differentiableAt_Gamma {s : ℝ} (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℝ Gamma s


theorem lipschitz (h : Isometry f) : LipschitzWith 1 f

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
(h : Isometry f)


theorem ConcaveOn.add (hf : ConcaveOn 𝕜 s f) (hg : ConcaveOn 𝕜 s g) : ConcaveOn 𝕜 s (f + g)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[DistribMulAction 𝕜 β]
{s : Set E}
{f g : E → β}
(hf : ConcaveOn 𝕜 s f)
(hg : ConcaveOn 𝕜 s g)


theorem associator_inv (X Y Z : C) :
    (α_ X Y Z).inv =
      coprod.desc (coprod.inl ≫ coprod.inl) (coprod.desc (coprod.inr ≫ coprod.inl) coprod.inr)

(CategoryTheory.MonoidalCategory.associator X Y Z).inv =
  CategoryTheory.Limits.coprod.desc
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.coprod.inl CategoryTheory.Limits.coprod.inl)
    (CategoryTheory.Limits.coprod.desc
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.coprod.inr CategoryTheory.Limits.coprod.inl)
      CategoryTheory.Limits.coprod.inr)


/-- The product of two finite adèles is a finite adèle. -/
theorem mul {x y : K_hat R K} (hx : x.IsFiniteAdele) (hy : y.IsFiniteAdele) :
    (x * y).IsFiniteAdele

{x y : DedekindDomain.ProdAdicCompletions R K}


@[simp] theorem toNat_ofNat (n : Nat) : toNat ↑n = n


/-- A set `s` is a *sublattice* if `a ⊔ b ∈ s` and `a ⊓ b ∈ s` for all `a ∈ s`, `b ∈ s`.
Note: This is not the preferred way to declare a sublattice. One should instead use `Sublattice`.
TODO: Define `Sublattice`. -/
structure IsSublattice (s : Set α) : Prop where
  supClosed : SupClosed s
  infClosed : InfClosed s

{α : Type u_2}
[Lattice α]
{s : Set α}
(self : IsSublattice s)


theorem map_inf_comap_of_surjective (S T : L.Substructure N) :
    (S.comap f ⊓ T.comap f).map f = S ⊓ T

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

FirstOrder.Language.Substructure.map f
    (FirstOrder.Language.Substructure.comap f S ⊓ FirstOrder.Language.Substructure.comap f T) =
  S ⊓ T


@[simp]
theorem equivAlgHom_coe (f : characterSpace 𝕜 A) : ⇑(equivAlgHom f) = f

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedRing A]
[CompleteSpace A]
[NormedAlgebra 𝕜 A]
(f : ↑(WeakDual.characterSpace 𝕜 A))

⇑(WeakDual.CharacterSpace.equivAlgHom f) = ⇑f


theorem Colorable.chromaticNumber_le {n : ℕ} (hc : G.Colorable n) : G.chromaticNumber ≤ n

{V : Type u}
{G : SimpleGraph V}
{n : ℕ}
(hc : G.Colorable n)


/-- Sum of a multiset of elements in an `IntermediateField` is in the `IntermediateField`. -/
protected theorem multiset_sum_mem (m : Multiset L) : (∀ a ∈ m, a ∈ S) → m.sum ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
(m : Multiset L)


theorem boundedFormula_realize_cast {β : Type*} {n : ℕ} (φ : L.BoundedFormula β n)
    (x : β → ∀ a, M a) (v : Fin n → ∀ a, M a) :
    (φ.Realize (fun i : β => (x i : (u : Filter α).Product M))
        (fun i => (v i : (u : Filter α).Product M))) ↔
      ∀ᶠ a : α in u, φ.Realize (fun i : β => x i a) fun i => v i a

{α : Type u_1}
{M : α → Type u_2}
{u : Ultrafilter α}
{L : FirstOrder.Language}
[(a : α) → L.Structure (M a)]
[∀ (a : α), Nonempty (M a)]
{β : Type u_3}
{n : ℕ}
(φ : L.BoundedFormula β n)
(x : β → (a : α) → M a)
(v : Fin n → (a : α) → M a)

(φ.Realize (fun i => Quotient.mk' (x i)) fun i => Quotient.mk' (v i)) ↔
  ∀ᶠ (a : α) in ↑u, φ.Realize (fun i => x i a) fun i => v i a


@[simp]
theorem braiding_inv_apply {M N : ModuleCat.{u} R} (m : M) (n : N) :
    ((β_ M N).inv : N ⊗ M ⟶ M ⊗ N) (n ⊗ₜ m) = m ⊗ₜ n

{R : Type u}
[CommRing R]
{M N : ModuleCat R}
(m : ↑M)
(n : ↑N)


@[simp]
theorem zero_ne_trop_coe (x : R) : (0 : Tropical (WithTop R)) ≠ trop x


@[symm]
theorem Equiv.symm {l₁ l₂ : Lists α} (h : l₁ ~ l₂) : l₂ ~ l₁

{α : Type u_1}
{l₁ l₂ : Lists α}
(h : l₁ ~ l₂)


theorem Summable.matrix_transpose {f : X → Matrix m n R} (hf : Summable f) :
    Summable fun x => (f x)ᵀ

{X : Type u_1}
{m : Type u_4}
{n : Type u_5}
{R : Type u_8}
[AddCommMonoid R]
[TopologicalSpace R]
{f : X → Matrix m n R}
(hf : Summable f)


@[simp] theorem gcd_mul_left_right (m n : Nat) : gcd n (m * n) = n


theorem Smooth.smoothOn (hf : Smooth I I' f) : SmoothOn I I' f s

{𝕜 : 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'}
{s : Set M}
(hf : Smooth I I' f)


/-- The following statement says that summing over `s`-factored numbers such that
`s` contains `primesBelow N` for large enough `N` gets us arbitrarily close to the sum
over all natural numbers (assuming `f` is summable and `f 0 = 0`; the latter since
`0` is not `s`-factored). -/
lemma norm_tsum_factoredNumbers_sub_tsum_lt (hsum : Summable f) (hf₀ : f 0 = 0) {ε : ℝ}
    (εpos : 0 < ε) :
    ∃ N : ℕ, ∀ s : Finset ℕ, primesBelow N ≤ s →
      ‖(∑' m : ℕ, f m) - ∑' m : factoredNumbers s, f m‖ < ε

{R : Type u_1}
[NormedCommRing R]
[CompleteSpace R]
{f : ℕ → R}
(hsum : Summable f)
(hf₀ : f 0 = 0)
{ε : ℝ}
(εpos : 0 < ε)

∃ N, ∀ (s : Finset ℕ), N.primesBelow ≤ s → ‖∑' (m : ℕ), f m - ∑' (m : ↑(Nat.factoredNumbers s)), f ↑m‖ < ε


theorem condexpInd_ae_eq_condexpIndSMul (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
    (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) :
    condexpInd G hm μ s x =ᵐ[μ] condexpIndSMul hm hs hμs x

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[NormedSpace ℝ G]
(hm : m ≤ m0)
[MeasureTheory.SigmaFinite (μ.trim hm)]
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(x : G)

↑↑((MeasureTheory.condexpInd G hm μ s) x) =ᵐ[μ] ↑↑(MeasureTheory.condexpIndSMul hm hs hμs x)


theorem isBigO_comp_rev {α : Type*} (f : α → E) (l : Filter α) : f =O[l] fun x' => e (f x')

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


/-- `ZFSet.toSet` as an equivalence. -/
@[simps apply_coe]
noncomputable def toSet_equiv : ZFSet.{u} ≃ {s : Set ZFSet.{u} // Small.{u, u+1} s}


lemma Continuous.sup' (hf : Continuous f) (hg : Continuous g) : Continuous (f ⊔ g)

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
[Sup L]
[ContinuousSup L]
{f g : X → L}
(hf : Continuous f)
(hg : Continuous g)


/-- If `f` is a conservative map and `s` is a measurable set of nonzero measure, then
for an arbitrarily large `m` a positive measure of points `x ∈ s` returns back to `s`
after `m` iterations of `f`. -/
theorem exists_gt_measure_inter_ne_zero (hf : Conservative f μ) (hs : NullMeasurableSet s μ)
    (h0 : μ s ≠ 0) (N : ℕ) : ∃ m > N, μ (s ∩ f^[m] ⁻¹' s) ≠ 0

(hs : MeasureTheory.NullMeasurableSet s μ)


/-- Convenience constructor for an isomorphism in monomorphisms over `X`. -/
@[simps]
def isoMk {f g : MonoOver X} (h : f.obj.left ≅ g.obj.left)
    (w : h.hom ≫ g.arrow = f.arrow := by aesop_cat) : f ≅ g

(w : CategoryTheory.CategoryStruct.comp h.hom g.arrow = f.arrow := by aesop_cat)

(CategoryTheory.MonoOver.isoMk h w).inv = CategoryTheory.MonoOver.homMk h.inv ⋯


/-- The isomorphism between left lifts induced by a left unitor. -/
@[simps! hom_right inv_right]
def whiskerOfIdCompIsoSelf (t : LeftLift f g) : (t.whisker (𝟙 c)).ofIdComp ≅ t

(t : CategoryTheory.Bicategory.LeftLift f g)

t.whiskerOfIdCompIsoSelf.hom.right = (CategoryTheory.Bicategory.leftUnitor t.lift).hom


@[simp]
theorem leadingCoeff_mul_X {p : R[X]} : leadingCoeff (p * X) = leadingCoeff p

(p * Polynomial.X).leadingCoeff = p.leadingCoeff


@[simp]
theorem sInf_coe (S : Set (LieSubalgebra R L)) : (↑(sInf S) : Set L) = ⋂ s ∈ S, (s : Set L)

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(S : Set (LieSubalgebra R L))


@[simp]
theorem algebraMap_eq : algebraMap R (MvPolynomial σ R) = C

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

algebraMap R (MvPolynomial σ R) = MvPolynomial.C


@[simp]
theorem interior_iInter₂_lt_nat {n : ℕ} (f : ℕ → Set X) :
    interior (⋂ m < n, f m) = ⋂ m < n, interior (f m)

{X : Type u}
[TopologicalSpace X]
{n : ℕ}
(f : ℕ → Set X)

interior (⋂ m, ⋂ (_ : m < n), f m) = ⋂ m, ⋂ (_ : m < n), interior (f m)


lemma prod_ne_zero (h : (0 : α) ∉ s) : s.prod ≠ 0

{α : Type u_2}
[CommMonoidWithZero α]
[NoZeroDivisors α]
[Nontrivial α]
{s : Multiset α}
(h : 0 ∉ s)


@[simp]
theorem get_inits : ∀ (n : ℕ) (s : Stream' α), get (inits s) n = take (succ n) s


/-- A category is an `InitialMonoClass` if the canonical morphism of an initial object is a
monomorphism.  In practice, this is most useful when given an arbitrary morphism out of the chosen
initial object, see `initial.mono_from`.
Given a terminal object, this is equivalent to the assumption that the unique morphism from initial
to terminal is a monomorphism, which is the second of Freyd's axioms for an AT category.

TODO: This is a condition satisfied by categories with zero objects and morphisms.
-/
class InitialMonoClass (C : Type u₁) [Category.{v₁} C] : Prop where
  /-- The map from the (any as stated) initial object to any other object is a
    monomorphism -/
  isInitial_mono_from : ∀ {I} (X : C) (hI : IsInitial I), Mono (hI.to X)

[self : CategoryTheory.Limits.InitialMonoClass C]

(hI : CategoryTheory.Limits.IsInitial I)


theorem mono_iff_mono_right [HasPullbacks A] [PreservesLimitsOfShape WalkingCospan G]
    {Y Z : StructuredArrow X G} (f : Y ⟶ Z) : Mono f ↔ Mono f.right

{Y Z : CategoryTheory.StructuredArrow X G}

CategoryTheory.Mono f ↔ CategoryTheory.Mono f.right


@[simp]
lemma prodMk_snd {a : C} (x : F.obj a) (y : G.obj a) :
    (Limits.prod.snd (X := F)).app a (prodMk x y) = y

{F G : CategoryTheory.Functor C (Type w)}

CategoryTheory.Limits.prod.snd.app a (CategoryTheory.FunctorToTypes.prodMk x y) = y


@[simp]
theorem decode_inr (s : Sym α n.succ) : decode (Sum.inr s) = s.map Embedding.some

{α : Type u_1}
{n : ℕ}
(s : Sym α n.succ)

SymOptionSuccEquiv.decode (Sum.inr s) = Sym.map (⇑Function.Embedding.some) s


theorem HasDerivAtFilter.comp_of_eq (hh₂ : HasDerivAtFilter h₂ h₂' y L')
    (hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') (hy : y = h x) :
    HasDerivAtFilter (h₂ ∘ h) (h₂' * h') x L

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)
{L : Filter 𝕜}
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{h : 𝕜 → 𝕜'}
{h₂ : 𝕜' → 𝕜'}
{h' h₂' : 𝕜'}
{L' : Filter 𝕜'}
{y : 𝕜'}
(hh₂ : HasDerivAtFilter h₂ h₂' y L')
(hh : HasDerivAtFilter h h' x L)
(hL : Filter.Tendsto h L L')
(hy : y = h x)


theorem get_eq_get (v : Vector α n) (i : Fin n) :
    v.get i = v.toList.get (Fin.cast v.toList_length.symm i)

{n : ℕ}
{α : Type u_1}
(v : Mathlib.Vector α n)
(i : Fin n)


@[simp] lemma mem_powersetCard : s ∈ powersetCard n t ↔ s ⊆ t ∧ card s = n

s ∈ Finset.powersetCard n t ↔ s ⊆ t ∧ s.card = n


theorem map_inter [DecidableEq α] [DecidableEq β] {f : α ↪ β} (s₁ s₂ : Finset α) :
    (s₁ ∩ s₂).map f = s₁.map f ∩ s₂.map f

{α : Type u_1}
{β : Type u_2}
[DecidableEq α]
[DecidableEq β]
{f : α ↪ β}
(s₁ s₂ : Finset α)

Finset.map f (s₁ ∩ s₂) = Finset.map f s₁ ∩ Finset.map f s₂


@[simp]
theorem ord.orderEmbedding_coe : (ord.orderEmbedding : Cardinal → Ordinal) = ord


/-- We can also define permutation matrices by permuting the rows of the identity matrix. -/
theorem equiv_toPEquiv_toMatrix [DecidableEq n] [Zero α] [One α] (σ : Equiv n n) (i j : n) :
    σ.toPEquiv.toMatrix i j = (1 : Matrix n n α) (σ i) j

{n : Type u_4}
{α : Type v}
[DecidableEq n]
[Zero α]
[One α]
(σ : n ≃ n)
(i j : n)


/-- Shows that `|v - Aₙ / Bₙ| ≤ 1 / (Bₙ * Bₙ₊₁)`. -/
theorem abs_sub_convs_le (not_terminatedAt_n : ¬(of v).TerminatedAt n) :
    |v - (of v).convs n| ≤ 1 / ((of v).dens n * ((of v).dens <| n + 1))

(not_terminatedAt_n : ¬(GenContFract.of v).TerminatedAt n)

|v - (GenContFract.of v).convs n| ≤ 1 / ((GenContFract.of v).dens n * (GenContFract.of v).dens (n + 1))


theorem ContMDiffWithinAt.clm_apply {g : M → F₁ →L[𝕜] F₂} {f : M → F₁} {s : Set M} {x : M}
    (hg : ContMDiffWithinAt I 𝓘(𝕜, F₁ →L[𝕜] F₂) n g s x)
    (hf : ContMDiffWithinAt I 𝓘(𝕜, F₁) n f s x) :
    ContMDiffWithinAt I 𝓘(𝕜, F₂) n (fun x => g x (f x)) s x

ContMDiffWithinAt I 𝓘(𝕜, F₂) n (fun x => (g x) (f x)) s x


@[simp] theorem addString_byteIdx (p : Pos) (s : String) :
    (p + s).byteIdx = p.byteIdx + s.utf8ByteSize


theorem hasStrictFDerivAt_exp_smul_const (x : 𝔸) (t : 𝕊) :
    HasStrictFDerivAt (fun u : 𝕊 => exp 𝕂 (u • x))
      (exp 𝕂 (t • x) • (1 : 𝕊 →L[𝕂] 𝕊).smulRight x) t

(𝕂 : Type u_1)
{𝕊 : Type u_2}
{𝔸 : Type u_3}
[RCLike 𝕂]
[NormedCommRing 𝕊]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝕊]
[NormedAlgebra 𝕂 𝔸]
[Algebra 𝕊 𝔸]
[ContinuousSMul 𝕊 𝔸]
[IsScalarTower 𝕂 𝕊 𝔸]
[CompleteSpace 𝔸]
(x : 𝔸)
(t : 𝕊)

HasStrictFDerivAt (fun u => NormedSpace.exp 𝕂 (u • x)) (NormedSpace.exp 𝕂 (t • x) • ContinuousLinearMap.smulRight 1 x) t


theorem functorPullback_inter (S R : Sieve (F.obj X)) :
    (S ⊓ R).functorPullback F = S.functorPullback F ⊓ R.functorPullback F

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
{X : C}
(S R : CategoryTheory.Sieve (F.obj X))

CategoryTheory.Sieve.functorPullback F (S ⊓ R) =
  CategoryTheory.Sieve.functorPullback F S ⊓ CategoryTheory.Sieve.functorPullback F R


lemma exp_sub_sum_range_succ_isLittleO_pow (n : ℕ) :
    (fun x ↦ exp x - ∑ i ∈ Finset.range (n + 1), x ^ i / i !) =o[𝓝 0] (· ^ n)

(fun x => Real.exp x - ∑ i ∈ Finset.range (n + 1), x ^ i / ↑i !) =o[𝓝 0] fun x => x ^ n


/-- Mapping a family of vectors along an `AlgEquiv` preserves the discriminant. -/
theorem discr_eq_discr_of_algEquiv [Fintype ι] (b : ι → B) (f : B ≃ₐ[A] C) :
    Algebra.discr A b = Algebra.discr A (f ∘ b)

{A : Type u}
{B : Type v}
{C : Type z}
{ι : Type w}
[DecidableEq ι]
[CommRing A]
[CommRing B]
[Algebra A B]
[CommRing C]
[Algebra A C]
[Fintype ι]
(b : ι → B)
(f : B ≃ₐ[A] C)

Algebra.discr A b = Algebra.discr A (⇑f ∘ b)


/-- A natural isomorphism `R₁ ≅ R₂` induces an equivalence of categories
    `Comma L R₁ ≌ Comma L R₂`. -/
@[simps!]
def mapRightIso (i : R₁ ≅ R₂) : Comma L R₁ ≌ Comma L R₂

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
{R₁ R₂ : CategoryTheory.Functor B T}
(i : R₁ ≅ R₂)

∀ {X Y : CategoryTheory.Comma L R₂} (f : X ⟶ Y), ((CategoryTheory.Comma.mapRightIso L i).inverse.map f).left = f.left


/-- In a paracompact space, every open covering of a closed set admits a locally finite refinement
indexed by the same type. -/
theorem precise_refinement_set [ParacompactSpace X] {s : Set X} (hs : IsClosed s) (u : ι → Set X)
    (uo : ∀ i, IsOpen (u i)) (us : s ⊆ ⋃ i, u i) :
    ∃ v : ι → Set X, (∀ i, IsOpen (v i)) ∧ (s ⊆ ⋃ i, v i) ∧ LocallyFinite v ∧ ∀ i, v i ⊆ u i

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

∃ v, (∀ (i : ι), IsOpen (v i)) ∧ s ⊆ ⋃ i, v i ∧ LocallyFinite v ∧ ∀ (i : ι), v i ⊆ u i


@[to_additive (attr := simp)]
theorem div_bot : f / ⊥ = ⊥


lemma one_half_lt_eulerMascheroniSeq_six : 1 / 2 < eulerMascheroniSeq 6


/-- If a function is defined piecewise in terms of functions which are continuous on their
respective pieces, then it is measurable. -/
theorem ContinuousOn.measurable_piecewise {f g : α → γ} {s : Set α} [∀ j : α, Decidable (j ∈ s)]
    (hf : ContinuousOn f s) (hg : ContinuousOn g sᶜ) (hs : MeasurableSet s) :
    Measurable (s.piecewise f g)

{α : Type u_1}
{γ : Type u_3}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[TopologicalSpace γ]
[MeasurableSpace γ]
[BorelSpace γ]
{f g : α → γ}
{s : Set α}
[(j : α) → Decidable (j ∈ s)]
(hf : ContinuousOn f s)
(hg : ContinuousOn g sᶜ)
(hs : MeasurableSet s)


/-- Projecting and then lifting a subobject recovers the original subobject, because there is at
    most one morphism making the projected subobject into a structured arrow. -/
theorem lift_projectSubobject [HasLimits C] [PreservesLimits T] {A : StructuredArrow S T} :
    ∀ (P : Subobject A) {q} (hq : q ≫ T.map (projectSubobject P).arrow = A.hom),
      liftSubobject (projectSubobject P) hq = P

{A : CategoryTheory.StructuredArrow S T}

{q :
  (CategoryTheory.Functor.fromPUnit S).obj A.left ⟶
    T.obj (CategoryTheory.Subobject.underlying.obj (CategoryTheory.StructuredArrow.projectSubobject P))}

(hq : CategoryTheory.CategoryStruct.comp q (T.map (CategoryTheory.StructuredArrow.projectSubobject P).arrow) = A.hom)

CategoryTheory.StructuredArrow.liftSubobject (CategoryTheory.StructuredArrow.projectSubobject P) hq = P


theorem toWithTop_natCast (n : ℕ) {_ : Decidable (n : PartENat).Dom} : toWithTop n = n

∀ {x : Decidable (↑n).Dom}, (↑n).toWithTop = ↑n


@[simp]
theorem liminf_eq_top : f.liminf u = ⊤ ↔ u =ᶠ[f] ⊤

{α : Type u_2}
{β : Type u_3}
[CompleteLinearOrder α]
[TopologicalSpace α]
[FirstCountableTopology α]
[OrderTopology α]
{f : Filter β}
[CountableInterFilter f]
{u : β → α}


private theorem bound :
    ∀ {ε}, ε > 0 → ∃ N : ℕ, ∀ {n}, n ≥ N → ‖F.derivative.eval a‖ * T ^ 2 ^ n < ε

(hnorm : ‖Polynomial.eval a F‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2)

ε > 0 → ∃ N, ∀ {n : ℕ}, n ≥ N → ‖Polynomial.eval a (Polynomial.derivative F)‖ * T_gen p F a ^ 2 ^ n < ε


@[simp, norm_cast]
theorem Fin.coe_covBy_iff {n : ℕ} {a b : Fin n} : (a : ℕ) ⋖ b ↔ a ⋖ b

↑a ⋖ ↑b ↔ a ⋖ b


/-- The open set `imageOfDf f` coincides with the image of `basicOpen f` under the
morphism `C⁺ : Spec R[x] → Spec R`. -/
theorem imageOfDf_eq_comap_C_compl_zeroLocus :
    imageOfDf f = PrimeSpectrum.comap (C : R →+* R[X]) '' (zeroLocus {f})ᶜ

AlgebraicGeometry.Polynomial.imageOfDf f = ⇑(PrimeSpectrum.comap Polynomial.C) '' (PrimeSpectrum.zeroLocus {f})ᶜ


@[to_additive]
theorem ofMulEquivOfLocalizations_eq {k : N ≃* P} :
    (f.ofMulEquivOfLocalizations k).toMap = k.toMonoidHom.comp f.toMap

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{k : N ≃* P}


theorem subset_iInter₂ {s : Set α} {t : ∀ i, κ i → Set α} (h : ∀ i j, s ⊆ t i j) :
    s ⊆ ⋂ (i) (j), t i j

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{s : Set α}
{t : (i : ι) → κ i → Set α}
(h : ∀ (i : ι) (j : κ i), s ⊆ t i j)


theorem isClopen (s : Clopens α) : IsClopen (s : Set α)

{α : Type u_2}
[TopologicalSpace α]
(s : TopologicalSpace.Clopens α)


/-- The functor from differential graded objects to homological complexes.
-/
@[simps]
def dgoToHomologicalComplex :
    DifferentialObject ℤ (GradedObjectWithShift b V) ⥤
      HomologicalComplex V (ComplexShape.up' b)

(X : CategoryTheory.DifferentialObject ℤ (CategoryTheory.GradedObjectWithShift b V))

((HomologicalComplex.dgoToHomologicalComplex b V).obj X).X i = X.obj i


/-- The set in the definition of division is nonempty. -/
theorem div_nonempty {a b : Ordinal} (h : b ≠ 0) : { o | a < b * succ o }.Nonempty


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

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

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


@[to_additive]
theorem le_mul_inv_iff_le : 1 ≤ a * b⁻¹ ↔ b ≤ a

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


theorem mem_dite_empty_left (p : Prop) [Decidable p] (t : ¬p → Set α) (x : α) :
    (x ∈ if h : p then ∅ else t h) ↔ ∃ h : ¬p, x ∈ t h

{α : Type u}
(p : Prop)
[Decidable p]
(t : ¬p → Set α)
(x : α)

(x ∈ if h : p then ∅ else t h) ↔ ∃ (h : ¬p), x ∈ t h


@[to_additive]
theorem isUnit_iff : IsUnit f ↔ ∃ a, f = pure a ∧ IsUnit a

{α : Type u_2}
[SubtractionMonoid α]
{f : Filter α}

IsAddUnit f ↔ ∃ a, f = pure a ∧ IsAddUnit a


@[to_additive]
theorem OrderedCommMonoid.toCovariantClassRight (M : Type*) [OrderedCommMonoid M] :
    CovariantClass M M (swap (· * ·)) (· ≤ ·)

CovariantClass M M (Function.swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1


/-- A presheaf `P` is a sheaf for the Grothendieck topology generated by a pretopology `K`
    iff for every covering presieve `R` of `K`, the natural cone associated to `P` and
    `Sieve.generate R` is a limit cone. -/
theorem isSheaf_iff_isLimit_pretopology [HasPullbacks C] (K : Pretopology C) :
    IsSheaf (K.toGrothendieck C) P ↔
      ∀ ⦃X : C⦄ (R : Presieve X),
        R ∈ K X → Nonempty (IsLimit (P.mapCone (generate R).arrows.cocone.op))

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{A : Type u₂}
[CategoryTheory.Category.{v₂, u₂} A]
(P : CategoryTheory.Functor Cᵒᵖ A)
[CategoryTheory.Limits.HasPullbacks C]
(K : CategoryTheory.Pretopology C)

CategoryTheory.Presheaf.IsSheaf (CategoryTheory.Pretopology.toGrothendieck C K) P ↔
  ∀ ⦃X : C⦄,
    ∀ R ∈ K.coverings X,
      Nonempty (CategoryTheory.Limits.IsLimit (P.mapCone (CategoryTheory.Sieve.generate R).arrows.cocone.op))


theorem Preimage.isSubfield {K : Type*} [Field K] (f : F →+* K) {s : Set K} (hs : IsSubfield s) :
    IsSubfield (f ⁻¹' s)

{F : Type u_1}
[Field F]
{K : Type u_2}
[Field K]
(f : F →+* K)
{s : Set K}
(hs : IsSubfield s)


theorem inner_rightAngleRotation_self (x : E) : ⟪J x, x⟫ = 0

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


/-- General fencing theorem for continuous functions with an estimate on the derivative.
Let `f` and `B` be continuous functions on `[a, b]` such that

* `f a ≤ B a`;
* `B` has derivative `B'` everywhere on `ℝ`;
* for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)`
  is bounded above by a function `f'`;
* we have `f' x < B' x` whenever `f x = B x`.

Then `f x ≤ B x` everywhere on `[a, b]`. -/
theorem image_le_of_liminf_slope_right_lt_deriv_boundary {f f' : ℝ → ℝ} {a b : ℝ}
    (hf : ContinuousOn f (Icc a b))
    -- `hf'` actually says `liminf (f z - f x) / (z - x) ≤ f' x`
    (hf' : ∀ x ∈ Ico a b, ∀ r, f' x < r → ∃ᶠ z in 𝓝[>] x, slope f x z < r)
    {B B' : ℝ → ℝ} (ha : f a ≤ B a) (hB : ∀ x, HasDerivAt B (B' x) x)
    (bound : ∀ x ∈ Ico a b, f x = B x → f' x < B' x) : ∀ ⦃x⦄, x ∈ Icc a b → f x ≤ B x

(hf' : ∀ x ∈ Set.Ico a b, ∀ (r : ℝ), f' x < r → ∃ᶠ (z : ℝ) in 𝓝[>] x, slope f x z < r)

(bound : ∀ x ∈ Set.Ico a b, f x = B x → f' x < B' x)


@[simp]
theorem toTensorAlgebra_tprod {n} (x : Fin n → M) :
    TensorPower.toTensorAlgebra (PiTensorProduct.tprod R x) = TensorAlgebra.tprod R M n x

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{n : ℕ}
(x : Fin n → M)

TensorPower.toTensorAlgebra ((PiTensorProduct.tprod R) x) = (TensorAlgebra.tprod R M n) x


@[ext]
lemma ext {A B : Coalgebra F} {f g : A ⟶ B} (w : f.f = g.f := by aesop_cat) : f = g

{A B : CategoryTheory.Endofunctor.Coalgebra F}


theorem _root_.AntitoneOn.congr (h₁ : AntitoneOn f₁ s) (h : s.EqOn f₁ f₂) : AntitoneOn f₂ s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f₁ f₂ : α → β}
[Preorder α]
[Preorder β]
(h₁ : AntitoneOn f₁ s)
(h : Set.EqOn f₁ f₂ s)


theorem Basis.not_basis_of_ssubset (hI : M.Basis I X) (hJI : J ⊂ I) : ¬ M.Basis J X

{α : Type u_1}
{M : Matroid α}
{I J X : Set α}
(hI : M.Basis I X)
(hJI : J ⊂ I)


theorem unbounded_of_isEmpty [IsEmpty α] {r : α → α → Prop} (s : Set α) : Unbounded r s

{α : Type u}
[IsEmpty α]
{r : α → α → Prop}
(s : Set α)


/-- A class of morphisms `W` has the two-out-of-three property if whenever two out
of three maps in `f`, `g`, `f ≫ g` are in `W`, then the third map is also in `W`. -/
class HasTwoOutOfThreeProperty (W : MorphismProperty C)
    extends W.IsStableUnderComposition : Prop where
  of_postcomp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) : W g → W (f ≫ g) → W f
  of_precomp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) : W f → W (f ≫ g) → W g

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

W g → W (CategoryTheory.CategoryStruct.comp f g) → W f


theorem lowerCentralSeries_pi_of_finite [Finite η] (n : ℕ) :
    lowerCentralSeries (∀ i, Gs i) n = Subgroup.pi Set.univ
      fun i => lowerCentralSeries (Gs i) n

{η : Type u_2}
{Gs : η → Type u_3}
[(i : η) → Group (Gs i)]
[Finite η]
(n : ℕ)

lowerCentralSeries ((i : η) → Gs i) n = Subgroup.pi Set.univ fun i => lowerCentralSeries (Gs i) n


@[simp]
theorem neg_eq_self_iff (a : SignType) : -a = a ↔ a = 0


theorem intermediate_value_Ioc {a b : α} (hab : a ≤ b) {f : α → δ} (hf : ContinuousOn f (Icc a b)) :
    Ioc (f a) (f b) ⊆ f '' Ioc a b

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


/-- If `f` and `g` have the same constant term and derivative, then they are equal. -/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
    (hc : constantCoeff R f = constantCoeff R g) : f = g

(hD : (PowerSeries.derivative R) f = (PowerSeries.derivative R) g)

(hc : (PowerSeries.constantCoeff R) f = (PowerSeries.constantCoeff R) g)


theorem mem_top_objs (c : C) : c ∈ (⊤ : Subgroupoid C).objs

{C : Type u}
[CategoryTheory.Groupoid C]
(c : C)


@[simp]
theorem quadraticCharFun_one : quadraticCharFun F 1 = 1

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]


theorem eraseLead_coeff (i : ℕ) :
    f.eraseLead.coeff i = if i = f.natDegree then 0 else f.coeff i

{R : Type u_1}
[Semiring R]
{f : R[X]}
(i : ℕ)


lemma sqrt_succ_le_succ_sqrt (n : ℕ) : sqrt n.succ ≤ n.sqrt.succ


theorem toZNum_succ : ∀ n : Num, n.succ.toZNum = n.toZNum.succ


@[to_additive]
theorem map_div' [DivInvMonoid G] [DivInvMonoid H] [MonoidHomClass F G H]
    (f : F) (hf : ∀ a, f a⁻¹ = (f a)⁻¹) (a b : G) : f (a / b) = f a / f b

{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[DivInvMonoid G]
[DivInvMonoid H]
[MonoidHomClass F G H]
(f : F)
(hf : ∀ (a : G), f a⁻¹ = (f a)⁻¹)
(a b : G)


protected lemma Bornology.IsBounded.bddAbove (hs : IsBounded s) : BddAbove s

{α : Type u_1}
[Bornology α]
{s : Set α}
[Preorder α]
[IsOrderBornology α]
(hs : Bornology.IsBounded s)


@[simp]
theorem comp_map {C D E : Cat} (F : C ⟶ D) (G : D ⟶ E) {X Y : C} (f : X ⟶ Y) :
    (F ≫ G).map f = G.map (F.map f)

{C D E : CategoryTheory.Cat}
(F : C ⟶ D)
(G : D ⟶ E)
{X Y : ↑C}
(f : X ⟶ Y)

(CategoryTheory.CategoryStruct.comp F G).map f = G.map (F.map f)


/-- A product is regular if and only if the factors are. -/
@[to_additive "A sum is add-regular if and only if the summands are."]
theorem isRegular_mul_iff : IsRegular (a * b) ↔ IsRegular a ∧ IsRegular b

{R : Type u_1}
[CommSemigroup R]
{a b : R}


/-- Special case of `map_symmDiff` for boolean algebras. -/
theorem map_symmDiff' (a b : α) : f (a ∆ b) = f a ∆ f b

{F : Type u_1}
{α : Type u_3}
{β : Type u_4}
[BooleanAlgebra α]
[BooleanAlgebra β]
[FunLike F α β]
[BoundedLatticeHomClass F α β]
(f : F)
(a b : α)


@[reassoc (attr := simp)]
theorem limit.post_π (j : J) : limit.post F G ≫ limit.π (F ⋙ G) j = G.map (limit.π F j)

[CategoryTheory.Limits.HasLimit (F ⋙ G)]

CategoryTheory.Limits.limit.post F G ≫ CategoryTheory.Limits.limit.π (F ⋙ G) j =
  G.map (CategoryTheory.Limits.limit.π F j)


@[simp]
theorem functorCategoryMonoidalEquivalence.ε_app :
    (functorCategoryMonoidalEquivalence V G).ε.app PUnit.unit = 𝟙 _

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

(Action.functorCategoryMonoidalEquivalence V G).ε.app PUnit.unit =
  𝟙 ((𝟙_ (CategoryTheory.SingleObj ↑G ⥤ V)).obj PUnit.unit)


theorem contDiffAt_id {x} : ContDiffAt 𝕜 n (id : E → E) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{n : ℕ∞}
{x : E}


theorem mul_apply_antidiagonal [Add G] (f g : k[G]) (x : G) (s : Finset (G × G))
    (hs : ∀ {p : G × G}, p ∈ s ↔ p.1 + p.2 = x) : (f * g) x = ∑ p ∈ s, f p.1 * g p.2


private theorem zero_ne_addChar {i : Pos} {c : Char} : 0 ≠ i + c


@[to_additive]
theorem iIndepFun.indepFun_prod_range_succ {f : ℕ → Ω → β}
    (hf_Indep : iIndepFun (fun _ => m) f κ μ) (hf_meas : ∀ i, Measurable (f i)) (n : ℕ) :
    IndepFun (∏ j ∈ Finset.range n, f j) (f n) κ μ

{f : ℕ → Ω → β}

(hf_Indep : ProbabilityTheory.Kernel.iIndepFun (fun x => m) f κ μ)

ProbabilityTheory.Kernel.IndepFun (∑ j ∈ Finset.range n, f j) (f n) κ μ


theorem Perm.foldl_eq {f : β → α → β} {l₁ l₂ : List α} (rcomm : RightCommutative f) (p : l₁ ~ l₂) :
    ∀ b, foldl f b l₁ = foldl f b l₂

{α : Type u_1}
{β : Type u_2}
{f : β → α → β}
{l₁ l₂ : List α}
(rcomm : RightCommutative f)
(p : l₁.Perm l₂)
(b : β)


@[to_additive (attr := simp)] theorem snd_comp_inr : (snd : M ∗ N →* N).comp inr = .id _

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

AddMonoid.Coprod.snd.comp AddMonoid.Coprod.inr = AddMonoidHom.id N


@[simp]
theorem map_map (g : β → γ) (f : α → β) (l : Language α) : map g (map f l) = map (g ∘ f) l

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(g : β → γ)
(f : α → β)
(l : Language α)

(Language.map g) ((Language.map f) l) = (Language.map (g ∘ f)) l


theorem AntitoneOn.convex_lt (hf : AntitoneOn f s) (hs : Convex 𝕜 s) (r : β) :
    Convex 𝕜 ({ x ∈ s | f x < r })

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set E}
{f : E → β}
(hf : AntitoneOn f s)
(hs : Convex 𝕜 s)
(r : β)


/-- The pointwise maximum of convex functions is convex. -/
theorem ConvexOn.sup (hf : ConvexOn 𝕜 s f) (hg : ConvexOn 𝕜 s g) : ConvexOn 𝕜 s (f ⊔ g)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f g : E → β}
(hf : ConvexOn 𝕜 s f)
(hg : ConvexOn 𝕜 s g)


Ordinal.lift.{u_3, u_4} Ordinal.omega = Ordinal.omega


/-- The right homology data on a short complex equipped with a splitting. -/
@[simps]
noncomputable def rightHomologyData [HasZeroObject C] (s : S.Splitting) :
    RightHomologyData S

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


theorem sdiff_mem_sdiff [SDiff α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
    ma \ mb ∈ a \ b

{α : Type u_1}
[SDiff α]
(a b : Part α)
(ma mb : α)
(ha : ma ∈ a)
(hb : mb ∈ b)


/-- The type of `⨅`-preserving functions from `α` to `β`. -/
structure sInfHom (α β : Type*) [InfSet α] [InfSet β] where
  /-- The underlying function of an `sInfHom`. -/
  toFun : α → β
  /-- The proposition that a `sInfHom` commutes with arbitrary infima/meets -/
  map_sInf' (s : Set α) : toFun (sInf s) = sInf (toFun '' s)

{α : Type u_8}
{β : Type u_9}
[InfSet α]
[InfSet β]
(self : sInfHom α β)
(s : Set α)

self.toFun (sInf s) = sInf (self.toFun '' s)


/-- A subgroup contains the group's 1. -/
@[to_additive "An `AddSubgroup` contains the group's 0."]
protected theorem one_mem : (1 : G) ∈ H

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


/-- An `affineCombination` with sum of weights 1 is in the
`affineSpan` of an indexed family, if the underlying ring is
nontrivial. -/
theorem affineCombination_mem_affineSpan [Nontrivial k] {s : Finset ι} {w : ι → k}
    (h : ∑ i ∈ s, w i = 1) (p : ι → P) :
    s.affineCombination k p w ∈ affineSpan k (Set.range p)

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

(Finset.affineCombination k s p) w ∈ affineSpan k (Set.range p)


theorem map_ne {x y : P₁'} (h : x ≠ y) : f₁ x ≠ f₁ y

{𝕜 : Type u_1}
{V₁' : Type u_4}
{V₂ : Type u_5}
{P₁' : Type u_9}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V₁']
[NormedSpace 𝕜 V₁']
[MetricSpace P₁']
[NormedAddTorsor V₁' P₁']
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(f₁ : P₁' →ᵃⁱ[𝕜] P₂)
{x y : P₁'}
(h : x ≠ y)


/-- Linearly disjoint is symmetric if elements in the module commute. -/
theorem LinearDisjoint.symm_of_commute (H : M.LinearDisjoint N)
    (hc : ∀ (m : M) (n : N), Commute m.1 n.1) : N.LinearDisjoint M

(hc : ∀ (m : ↥M) (n : ↥N), Commute ↑m ↑n)


@[simp] theorem mem_insert_iff {l : List α} : a ∈ l.insert b ↔ a = b ∨ a ∈ l

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a b : α}
{l : List α}


@[to_additive]
theorem isComplement'_top_bot : IsComplement' (⊤ : Subgroup G) ⊥


theorem nullMeasurableSet_toMeasurable : NullMeasurableSet (toMeasurable μ s) μ

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

MeasureTheory.NullMeasurableSet (MeasureTheory.toMeasurable μ s) μ


/-- For every open directed cover of a compact set, there exists a single element of the
cover which itself includes the set. -/
theorem IsCompact.elim_directed_cover {ι : Type v} [hι : Nonempty ι] (hs : IsCompact s)
    (U : ι → Set X) (hUo : ∀ i, IsOpen (U i)) (hsU : s ⊆ ⋃ i, U i) (hdU : Directed (· ⊆ ·) U) :
    ∃ i, s ⊆ U i

(hdU : Directed (fun x x_1 => x ⊆ x_1) U)


/-- Bijection between `MulOpposite` of a subalgebra `S` and its opposite. -/
@[simps!]
def mopAlgEquivOp (S : Subalgebra R A) : Sᵐᵒᵖ ≃ₐ[R] S.op

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

∀ (a : ↥S.op), S.mopAlgEquivOp.symm a = MulOpposite.op (S.addEquivOp.symm a)


theorem ofReal_prod_of_nonneg {α : Type*} {s : Finset α} {f : α → ℝ} (hf : ∀ i, i ∈ s → 0 ≤ f i) :
    ENNReal.ofReal (∏ i ∈ s, f i) = ∏ i ∈ s, ENNReal.ofReal (f i)

{α : Type u_1}
{s : Finset α}
{f : α → ℝ}
(hf : ∀ i ∈ s, 0 ≤ f i)


@[to_additive] lemma oneLePart_eq_one : a⁺ᵐ = 1 ↔ a ≤ 1

{α : Type u_1}
[Lattice α]
[Group α]
{a : α}


@[simp]
theorem neg_one_lt_one : (-1 : SignType) < 1


@[simp, norm_cast]
theorem toReal_nat (n : ℕ) : (n : ℝ≥0∞).toReal = n


@[simp 1100]
theorem derivedSeries_one : derivedSeries G 1 = commutator G


@[to_additive]
theorem measure_preimage_inv (μ : Measure G) [IsInvInvariant μ] (A : Set G) :
    μ (Inv.inv ⁻¹' A) = μ A

{G : Type u_2}
[MeasurableSpace G]
[InvolutiveNeg G]
[MeasurableNeg G]
(μ : MeasureTheory.Measure G)
[μ.IsNegInvariant]
(A : Set G)


lemma exact_iff_of_concreteCategory [S.HasHomology] :
    S.Exact ↔ ∀ (x₂ : (forget₂ C Ab).obj S.X₂) (_ : ((forget₂ C Ab).map S.g) x₂ = 0),
      ∃ (x₁ : (forget₂ C Ab).obj S.X₁), ((forget₂ C Ab).map S.f) x₁ = x₂

S.Exact ↔
  ∀ (x₂ : ↑((CategoryTheory.forget₂ C Ab).obj S.X₂)),
    ((CategoryTheory.forget₂ C Ab).map S.g) x₂ = 0 → ∃ x₁, ((CategoryTheory.forget₂ C Ab).map S.f) x₁ = x₂


theorem Coprime.eq_of_mul_eq_zero {m n : ℕ} (h : m.Coprime n) (hmn : m * n = 0) :
    m = 0 ∧ n = 1 ∨ m = 1 ∧ n = 0


theorem constantCoeff_zero : constantCoeff R 0 = 0


lemma strictAnti_div_right_of_neg {b : EReal} (h : b < 0) (h' : b ≠ ⊥) :
    StrictAnti fun a ↦ a / b


lemma LSeries.abscissaOfAbsConv_le_of_forall_lt_LSeriesSummable {f : ℕ → ℂ} {x : ℝ}
    (h : ∀ y : ℝ, x < y → LSeriesSummable f y) :
    abscissaOfAbsConv f ≤ x

(h : ∀ (y : ℝ), x < y → LSeriesSummable f ↑y)


/-- The multiplicity of `p : ℕ` in `a : ℤ` is finite exactly when `a ≠ 0`. -/
theorem finite_int_prime_iff {a : ℤ} : Finite (p : ℤ) a ↔ a ≠ 0

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{a : ℤ}


/-- Rotating the first vector by `θ` subtracts `θ` from the angle between two vectors. -/
@[simp]
theorem oangle_rotation_left {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) (θ : Real.Angle) :
    o.oangle (o.rotation θ x) y = o.oangle x y - θ

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

o.oangle ((o.rotation θ) x) y = o.oangle x y - θ


/-- If `|discr K| ≤ N` then the Minkowski bound of `K` is less than `boundOfDiscrBdd`. -/
theorem minkowskiBound_lt_boundOfDiscBdd : minkowskiBound K ↑1 < boundOfDiscBdd N

{K : Type u_1}
[Field K]
[NumberField K]
{N : ℕ}
(hK : |NumberField.discr K| ≤ ↑N)

NumberField.mixedEmbedding.minkowskiBound K 1 < ↑(NumberField.hermiteTheorem.boundOfDiscBdd N)


theorem tangentCone_mono (h : s ⊆ t) : tangentConeAt 𝕜 s x ⊆ tangentConeAt 𝕜 t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s t : Set E}
(h : s ⊆ t)


@[simp]
theorem reverse_reverse {v : Vector α n} : v.reverse.reverse = v

{n : ℕ}
{α : Type u_1}
{v : Mathlib.Vector α n}


protected theorem mul_div_assoc' (b : Int) {a c : Int} (h : c ∣ a) :
    (a * b).div c = a.div c * b


theorem nhdsWithin_extend_target_eq {y : M} (hy : y ∈ f.source) :
    𝓝[(f.extend I).target] f.extend I y = 𝓝[range I] f.extend I y

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)
{y : M}
(hy : y ∈ f.source)

𝓝[(f.extend I).target] ↑(f.extend I) y = 𝓝[Set.range ↑I] ↑(f.extend I) y


theorem val_le_one_iff_eq_coe (f : LaurentSeries K) : Valued.v f ≤ (1 : ℤₘ₀) ↔
    ∃ F : PowerSeries K, F = f

(K : Type u_2)
[Field K]
(f : LaurentSeries K)

Valued.v f ≤ 1 ↔ ∃ F, (HahnSeries.ofPowerSeries ℤ K) F = f


lemma map_ofHom (f : X ⟶ Y) (L : C ⥤ D) (hL : W.IsInvertedBy L) [W.ContainsIdentities] :
    (ofHom W f).map L hL = L.map f

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
(W : CategoryTheory.MorphismProperty C)
{X Y : C}
(f : X ⟶ Y)
(L : CategoryTheory.Functor C D)
(hL : W.IsInvertedBy L)
[W.ContainsIdentities]

(CategoryTheory.MorphismProperty.LeftFraction.ofHom W f).map L hL = L.map f


@[simp] lemma powerset_inter (s t : Finset α) : (s ∩ t).powerset = s.powerset ⊼ t.powerset

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