/-- A variant of `tendsto_atTop` that
uses `∃ N, ∀ n > N, ...` rather than `∃ N, ∀ n ≥ N, ...`
-/
theorem tendsto_atTop' [Nonempty β] [SemilatticeSup β] [NoMaxOrder β] {u : β → α} {a : α} :
    Tendsto u atTop (𝓝 a) ↔ ∀ ε > 0, ∃ N, ∀ n > N, dist (u n) a < ε

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[Nonempty β]
[SemilatticeSup β]
[NoMaxOrder β]
{u : β → α}
{a : α}

Filter.Tendsto u Filter.atTop (𝓝 a) ↔ ∀ ε > 0, ∃ N, ∀ n > N, dist (u n) a < ε


/-- Wallis' product formula for `π / 2`. -/
theorem Real.tendsto_prod_pi_div_two :
    Tendsto (fun k => ∏ i ∈ range k, ((2 : ℝ) * i + 2) / (2 * i + 1) * ((2 * i + 2) / (2 * i + 3)))
      atTop (𝓝 (π / 2))

Filter.Tendsto (fun k => ∏ i ∈ Finset.range k, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3))) Filter.atTop
  (𝓝 (π / 2))


theorem closure_preimage_le (f : R →ₙ+* S) (s : Set S) : closure (f ⁻¹' s) ≤ (closure s).comap f

{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
(f : R →ₙ+* S)
(s : Set S)

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


@[to_additive (attr := simp)]
theorem coeSubtype : (SubgroupClass.subtype H : H → G) = ((↑) : H → G)

{G : Type u_1}
[Group G]
{S : Type u_6}
(H : S)
[SetLike S G]
[SubgroupClass S G]


theorem embedding_id : Embedding (@id X)


@[to_additive]
theorem inv_ker_one {f : G → H} (hf : IsGroupHom f) {a b : G} (h : f a = f b) :
    f (a * b⁻¹) = 1

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
[AddGroup H]
{f : G → H}
(hf : IsAddGroupHom f)
{a b : G}
(h : f a = f b)


lemma cfc_add (f g : R → R) (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)
    (hg : ContinuousOn g (spectrum R a) := by cfc_cont_tac) :
    cfc (fun x ↦ f x + g x) a = cfc f a + cfc g a

cfc (fun x => f x + g x) a = cfc f a + cfc g a


theorem Substructure.cg_iff_structure_cg (S : L.Substructure M) : S.CG ↔ Structure.CG L S

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
(S : L.Substructure M)

S.CG ↔ FirstOrder.Language.Structure.CG L ↥S


theorem isometry_map_mkMetric (m : ℝ≥0∞ → ℝ≥0∞) {f : X → Y} (hf : Isometry f)
    (H : Monotone m ∨ Surjective f) : map f (mkMetric m) = restrict (range f) (mkMetric m)

(m : ℝ≥0∞ → ℝ≥0∞)

(H : Monotone m ∨ Function.Surjective f)

(MeasureTheory.OuterMeasure.map f) (MeasureTheory.OuterMeasure.mkMetric m) =
  (MeasureTheory.OuterMeasure.restrict (Set.range f)) (MeasureTheory.OuterMeasure.mkMetric m)


theorem isSeparable_range [TopologicalSpace β] [SeparableSpace α] {f : α → β} (hf : Continuous f) :
    IsSeparable (range f)

{α : Type u}
{β : Type u_1}
[t : TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace.SeparableSpace α]
{f : α → β}
(hf : Continuous f)


@[simp]
protected theorem toFinset_inj : hs.toFinset = ht.toFinset ↔ s = t

{α : Type u}
{s t : Set α}
{hs : s.Finite}
{ht : t.Finite}


theorem eq_zero_iff_forall_dual_eq_zero (x : E) : x = 0 ↔ ∀ g : Dual 𝕜 E, g x = 0

(𝕜 : Type v)
[RCLike 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(x : E)

x = 0 ↔ ∀ (g : NormedSpace.Dual 𝕜 E), g x = 0


@[simp, mfld_simps]
theorem refl_coe : (PartialEquiv.refl α : α → α) = id


@[simp]
theorem factorization_eq_zero_of_non_prime (n : ℕ) {p : ℕ} (hp : ¬p.Prime) :
    n.factorization p = 0


theorem hasFDerivAt_norm_rpow (x : E) {p : ℝ} (hp : 1 < p) :
    HasFDerivAt (fun x : E ↦ ‖x‖ ^ p) ((p * ‖x‖ ^ (p - 2)) • innerSL ℝ x) x

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
(x : E)
{p : ℝ}
(hp : 1 < p)

HasFDerivAt (fun x => ‖x‖ ^ p) ((p * ‖x‖ ^ (p - 2)) • (innerSL ℝ) x) x


@[simp] lemma natDegree_mul_X_pow (hp : p ≠ 0) : natDegree (p * X ^ n) = natDegree p + n

{R : Type u}
[Semiring R]
[Nontrivial R]
{p : R[X]}
(n : ℕ)
(hp : p ≠ 0)

(p * Polynomial.X ^ n).natDegree = p.natDegree + n


/-- The chain complex `s.nondegComplex` attached to a splitting of a simplicial object `X`
becomes isomorphic to the normalized Moore complex `N₁.obj X` defined as a formal direct
factor in the category `Karoubi (ChainComplex C ℕ)`. -/
@[simps]
noncomputable def toKaroubiNondegComplexIsoN₁ :
    (toKaroubi _).obj s.nondegComplex ≅ N₁.obj X

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

s.toKaroubiNondegComplexIsoN₁.inv.f.f n = s.πSummand (SimplicialObject.Splitting.IndexSet.id (Opposite.op [n]))


@[simp]
theorem natSepDegree_zero : (0 : F[X]).natSepDegree = 0


theorem divMonomial_add (a b : σ →₀ ℕ) (x : MvPolynomial σ R) :
    x /ᵐᵒⁿᵒᵐⁱᵃˡ (a + b) = x /ᵐᵒⁿᵒᵐⁱᵃˡ a /ᵐᵒⁿᵒᵐⁱᵃˡ b

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(a b : σ →₀ ℕ)
(x : MvPolynomial σ R)

x.divMonomial (a + b) = (x.divMonomial a).divMonomial b


@[simp]
theorem comp_contLinear (f : P →ᴬ[R] Q) (g : Q →ᴬ[R] Q₂) :
    (g.comp f).contLinear = g.contLinear.comp f.contLinear

{R : Type u_2}
{V : Type u_3}
{W : Type u_4}
{W₂ : Type u_5}
{P : Type u_6}
{Q : Type u_7}
{Q₂ : Type u_8}
[NormedAddCommGroup V]
[MetricSpace P]
[NormedAddTorsor V P]
[NormedAddCommGroup W]
[MetricSpace Q]
[NormedAddTorsor W Q]
[NormedAddCommGroup W₂]
[MetricSpace Q₂]
[NormedAddTorsor W₂ Q₂]
[NormedField R]
[NormedSpace R V]
[NormedSpace R W]
[NormedSpace R W₂]
(f : P →ᴬ[R] Q)
(g : Q →ᴬ[R] Q₂)


theorem nonneg_of_zero_le_restrict (hi₂ : 0 ≤[i] v) : 0 ≤ v i

(hi₂ : MeasureTheory.VectorMeasure.restrict 0 i ≤ v.restrict i)


/-- We say that `P : AffineTargetMorphismProperty` is a local property if
1. `P` respects isomorphisms.
2. If `P` holds for `f : X ⟶ Y`, then `P` holds for `f ∣_ Y.basicOpen r` for any
  global section `r`.
3. If `P` holds for `f ∣_ Y.basicOpen r` for all `r` in a spanning set of the global sections,
  then `P` holds for `f`.
-/
class IsLocal (P : AffineTargetMorphismProperty) : Prop where
  /-- `P` as a morphism property respects isomorphisms -/
  respectsIso : P.toProperty.RespectsIso
  /-- `P` is stable under restriction to basic open set of global sections. -/
  to_basicOpen :
    ∀ {X Y : Scheme} [IsAffine Y] (f : X ⟶ Y) (r : Γ(Y, ⊤)), P f → P (f ∣_ Y.basicOpen r)
  /-- `P` for `f` if `P` holds for `f` restricted to basic sets of a spanning set of the global
    sections -/
  of_basicOpenCover :
    ∀ {X Y : Scheme} [IsAffine Y] (f : X ⟶ Y) (s : Finset Γ(Y, ⊤))
      (_ : Ideal.span (s : Set Γ(Y, ⊤)) = ⊤), (∀ r : s, P (f ∣_ Y.basicOpen r.1)) → P f

(s : Finset ↑(Y.presheaf.obj (Opposite.op ⊤)))

Ideal.span ↑s = ⊤ → (∀ (r : { x // x ∈ s }), P (f ∣_ Y.basicOpen ↑r)) → P f


theorem Nondegenerate.congr {B : BilinForm R M} (e : M ≃ₗ[R] M') (h : B.Nondegenerate) :
    (congr e B).Nondegenerate

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type u_9}
[AddCommMonoid M']
[Module R M']
{B : LinearMap.BilinForm R M}
(e : M ≃ₗ[R] M')
(h : B.Nondegenerate)


@[simp]
lemma span_weight_isNonZero_eq_top :
    span K ({α : Weight K H L | α.IsNonZero}.image (Weight.toLinear K H L)) = ⊤

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

Submodule.span K (LieModule.Weight.toLinear K (↥H) L '' {α | α.IsNonZero}) = ⊤


theorem IsNat.to_eq {α : Type u} [AddMonoidWithOne α] {n} : {a a' : α} → IsNat a n → n = a' → a = a'

{α : Type u}
[AddMonoidWithOne α]
{n : ℕ}
{a a' : α}

Mathlib.Meta.NormNum.IsNat a n → ↑n = a' → a = a'


theorem congr_fun (h : B = D) (x y : M) : B x y = D x y

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B D : LinearMap.BilinForm R M}
(h : B = D)
(x y : M)


theorem derivFamily_fp {i} (H : IsNormal (f i)) (o : Ordinal.{max u v}) :
    f i (derivFamily.{u, v} f o) = derivFamily.{u, v} f o

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

f i (Ordinal.derivFamily f o) = Ordinal.derivFamily f o


/-- Unweighted mean inequality, version for two elements of `ℝ≥0` and real exponents. -/
theorem rpow_add_le_mul_rpow_add_rpow (z₁ z₂ : ℝ≥0) {p : ℝ} (hp : 1 ≤ p) :
    (z₁ + z₂) ^ p ≤ (2 : ℝ≥0) ^ (p - 1) * (z₁ ^ p + z₂ ^ p)


theorem isLittleO_const_smul_left {c : 𝕜} (hc : c ≠ 0) :
    (fun x => c • f' x) =o[l] g ↔ f' =o[l] g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
{𝕜 : Type u_15}
[Norm F]
[SeminormedAddCommGroup E']
[NormedDivisionRing 𝕜]
{g : α → F}
{f' : α → E'}
{l : Filter α}
[Module 𝕜 E']
[BoundedSMul 𝕜 E']
{c : 𝕜}
(hc : c ≠ 0)


private theorem neg_le_lf_neg_iff : ∀ {x y : PGame.{u}}, (-y ≤ -x ↔ x ≤ y) ∧ (-y ⧏ -x ↔ x ⧏ y)

(-y ≤ -x ↔ x ≤ y) ∧ ((-y).LF (-x) ↔ x.LF y)


@[simp] theorem pop_push (a : Array α) : (a.push x).pop = a


theorem binary_relation_sInf_iff {α β : Type*} (s : Set (α → β → Prop)) {a : α} {b : β} :
    sInf s a b ↔ ∀ r : α → β → Prop, r ∈ s → r a b

{α : Type u_9}
{β : Type u_10}
(s : Set (α → β → Prop))
{a : α}
{b : β}


lemma isomorphic_distinguished (T₁ : Triangle Cᵒᵖ)
    (hT₁ : T₁ ∈ distinguishedTriangles C) (T₂ : Triangle Cᵒᵖ) (e : T₂ ≅ T₁) :
    T₂ ∈ distinguishedTriangles C

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

(T₁ : CategoryTheory.Pretriangulated.Triangle Cᵒᵖ)

(hT₁ : T₁ ∈ CategoryTheory.Pretriangulated.Opposite.distinguishedTriangles C)

(T₂ : CategoryTheory.Pretriangulated.Triangle Cᵒᵖ)

T₂ ∈ CategoryTheory.Pretriangulated.Opposite.distinguishedTriangles C


@[norm_cast]
theorem norm_cast_real (m : ℤ) : ‖(m : ℝ)‖ = ‖m‖


theorem eq_iSup_inf_genEigenspace [FiniteDimensional K V]
    (h : ∀ x ∈ p, f x ∈ p) (h' : ⨆ μ, ⨆ k, f.genEigenspace μ k = ⊤) :
    p = ⨆ μ, ⨆ k, p ⊓ f.genEigenspace μ k

(h' : ⨆ μ, ⨆ k, (f.genEigenspace μ) k = ⊤)


/-- A measurable equivalence is a measurable embedding. -/
protected theorem measurableEmbedding (e : α ≃ᵐ β) : MeasurableEmbedding e

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(e : α ≃ᵐ β)


protected theorem mul_le_mul_of_nonpos_left {a b c : Int}
    (ha : a ≤ 0) (h : c ≤ b) : a * b ≤ a * c


theorem range_eq_top [RingHomSurjective τ₁₂] {f : F} : range f = ⊤ ↔ Surjective f

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_6}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_11}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
[RingHomSurjective τ₁₂]
{f : F}

LinearMap.range f = ⊤ ↔ Function.Surjective ⇑f


@[reassoc]
theorem equalizerSubobject_arrow_comp :
    (equalizerSubobject f g).arrow ≫ f = (equalizerSubobject f g).arrow ≫ g

(CategoryTheory.Limits.equalizerSubobject f g).arrow ≫ f = (CategoryTheory.Limits.equalizerSubobject f g).arrow ≫ g


@[simp]
theorem foldl_reverse (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) (x : CliffordAlgebra Q) :
    foldl Q f hf n (reverse x) = foldr Q f hf n x

((CliffordAlgebra.foldl Q f hf) n) (CliffordAlgebra.reverse x) = ((CliffordAlgebra.foldr Q f hf) n) x


theorem sum_le_iSup {ι : Type u} (f : ι → Cardinal.{u}) : sum f ≤ #ι * iSup f


@[ext] theorem Proj.ext (h : s.1 = t.1) : s = t

{V : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ}

(s t : ↑((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).val.obj V))


@[simp]
theorem comp_codRestrict (f : M →[L] N) (g : N →[L] P) (p : L.Substructure P) (h : ∀ b, g b ∈ p) :
    ((codRestrict p g h).comp f : M →[L] p) = codRestrict p (g.comp f) fun _ => h _

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
{P : Type u_2}
[L.Structure M]
[L.Structure N]
[L.Structure P]
(f : L.Hom M N)
(g : L.Hom N P)
(p : L.Substructure P)
(h : ∀ (b : N), g b ∈ p)

(FirstOrder.Language.Hom.codRestrict p g h).comp f = FirstOrder.Language.Hom.codRestrict p (g.comp f) ⋯


theorem MDifferentiableAt.const_smul (hf : MDifferentiableAt I 𝓘(𝕜, E') f z) (s : 𝕜) :
    MDifferentiableAt I 𝓘(𝕜, E') (s • f) z

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{z : M}
{f : M → E'}
(hf : MDifferentiableAt I 𝓘(𝕜, E') f z)
(s : 𝕜)


@[to_additive]
theorem lt_or_le_of_mul_le_mul [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] {a₁ a₂ b₁ b₂ : α} :
    a₁ * b₁ ≤ a₂ * b₂ → a₁ < a₂ ∨ b₁ ≤ b₂

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

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

a₁ * b₁ ≤ a₂ * b₂ → a₁ < a₂ ∨ b₁ ≤ b₂


theorem withDensity_add_left (κ η : Kernel α β) [IsSFiniteKernel κ] [IsSFiniteKernel η]
    (f : α → β → ℝ≥0∞) : withDensity (κ + η) f = withDensity κ f + withDensity η f

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(κ η : ProbabilityTheory.Kernel α β)
[ProbabilityTheory.IsSFiniteKernel κ]
[ProbabilityTheory.IsSFiniteKernel η]
(f : α → β → ℝ≥0∞)

(κ + η).withDensity f = κ.withDensity f + η.withDensity f


@[to_additive]
theorem prod_set_coe (s : Set α) [Fintype s] : (∏ i : s, f i) = ∏ i ∈ s.toFinset, f i

{α : Type u_3}
{β : Type u_4}
{f : α → β}
[AddCommMonoid β]
(s : Set α)
[Fintype ↑s]


theorem coe_mono : Monotone (fun (a : α) => (a : WithBot α))


/-- Isomorphism obtained by separating the term of index `none` of a direct sum over `Option ι`. -/
@[simps!]
noncomputable def addEquivProdDirectSum : (⨁ i, α i) ≃+ α none × ⨁ i, α (some i)

(f : (fun i => α i) none × Π₀ (i : ι), (fun i => α i) (some i))

(DirectSum.addEquivProdDirectSum.symm f) i =
  match i with
  | none => f.1
  | some val => f.2 val


theorem countable_biInf_eq_iInf_seq' [CompleteLattice α] {B : Set ι} (Bcbl : B.Countable)
    (f : ι → α) {i₀ : ι} (h : f i₀ = ⊤) : ∃ x : ℕ → ι, ⨅ t ∈ B, f t = ⨅ i, f (x i)

{α : Type u_1}
{ι : Type u_4}
[CompleteLattice α]
{B : Set ι}
(Bcbl : B.Countable)
(f : ι → α)
{i₀ : ι}
(h : f i₀ = ⊤)


@[simp]
theorem dot_eq_zero_of_left_eq_zero {xs ys : IntList} (h : ∀ x, x ∈ xs → x = 0) : dot xs ys = 0

{xs ys : Lean.Omega.IntList}
(h : ∀ (x : Int), x ∈ xs → x = 0)


@[simp]
theorem powersetCard_zero_left (s : Multiset α) : powersetCard 0 s = {0}


/-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_lt_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b < a) : ∀ b ∈ s, b < a

(hst : { ofColex := s } ≤ { ofColex := t })


@[instance]
theorem ordConnected_image {E : Type*} [EquivLike E α β] [OrderIsoClass E α β] (e : E) {s : Set α}
    [hs : OrdConnected s] : OrdConnected (e '' s)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{E : Type u_3}
[EquivLike E α β]
[OrderIsoClass E α β]
(e : E)
{s : Set α}
[hs : s.OrdConnected]


@[simp, mfld_simps]
theorem restr_coe_symm (s : Set α) : ((e.restr s).symm : β → α) = e.symm

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
(s : Set α)


@[reassoc]
theorem associator_inv_naturality_left {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c) (h : c ⟶ d) :
    η ▷ (g ≫ h) ≫ (α_ f' g h).inv = (α_ f g h).inv ≫ η ▷ g ▷ h

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight η (CategoryTheory.CategoryStruct.comp g h))
    (CategoryTheory.Bicategory.associator f' g h).inv =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator f g h).inv
    (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.whiskerRight η g) h)


/-- A subset of a concyclic set is concyclic. -/
theorem Concyclic.subset {ps₁ ps₂ : Set P} (hs : ps₁ ⊆ ps₂) (h : Concyclic ps₂) : Concyclic ps₁

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{ps₁ ps₂ : Set P}
(hs : ps₁ ⊆ ps₂)
(h : EuclideanGeometry.Concyclic ps₂)


/-- `seminormFromBounded' f` preserves `0`. -/
theorem seminormFromBounded_zero (f_zero : f 0 = 0) : seminormFromBounded' f (0 : R) = 0

{R : Type u_1}
[CommRing R]
{f : R → ℝ}
(f_zero : f 0 = 0)


@[to_additive] private theorem toIsLeftCancelMul [UniqueProds G] : IsLeftCancelMul G


@[simp]
theorem Submodule.finrank_eq_zero [StrongRankCondition R] [NoZeroSMulDivisors R M]
    {S : Submodule R M} [Module.Finite R S] :
    finrank R S = 0 ↔ S = ⊥

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
[StrongRankCondition R]
[NoZeroSMulDivisors R M]
{S : Submodule R M}
[Module.Finite R ↥S]

FiniteDimensional.finrank R ↥S = 0 ↔ S = ⊥


/-- A set of points is collinear if and only if they can all be
expressed as multiples of the same vector, added to the same base
point. -/
theorem collinear_iff_exists_forall_eq_smul_vadd (s : Set P) :
    Collinear k s ↔ ∃ (p₀ : P) (v : V), ∀ p ∈ s, ∃ r : k, p = r • v +ᵥ p₀

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(s : Set P)

Collinear k s ↔ ∃ p₀ v, ∀ p ∈ s, ∃ r, p = r • v +ᵥ p₀


@[to_additive]
theorem nhds_one_symm : comap Inv.inv (𝓝 (1 : G)) = 𝓝 (1 : G)

(G : Type w)
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]


theorem Subpresheaf.family_of_elements_compatible {U : Cᵒᵖ} (s : F.obj U) :
    (G.familyOfElementsOfSection s).Compatible

(G : CategoryTheory.GrothendieckTopology.Subpresheaf F)


@[simp, norm_cast]
theorem coe_neg (f : CauSeq β abv) : ⇑(-f) = -f

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


/--
Given a functor `F` and a collection of colimit cocones for each diagram `X ↦ F X k`, we can stitch
them together to give a cocone for the diagram `F`.
`combinedIsColimit` shows that the new cocone is colimiting, and `evalCombined` shows it is
(essentially) made up of the original cocones.
-/
@[simps]
def combineCocones (F : J ⥤ K ⥤ C) (c : ∀ k : K, ColimitCocone (F.flip.obj k)) : Cocone F

(c : (k : K) → CategoryTheory.Limits.ColimitCocone (F.flip.obj k))

(CategoryTheory.Limits.combineCocones F c).pt.obj k = (c k).cocone.pt


/-- Product of elements of a subsemiring of a `CommSemiring` indexed by a `Finset` is in the
    subsemiring. -/
protected theorem prod_mem {R : Type*} [CommSemiring R] (s : Subsemiring R) {ι : Type*}
    {t : Finset ι} {f : ι → R} (h : ∀ c ∈ t, f c ∈ s) : (∏ i ∈ t, f i) ∈ s

{R : Type u_1}
[CommSemiring R]
(s : Subsemiring R)
{ι : Type u_2}
{t : Finset ι}
{f : ι → R}
(h : ∀ c ∈ t, f c ∈ s)


@[to_additive]
lemma mem_orbit_symm {a₁ a₂ : α} : a₁ ∈ orbit G a₂ ↔ a₂ ∈ orbit G a₁

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
{a₁ a₂ : α}

a₁ ∈ AddAction.orbit G a₂ ↔ a₂ ∈ AddAction.orbit G a₁


theorem integral_cexp_neg_mul_sq_norm_add
    (hb : 0 < b.re) (c : ℂ) (w : V) :
    ∫ v : V, cexp (- b * ‖v‖^2 + c * ⟪w, v⟫) =
      (π / b) ^ (FiniteDimensional.finrank ℝ V / 2 : ℂ) * cexp (c ^ 2 * ‖w‖^2 / (4 * b))

{b : ℂ}
{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[FiniteDimensional ℝ V]
[MeasurableSpace V]
[BorelSpace V]
(hb : 0 < b.re)
(c : ℂ)
(w : V)

∫ (v : V), cexp (-b * ↑‖v‖ ^ 2 + c * ↑⟪w, v⟫_ℝ) =
  (↑π / b) ^ (↑(FiniteDimensional.finrank ℝ V) / 2) * cexp (c ^ 2 * ↑‖w‖ ^ 2 / (4 * b))


@[simp]
theorem not_supIrred : ¬SupIrred a ↔ IsMin a ∨ ∃ b c, b ⊔ c = a ∧ b < a ∧ c < a

{α : Type u_2}
[SemilatticeSup α]
{a : α}


theorem Nat.Prime.isPrimePow {p : ℕ} (hp : p.Prime) : IsPrimePow p


theorem neq_of_not_iff : ¬(a ↔ b) → a ≠ b


theorem lt_succ_iff_eq_or_lt_of_not_isMax (hb : ¬IsMax b) : a < succ b ↔ a = b ∨ a < b

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a b : α}
(hb : ¬IsMax b)


theorem roots.le_of_dvd (h : q ≠ 0) : p ∣ q → roots p ≤ roots q

{R : Type u}
[CommRing R]
[IsDomain R]
{p q : Polynomial R}
(h : q ≠ 0)


@[fun_prop]
theorem hasFDerivWithinAt_id (x : E) (s : Set E) : HasFDerivWithinAt id (id 𝕜 E) s x

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

HasFDerivWithinAt id (ContinuousLinearMap.id 𝕜 E) s x


protected theorem StrictMono.ite (hf : StrictMono f) (hg : StrictMono g) {p : α → Prop}
    [DecidablePred p] (hp : ∀ ⦃x y⦄, x < y → p y → p x) (hfg : ∀ x, f x ≤ g x) :
    StrictMono fun x ↦ if p x then f x else g x

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f g : α → β}
(hf : StrictMono f)
(hg : StrictMono g)
{p : α → Prop}
[DecidablePred p]
(hp : ∀ ⦃x y : α⦄, x < y → p y → p x)
(hfg : ∀ (x : α), f x ≤ g x)

StrictMono fun x => if p x then f x else g x


@[to_additive (attr := fun_prop, measurability)]
theorem Measurable.inv (hf : Measurable f) : Measurable fun x => (f x)⁻¹

{G : Type u_2}
{α : Type u_3}
[Neg G]
[MeasurableSpace G]
[MeasurableNeg G]
{m : MeasurableSpace α}
{f : α → G}
(hf : Measurable f)


lemma even_iff_exists_two_mul : Even a ↔ ∃ b, a = 2 * b


/-- If `x` is a root of unity (spelled as `IsOfFinOrder x`) in an `n`-th cyclotomic extension of
`ℚ`, where `n` is odd, and `ζ` is a primitive `n`-th root of unity, then there exist `r`
such that `x = (-ζ)^r`. -/
theorem exists_neg_pow_of_isOfFinOrder [NumberField K] [IsCyclotomicExtension {n} ℚ K]
    (hno : Odd (n : ℕ)) {ζ x : K} (hζ : IsPrimitiveRoot ζ n) (hx : IsOfFinOrder x) :
    ∃ r : ℕ, x = (-ζ) ^ r

{n : ℕ+}
{K : Type u}
[Field K]
[NumberField K]
[IsCyclotomicExtension {n} ℚ K]
(hno : Odd ↑n)
{ζ x : K}
(hζ : IsPrimitiveRoot ζ ↑n)
(hx : IsOfFinOrder x)


theorem inv_kronecker [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing R]
    (A : Matrix m m R) (B : Matrix n n R) : (A ⊗ₖ B)⁻¹ = A⁻¹ ⊗ₖ B⁻¹

{R : Type u_1}
{m : Type u_9}
{n : Type u_10}
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
[CommRing R]
(A : Matrix m m R)
(B : Matrix n n R)

(Matrix.kroneckerMap (fun x x_1 => x * x_1) A B)⁻¹ = Matrix.kroneckerMap (fun x x_1 => x * x_1) A⁻¹ B⁻¹


/-- The bijection `(X ⟶ Y) ≃ ShiftedHom X Y m₀` when `m₀ = 0`. -/
@[simps apply]
noncomputable def homEquiv (m₀ : M) (hm₀ : m₀ = 0) : (X ⟶ Y) ≃ ShiftedHom X Y m₀

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
{M : Type u_4}
[AddMonoid M]
[CategoryTheory.HasShift C M]
{X Y : C}
(m₀ : M)
(hm₀ : m₀ = 0)
(f : X ⟶ Y)

(CategoryTheory.ShiftedHom.homEquiv m₀ hm₀) f = CategoryTheory.ShiftedHom.mk₀ m₀ hm₀ f


@[simp] theorem length_tail (l : List α) : length (tail l) = length l - 1


@[to_additive]
theorem Tendsto.mul_mul [MulHomClass F α β] (m : F) {f₁ g₁ : Filter α} {f₂ g₂ : Filter β} :
    Tendsto m f₁ f₂ → Tendsto m g₁ g₂ → Tendsto m (f₁ * g₁) (f₂ * g₂)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[AddZeroClass α]
[AddZeroClass β]
[FunLike F α β]
[AddHomClass F α β]
(m : F)
{f₁ g₁ : Filter α}
{f₂ g₂ : Filter β}

Filter.Tendsto (⇑m) f₁ f₂ → Filter.Tendsto (⇑m) g₁ g₂ → Filter.Tendsto (⇑m) (f₁ + g₁) (f₂ + g₂)


/-- The **Fermat-Euler totient theorem**. `ZMod.pow_totient` is an alternative statement
  of the same theorem. -/
theorem Nat.ModEq.pow_totient {x n : ℕ} (h : Nat.Coprime x n) : x ^ φ n ≡ 1 [MOD n]


lemma addX_of_X_eq' {P Q : Fin 3 → R} (hP : W'.Equation P) (hQ : W'.Equation Q)
    (hx : P x * Q z ^ 2 = Q x * P z ^ 2) :
    W'.addX P Q * (P z * Q z) ^ 2 = (P y * Q z ^ 3 - Q y * P z ^ 3) ^ 2

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P Q : Fin 3 → R}
(hP : W'.Equation P)
(hQ : W'.Equation Q)
(hx : P x * Q z ^ 2 = Q x * P z ^ 2)


theorem InfinitePos.not_infiniteNeg {x : ℝ*} (hp : InfinitePos x) : ¬InfiniteNeg x


/-- The `p`-adic valuation of `m` equals zero if it is between `p * k` and `p * (k + 1)` for
some `k`. -/
theorem padicValNat_eq_zero_of_mem_Ioo {m k : ℕ}
    (hm : m ∈ Set.Ioo (p * k) (p * (k + 1))) : padicValNat p m = 0


/-- If the action of a countable group `G` admits an invariant measure `μ` with a fundamental domain
`s`, then every null-measurable set `t` such that the sets `g • t ∩ s` are pairwise a.e.-disjoint
has measure at most `μ s`. -/
@[to_additive "If the additive action of a countable group `G` admits an invariant measure `μ` with
  a fundamental domain `s`, then every null-measurable set `t` such that the sets `g +ᵥ t ∩ s` are
  pairwise a.e.-disjoint has measure at most `μ s`."]
theorem measure_le_of_pairwise_disjoint (hs : IsFundamentalDomain G s μ)
    (ht : NullMeasurableSet t μ) (hd : Pairwise (AEDisjoint μ on fun g : G => g • t ∩ s)) :
    μ t ≤ μ s

[MeasureTheory.VAddInvariantMeasure G α μ]

(hs : MeasureTheory.IsAddFundamentalDomain G s μ)

(ht : MeasureTheory.NullMeasurableSet t μ)

(hd : Pairwise (MeasureTheory.AEDisjoint μ on fun g => (g +ᵥ t) ∩ s))


@[simp]
theorem bihimp_right_inj : a ⇔ b = a ⇔ c ↔ b = c

{α : Type u_2}
[BooleanAlgebra α]
{a b c : α}


/-- For nontrivial `𝕜`, if `B` is an exposed subset of `A`, then `B` is the intersection of `A` with
some closed halfspace. The converse is *not* true. It would require that the corresponding open
halfspace doesn't intersect `A`. -/
theorem eq_inter_halfspace [Nontrivial 𝕜] {A B : Set E} (hAB : IsExposed 𝕜 A B) :
    ∃ l : E →L[𝕜] 𝕜, ∃ a, B = { x ∈ A | a ≤ l x }

{𝕜 : Type u_1}
{E : Type u_2}
[TopologicalSpace 𝕜]
[OrderedRing 𝕜]
[AddCommMonoid E]
[TopologicalSpace E]
[Module 𝕜 E]
[Nontrivial 𝕜]
{A B : Set E}
(hAB : IsExposed 𝕜 A B)


theorem Gamma_normal (N : ℕ) : Subgroup.Normal (Gamma N)


/-- The image of the unit ball under a continuous multilinear map is bounded. -/
theorem unit_le_opNorm (h : ‖m‖ ≤ 1) : ‖f m‖ ≤ ‖f‖

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


@[to_additive (attr := simp)] theorem snd_comp_inl : (snd : M ∗ N →* N).comp inl = 1

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

AddMonoid.Coprod.snd.comp AddMonoid.Coprod.inl = 0


/-- Expressing `HasFDerivAt f f' x` in terms of `HasDerivAt` -/
theorem hasFDerivAt_iff_hasDerivAt {f' : 𝕜 →L[𝕜] F} : HasFDerivAt f f' x ↔ HasDerivAt f (f' 1) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{f' : 𝕜 →L[𝕜] F}


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


theorem nhds_top_order [TopologicalSpace α] [Preorder α] [OrderTop α] [OrderTopology α] :
    𝓝 (⊤ : α) = ⨅ (l) (h₂ : l < ⊤), 𝓟 (Ioi l)

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[OrderTop α]
[OrderTopology α]


/-- The unit isomorphism of the auto-equivalence of categories `triangleRotation C` of
`Triangle C` given by the rotation of triangles. -/
@[simps!]
def rotCompInvRot : 𝟭 (Triangle C) ≅ rotate C ⋙ invRotate C

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

(X : CategoryTheory.Pretriangulated.Triangle C)

(CategoryTheory.Pretriangulated.rotCompInvRot.inv.app X).hom₁ =
  (CategoryTheory.shiftFunctorCompIsoId C 1 (-1) ⋯).hom.app X.obj₁


@[simp]
theorem nthRoots_zero_right {R} [CommRing R] [IsDomain R] (n : ℕ) :
    nthRoots n (0 : R) = Multiset.replicate n 0

{R : Type u_1}
[CommRing R]
[IsDomain R]
(n : ℕ)

Polynomial.nthRoots n 0 = Multiset.replicate n 0


@[simp]
theorem coe_top : (↑(⊤ : StarSubalgebra R A) : Set A) = Set.univ

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]


private theorem Cofix.bisim_aux (r : Cofix F → Cofix F → Prop) (h' : ∀ x, r x x)
    (h : ∀ x y, r x y → Quot.mk r <$> Cofix.dest x = Quot.mk r <$> Cofix.dest y) :
    ∀ x y, r x y → x = y

(h : ∀ (x y : QPF.Cofix F), r x y → Quot.mk r <$> x.dest = Quot.mk r <$> y.dest)


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

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

t.indicator (∑ i ∈ s, f i) = ∑ i ∈ s, t.indicator (f i)


@[to_additive]
theorem op_le_iff {S₁ : Subgroup G} {S₂ : Subgroup Gᵐᵒᵖ} : S₁.op ≤ S₂ ↔ S₁ ≤ S₂.unop

{G : Type u_2}
[Group G]
{S₁ : Subgroup G}
{S₂ : Subgroup Gᵐᵒᵖ}


@[simp, norm_cast]
theorem abs_ofReal (r : ℝ) : Complex.abs r = |r|


@[simp]
theorem DirectSum.toAddMonoidAlgebra_of (i : ι) (m : M) :
    (DirectSum.of _ i m : ⨁ _ : ι, M).toAddMonoidAlgebra = Finsupp.single i m

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[Semiring M]
[(m : M) → Decidable (m ≠ 0)]
(i : ι)
(m : M)

((DirectSum.of (fun x => M) i) m).toAddMonoidAlgebra = Finsupp.single i m


@[to_additive]
protected lemma IsOfFinOrder.powers_eq_image_range_orderOf [DecidableEq G] (hx : IsOfFinOrder x) :
    (Submonoid.powers x : Set G) = (Finset.range (orderOf x)).image (x ^ ·)

{G : Type u_1}
[AddMonoid G]
{x : G}
[DecidableEq G]
(hx : IsOfFinAddOrder x)

↑(AddSubmonoid.multiples x) = ↑(Finset.image (fun x_1 => x_1 • x) (Finset.range (addOrderOf x)))


@[to_additive existing (attr := simp)]
lemma mulLeft_one : Equiv.mulLeft (1 : α) = 1


theorem forget₂_ρ (V : FDRep k G) : ((forget₂ (FDRep k G) (Rep k G)).obj V).ρ = V.ρ

{k G : Type u}
[Field k]
[Monoid G]
(V : FDRep k G)

((CategoryTheory.forget₂ (FDRep k G) (Rep k G)).obj V).ρ = V.ρ


theorem GLPos.det_ne_zero (A : GLPos n R) : ((A : GL n R) : Matrix n n R).det ≠ 0

{n : Type u}
{R : Type v}
[DecidableEq n]
[Fintype n]
[LinearOrderedCommRing R]
(A : ↥(Matrix.GLPos n R))


@[simp]
lemma homMk₄_app_zero : (homMk₄ app₀ app₁ app₂ app₃ app₄ w₀ w₁ w₂ w₃).app 0 = app₀

{f g : CategoryTheory.ComposableArrows C 4}

(w₀ :
  CategoryTheory.CategoryStruct.comp (f.map' 0 1 ⋯ ⋯) app₁ = CategoryTheory.CategoryStruct.comp app₀ (g.map' 0 1 ⋯ ⋯))

(w₁ :
  CategoryTheory.CategoryStruct.comp (f.map' 1 2 ⋯ ⋯) app₂ = CategoryTheory.CategoryStruct.comp app₁ (g.map' 1 2 ⋯ ⋯))

(w₂ :
  CategoryTheory.CategoryStruct.comp (f.map' 2 3 ⋯ ⋯) app₃ = CategoryTheory.CategoryStruct.comp app₂ (g.map' 2 3 ⋯ ⋯))

(w₃ :
  CategoryTheory.CategoryStruct.comp (f.map' 3 4 ⋯ ⋯) app₄ = CategoryTheory.CategoryStruct.comp app₃ (g.map' 3 4 ⋯ ⋯))

(CategoryTheory.ComposableArrows.homMk₄ app₀ app₁ app₂ app₃ app₄ w₀ w₁ w₂ w₃).app 0 = app₀


@[simp 1100]
theorem dNext_comp_right (f : ∀ i j, C.X i ⟶ D.X j) (g : D ⟶ E) (i : ι) :
    (dNext i fun i j => f i j ≫ g.f j) = dNext i f ≫ g.f i

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D E : HomologicalComplex V c}
(f : (i j : ι) → C.X i ⟶ D.X j)
(g : D ⟶ E)
(i : ι)

((dNext i) fun i j => f i j ≫ g.f j) = (dNext i) f ≫ g.f i


/-- The `diag` of `s : Finset α` is sent on a finset of `Sym2 α` of card `s.card`. -/
theorem card_image_diag (s : Finset α) : (s.diag.image Sym2.mk).card = s.card

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

(Finset.image Sym2.mk s.diag).card = s.card


@[simp]
theorem sum_eq_sup {ι : Type*} (s : Finset ι) (f : ι → Ideal R) : s.sum f = s.sup f

{R : Type u}
[Semiring R]
{ι : Type u_1}
(s : Finset ι)
(f : ι → Ideal R)


theorem iUnion_subset_iUnion_const {s : Set α} (h : ι → ι₂) : ⋃ _ : ι, s ⊆ ⋃ _ : ι₂, s

{α : Type u_1}
{ι : Sort u_4}
{ι₂ : Sort u_6}
{s : Set α}
(h : ι → ι₂)


theorem sup_le : a ≤ c → b ≤ c → a ⊔ b ≤ c

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


@[to_additive (attr := simp 1100, nolint simpNF)]
theorem mem_map_iff_mem {f : G →* N} (hf : Function.Injective f) {K : Subgroup G} {x : G} :
    f x ∈ K.map f ↔ x ∈ K

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}
(hf : Function.Injective ⇑f)
{K : Subgroup G}
{x : G}


lemma sup_mem_supClosure (ha : a ∈ s) (hb : b ∈ s) : a ⊔ b ∈ supClosure s

{α : Type u_2}
[SemilatticeSup α]
{s : Set α}
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)


theorem equivalence_unitIso :
    DoldKan.equivalence.unitIso = (ε : 𝟭 (SimplicialObject C) ≅ N ⋙ Γ)


theorem mul_div_self_cancel_iff {I : FractionalIdeal R₁⁰ K} : I * (1 / I) = 1 ↔ ∃ J, I * J = 1

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[frac : IsFractionRing R₁ K]
[IsDomain R₁]
{I : FractionalIdeal R₁⁰ K}


@[mono]
theorem log_mono_right (b : Ordinal) {x y : Ordinal} (xy : x ≤ y) : log b x ≤ log b y

(b : Ordinal.{u_1})
{x y : Ordinal.{u_1}}
(xy : x ≤ y)


theorem IsOpen.uniqueDiffWithinAt (hs : IsOpen s) (xs : x ∈ s) : UniqueDiffWithinAt 𝕜 s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s : Set E}
(hs : IsOpen s)
(xs : x ∈ s)


/-- The embedding `α → FreeSemigroup α`. -/
@[to_additive (attr := simps) "The embedding `α → FreeAddSemigroup α`."]
def of (x : α) : FreeSemigroup α


/-- The glue data associated with an open cover.
The canonical isomorphism `𝒰.gluedCover.glued ⟶ X` is provided by `𝒰.fromGlued`. -/
@[simps]
def gluedCover : Scheme.GlueData.{u}

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)


lemma epi_iff_surjective_on_stonean : Epi f ↔
    ∀ (S : Stonean), Function.Surjective (f.val.app (op S.compHaus))

(R : Type (u + 1))
[Ring R]
{X Y : CondensedMod R}
(f : X ⟶ Y)

CategoryTheory.Epi f ↔ ∀ (S : Stonean), Function.Surjective ⇑(f.val.app (Opposite.op S.compHaus))


theorem star_mem_star_iff (S : Subalgebra R A) (x : A) : star x ∈ star S ↔ x ∈ S

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


@[simp]
theorem coe_bot [Preorder α] {a : α} : ↑(⊥ : Ici a) = a


theorem Iic_mem_nhdsSet_Icc (h : b < c) : Iic c ∈ 𝓝ˢ (Icc a b)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a b c : α}
(h : b < c)


/-- `CliffordAlgebra.reverse` and `CliffordAlgebra.involute` commute. Note that the composition
is sometimes referred to as the "clifford conjugate". -/
theorem reverse_involute_commute : Function.Commute (reverse (Q := Q)) involute

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


theorem linfty_opNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A *ᵥ v‖ ≤ ‖A‖ * ‖v‖

{l : Type u_2}
{m : Type u_3}
{α : Type u_5}
[Fintype l]
[Fintype m]
[NonUnitalSeminormedRing α]
(A : Matrix l m α)
(v : m → α)

‖A *ᵥ v‖ ≤ ‖A‖ * ‖v‖


theorem zeroLocus_empty_of_one_mem {s : Set A} (h : (1 : A) ∈ s) : zeroLocus 𝒜 s = ∅

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
{s : Set A}
(h : 1 ∈ s)


@[simp]
theorem map_none (f : α → β) : map f none = none

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


theorem natDegree_map_le (p : R[X]) : natDegree (p.map f) ≤ natDegree p

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

(Polynomial.map f p).natDegree ≤ p.natDegree


@[to_additive]
theorem Pi.mulSingle_inv [∀ i, Group <| f i] (i : I) (x : f i) :
    mulSingle i x⁻¹ = (mulSingle i x)⁻¹

{I : Type u}
{f : I → Type v}
[DecidableEq I]
[(i : I) → AddGroup (f i)]
(i : I)
(x : f i)


theorem to_isAddGroupHom (hf : IsRingHom f) : IsAddGroupHom f

{α : Type u}
{β : Type v}
[Ring α]
[Ring β]
{f : α → β}
(hf : IsRingHom f)


@[simp]
theorem mk_toList : ∀ (v : Vector α n) (h), (⟨toList v, h⟩ : Vector α n) = v

{n : ℕ}
{α : Type u_1}
(v : Mathlib.Vector α n)
(h : v.toList.length = n)


theorem nodup_map_iff_inj_on {f : α → β} {l : List α} (d : Nodup l) :
    Nodup (map f l) ↔ ∀ x ∈ l, ∀ y ∈ l, f x = f y → x = y

{α : Type u}
{β : Type v}
{f : α → β}
{l : List α}
(d : l.Nodup)

(List.map f l).Nodup ↔ ∀ x ∈ l, ∀ y ∈ l, f x = f y → x = y


@[simp]
theorem lastFun_from_append1_drop_last {α : TypeVec (n + 1)} :
    lastFun (@fromAppend1DropLast _ α) = _root_.id

TypeVec.lastFun TypeVec.fromAppend1DropLast = id


@[simp]
theorem integral_piecewise_zero {m : MeasurableSpace α} (f : α →ₛ F) (μ : Measure α) {s : Set α}
    (hs : MeasurableSet s) : (piecewise s hs f 0).integral μ = f.integral (μ.restrict s)

{α : Type u_1}
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{m : MeasurableSpace α}
(f : MeasureTheory.SimpleFunc α F)
(μ : MeasureTheory.Measure α)
{s : Set α}
(hs : MeasurableSet s)

MeasureTheory.SimpleFunc.integral μ (MeasureTheory.SimpleFunc.piecewise s hs f 0) =
  MeasureTheory.SimpleFunc.integral (μ.restrict s) f


/-- The identity functor on `C`, viewed as a functor from the
monoidal opposite of `C` to `C`, upgraded to a braided functor. -/
@[simps!] def unmopBraidedFunctor : BraidedFunctor Cᴹᵒᵖ C

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
(self : Cᴹᵒᵖ)

(CategoryTheory.MonoidalOpposite.unmopBraidedFunctor C).obj self = self.unmop


theorem lintegral_finset [MeasurableSingletonClass α] (s : Finset α) (f : α → ℝ≥0∞) :
    ∫⁻ x in s, f x ∂μ = ∑ x ∈ s, f x * μ {x}

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasurableSingletonClass α]
(s : Finset α)
(f : α → ℝ≥0∞)

∫⁻ (x : α) in ↑s, f x ∂μ = ∑ x ∈ s, f x * μ {x}


/-- `hasLimitsOfSizeShrink.{v u} C` tries to obtain `HasLimitsOfSize.{v u} C`
from some other `HasLimitsOfSize C`.
-/
theorem hasLimitsOfSizeShrink [HasLimitsOfSize.{max v₁ v₂, max u₁ u₂} C] :
    HasLimitsOfSize.{v₁, u₁} C

[CategoryTheory.Limits.HasLimitsOfSize.{max v₁ v₂, max u₁ u₂, v, u} C]

CategoryTheory.Limits.HasLimitsOfSize.{v₁, u₁, v, u} C


theorem isLUB_iff_le_iff : IsLUB s a ↔ ∀ b, a ≤ b ↔ b ∈ upperBounds s

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

IsLUB s a ↔ ∀ (b : α), a ≤ b ↔ b ∈ upperBounds s


protected theorem ClosedEmbedding.sigmaCompactSpace {e : Y → X} (he : ClosedEmbedding e) :
    SigmaCompactSpace Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[SigmaCompactSpace X]
{e : Y → X}
(he : ClosedEmbedding e)


/-- In a multiplicative group action, the points fixed by `g` are also fixed by `g⁻¹` -/
@[to_additive (attr := simp)
  "In an additive group action, the points fixed by `g` are also fixed by `g⁻¹`"]
theorem fixedBy_inv (g : G) : fixedBy α g⁻¹ = fixedBy α g

(α : Type u_1)
{G : Type u_2}
[Group G]
[MulAction G α]
(g : G)

MulAction.fixedBy α g⁻¹ = MulAction.fixedBy α g


@[measurability, fun_prop]
theorem Measurable.ennreal_tsum' {ι} [Countable ι] {f : ι → α → ℝ≥0∞} (h : ∀ i, Measurable (f i)) :
    Measurable (∑' i, f i)

{α : Type u_1}
[MeasurableSpace α]
{ι : Type u_5}
[Countable ι]
{f : ι → α → ℝ≥0∞}
(h : ∀ (i : ι), Measurable (f i))


theorem lintegral_eq_iSup_eapprox_lintegral {f : α → ℝ≥0∞} (hf : Measurable f) :
    ∫⁻ a, f a ∂μ = ⨆ n, (eapprox f n).lintegral μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : Measurable f)

∫⁻ (a : α), f a ∂μ = ⨆ n, (MeasureTheory.SimpleFunc.eapprox f n).lintegral μ


theorem le_div_iff {I J K : Submodule R A} : I ≤ J / K ↔ ∀ x ∈ I, ∀ z ∈ K, x * z ∈ J

{R : Type u}
[CommSemiring R]
{A : Type v}
[CommSemiring A]
[Algebra R A]
{I J K : Submodule R A}


/-- Pointwise maximum of two monotone functions is a monotone function. -/
protected theorem max [Preorder α] [LinearOrder β] {f g : α → β} {s : Set α} (hf : MonotoneOn f s)
    (hg : MonotoneOn g s) : MonotoneOn (fun x => max (f x) (g x)) s

{α : Type u}
{β : Type v}
[Preorder α]
[LinearOrder β]
{f g : α → β}
{s : Set α}
(hf : MonotoneOn f s)
(hg : MonotoneOn g s)


@[simp]
theorem coe_mul : ⇑(f * g) = f ∘ g


@[to_additive (attr := simp)]
theorem one_apply (G H : Grp) (g : G) : ((1 : G ⟶ H) : G → H) g = 1


@[simp]
theorem isBoundedUnder_ge_inf [SemilatticeInf α] {f : Filter β} {u v : β → α} :
    (f.IsBoundedUnder (· ≥ ·) fun a => u a ⊓ v a) ↔
      f.IsBoundedUnder (· ≥ ·) u ∧ f.IsBoundedUnder (· ≥ ·) v

{α : Type u_1}
{β : Type u_2}
[SemilatticeInf α]
{f : Filter β}
{u v : β → α}

(Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f fun a => u a ⊓ v a) ↔
  Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f u ∧ Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f v


theorem convex_parallelepiped (v : ι → E) : Convex ℝ (parallelepiped v)

{ι : Type u_1}
{E : Type u_3}
[Fintype ι]
[AddCommGroup E]
[Module ℝ E]
(v : ι → E)


theorem coe_toAlternatingMap : ⇑f.toAlternatingMap = f

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
(f : M [⋀^ι]→L[R] N)


@[simp]
lemma leRec_self {n} {motive : (m : ℕ) → n ≤ m → Sort*}
    (refl : motive n le_rfl)
    (le_succ_of_le : ∀ ⦃k⦄ (h : n ≤ k), motive k h → motive (k + 1) (le_succ_of_le h)) :
    (leRec (motive := motive) refl le_succ_of_le le_rfl : motive n le_rfl) = refl

(le_succ_of_le : ⦃k : ℕ⦄ → (h : n ≤ k) → motive k h → motive (k + 1) ⋯)


@[simp]
theorem Orientation.map_symm (e : M ≃ₗ[R] N) :
    (Orientation.map ι e).symm = Orientation.map ι e.symm

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
(ι : Type u_4)
(e : M ≃ₗ[R] N)


lemma TransGen.closed' {P : α → Prop} (dc : ∀ {a b}, r a b → P b → P a)
    {a b : α} (h : TransGen r a b) : P b → P a

{α : Type u_1}
{r : α → α → Prop}
{P : α → Prop}
(dc : ∀ {a b : α}, r a b → P b → P a)
{a b : α}
(h : Relation.TransGen r a b)


/-- Given a wide pullback in `C`, construct a product in `C/B`. -/
theorem over_product_of_widePullback [HasLimitsOfShape (WidePullbackShape J) C] {B : C} :
    HasLimitsOfShape (Discrete J) (Over B)

[CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WidePullbackShape J) C]

CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Discrete J) (CategoryTheory.Over B)


theorem restrictScalars_injective :
    Function.Injective (restrictScalars R : Subalgebra S A → Subalgebra R A)

(R : Type u)
{S : Type v}
{A : Type w}
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Algebra R S]
[Algebra S A]
[Algebra R A]
[IsScalarTower R S A]


theorem Finite.of_injective {α β : Sort*} [Finite β] (f : α → β) (H : Injective f) : Finite α

{α : Sort u_4}
{β : Sort u_5}
[Finite β]
(f : α → β)
(H : Function.Injective f)


theorem sizeUpTo_index_le (j : Fin n) : c.sizeUpTo (c.index j) ≤ j


theorem inv_eq_inv_aux (φ : k⟦X⟧) : φ⁻¹ = inv.aux (constantCoeff k φ)⁻¹ φ

{k : Type u_2}
[Field k]
(φ : PowerSeries k)

φ⁻¹ = PowerSeries.inv.aux ((PowerSeries.constantCoeff k) φ)⁻¹ φ


@[to_additive (attr := simp)]
theorem prod.of {x : α} : prod (of x) = x


@[simp]
theorem preimage_inter [DecidableEq α] [DecidableEq β] {f : α → β} {s t : Finset β}
    (hs : Set.InjOn f (f ⁻¹' ↑s)) (ht : Set.InjOn f (f ⁻¹' ↑t)) :
    (preimage (s ∩ t) f fun x₁ hx₁ x₂ hx₂ =>
        hs (mem_of_mem_inter_left hx₁) (mem_of_mem_inter_left hx₂)) =
      preimage s f hs ∩ preimage t f ht

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

(s ∩ t).preimage f ⋯ = s.preimage f hs ∩ t.preimage f ht


/-- If `s` has the unique differential property, `f` is differentiable on `s` and its derivative
at every point of `s` has dense range, then `f '' s` has the unique differential property.
This version uses the `HasMFDerivWithinAt` predicate. -/
theorem UniqueMDiffOn.image_denseRange' (hs : UniqueMDiffOn I s) {f : M → M'}
    {f' : M → E →L[𝕜] E'} (hf : ∀ x ∈ s, HasMFDerivWithinAt I I' f s x (f' x))
    (hd : ∀ x ∈ s, DenseRange (f' x)) :
    UniqueMDiffOn I' (f '' s)


theorem inv_one_add_tan_sq {x : ℝ} (hx : cos x ≠ 0) : (1 + tan x ^ 2)⁻¹ = cos x ^ 2


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

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

TypeVec.dropFun (TypeVec.toSubtype p) = TypeVec.toSubtype fun i => p i.fs


@[simp]
theorem extend_apply' [MeasurableSpace β] (f₁ : α →ₛ γ) {g : α → β} (hg : MeasurableEmbedding g)
    (f₂ : β →ₛ γ) {y : β} (h : ¬∃ x, g x = y) : (f₁.extend g hg f₂) y = f₂ y

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
(f₁ : MeasureTheory.SimpleFunc α γ)
{g : α → β}
(hg : MeasurableEmbedding g)
(f₂ : MeasureTheory.SimpleFunc β γ)
{y : β}
(h : ¬∃ x, g x = y)


theorem isAdjointPair_zero : IsAdjointPair B B' 0 0

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


theorem ne_zero_of_mem_nthRootsFinset {η : R} (hη : η ∈ nthRootsFinset n R) : η ≠ 0

(hη : η ∈ Polynomial.nthRootsFinset n R)


theorem zero_def : (0 : SetSemiring α) = Set.up ∅


protected theorem aestronglyMeasurable (f : Lp.simpleFunc E p μ) :
    AEStronglyMeasurable (toSimpleFunc f) μ

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

MeasureTheory.AEStronglyMeasurable (↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc f)) μ


@[simp, norm_cast]
lemma coe_natCast (Γ : Subgroup SL(2, ℤ)) (n : ℕ) :
    ⇑(n : ModularForm Γ 0) = n


theorem rotate'_cons_succ (l : List α) (a : α) (n : ℕ) :
    (a :: l : List α).rotate' n.succ = (l ++ [a]).rotate' n

{α : Type u}
(l : List α)
(a : α)
(n : ℕ)

(a :: l).rotate' n.succ = (l ++ [a]).rotate' n


protected theorem bijective_iff_surjective_and_card [Finite α] (f : α → β) :
    Bijective f ↔ Surjective f ∧ Nat.card α = Nat.card β

{α : Type u_1}
{β : Type u_2}
[Finite α]
(f : α → β)

Function.Bijective f ↔ Function.Surjective f ∧ Nat.card α = Nat.card β


theorem leftInvOn_piecewise {e' : PartialHomeomorph X Y} [∀ i, Decidable (i ∈ s)]
    [∀ i, Decidable (i ∈ t)] (h : e.IsImage s t) (h' : e'.IsImage s t) :
    LeftInvOn (t.piecewise e.symm e'.symm) (s.piecewise e e') (s.ite e.source e'.source)

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e : PartialHomeomorph X Y}
{s : Set X}
{t : Set Y}
{e' : PartialHomeomorph X Y}
[(i : X) → Decidable (i ∈ s)]
[(i : Y) → Decidable (i ∈ t)]
(h : e.IsImage s t)
(h' : e'.IsImage s t)

Set.LeftInvOn (t.piecewise ↑e.symm ↑e'.symm) (s.piecewise ↑e ↑e') (s.ite e.source e'.source)


theorem proj_bot_bijective [DiscreteTopology X] : Bijective (⊥ : DiscreteQuotient X).proj

{X : Type u_2}
[TopologicalSpace X]
[DiscreteTopology X]


theorem eisenstein_lemma_aux (p : ℕ) [Fact p.Prime] [Fact (p % 2 = 1)] {a : ℕ} (ha2 : a % 2 = 1)
    (hap : (a : ZMod p) ≠ 0) :
    ((Ico 1 (p / 2).succ).filter fun x : ℕ => p / 2 < (a * x : ZMod p).val).card ≡
      ∑ x ∈ Ico 1 (p / 2).succ, x * a / p [MOD 2]

(p : ℕ)
[Fact (Nat.Prime p)]
[Fact (p % 2 = 1)]
{a : ℕ}
(ha2 : a % 2 = 1)
(hap : ↑a ≠ 0)

(Finset.filter (fun x => p / 2 < (↑a * ↑x).val) (Finset.Ico 1 (p / 2).succ)).card ≡
  ∑ x ∈ Finset.Ico 1 (p / 2).succ, x * a / p [MOD 2]


theorem gc_map_comap : GaloisConnection (map f) (comap f)

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{L₂ : Type w}
[LieRing L₂]
[LieAlgebra R L₂]
{f : L →ₗ⁅R⁆ L₂}

GaloisConnection (LieSubalgebra.map f) (LieSubalgebra.comap f)


@[fun_prop]
theorem IsBoundedBilinearMap.hasFDerivWithinAt (h : IsBoundedBilinearMap 𝕜 b) (p : E × F) :
    HasFDerivWithinAt b (h.deriv p) u p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{b : E × F → G}
{u : Set (E × F)}
(h : IsBoundedBilinearMap 𝕜 b)
(p : E × F)


theorem Compares.ne_gt [Preorder α] {o} {a b : α} (h : Compares o a b) : o ≠ gt ↔ a ≤ b

{α : Type u_1}
[Preorder α]
{o : Ordering}
{a b : α}
(h : o.Compares a b)


theorem infinite_image_iff {s : Set α} {f : α → β} (hi : InjOn f s) :
    (f '' s).Infinite ↔ s.Infinite

{α : Type u}
{β : Type v}
{s : Set α}
{f : α → β}
(hi : Set.InjOn f s)


@[simp]
theorem lift_ι_apply (f : X → A) (x) : lift R f (ι R x) = f x

{R : Type u_1}
[CommSemiring R]
{X : Type u_2}
{A : Type u_3}
[Semiring A]
[Algebra R A]
(f : X → A)
(x : X)

((FreeAlgebra.lift R) f) (FreeAlgebra.ι R x) = f x


@[reassoc (attr := simp)]
theorem limitObjIsoLimitCompEvaluation_inv_π_app [HasLimitsOfShape J C] (F : J ⥤ K ⥤ C) (j : J)
    (k : K) :
    (limitObjIsoLimitCompEvaluation F k).inv ≫ (limit.π F j).app k =
      limit.π (F ⋙ (evaluation K C).obj k) j

(CategoryTheory.Limits.limitObjIsoLimitCompEvaluation F k).inv ≫ (CategoryTheory.Limits.limit.π F j).app k =
  CategoryTheory.Limits.limit.π (F ⋙ (CategoryTheory.evaluation K C).obj k) j


theorem iUnion_inter_subset {ι α} {s t : ι → Set α} : ⋃ i, s i ∩ t i ⊆ (⋃ i, s i) ∩ ⋃ i, t i

{ι : Sort u_11}
{α : Type u_12}
{s t : ι → Set α}


@[simp]
protected theorem orthonormal (b : OrthonormalBasis ι 𝕜 E) : Orthonormal 𝕜 b

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
{E : Type u_4}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[Fintype ι]
(b : OrthonormalBasis ι 𝕜 E)


protected theorem Nodup.product : Nodup s → Nodup t → Nodup (s ×ˢ t)

{α : Type u_1}
{β : Type v}
{s : Multiset α}
{t : Multiset β}


@[simp]
theorem realize_total : M ⊨ r.total ↔ Total fun x y : M => RelMap r ![x, y]

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{r : L.Relations 2}

M ⊨ r.total ↔ Total fun x y => FirstOrder.Language.Structure.RelMap r ![x, y]


/-- **HM-GM inequality**: The **harmonic mean is less than or equal to the geometric mean. --/
theorem harm_mean_le_geom_mean {ι : Type*} (s : Finset ι) (hs : s.Nonempty) (w : ι → ℝ)
    (z : ι → ℝ) (hw : ∀ i ∈ s, 0 < w i) (hw' : 0 < ∑ i in s, w i) (hz : ∀ i ∈ s, 0 < z i) :
    (∑ i in s, w i) / (∑ i in s, w i / z i) ≤ (∏ i in s, z i ^ w i) ^ (∑ i in s, w i)⁻¹

{ι : Type u_1}
(s : Finset ι)
(hs : s.Nonempty)
(w z : ι → ℝ)
(hw : ∀ i ∈ s, 0 < w i)
(hw' : 0 < ∑ i ∈ s, w i)
(hz : ∀ i ∈ s, 0 < z i)

(∑ i ∈ s, w i) / ∑ i ∈ s, w i / z i ≤ (∏ i ∈ s, z i ^ w i) ^ (∑ i ∈ s, w i)⁻¹


theorem not_mem_of_dist_lt_infDist (h : dist x y < infDist x s) : y ∉ s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x y : α}
(h : dist x y < Metric.infDist x s)


@[to_additive]
theorem mem_div : a ∈ s / t ↔ ∃ x ∈ s, ∃ y ∈ t, x / y = a

{α : Type u_2}
[Sub α]
{s t : Set α}
{a : α}


/-- A function that is complex differentiable on the open ball of radius `r` around `c`
is given by evaluating its Taylor series at `c` on this open ball. -/
lemma taylorSeries_eq_on_ball' {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f (Metric.ball c r)) :
    ∑' n : ℕ, (n ! : ℂ)⁻¹ * iteratedDeriv n f c * (z - c) ^ n = f z

∑' (n : ℕ), (↑n.factorial)⁻¹ * iteratedDeriv n f c * (z - c) ^ n = f z


private theorem newton_seq_dist {n k : ℕ} (hnk : n ≤ k) :
    ‖newton_seq k - newton_seq n‖ ≤ ‖F.derivative.eval a‖ * T ^ 2 ^ n

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

‖newton_seq_gen hnorm k - newton_seq_gen hnorm n‖ ≤ ‖Polynomial.eval a (Polynomial.derivative F)‖ * T_gen p F a ^ 2 ^ n


/-- `SimplexCategory` is a skeleton of `NonemptyFinLinOrd`.
-/
lemma isSkeletonOf :
    IsSkeletonOf NonemptyFinLinOrd SimplexCategory skeletalFunctor

CategoryTheory.IsSkeletonOf NonemptyFinLinOrd SimplexCategory SimplexCategory.skeletalFunctor


protected theorem mul_inv_cancel (x : K) (hx : x ≠ 0) : x * IsFractionRing.inv A x = 1

(A : Type u_4)
[CommRing A]
[IsDomain A]
{K : Type u_5}
[CommRing K]
[Algebra A K]
[IsFractionRing A K]
(x : K)
(hx : x ≠ 0)


protected theorem IsClopen.isClosed (hs : IsClopen s) : IsClosed s

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


theorem finset_sup_factors {I : Type*} {A B : C} {s : Finset I} {P : I → Subobject B} {f : A ⟶ B}
    (h : ∃ i ∈ s, (P i).Factors f) : (s.sup P).Factors f


theorem natDegree_sub : (p - q).natDegree = (q - p).natDegree


theorem lt_div {a b c : Ordinal} (h : c ≠ 0) : a < b / c ↔ c * succ a ≤ b


@[simp]
theorem union_empty (s : Finset α) : s ∪ ∅ = s

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


theorem exists_mem_target {p : β → Prop} : (∃ y ∈ e.target, p y) ↔ ∃ x ∈ e.source, p (e x)

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
{p : β → Prop}

(∃ y ∈ e.target, p y) ↔ ∃ x ∈ e.source, p (↑e x)


/-- If one controls the norm of every `f x`, then one controls the norm of `f`. -/
theorem opNorm_le_bound {M : ℝ} (hMp : 0 ≤ M) (hM : ∀ x, ‖f x‖ ≤ M * ‖x‖) : ‖f‖ ≤ M

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
(f : NormedAddGroupHom V₁ V₂)
{M : ℝ}
(hMp : 0 ≤ M)
(hM : ∀ (x : V₁), ‖f x‖ ≤ M * ‖x‖)


theorem isClosed_singleton_iff_isMaximal (x : PrimeSpectrum R) :
    IsClosed ({x} : Set (PrimeSpectrum R)) ↔ x.asIdeal.IsMaximal

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


theorem trivial_def (g : G) (v : V) : trivial k (V := V) g v = v

(k : Type u_1)
{G : Type u_2}
{V : Type u_3}
[CommSemiring k]
[Monoid G]
[AddCommMonoid V]
[Module k V]
(g : G)
(v : V)


theorem nndist_eq_nnnorm_vsub (x y : P) : nndist x y = ‖x -ᵥ y‖₊

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


theorem Parallel.vectorSpan_eq {s₁ s₂ : Set P} (h : affineSpan k s₁ ∥ affineSpan k s₂) :
    vectorSpan k s₁ = vectorSpan k s₂

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s₁ s₂ : Set P}
(h : affineSpan k s₁ ∥ affineSpan k s₂)


/--
A functor `G : C ⥤ D` is locally faithful wrt a topology on `D` if for every `f₁ f₂ : U ⟶ V` whose
image in `D` are equal, the set of `G.map gᵢ : G.obj Wᵢ ⟶ G.obj U` such that `gᵢ ≫ f₁ = gᵢ ≫ f₂`
is a coverage of the topology on `D`.
-/
class IsLocallyFaithful : Prop where
  functorPushforward_equalizer_mem : ∀ {U V : C} (f₁ f₂ : U ⟶ V), G.map f₁ = G.map f₂ →
    (Sieve.equalizer f₁ f₂).functorPushforward G ∈ K _

{K : CategoryTheory.GrothendieckTopology D}

G.map f₁ = G.map f₂ →
  CategoryTheory.Sieve.functorPushforward G (CategoryTheory.Sieve.equalizer f₁ f₂) ∈ K.sieves (G.obj U)


theorem map_sub (n m k : ℕ) (h₁ : k ≤ n) :
    ((Ico n m).map fun x => x - k) = Ico (n - k) (m - k)

List.map (fun x => x - k) (List.Ico n m) = List.Ico (n - k) (m - k)


@[to_additive (attr := simp)]
lemma sup'_one [SemilatticeSup β] (f : α → β) : sup' 1 one_nonempty f = f 1

{α : Type u_2}
{β : Type u_3}
[Zero α]
[SemilatticeSup β]
(f : α → β)


/-- Two functors to a product category are equal iff they agree on every coordinate. -/
theorem pi_ext (f f' : A ⥤ ∀ i, C i) (h : ∀ i, f ⋙ (Pi.eval C i) = f' ⋙ (Pi.eval C i)) :
    f = f'

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

(f f' : CategoryTheory.Functor A ((i : I) → C i))

(h : ∀ (i : I), f.comp (CategoryTheory.Pi.eval C i) = f'.comp (CategoryTheory.Pi.eval C i))


@[simp, norm_cast] lemma coe_le_coe : ⇑f ≤ g ↔ f ≤ g

{ι : Type u_1}
{α : Type u_2}
[Zero α]
[LE α]
{f g : ι →₀ α}

⇑f ≤ ⇑g ↔ f ≤ g


@[to_additive]
lemma prod_Ioc_mul_eq_prod_Icc (h : a ≤ b) : (∏ x ∈ Ioc a b, f x) * f a = ∏ x ∈ Icc a b, f x

{α : Type u_1}
{M : Type u_2}
[PartialOrder α]
[CommMonoid M]
{f : α → M}
{a b : α}
[LocallyFiniteOrder α]
(h : a ≤ b)

(∏ x ∈ Finset.Ioc a b, f x) * f a = ∏ x ∈ Finset.Icc a b, f x


lemma of_comp_eq_zero_of_ker_in_range [Zero P] (hc : g.comp f = 0)
    (hr : ∀ y, g y = 0 → y ∈ Set.range f) :
    Exact f g

(hr : ∀ (y : N), g y = 0 → y ∈ Set.range f)


@[continuity]
theorem continuous_log : Continuous fun x : { x : ℝ // x ≠ 0 } => log x


protected theorem IsTopologicalBasis.iInf {β : Type*} {ι : Type*} {t : ι → TopologicalSpace β}
    {T : ι → Set (Set β)} (h_basis : ∀ i, IsTopologicalBasis (t := t i) (T i)) :
    IsTopologicalBasis (t := ⨅ i, t i)
      { S | ∃ (U : ι → Set β) (F : Finset ι), (∀ i, i ∈ F → U i ∈ T i) ∧ S = ⋂ i ∈ F, U i }

(h_basis : ∀ (i : ι), TopologicalSpace.IsTopologicalBasis (T i))

TopologicalSpace.IsTopologicalBasis {S | ∃ U F, (∀ i ∈ F, U i ∈ T i) ∧ S = ⋂ i ∈ F, U i}


@[simp] lemma shatterer_eq : 𝒜.shatterer = 𝒜 ↔ IsLowerSet (𝒜 : Set (Finset α))

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}


theorem StarConvex.sub (hs : StarConvex 𝕜 x s) (ht : StarConvex 𝕜 y t) :
    StarConvex 𝕜 (x - y) (s - t)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{x y : E}
{s t : Set E}
(hs : StarConvex 𝕜 x s)
(ht : StarConvex 𝕜 y t)


@[fun_prop]
theorem DifferentiableOn.const_smul (h : DifferentiableOn 𝕜 f s) (c : R) :
    DifferentiableOn 𝕜 (fun y => c • f y) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
{R : Type u_6}
[Semiring R]
[Module R F]
[SMulCommClass 𝕜 R F]
[ContinuousConstSMul R F]
(h : DifferentiableOn 𝕜 f s)
(c : R)


theorem IsPushout.isVanKampen_inl {W E X Z : C} (c : BinaryCofan W E) [FinitaryExtensive C]
    [HasPullbacks C] (hc : IsColimit c) (f : W ⟶ X) (h : X ⟶ Z) (i : c.pt ⟶ Z)
    (H : IsPushout f c.inl h i) : H.IsVanKampen

(c : CategoryTheory.Limits.BinaryCofan W E)

(hc : CategoryTheory.Limits.IsColimit c)

(H : CategoryTheory.IsPushout f c.inl h i)


theorem map_add (x y : E) : e (x + y) = e x + e y

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


theorem opow_dvd_opow (a : Ordinal) {b c : Ordinal} (h : b ≤ c) : a ^ b ∣ a ^ c

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


@[simp]
theorem Perm.subtypeCongr.trans :
    (ep.subtypeCongr en).trans (ep'.subtypeCongr en')
    = Perm.subtypeCongr (ep.trans ep') (en.trans en')

{ε : Type u_1}
{p : ε → Prop}
[DecidablePred p]
(ep ep' : Equiv.Perm { a // p a })
(en en' : Equiv.Perm { a // ¬p a })

Equiv.trans (ep.subtypeCongr en) (ep'.subtypeCongr en') =
  Equiv.Perm.subtypeCongr (Equiv.trans ep ep') (Equiv.trans en en')


lemma bijOn_symm_image : BijOn e.symm (e '' s) s

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
{s : Set α}


protected theorem eq_zero_of_add_eq_zero_right (h : n + m = 0) : n = 0


@[to_additive] lemma le_mabs : a ≤ |b|ₘ ↔ a ≤ b ∨ a ≤ b⁻¹

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


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

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


@[to_additive]
lemma noncommProd_induction (s : Multiset α) (comm)
    (p : α → Prop) (hom : ∀ a b, p a → p b → p (a * b)) (unit : p 1) (base : ∀ x ∈ s, p x) :
    p (s.noncommProd comm)

(hom : ∀ (a b : α), p a → p b → p (a * b))


@[simp]
theorem sUnion_empty : ⋃₀ (∅ : ZFSet.{u}) = ∅


@[simp]
theorem cliqueFinset_map_of_equiv (e : α ≃ β) (n : ℕ) :
    (G.map e.toEmbedding).cliqueFinset n =
      (G.cliqueFinset n).map ⟨map e.toEmbedding, Finset.map_injective _⟩

{α : Type u_1}
{β : Type u_2}
(G : SimpleGraph α)
[Fintype α]
[DecidableEq α]
[DecidableRel G.Adj]
[Fintype β]
[DecidableEq β]
(e : α ≃ β)
(n : ℕ)

(SimpleGraph.map e.toEmbedding G).cliqueFinset n =
  Finset.map { toFun := Finset.map e.toEmbedding, inj' := ⋯ } (G.cliqueFinset n)


/-- If a martingale `f` adapted to `ℱ` converges in L¹ to `g`, then for all `n`, `f n` is almost
everywhere equal to `𝔼[g | ℱ n]`. -/
theorem Martingale.eq_condexp_of_tendsto_eLpNorm {μ : Measure Ω} (hf : Martingale f ℱ μ)
    (hg : Integrable g μ) (hgtends : Tendsto (fun n => eLpNorm (f n - g) 1 μ) atTop (𝓝 0)) (n : ℕ) :
    f n =ᵐ[μ] μ[g|ℱ n]

{f : ℕ → Ω → ℝ}

(hgtends : Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - g) 1 μ) Filter.atTop (𝓝 0))


@[to_additive (attr := simp)]
lemma op_smul_coe_set [Group G] [SetLike S G] [SubgroupClass S G] {s : S} {a : G} (ha : a ∈ s) :
    MulOpposite.op a • (s : Set G) = s

{G : Type u_2}
{S : Type u_4}
[AddGroup G]
[SetLike S G]
[AddSubgroupClass S G]
{s : S}
{a : G}
(ha : a ∈ s)


@[to_additive existing (attr := simp)]
theorem coe_div_interval : (↑(s / t) : Interval α) = s / t

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


@[gcongr]
theorem sup_le_sup_left (h₁ : a ≤ b) (c) : c ⊔ a ≤ c ⊔ b

{α : Type u}
[SemilatticeSup α]
{a b : α}
(h₁ : a ≤ b)
(c : α)


theorem csInf_le_csInf (ht : BddBelow t) (hs : s.Nonempty) (h : s ⊆ t) : sInf t ≤ sInf s

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s t : Set α}
(ht : BddBelow t)
(hs : s.Nonempty)
(h : s ⊆ t)


@[reassoc]
theorem Γ₀_obj_termwise_mapMono_comp_PInfty (X : SimplicialObject C) {Δ Δ' : SimplexCategory}
    (i : Δ ⟶ Δ') [Mono i] :
    Γ₀.Obj.Termwise.mapMono (AlternatingFaceMapComplex.obj X) i ≫ PInfty.f Δ.len =
      PInfty.f Δ'.len ≫ X.map i.op

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(X : CategoryTheory.SimplicialObject C)
{Δ Δ' : SimplexCategory}
(i : Δ ⟶ Δ')
[CategoryTheory.Mono i]

AlgebraicTopology.DoldKan.Γ₀.Obj.Termwise.mapMono K[X] i ≫ AlgebraicTopology.DoldKan.PInfty.f Δ.len =
  AlgebraicTopology.DoldKan.PInfty.f Δ'.len ≫ X.map i.op


@[simp]
theorem gcd_mul_left_add_left (m n k : ℕ) : gcd (n * k + m) n = gcd m n


@[to_additive (attr := simp)] lemma unop_toSubmonoid (H : Subgroup Gᵐᵒᵖ) :
    H.unop.toSubmonoid = H.toSubmonoid.unop

{G : Type u_2}
[Group G]
(H : Subgroup Gᵐᵒᵖ)


theorem ae_mem_iff_measure_eq [IsFiniteMeasure μ] {s : Set α} (hs : NullMeasurableSet s μ) :
    (∀ᵐ a ∂μ, a ∈ s) ↔ μ s = μ univ

(hs : MeasureTheory.NullMeasurableSet s μ)

(∀ᵐ (a : α) ∂μ, a ∈ s) ↔ μ s = μ Set.univ


@[simps (config := .lemmasOnly)]
instance instInv : Inv ℍ[R]

{R : Type u_1}
[LinearOrderedField R]
(a : ℍ[R])


/-- If the spectrum of an element restricts to a smaller scalar ring, then a continuous functional
calculus over the larger scalar ring descends to the smaller one. -/
@[simps!]
def starAlgHom {R : Type u} {S : Type v} {A : Type w} [Semifield R]
    [StarRing R] [TopologicalSpace R] [TopologicalSemiring R] [ContinuousStar R] [Semifield S]
    [StarRing S] [TopologicalSpace S] [TopologicalSemiring S] [ContinuousStar S] [Ring A]
    [StarRing A] [Algebra R S] [Algebra R A] [Algebra S A]
    [IsScalarTower R S A] [StarModule R S] [ContinuousSMul R S] {a : A}
    (φ : C(spectrum S a, S) →⋆ₐ[S] A) {f : C(S, R)} (h : SpectrumRestricts a f) :
    C(spectrum R a, R) →⋆ₐ[R] A

{R : Type u}
{S : Type v}
{A : Type w}
[Semifield R]
[StarRing R]
[TopologicalSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[Semifield S]
[StarRing S]
[TopologicalSpace S]
[TopologicalSemiring S]
[ContinuousStar S]
[Ring A]
[StarRing A]
[Algebra R S]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
[StarModule R S]
[ContinuousSMul R S]
{a : A}
(φ : C(↑(spectrum S a), S) →⋆ₐ[S] A)
{f : C(S, R)}
(h : SpectrumRestricts a ⇑f)

∀ (a_1 : C(↑(spectrum R a), R)),
  (SpectrumRestricts.starAlgHom φ h) a_1 =
    φ
      ({ toFun := ⇑(StarAlgHom.ofId R S), continuous_toFun := ⋯ }.comp
        (a_1.comp { toFun := Subtype.map ⇑f ⋯, continuous_toFun := ⋯ }))


theorem ssubset_iff_exists_subset_erase {s t : Finset α} : s ⊂ t ↔ ∃ a ∈ t, s ⊆ t.erase a

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


@[simp]
lemma fromRows_apply_inl (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) (i : m₁) (j : n) :
    (fromRows A₁ A₂) (Sum.inl i) j = A₁ i j

{R : Type u_1}
{m₁ : Type u_3}
{m₂ : Type u_4}
{n : Type u_5}
(A₁ : Matrix m₁ n R)
(A₂ : Matrix m₂ n R)
(i : m₁)
(j : n)


@[to_additive]
theorem Step.append_left_iff : ∀ L, Step (L ++ L₁) (L ++ L₂) ↔ Step L₁ L₂

{α : Type u}
{L₁ L₂ : List (α × Bool)}
(L : List (α × Bool))

FreeGroup.Red.Step (L ++ L₁) (L ++ L₂) ↔ FreeGroup.Red.Step L₁ L₂


theorem generateFrom_measurableSet_of_generatePiSystem {α} {g : Set (Set α)} (t : Set α)
    (ht : t ∈ generatePiSystem g) : MeasurableSet[generateFrom g] t

{α : Type u_1}
{g : Set (Set α)}
(t : Set α)
(ht : t ∈ generatePiSystem g)


theorem Prime.eq_one_or_self_of_dvd {p : ℕ} (pp : p.Prime) (m : ℕ) (hm : m ∣ p) :
    m = 1 ∨ m = p

{p : ℕ}
(pp : Nat.Prime p)
(m : ℕ)
(hm : m ∣ p)


theorem mem_sub_of_nodup [DecidableEq α] {a : α} {s t : Multiset α} (d : Nodup s) :
    a ∈ s - t ↔ a ∈ s ∧ a ∉ t

{α : Type u_1}
[DecidableEq α]
{a : α}
{s t : Multiset α}
(d : s.Nodup)


/-- **Four squares theorem** -/
theorem sum_four_squares (n : ℕ) : ∃ a b c d : ℕ, a ^ 2 + b ^ 2 + c ^ 2 + d ^ 2 = n


@[simp]
theorem smul_lie : ⁅t • x, m⁆ = t • ⁅x, m⁆

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(t : R)
(x : L)
(m : M)


lemma univ_val_map_subtype_restrict [Fintype α] (f : α → β)
    (p : α → Prop) [DecidablePred p] [Fintype {a // p a}] :
    univ.val.map (Subtype.restrict p f) = (univ.filter p).val.map f

{α : Type u_1}
{β : Type u_2}
[Fintype α]
(f : α → β)
(p : α → Prop)
[DecidablePred p]
[Fintype { a // p a }]

Multiset.map (Subtype.restrict p f) Finset.univ.val = Multiset.map f (Finset.filter p Finset.univ).val


@[to_additive sum_eq_card_nsmul]
theorem prod_eq_pow_card (l : List M) (m : M) (h : ∀ x ∈ l, x = m) : l.prod = m ^ l.length

{M : Type u_4}
[AddMonoid M]
(l : List M)
(m : M)
(h : ∀ x ∈ l, x = m)


@[simp]
theorem isCompact_singleton {x : X} : IsCompact ({x} : Set X)

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


/-- If a function vanishes on `sᶜ`, then its integral on `s` coincides with its integral on the
whole space. -/
theorem setIntegral_eq_integral_of_forall_compl_eq_zero (h : ∀ x, x ∉ s → f x = 0) :
    ∫ x in s, f x ∂μ = ∫ x, f x ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{s : Set X}
{μ : MeasureTheory.Measure X}
(h : ∀ x ∉ s, f x = 0)

∫ (x : X) in s, f x ∂μ = ∫ (x : X), f x ∂μ


theorem HasFDerivWithinAt.ccos (hf : HasFDerivWithinAt f f' s x) :
    HasFDerivWithinAt (fun x => Complex.cos (f x)) (-Complex.sin (f x) • f') s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{f' : E →L[ℂ] ℂ}
{x : E}
{s : Set E}
(hf : HasFDerivWithinAt f f' s x)


@[to_additive]
theorem card_mul_iff :
    (s * t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × α)).InjOn fun p => p.1 * p.2

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

(s * t).card = s.card * t.card ↔ Set.InjOn (fun p => p.1 * p.2) (↑s ×ˢ ↑t)


theorem parts_top_subset (a : α) [Decidable (a = ⊥)] : (⊤ : Finpartition a).parts ⊆ {a}

{α : Type u_1}
[Lattice α]
[OrderBot α]
(a : α)
[Decidable (a = ⊥)]


@[simp]
theorem totalDegree_one : (1 : MvPolynomial σ R).totalDegree = 0

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


/-- Composing a basis with a linear equiv gives the same orientation if and only if the
determinant is positive. -/
theorem orientation_comp_linearEquiv_eq_iff_det_pos (e : Basis ι R M) (f : M ≃ₗ[R] M) :
    (e.map f).orientation = e.orientation ↔ 0 < LinearMap.det (f : M →ₗ[R] M)

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_3}
[Fintype ι]
[DecidableEq ι]
(e : Basis ι R M)
(f : M ≃ₗ[R] M)

(e.map f).orientation = e.orientation ↔ 0 < LinearMap.det ↑f


@[simp] lemma map_id' : Prod.map (fun a : α ↦ a) (fun b : β ↦ b) = fun x ↦ x

(Prod.map (fun a => a) fun b => b) = fun x => x


theorem exists_fix_le_approx (x : α) : ∃ i, Part.fix f x ≤ approx f i x

(f : ((a : α) → Part (β a)) →o (a : α) → Part (β a))

∃ i, Part.fix (⇑f) x ≤ Part.Fix.approx (⇑f) i x


/-- The property of being `C^n`, initially defined in terms of the Fréchet derivative, can be
reformulated in terms of the one-dimensional derivative on sets with unique derivatives. -/
theorem contDiffOn_iff_continuousOn_differentiableOn_deriv {n : ℕ∞} (hs : UniqueDiffOn 𝕜 s) :
    ContDiffOn 𝕜 n f s ↔ (∀ m : ℕ, (m : ℕ∞) ≤ n → ContinuousOn (iteratedDerivWithin m f s) s) ∧
      ∀ m : ℕ, (m : ℕ∞) < n → DifferentiableOn 𝕜 (iteratedDerivWithin m f s) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{s : Set 𝕜}
{n : ℕ∞}
(hs : UniqueDiffOn 𝕜 s)

ContDiffOn 𝕜 n f s ↔
  (∀ (m : ℕ), ↑m ≤ n → ContinuousOn (iteratedDerivWithin m f s) s) ∧
    ∀ (m : ℕ), ↑m < n → DifferentiableOn 𝕜 (iteratedDerivWithin m f s) s


@[to_additive]
theorem mk'_eq_of_eq {a₁ b₁ : M} {a₂ b₂ : S} (H : ↑a₂ * b₁ = ↑b₂ * a₁) :
    f.mk' a₁ a₂ = f.mk' b₁ b₂

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(f : S.LocalizationMap N)
{a₁ b₁ : M}
{a₂ b₂ : ↥S}
(H : ↑a₂ * b₁ = ↑b₂ * a₁)


theorem basisSets_neg (U) (hU' : U ∈ p.basisSets) :
    ∃ V ∈ p.basisSets, V ⊆ (fun x : E => -x) ⁻¹' U

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : SeminormFamily 𝕜 E ι)
(U : Set E)
(hU' : U ∈ p.basisSets)

∃ V ∈ p.basisSets, V ⊆ (fun x => -x) ⁻¹' U


theorem max_comm (a b : α) : max a b = max b a


theorem IsField.isPrincipalIdealRing {R : Type*} [CommRing R] (h : IsField R) :
    IsPrincipalIdealRing R

{R : Type u_1}
[CommRing R]
(h : IsField R)


@[simp]
lemma disjoint_union_right : Disjoint s (t ∪ u) ↔ Disjoint s t ∧ Disjoint s u


/-- The `ℝ`-spectrum of a Hermitian matrix over `RCLike` field is the range of the eigenvalue
function -/
theorem eigenvalues_eq_spectrum_real {a : Matrix n n 𝕜} (ha : IsHermitian a) :
    spectrum ℝ a = Set.range (ha.eigenvalues)

{n : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
[Fintype n]
[DecidableEq n]
{a : Matrix n n 𝕜}
(ha : a.IsHermitian)


@[to_additive (attr := simp)] lemma op_one [One α] : op (1 : α) = 1


@[simp] lemma swapLeft_prodMkRight (κ : Kernel α β) (γ : Type*) [MeasurableSpace γ] :
    swapLeft (prodMkRight γ κ) = prodMkLeft γ κ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(κ : ProbabilityTheory.Kernel α β)
(γ : Type u_6)
[MeasurableSpace γ]

(ProbabilityTheory.Kernel.prodMkRight γ κ).swapLeft = ProbabilityTheory.Kernel.prodMkLeft γ κ


{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
(X : LeftInvariantDerivation I G)


lemma smul_pow (r : M) (x : N) : ∀ n, (r • x) ^ n = r ^ n • x ^ n

{M : Type u_1}
{N : Type u_2}
[Monoid M]
[Monoid N]
[MulAction M N]
[IsScalarTower M N N]
[SMulCommClass M N N]
(r : M)
(x : N)
(n : ℕ)


lemma _root_.MonoidHom.compAddChar_injective_left (ψ : AddChar A M) (hψ : Surjective ψ) :
    Injective fun f : M →* N ↦ f.compAddChar ψ

{A : Type u_1}
{M : Type u_3}
{N : Type u_4}
[AddMonoid A]
[Monoid M]
[Monoid N]
(ψ : AddChar A M)
(hψ : Function.Surjective ⇑ψ)

Function.Injective fun f => f.compAddChar ψ


theorem lt_of_forall_lt_of_lt (a b : Lex (α →₀ N)) (i : α) :
    (∀ j < i, ofLex a j = ofLex b j) → ofLex a i < ofLex b i → a < b

{α : Type u_1}
{N : Type u_2}
[Zero N]
[LinearOrder α]
[PartialOrder N]
(a b : Lex (α →₀ N))
(i : α)

(∀ j < i, (ofLex a) j = (ofLex b) j) → (ofLex a) i < (ofLex b) i → a < b


theorem inv_antitoneOn_Ioi :
    AntitoneOn (fun x : α ↦ x⁻¹) (Set.Ioi 0)


lemma measurable_rnDerivAux_right (κ η : Kernel α γ) (a : α) :
    Measurable (fun x : γ ↦ rnDerivAux κ η a x)

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]


/-- An induction principle for `Projectivization`. Use as `induction v`. -/
@[elab_as_elim, cases_eliminator, induction_eliminator]
theorem ind {P : ℙ K V → Prop} (h : ∀ (v : V) (h : v ≠ 0), P (mk K v h)) : ∀ p, P p

(h : ∀ (v : V) (h : v ≠ 0), P (Projectivization.mk K v h))


/-- Every diagram indexing a pullback is naturally isomorphic (actually, equal) to a `cospan` -/
-- @[simps (config := { rhsMd := semireducible })]  Porting note: no semireducible
@[simps!]
def diagramIsoCospan (F : WalkingCospan ⥤ C) : F ≅ cospan (F.map inl) (F.map inr)

(F : CategoryTheory.Limits.WalkingCospan ⥤ C)

(CategoryTheory.Limits.diagramIsoCospan F).hom.app X = CategoryTheory.eqToHom ⋯


@[to_additive]
theorem eq_one_div_of_mul_eq_one_left (h : b * a = 1) : b = 1 / a

{α : Type u_1}
[DivisionMonoid α]
{a b : α}
(h : b * a = 1)


@[simp]
theorem support_uniformOfFinset : (uniformOfFinset s hs).support = s

{α : Type u_1}
{s : Finset α}
(hs : s.Nonempty)


@[simp]
theorem map_singleton (f : α → β) (a : α) : ({a} : Multiset α).map f = {f a}

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


theorem ofNat_val_sub {x y : Fin n} :
    (((x - y : Fin n)) : Int) = (((n - y : Nat) + (x : Int) : Int)) % n


theorem sin_sub_two_pi (x : ℂ) : sin (x - 2 * π) = sin x

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


/-- A set is a neighborhood of `a` if and only if it contains an interval `(l, u)` containing `a`,
provided `a` is neither a bottom element nor a top element. -/
theorem mem_nhds_iff_exists_Ioo_subset' [OrderTopology α] {a : α} {s : Set α} (hl : ∃ l, l < a)
    (hu : ∃ u, a < u) : s ∈ 𝓝 a ↔ ∃ l u, a ∈ Ioo l u ∧ Ioo l u ⊆ s

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}
{s : Set α}
(hl : ∃ l, l < a)
(hu : ∃ u, a < u)

s ∈ 𝓝 a ↔ ∃ l u, a ∈ Set.Ioo l u ∧ Set.Ioo l u ⊆ s


theorem snd_sumFinsuppLEquivProdFinsupp {α β : Type*} (f : α ⊕ β →₀ M) (y : β) :
    (sumFinsuppLEquivProdFinsupp R f).2 y = f (Sum.inr y)

{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_7}
{β : Type u_8}
(f : α ⊕ β →₀ M)
(y : β)

((Finsupp.sumFinsuppLEquivProdFinsupp R) f).2 y = f (Sum.inr y)


@[refl]
protected theorem refl (a : ℕ) : a ≡ a [MOD n]


@[simp]
theorem funMap_sumInl [(L.sum L').Structure M] [(LHom.sumInl : L →ᴸ L.sum L').IsExpansionOn M] {n}
    {f : L.Functions n} {x : Fin n → M} : @funMap (L.sum L') M _ n (Sum.inl f) x = funMap f x

FirstOrder.Language.Structure.funMap (Sum.inl f) x = FirstOrder.Language.Structure.funMap f x


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

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

↑S.starClosure = ⋂ s, ⋂ (_ : ↑(NonUnitalSubsemiring.closure (↑S ∪ star ↑S)) ⊆ ↑s), ↑s


theorem pairwise_disjoint_Ioo_add_intCast :
    Pairwise (Disjoint on fun n : ℤ => Ioo (a + n) (a + n + 1))

Pairwise (Disjoint on fun n => Set.Ioo (a + ↑n) (a + ↑n + 1))


@[to_additive]
protected theorem inv_mem_iff {x : G} : x⁻¹ ∈ H ↔ x ∈ H

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

x⁻¹ ∈ H ↔ x ∈ H


@[simp, norm_cast] lemma coe_castRingHom : (castRingHom α : ℕ → α) = Nat.cast


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

∀ {X Y : HomologicalComplex C c} (f : X ⟶ Y),
  (HomologicalComplex.opcyclesFunctor C c i).map f = HomologicalComplex.opcyclesMap f i


theorem getLast?_eq_get? : ∀ (l : List α), getLast? l = l.get? (l.length - 1)


theorem aestronglyMeasurable_withDensity_iff {E : Type*} [NormedAddCommGroup E]
    [NormedSpace ℝ E] {f : α → ℝ≥0} (hf : Measurable f) {g : α → E} :
    AEStronglyMeasurable g (μ.withDensity fun x => (f x : ℝ≥0∞)) ↔
      AEStronglyMeasurable (fun x => (f x : ℝ) • g x) μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : α → ℝ≥0}
(hf : Measurable f)
{g : α → E}

MeasureTheory.AEStronglyMeasurable g (μ.withDensity fun x => ↑(f x)) ↔
  MeasureTheory.AEStronglyMeasurable (fun x => ↑(f x) • g x) μ


@[to_additive (attr := simp)]
theorem norm_eq_zero {x : FreeGroup α} : norm x = 0 ↔ x = 1

{α : Type u}
[DecidableEq α]
{x : FreeAddGroup α}


nonrec theorem HasDerivAt.sub_const (hf : HasDerivAt f f' x) (c : F) :
    HasDerivAt (fun x => f x - c) f' x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
(hf : HasDerivAt f f' x)
(c : F)


theorem HasBasis.comap (f : β → α) (hl : l.HasBasis p s) :
    (l.comap f).HasBasis p fun i => f ⁻¹' s i

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

(Filter.comap f l).HasBasis p fun i => f ⁻¹' s i


/-- A continuous function is bounded above on a compact set. -/
theorem IsCompact.bddAbove_image [ClosedIciTopology α] [Nonempty α] {f : β → α} {K : Set β}
    (hK : IsCompact K) (hf : ContinuousOn f K) : BddAbove (f '' K)

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIciTopology α]
[Nonempty α]
{f : β → α}
{K : Set β}
(hK : IsCompact K)
(hf : ContinuousOn f K)


lemma map_eq_top_iff
    (f : R →+* S) {I : Ideal R} (hf₁ : Function.Injective f) (hf₂ : f.IsIntegral) :
    I.map f = ⊤ ↔ I = ⊤

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
(f : R →+* S)
{I : Ideal R}
(hf₁ : Function.Injective ⇑f)
(hf₂ : f.IsIntegral)


theorem LinearMap.mul_toMatrix₂ (B : M₁ →ₗ[R] M₂ →ₗ[R] R) (M : Matrix n' n R) :
    M * LinearMap.toMatrix₂ b₁ b₂ B =
      LinearMap.toMatrix₂ b₁' b₂ (B.comp (toLin b₁' b₁ Mᵀ))

{R : Type u_1}
{M₁ : Type u_7}
{M₂ : Type u_8}
{M₁' : Type u_9}
{n : Type u_12}
{m : Type u_13}
{n' : Type u_14}
[CommSemiring R]
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]
(b₁ : Basis n R M₁)
(b₂ : Basis m R M₂)
[AddCommMonoid M₁']
[Module R M₁']
(b₁' : Basis n' R M₁')
[Fintype n']
[DecidableEq n']
(B : M₁ →ₗ[R] M₂ →ₗ[R] R)
(M : Matrix n' n R)

M * (LinearMap.toMatrix₂ b₁ b₂) B = (LinearMap.toMatrix₂ b₁' b₂) (B ∘ₗ (Matrix.toLin b₁' b₁) Mᵀ)


theorem right_mem_segment (x y : E) : y ∈ [x -[𝕜] y]

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[MulActionWithZero 𝕜 E]
(x y : E)


@[simp]
theorem ContinuousMultilinearMap.uncurry0_apply (f : G[×0]→L[𝕜] G') : f.uncurry0 = f 0

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


@[to_additive]
theorem inv_ker_one {f : G → H} (hf : IsGroupHom f) {a b : G} (h : f a = f b) :
    f (a * b⁻¹) = 1

{G : Type u_1}
{H : Type u_2}
[Group G]
[Group H]
{f : G → H}
(hf : IsGroupHom f)
{a b : G}
(h : f a = f b)


lemma IsMatching.subgraphOfAdj (h : G.Adj v w) : (G.subgraphOfAdj h).IsMatching

{V : Type u_1}
{G : SimpleGraph V}
{v w : V}
(h : G.Adj v w)


lemma IsPreconnected.inter_derivedSet_nonempty [T1Space X] {U : Set X} (hs : IsPreconnected U)
    (a b : Set X) (h : U ⊆ a ∪ b) (ha : (U ∩ derivedSet a).Nonempty)
    (hb : (U ∩ derivedSet b).Nonempty) : (U ∩ (derivedSet a ∩ derivedSet b)).Nonempty

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{U : Set X}
(hs : IsPreconnected U)
(a b : Set X)
(h : U ⊆ a ∪ b)
(ha : (U ∩ derivedSet a).Nonempty)
(hb : (U ∩ derivedSet b).Nonempty)


/-- A *closed* measure zero subset is nowhere dense. (Closedness is required: for instance, the
rational numbers are countable (thus have measure zero), but are dense (hence not nowhere dense). -/
lemma IsNowhereDense.of_isClosed_null (h₁s : IsClosed s) (h₂s : μ s = 0) :
    IsNowhereDense s

{X : Type u_1}
[TopologicalSpace X]
[MeasurableSpace X]
{s : Set X}
{μ : MeasureTheory.Measure X}
[μ.IsOpenPosMeasure]
(h₁s : IsClosed s)
(h₂s : μ s = 0)


/-- The pigeonhole principle for finitely many pigeons counted by weight, non-strict inequality
version: if the total weight of a finite set of pigeons is greater than or equal to `n • b`, they
are sorted into some pigeonholes, and for all but `n > 0` pigeonholes the total weight of the
pigeons there is nonpositive, then for at least one of these `n` pigeonholes, the total weight of
the pigeons in this pigeonhole is greater than or equal to `b`. -/
theorem exists_le_sum_fiber_of_sum_fiber_nonpos_of_nsmul_le_sum
    (hf : ∀ y ∉ t, ∑ x ∈ s.filter fun x => f x = y, w x ≤ 0) (ht : t.Nonempty)
    (hb : t.card • b ≤ ∑ x ∈ s, w x) : ∃ y ∈ t, b ≤ ∑ x ∈ s.filter fun x => f x = y, w x

(hf : ∀ y ∉ t, ∑ x ∈ Finset.filter (fun x => f x = y) s, w x ≤ 0)

∃ y ∈ t, b ≤ ∑ x ∈ Finset.filter (fun x => f x = y) s, w x


lemma pow_ne_zero_iff (hn : n ≠ 0) : a ^ n ≠ 0 ↔ a ≠ 0

{M₀ : Type u_2}
[MonoidWithZero M₀]
{a : M₀}
{n : ℕ}
[NoZeroDivisors M₀]
(hn : n ≠ 0)


theorem image_toPullbackDiag (f : X → Y) (s : Set X) :
    toPullbackDiag f '' s = pullbackDiagonal f ∩ Subtype.val ⁻¹' s ×ˢ s

{X : Type u_1}
{Y : Sort u_2}
(f : X → Y)
(s : Set X)

toPullbackDiag f '' s = Function.pullbackDiagonal f ∩ Subtype.val ⁻¹' s ×ˢ s


@[simp]
theorem sumCongr_one {α β : Type*} : sumCongr (1 : Perm α) (1 : Perm β) = 1


@[simp]
theorem mkMetric'_toOuterMeasure (m : Set X → ℝ≥0∞) :
    (mkMetric' m).toOuterMeasure = (OuterMeasure.mkMetric' m).trim

{X : Type u_2}
[EMetricSpace X]
[MeasurableSpace X]
[BorelSpace X]
(m : Set X → ℝ≥0∞)

(MeasureTheory.Measure.mkMetric' m).toOuterMeasure = (MeasureTheory.OuterMeasure.mkMetric' m).trim


@[ghost_simps]
theorem ghostComponent_zero_verschiebungFun (x : 𝕎 R) :
    ghostComponent 0 (verschiebungFun x) = 0

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

(WittVector.ghostComponent 0) x.verschiebungFun = 0


theorem op_tensor_op {W X Y Z : C} (f : W ⟶ X) (g : Y ⟶ Z) : f.op ⊗ g.op = (f ⊗ g).op

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

CategoryTheory.MonoidalCategory.tensorHom f.op g.op = (CategoryTheory.MonoidalCategory.tensorHom f g).op


@[simp] theorem modifyHead_cons (a : α) (l : List α) (f : α → α) :
    (a :: l).modifyHead f = f a :: l

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


/-- The product of the constant function `1` over any set equals `1`. -/
@[to_additive "The sum of the constant function `0` over any set equals `0`."]
theorem finprod_mem_one (s : Set α) : (∏ᶠ i ∈ s, (1 : M)) = 1

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
(s : Set α)


@[to_additive]
theorem val_mk (a : α) (b h₁ h₂) : ↑(Units.mk a b h₁ h₂) = a

{α : Type u}
[AddMonoid α]
(a b : α)
(h₁ : a + b = 0)
(h₂ : b + a = 0)

↑{ val := a, neg := b, val_neg := h₁, neg_val := h₂ } = a


theorem image_comm {β'} {f : β → γ} {g : α → β} {f' : α → β'} {g' : β' → γ}
    (h_comm : ∀ a, f (g a) = g' (f' a)) : (s.image g).image f = (s.image f').image g'


theorem iIndepFun.condexp_natural_ae_eq_of_lt [SecondCountableTopology β] [CompleteSpace β]
    [NormedSpace ℝ β] (hf : ∀ i, StronglyMeasurable (f i)) (hfi : iIndepFun (fun _ => mβ) f μ)
    (hij : i < j) : μ[f j|Filtration.natural f hf i] =ᵐ[μ] fun _ => μ[f j]

{f : ι → Ω → β}

(hf : ∀ (i : ι), MeasureTheory.StronglyMeasurable (f i))

(hfi : ProbabilityTheory.iIndepFun (fun x => mβ) f μ)

μ[f j|↑(MeasureTheory.Filtration.natural f hf) i] =ᵐ[μ] fun x => ∫ (x : Ω), f j x ∂μ


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

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


theorem pow_dvd_card_of_pow_dvd_card [Finite G] {p n : ℕ} [hp : Fact p.Prime] (P : Sylow p G)
    (hdvd : p ^ n ∣ Nat.card G) : p ^ n ∣ Nat.card P

{G : Type u}
[Group G]
[Finite G]
{p n : ℕ}
[hp : Fact (Nat.Prime p)]
(P : Sylow p G)
(hdvd : p ^ n ∣ Nat.card G)


/-- If a function admits a power series expansion at `x`, then it is the uniform limit of the
partial sums of this power series on strict subdisks of the disk of convergence, i.e., `f (x + y)`
is the uniform limit of `p.partialSum n y` there. -/
theorem HasFPowerSeriesOnBall.tendstoUniformlyOn {r' : ℝ≥0} (hf : HasFPowerSeriesOnBall f p x r)
    (h : (r' : ℝ≥0∞) < r) :
    TendstoUniformlyOn (fun n y => p.partialSum n y) (fun y => f (x + y)) atTop
      (Metric.ball (0 : E) r')

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}
{r' : ℝ≥0}
(hf : HasFPowerSeriesOnBall f p x r)
(h : ↑r' < r)

TendstoUniformlyOn (fun n y => p.partialSum n y) (fun y => f (x + y)) Filter.atTop (Metric.ball 0 ↑r')


@[simp]
theorem smul_mem_smul_set_iff₀ (ha : a ≠ 0) (A : Set β) (x : β) : a • x ∈ a • A ↔ x ∈ A

{α : Type u_2}
{β : Type u_3}
[GroupWithZero α]
[MulAction α β]
{a : α}
(ha : a ≠ 0)
(A : Set β)
(x : β)


@[gcongr]
theorem inf_le_inf_left (a : α) {b c : α} (h : b ≤ c) : a ⊓ b ≤ a ⊓ c

{α : Type u}
[SemilatticeInf α]
(a : α)
{b c : α}
(h : b ≤ c)


theorem toLp_inj {f g : C(α, E)} [μ.IsOpenPosMeasure] [NormedField 𝕜] [NormedSpace 𝕜 E] :
    toLp (E := E) p μ 𝕜 f = toLp (E := E) p μ 𝕜 g ↔ f = g

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
(μ : MeasureTheory.Measure α)
[NormedAddCommGroup E]
[TopologicalSpace α]
[BorelSpace α]
[SecondCountableTopologyEither α E]
[CompactSpace α]
[MeasureTheory.IsFiniteMeasure μ]
{𝕜 : Type u_5}
[Fact (1 ≤ p)]
{f g : C(α, E)}
[μ.IsOpenPosMeasure]
[NormedField 𝕜]
[NormedSpace 𝕜 E]

(ContinuousMap.toLp p μ 𝕜) f = (ContinuousMap.toLp p μ 𝕜) g ↔ f = g


@[to_additive]
theorem mul_top_of_one_le (hf : 1 ≤ f) : f * ⊤ = ⊤

{α : Type u_2}
[AddMonoid α]
{f : Filter α}
(hf : 0 ≤ f)


/-- Constructs a `HasShift C A` instance from `ShiftMkCore`. -/
@[simps]
def hasShiftMk (h : ShiftMkCore C A) : HasShift C A

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

CategoryTheory.HasShift.shift.toFunctor = CategoryTheory.Discrete.functor h.F


@[to_additive]
theorem iInter₂_mul_subset (s : ∀ i, κ i → Set α) (t : Set α) :
    (⋂ (i) (j), s i j) * t ⊆ ⋂ (i) (j), s i j * t

{α : Type u_2}
{ι : Sort u_5}
{κ : ι → Sort u_6}
[Mul α]
(s : (i : ι) → κ i → Set α)
(t : Set α)

(⋂ i, ⋂ j, s i j) * t ⊆ ⋂ i, ⋂ j, s i j * t


theorem Subset.trans {s t u : Multiset α} : s ⊆ t → t ⊆ u → s ⊆ u


theorem mem_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → NonUnitalSubsemiring R}
    (hS : Directed (· ≤ ·) S) {x : R} : (x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i

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


@[simp] lemma nnnorm_ofDual (x : Eᵒᵈ) : ‖ofDual x‖₊ = ‖x‖₊


theorem Submodule.connectedComponentIn_eq_self_of_one_lt_codim (E : Submodule ℝ F)
    (hcodim : 1 < Module.rank ℝ (F ⧸ E)) {x : F} (hx : x ∉ E) :
    connectedComponentIn ((E : Set F)ᶜ) x = (E : Set F)ᶜ

{F : Type u_1}
[AddCommGroup F]
[Module ℝ F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousSMul ℝ F]
(E : Submodule ℝ F)
(hcodim : 1 < Module.rank ℝ (F ⧸ E))
{x : F}
(hx : x ∉ E)


theorem up_iSup [SupSet α] (f : ι → α) : up (⨆ i, f i) = ⨆ i, up (f i)

{α : Type u_1}
{ι : Sort u_5}
[SupSet α]
(f : ι → α)

{ down := ⨆ i, f i } = ⨆ i, { down := f i }


theorem addEquality_sat (w : c + Coeffs.dot x y = 0) :
    Constraint.sat' { lowerBound := some (-c), upperBound := some (-c) } x y

{c : Int}
{x y : Lean.Omega.Coeffs}
(w : c + x.dot y = 0)

{ lowerBound := some (-c), upperBound := some (-c) }.sat' x y = true


@[simp]
theorem constantCoeff_comp_C : (constantCoeff σ R).comp (C σ R) = RingHom.id R

{σ : Type u_1}
{R : Type u_2}
[Semiring R]

(MvPowerSeries.constantCoeff σ R).comp (MvPowerSeries.C σ R) = RingHom.id R


@[simp]
theorem floor_nat : (Nat.floor : ℕ → ℕ) = id


@[to_additive]
theorem mul_self_mem_of_index_two (h : H.index = 2) (a : G) : a * a ∈ H

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
(h : H.index = 2)
(a : G)


@[simp]
theorem quotientMulEquivQuotientProd_fst (I J : Ideal R) (coprime : IsCoprime I J) (x : R ⧸ I * J) :
    (quotientMulEquivQuotientProd I J coprime x).fst =
      Ideal.Quotient.factor (I * J) I mul_le_right x

{R : Type u}
[CommRing R]
(I J : Ideal R)
(coprime : IsCoprime I J)
(x : R ⧸ I * J)

((I.quotientMulEquivQuotientProd J coprime) x).1 = (Ideal.Quotient.factor (I * J) I ⋯) x


theorem IsTheta.div {f₁ f₂ : α → 𝕜} {g₁ g₂ : α → 𝕜'} (h₁ : f₁ =Θ[l] g₁) (h₂ : f₂ =Θ[l] g₂) :
    (fun x ↦ f₁ x / f₂ x) =Θ[l] fun x ↦ g₁ x / g₂ x

{α : Type u_1}
{𝕜 : Type u_14}
{𝕜' : Type u_15}
[NormedField 𝕜]
[NormedField 𝕜']
{l : Filter α}
{f₁ f₂ : α → 𝕜}
{g₁ g₂ : α → 𝕜'}
(h₁ : f₁ =Θ[l] g₁)
(h₂ : f₂ =Θ[l] g₂)

(fun x => f₁ x / f₂ x) =Θ[l] fun x => g₁ x / g₂ x


theorem mod_lt : ∀ (a) {b : R}, b ≠ 0 → a % b ≺ b

{R : Type u}
[EuclideanDomain R]
(a : R)
{b : R}


/-- The gaussian pdf is strongly measurable. -/
lemma stronglyMeasurable_gaussianPDFReal (μ : ℝ) (v : ℝ≥0) :
    StronglyMeasurable (gaussianPDFReal μ v)

MeasureTheory.StronglyMeasurable (ProbabilityTheory.gaussianPDFReal μ v)


theorem formPerm_disjoint_iff (hl : Nodup l) (hl' : Nodup l') (hn : 2 ≤ l.length)
    (hn' : 2 ≤ l'.length) : Perm.Disjoint (formPerm l) (formPerm l') ↔ l.Disjoint l'

{α : Type u_1}
[DecidableEq α]
{l l' : List α}
(hl : l.Nodup)
(hl' : l'.Nodup)
(hn : 2 ≤ l.length)
(hn' : 2 ≤ l'.length)

l.formPerm.Disjoint l'.formPerm ↔ l.Disjoint l'


@[to_additive]
theorem smul_le_smul : f₁ ≤ f₂ → g₁ ≤ g₂ → f₁ • g₁ ≤ f₂ • g₂

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{f₁ f₂ : Filter α}
{g₁ g₂ : Filter β}

f₁ ≤ f₂ → g₁ ≤ g₂ → f₁ • g₁ ≤ f₂ • g₂


theorem card {R : Type*} [Fintype R] :
    Fintype.card (TruncatedWittVector p n R) = Fintype.card R ^ n


protected theorem dvd_refl (n : Int) : n ∣ n


/-- Noncommutative version of `Algebra.adjoin_range_eq_range_aeval`. -/
theorem _root_.Algebra.adjoin_range_eq_range_freeAlgebra_lift (f : X → A) :
    Algebra.adjoin R (Set.range f) = (FreeAlgebra.lift R f).range

(R : Type u_1)
[CommSemiring R]
(X : Type u_2)
{A : Type u_3}
[Semiring A]
[Algebra R A]
(f : X → A)

Algebra.adjoin R (Set.range f) = ((FreeAlgebra.lift R) f).range


@[simp]
theorem localizationToStalk_of (x : PrimeSpectrum.Top R) (f : R) :
    localizationToStalk R x (algebraMap _ (Localization _) f) = toStalk R x f

(x : ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

(AlgebraicGeometry.StructureSheaf.localizationToStalk R x) ((algebraMap R (Localization x.asIdeal.primeCompl)) f) =
  (AlgebraicGeometry.StructureSheaf.toStalk R x) f


/-- A morphism factors through the image sheaf. -/
@[simps]
def toImageSheaf {F F' : Sheaf J (Type w)} (f : F ⟶ F') : F ⟶ imageSheaf f

{J : CategoryTheory.GrothendieckTopology C}

{F F' : CategoryTheory.Sheaf J (Type w)}

(CategoryTheory.GrothendieckTopology.toImageSheaf f).val = J.toImagePresheafSheafify f.val


theorem mul_lt_aleph0_iff {a b : Cardinal} : a * b < ℵ₀ ↔ a = 0 ∨ b = 0 ∨ a < ℵ₀ ∧ b < ℵ₀

a * b < Cardinal.aleph0 ↔ a = 0 ∨ b = 0 ∨ a < Cardinal.aleph0 ∧ b < Cardinal.aleph0


theorem derivation_eq_of_forall_mem_vars {D₁ D₂ : Derivation R (MvPolynomial σ R) A}
    {f : MvPolynomial σ R} (h : ∀ i ∈ f.vars, D₁ (X i) = D₂ (X i)) : D₁ f = D₂ f

(h : ∀ i ∈ f.vars, D₁ (MvPolynomial.X i) = D₂ (MvPolynomial.X i))


theorem Sbtw.left_mem_affineSpan {x y z : P} (h : Sbtw R x y z) : x ∈ line[R, z, y]

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


@[simp, norm_cast]
lemma cast_multiset_sum [AddCommGroupWithOne β] (s : Multiset ℤ) :
    (↑s.sum : β) = (s.map (↑)).sum

{β : Type u_3}
[AddCommGroupWithOne β]
(s : Multiset ℤ)


theorem coe_injective {α} : Injective ((↑) : Finset α → Set α)


theorem getElem?_range {m n : Nat} (h : m < n) : (range n)[m]? = some m


theorem natDegree_C_mul_eq_of_mul_eq_one {ai : R} (au : ai * a = 1) :
    (C a * p).natDegree = p.natDegree

{R : Type u}
{a : R}
[Semiring R]
{p : R[X]}
{ai : R}
(au : ai * a = 1)

(Polynomial.C a * p).natDegree = p.natDegree


theorem add_mul_self (x y : R) : (x + y) * (x + y) = x * x + y * y

{R : Type u_1}
[CommSemiring R]
[CharP R 2]
(x y : R)


theorem isStrictWeakOrder_of_isOrderConnected [IsAsymm α r] [IsOrderConnected α r] :
    IsStrictWeakOrder α r

{α : Type u}
{r : α → α → Prop}
[IsAsymm α r]
[IsOrderConnected α r]


/-- `Sum.map` as a relation embedding between `Sum.LiftRel` relations. -/
@[simps]
def sumLiftRelMap (f : r ↪r s) (g : t ↪r u) : Sum.LiftRel r t ↪r Sum.LiftRel s u

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{r : α → α → Prop}
{s : β → β → Prop}
{t : γ → γ → Prop}
{u : δ → δ → Prop}
(f : r ↪r s)
(g : t ↪r u)

∀ (a : α ⊕ γ), (f.sumLiftRelMap g) a = Sum.map (⇑f) (⇑g) a


/-- The limit bicone for the biproduct over an index type with exactly one term. -/
@[simps]
def limitBiconeOfUnique : LimitBicone f

(CategoryTheory.Limits.limitBiconeOfUnique f).bicone.π j = CategoryTheory.eqToHom ⋯


@[simp]
theorem lie_sup : ⁅I, N ⊔ N'⁆ = ⁅I, N⁆ ⊔ ⁅I, N'⁆

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


theorem _root_.quasispectrum.isCompact (a : B) : IsCompact (quasispectrum 𝕜 a)

{𝕜 : Type u_1}
[NormedField 𝕜]
{B : Type u_3}
[NonUnitalNormedRing B]
[NormedSpace 𝕜 B]
[CompleteSpace B]
[IsScalarTower 𝕜 B B]
[SMulCommClass 𝕜 B B]
[ProperSpace 𝕜]
(a : B)


/-- If `γ` is an invertible element of a linearly ordered group with zero element adjoined, then
`Iio (γ : Γ₀)` is a neighbourhood of `0`. -/
theorem nhds_zero_of_units (γ : Γ₀ˣ) : Iio ↑γ ∈ 𝓝 (0 : Γ₀)

{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
(γ : Γ₀ˣ)


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

∀ {X Y : HomologicalComplex C c} (f : X ⟶ Y),
  (HomologicalComplex.homologyFunctor C c i).map f = HomologicalComplex.homologyMap f i


/-- `OrientedCmp cmp` asserts that `cmp` is determined by the relation `cmp x y = .lt`. -/
class OrientedCmp (cmp : α → α → Ordering) : Prop where
  /-- The comparator operation is symmetric, in the sense that if `cmp x y` equals `.lt` then
  `cmp y x = .gt` and vice versa. -/
  symm (x y) : (cmp x y).swap = cmp y x

{α : Sort u_1}
{cmp : α → α → Ordering}
[self : Batteries.OrientedCmp cmp]
(x y : α)


theorem powerset_inter (s t : Set α) : 𝒫(s ∩ t) = 𝒫 s ∩ 𝒫 t


theorem map_bind (q : α → PMF β) (f : β → γ) : (p.bind q).map f = p.bind fun a => (q a).map f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(p : PMF α)
(q : α → PMF β)
(f : β → γ)

PMF.map f (p.bind q) = p.bind fun a => PMF.map f (q a)


/-- This definition provides a convenient way to show that a multicofork is a colimit. -/
@[simps]
def IsColimit.mk (desc : ∀ E : Multicofork I, K.pt ⟶ E.pt)
    (fac : ∀ (E : Multicofork I) (i : I.R), K.π i ≫ desc E = E.π i)
    (uniq : ∀ (E : Multicofork I) (m : K.pt ⟶ E.pt), (∀ i : I.R, K.π i ≫ m = E.π i) → m = desc E) :
    IsColimit K

{I : CategoryTheory.Limits.MultispanIndex C}

(K : CategoryTheory.Limits.Multicofork I)

(desc : (E : CategoryTheory.Limits.Multicofork I) → K.pt ⟶ E.pt)

(fac :
  ∀ (E : CategoryTheory.Limits.Multicofork I) (i : I.R), CategoryTheory.CategoryStruct.comp (K.π i) (desc E) = E.π i)

(uniq :
  ∀ (E : CategoryTheory.Limits.Multicofork I) (m : K.pt ⟶ E.pt),
    (∀ (i : I.R), CategoryTheory.CategoryStruct.comp (K.π i) m = E.π i) → m = desc E)

(CategoryTheory.Limits.Multicofork.IsColimit.mk K desc fac uniq).desc E = desc E


@[to_additive]
lemma prod_lt_prod_of_ne_nil [Preorder M] [CovariantClass M M (· * ·) (· < ·)]
    [CovariantClass M M (· * ·) (· ≤ ·)] [CovariantClass M M (Function.swap (· * ·)) (· < ·)]
    [CovariantClass M M (Function.swap (· * ·)) (· ≤ ·)] {l : List ι} (hl : l ≠ []) (f g : ι → M)
    (hlt : ∀ i ∈ l, f i < g i) : (l.map f).prod < (l.map g).prod

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

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

[CovariantClass M M (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1]

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


theorem map₂_sup_left : map₂ m (f₁ ⊔ f₂) g = map₂ m f₁ g ⊔ map₂ m f₂ g

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{m : α → β → γ}
{f₁ f₂ : Filter α}
{g : Filter β}

Filter.map₂ m (f₁ ⊔ f₂) g = Filter.map₂ m f₁ g ⊔ Filter.map₂ m f₂ g


/-- Given `(S : Solution)`, we have that `λ ^ 2` does not divide `S.a + η * S.b`. -/
lemma lambda_sq_not_dvd_a_add_eta_mul_b : ¬ λ ^ 2 ∣ (S.a + η * S.b)

(S : FermatLastTheoremForThreeGen.Solution hζ)

¬(hζ.toInteger - 1) ^ 2 ∣ S.a + ↑⋯.unit * S.b


theorem measure_image_eq_zero_of_comap_eq_zero {β} [MeasurableSpace α] {_mβ : MeasurableSpace β}
    (f : α → β) (μ : Measure β) (hfi : Injective f)
    (hf : ∀ s, MeasurableSet s → NullMeasurableSet (f '' s) μ) {s : Set α} (hs : comap f μ s = 0) :
    μ (f '' s) = 0

(hf : ∀ (s : Set α), MeasurableSet s → MeasureTheory.NullMeasurableSet (f '' s) μ)

(hs : (MeasureTheory.Measure.comap f μ) s = 0)


theorem succ_le_of_lt {a b : α} : a < b → succ a ≤ b

{α : Type u_1}
[Preorder α]
[SuccOrder α]
{a b : α}


theorem blocksFun_sigmaCompositionAux (a : Composition n) (b : Composition a.length)
    (i : Fin b.length) (j : Fin (blocksFun b i)) :
    blocksFun (sigmaCompositionAux a b ⟨i, (length_gather a b).symm ▸ i.2⟩)
        ⟨j, (length_sigmaCompositionAux a b i).symm ▸ j.2⟩ =
      blocksFun a (embedding b i j)

{n : ℕ}
(a : Composition n)
(b : Composition a.length)
(i : Fin b.length)
(j : Fin (b.blocksFun i))

(a.sigmaCompositionAux b ⟨↑i, ⋯⟩).blocksFun ⟨↑j, ⋯⟩ = a.blocksFun ((b.embedding i) j)


@[to_additive]
theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i))
    (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x

(hf : LocallyFinite fun i => Function.support (f i))


@[to_additive]
theorem Step.cons_left_iff {a : α} {b : Bool} :
    Step ((a, b) :: L₁) L₂ ↔ (∃ L, Step L₁ L ∧ L₂ = (a, b) :: L) ∨ L₁ = (a, ! b) :: L₂

{α : Type u}
{L₁ L₂ : List (α × Bool)}
{a : α}
{b : Bool}

FreeGroup.Red.Step ((a, b) :: L₁) L₂ ↔ (∃ L, FreeGroup.Red.Step L₁ L ∧ L₂ = (a, b) :: L) ∨ L₁ = (a, !b) :: L₂


@[simp]
theorem not_infPrime : ¬InfPrime a ↔ IsMax a ∨ ∃ b c, b ⊓ c ≤ a ∧ ¬b ≤ a ∧ ¬c ≤ a

{α : Type u_2}
[SemilatticeInf α]
{a : α}


lemma equalizerCondition_w (P : Cᵒᵖ ⥤ D) {X B : C} {π : X ⟶ B} (c : PullbackCone π π) :
    P.map π.op ≫ P.map c.fst.op = P.map π.op ≫ P.map c.snd.op

(c : CategoryTheory.Limits.PullbackCone π π)

CategoryTheory.CategoryStruct.comp (P.map π.op) (P.map c.fst.op) =
  CategoryTheory.CategoryStruct.comp (P.map π.op) (P.map c.snd.op)


@[to_additive]
theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α) :
    ⇑(∏ x ∈ s, f x) = ∏ x ∈ s, ⇑(f x)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[AddZeroClass β]
[AddCommMonoid γ]
(f : α → β →+ γ)
(s : Finset α)


@[simp]
theorem toMul_list_sum (s : List (Additive α)) : toMul s.sum = (s.map toMul).prod

{α : Type u_3}
[Monoid α]
(s : List (Additive α))

Additive.toMul s.sum = (List.map (⇑Additive.toMul) s).prod


@[simp]
protected theorem sub_iff_left :
    a₁ ≡ b₁ [PMOD p] → (a₁ - a₂ ≡ b₁ - b₂ [PMOD p] ↔ a₂ ≡ b₂ [PMOD p])

{α : Type u_1}
[AddCommGroup α]
{p a₁ a₂ b₁ b₂ : α}


theorem expSeries_summable' (x : 𝔸) : Summable fun n => (n !⁻¹ : 𝕂) • x ^ n

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
(x : 𝔸)

Summable fun n => (↑n.factorial)⁻¹ • x ^ n


@[simp]
lemma tilted_zero' (μ : Measure α) : μ.tilted 0 = (μ Set.univ)⁻¹ • μ

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


theorem sub : mapFun f (x - y) = mapFun f x - mapFun f y

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

WittVector.mapFun (⇑f) (x - y) = WittVector.mapFun (⇑f) x - WittVector.mapFun (⇑f) y


theorem ZMod.trace_pow_card {p : ℕ} [Fact p.Prime] (M : Matrix n n (ZMod p)) :
    trace (M ^ p) = trace M ^ p

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


theorem bijective_iterateFrobenius : Bijective (iterateFrobenius R p n)

(R : Type u_1)
(p n : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]

Function.Bijective ⇑(iterateFrobenius R p n)


theorem orderTop_eq_top_iff {x : HahnSeries Γ R} : orderTop x = ⊤ ↔ x = 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{x : HahnSeries Γ R}


/-- In a canonically-ordered monoid, a product bounds each of its terms.

See also `Finset.single_le_prod'`. -/
@[to_additive "In a canonically-ordered additive monoid, a sum bounds each of its terms.

See also `Finset.single_le_sum`."]
lemma _root_.CanonicallyOrderedCommMonoid.single_le_prod {i : ι} (hi : i ∈ s) :
    f i ≤ ∏ j ∈ s, f j

{ι : Type u_1}
{M : Type u_4}
[CanonicallyOrderedCommMonoid M]
{f : ι → M}
{s : Finset ι}
{i : ι}
(hi : i ∈ s)


@[simp]
theorem integral_zero : (∫ _ in a..b, (0 : E) ∂μ) = 0

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}


theorem setSeq_prod_subset {N m n} (hm : N ≤ m) (hn : N ≤ n) :
    setSeq hf U_mem m ×ˢ setSeq hf U_mem n ⊆ U N

{α : Type u}
[uniformSpace : UniformSpace α]
{f : Filter α}
(hf : Cauchy f)
{U : ℕ → Set (α × α)}
(U_mem : ∀ (n : ℕ), U n ∈ 𝓤 α)
{N m n : ℕ}
(hm : N ≤ m)
(hn : N ≤ n)

SequentiallyComplete.setSeq hf U_mem m ×ˢ SequentiallyComplete.setSeq hf U_mem n ⊆ U N


@[simp]
theorem invOf_sym [Mul α] [AddMonoidWithOne α] [Invertible (2 : α)] (a : α) [Invertible a] :
    ⅟ (sym a) = sym (⅟ a)

{α : Type u_1}
[Mul α]
[AddMonoidWithOne α]
[Invertible 2]
(a : α)
[Invertible a]