theorem Commute.isRightRegular_iff {a : R} (ca : ∀ b, Commute a b) :
    IsRightRegular a ↔ IsLeftRegular a

{R : Type u_1}
[Mul R]
{a : R}
(ca : ∀ (b : R), Commute a b)


lemma cpow_ofReal_re (x : ℂ) (y : ℝ) : (x ^ (y : ℂ)).re = (abs x) ^ y * Real.cos (arg x * y)

(x ^ ↑y).re = Complex.abs x ^ y * Real.cos (x.arg * y)


theorem image₂_union_inter_subset {f : α → α → β} {s t : Finset α} (hf : ∀ a b, f a b = f b a) :
    image₂ f (s ∪ t) (s ∩ t) ⊆ image₂ f s t

{α : Type u_1}
{β : Type u_3}
[DecidableEq α]
[DecidableEq β]
{f : α → α → β}
{s t : Finset α}
(hf : ∀ (a b : α), f a b = f b a)

Finset.image₂ f (s ∪ t) (s ∩ t) ⊆ Finset.image₂ f s t


theorem vComp_apply_coe (t : Icc v.tMin v.tMax) : f.vComp t = v t (f t)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{v : PicardLindelof E}
(f : v.FunSpace)
(t : ↑(Set.Icc v.tMin v.tMax))


/-- Seeing `ℝ≥0∞` as `ℝ≥0` does not change their sum, unless one of the `ℝ≥0∞` is
infinity -/
theorem toNNReal_sum {s : Finset α} {f : α → ℝ≥0∞} (hf : ∀ a ∈ s, f a ≠ ∞) :
    ENNReal.toNNReal (∑ a ∈ s, f a) = ∑ a ∈ s, ENNReal.toNNReal (f a)

{α : Type u_1}
{s : Finset α}
{f : α → ℝ≥0∞}
(hf : ∀ a ∈ s, f a ≠ ⊤)

(∑ a ∈ s, f a).toNNReal = ∑ a ∈ s, (f a).toNNReal


@[to_additive]
lemma iCondIndepFun.indepFun_div_div (hf_indep : iCondIndepFun m' hm' (fun _ ↦ m) f μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    CondIndepFun m' hm' (f i / f j) (f k / f l) μ

{f : ι → Ω → β}

(hf_indep : ProbabilityTheory.iCondIndepFun m' hm' (fun x => m) f μ)

ProbabilityTheory.CondIndepFun m' hm' (f i - f j) (f k - f l) μ


theorem isGLB_empty [OrderTop α] : IsGLB ∅ (⊤ : α)


/-- The functor `Square C ⥤ Arrow (Arrow C)` which sends a
commutative square `sq` to the obvious arrow from the top morphism of `sq`
to the bottom morphism of `sq`. -/
@[simps!]
def toArrowArrowFunctor' : Square C ⥤ Arrow (Arrow C)

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

(CategoryTheory.Square.toArrowArrowFunctor'.obj sq).right.left = sq.X₃


@[simp]
theorem toFun_eq_coe (f : LocallyConstant X Y) : f.toFun = f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
(f : LocallyConstant X Y)


@[simp] theorem freeOn_dual_eq : (freeOn E)✶ = loopyOn E


nonrec theorem HasStrictDerivAt.neg (h : HasStrictDerivAt f f' x) :
    HasStrictDerivAt (fun x => -f x) (-f') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
(h : HasStrictDerivAt f f' x)


protected theorem Connected.pos_dist_of_ne (hconn : G.Connected) (hne : u ≠ v) :
    0 < G.dist u v

{V : Type u_1}
{G : SimpleGraph V}
{u v : V}
(hconn : G.Connected)
(hne : u ≠ v)


@[simp]
theorem equiv_symm_eps :
    CliffordAlgebraDualNumber.equiv.symm (eps : R[ε]) = ι (0 : QuadraticForm R R) 1

CliffordAlgebraDualNumber.equiv.symm DualNumber.eps = (CliffordAlgebra.ι 0) 1


/-- The terminal object in `Factorisation f`, with the codomain of `f` as its midpoint. -/
@[simps]
protected def terminal : Factorisation f

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

CategoryTheory.Factorisation.terminal.π = CategoryTheory.CategoryStruct.id Y


theorem Matrix.toLin'_apply' (M : Matrix m n R) : Matrix.toLin' M = M.mulVecLin

{R : Type u_1}
[CommSemiring R]
{m : Type u_4}
{n : Type u_5}
[DecidableEq n]
[Fintype n]
(M : Matrix m n R)


theorem isUnital_leftAdd : EckmannHilton.IsUnital (· +ₗ ·) 0

EckmannHilton.IsUnital (fun x x_1 => CategoryTheory.SemiadditiveOfBinaryBiproducts.leftAdd X Y x x_1) 0


@[simp]
theorem sign_nonneg_iff : 0 ≤ sign a ↔ 0 ≤ a

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


theorem measure_union_congr_of_subset {t₁ t₂ : Set α} (hs : s₁ ⊆ s₂) (hsμ : μ s₂ ≤ μ s₁)
    (ht : t₁ ⊆ t₂) (htμ : μ t₂ ≤ μ t₁) : μ (s₁ ∪ t₁) = μ (s₂ ∪ t₂)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s₁ s₂ t₁ t₂ : Set α}
(hs : s₁ ⊆ s₂)
(hsμ : μ s₂ ≤ μ s₁)
(ht : t₁ ⊆ t₂)
(htμ : μ t₂ ≤ μ t₁)


@[measurability, fun_prop]
theorem AEMeasurable.norm {f : β → α} {μ : Measure β} (hf : AEMeasurable f μ) :
    AEMeasurable (fun a => norm (f a)) μ

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


@[to_additive]
theorem iUnion_div_left_image : ⋃ a ∈ s, (a / ·) '' t = s / t


/-- Generalization of `IsIntegral.of_mem_closure` bootstrapped up from that lemma -/
theorem IsIntegral.of_mem_closure' (G : Set A) (hG : ∀ x ∈ G, IsIntegral R x) :
    ∀ x ∈ Subring.closure G, IsIntegral R x

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
(G : Set A)
(hG : ∀ x ∈ G, IsIntegral R x)
(x : A)


nonrec theorem exp_bound {x : ℝ} (hx : |x| ≤ 1) {n : ℕ} (hn : 0 < n) :
    |exp x - ∑ m ∈ range n, x ^ m / m.factorial| ≤ |x| ^ n * (n.succ / (n.factorial * n))

|Real.exp x - ∑ m ∈ Finset.range n, x ^ m / ↑m.factorial| ≤ |x| ^ n * (↑n.succ / (↑n.factorial * ↑n))


@[to_additive]
theorem map_mul_left_ae (μ : Measure G) [IsMulLeftInvariant μ] (x : G) :
    Filter.map (fun h => x * h) (ae μ) = ae μ

{G : Type u_2}
[MeasurableSpace G]
[Group G]
[MeasurableMul G]
(μ : MeasureTheory.Measure G)
[μ.IsMulLeftInvariant]
(x : G)

Filter.map (fun h => x * h) (MeasureTheory.ae μ) = MeasureTheory.ae μ


/-- The (open) thickening of a set contains the closure of the set. -/
theorem closure_subset_thickening {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) :
    closure E ⊆ thickening δ E

{α : Type u}
[PseudoEMetricSpace α]
{δ : ℝ}
(δ_pos : 0 < δ)
(E : Set α)


/-- Let `μ` be a σ-finite left invariant measure on `G`. Then `μ` is equal to the Haar measure
defined by `K₀` iff `μ K₀ = 1`. -/
@[to_additive]
theorem haarMeasure_eq_iff (K₀ : PositiveCompacts G) (μ : Measure G) [SigmaFinite μ]
    [IsMulLeftInvariant μ] :
    haarMeasure K₀ = μ ↔ μ K₀ = 1

(K₀ : TopologicalSpace.PositiveCompacts G)

MeasureTheory.Measure.haarMeasure K₀ = μ ↔ μ ↑K₀ = 1


theorem nhds_basis_closeds (x : X) : (𝓝 x).HasBasis (fun s : Set X => x ∉ s ∧ IsClosed s) compl

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

(𝓝 x).HasBasis (fun s => x ∉ s ∧ IsClosed s) compl


@[simp]
theorem coe_top : ((⊤ : HomogeneousIdeal 𝒜) : Set A) = univ

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[DecidableEq ι]
[AddMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[GradedRing 𝒜]


theorem convex_openSegment (a b : E) : Convex 𝕜 (openSegment 𝕜 a b)

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


lemma eventuallyConst_atTop_nat {f : ℕ → α} :
    EventuallyConst f atTop ↔ ∃ n, ∀ m, n ≤ m → f (m + 1) = f m

Filter.EventuallyConst f Filter.atTop ↔ ∃ n, ∀ (m : ℕ), n ≤ m → f (m + 1) = f m


@[simp]
lemma apply_root_root_zero_iff : B (P.root i) (P.root j) = 0 ↔ P.pairing i j = 0

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[LinearOrderedCommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
{P : RootPairing ι R M N}
(B : M →ₗ[R] M →ₗ[R] R)
[P.IsRootPositive B]
(i j : ι)

(B (P.root i)) (P.root j) = 0 ↔ P.pairing i j = 0


theorem linearIndependent_equiv (e : ι ≃ ι') {f : ι' → M} :
    LinearIndependent R (f ∘ e) ↔ LinearIndependent R f

{ι : Type u'}
{ι' : Type u_1}
{R : Type u_2}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(e : ι ≃ ι')
{f : ι' → M}

LinearIndependent R (f ∘ ⇑e) ↔ LinearIndependent R f


@[simp] -- Porting note: removed `norm_cast`
theorem coe_to_affineMap (f : P →ᴬ[R] Q) : ((f : P →ᵃ[R] Q) : P → Q) = f

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
{Q : Type u_5}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace Q]
[AddTorsor W Q]
(f : P →ᴬ[R] Q)


@[to_additive (attr := measurability)]
theorem Measurable.mul_const [MeasurableMul M] (hf : Measurable f) (c : M) :
    Measurable fun x => f x * c

{M : Type u_2}
{α : Type u_3}
[MeasurableSpace M]
[Add M]
{m : MeasurableSpace α}
{f : α → M}
[MeasurableAdd M]
(hf : Measurable f)
(c : M)


protected theorem comap_comp (g : C(β, γ)) (f : C(α, β)) :
    comap (g.comp f) = (comap f).comp (comap g)

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

TopologicalSpace.Opens.comap (g.comp f) = (TopologicalSpace.Opens.comap f).comp (TopologicalSpace.Opens.comap g)


theorem IsClique.subset (h : t ⊆ s) : G.IsClique s → G.IsClique t

{α : Type u_1}
{G : SimpleGraph α}
{s t : Set α}
(h : t ⊆ s)


/-- An `n`-Freiman homomorphism from a set `A` to a set `B` is a map which preserves products of `n`
elements. -/
@[to_additive]
structure IsMulFreimanHom (n : ℕ) (A : Set α) (B : Set β) (f : α → β) : Prop where
  mapsTo : MapsTo f A B
  /-- An `n`-Freiman homomorphism preserves products of `n` elements. -/
  map_prod_eq_map_prod ⦃s t : Multiset α⦄ (hsA : ∀ ⦃x⦄, x ∈ s → x ∈ A) (htA : ∀ ⦃x⦄, x ∈ t → x ∈ A)
    (hs : Multiset.card s = n) (ht : Multiset.card t = n) (h : s.prod = t.prod) :
    (s.map f).prod = (t.map f).prod

{α : Type u_2}
{β : Type u_3}
[CommMonoid α]
[CommMonoid β]
{n : ℕ}
{A : Set α}
{B : Set β}
{f : α → β}
(self : IsMulFreimanHom n A B f)


theorem decide_eq_true : [inst : Decidable p] → p → Eq (decide p) true


@[simp]
theorem cos_sub_nat_mul_two_pi (x : ℝ) (n : ℕ) : cos (x - n * (2 * π)) = cos x

Real.cos (x - ↑n * (2 * Real.pi)) = Real.cos x


theorem ext_iff {f g : LocallyConstant X Y} : f = g ↔ ∀ x, f x = g x

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


theorem ptendsto_iff_rtendsto (l₁ : Filter α) (l₂ : Filter β) (f : α →. β) :
    PTendsto f l₁ l₂ ↔ RTendsto f.graph' l₁ l₂

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

Filter.PTendsto f l₁ l₂ ↔ Filter.RTendsto f.graph' l₁ l₂


@[simp]
protected lemma const (c : β) : EventuallyConst (fun _ ↦ c) l

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
(c : β)


lemma mono_set {V : Set 𝕜} (hv : V ⊆ U) : MeromorphicOn f V

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
{U : Set 𝕜}
(hf : MeromorphicOn f U)
{V : Set 𝕜}
(hv : V ⊆ U)


theorem smul_sphere [Nontrivial E] (c : 𝕜) (x : E) {r : ℝ} (hr : 0 ≤ r) :
    c • sphere x r = sphere (c • x) (‖c‖ * r)

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedSpace ℝ E]
[Nontrivial E]
(c : 𝕜)
(x : E)
{r : ℝ}
(hr : 0 ≤ r)

c • Metric.sphere x r = Metric.sphere (c • x) (‖c‖ * r)


theorem eLpNorm_add_le' (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ)
    (p : ℝ≥0∞) : eLpNorm (f + g) p μ ≤ LpAddConst p * (eLpNorm f p μ + eLpNorm g p μ)

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

MeasureTheory.eLpNorm (f + g) p μ ≤
  MeasureTheory.LpAddConst p * (MeasureTheory.eLpNorm f p μ + MeasureTheory.eLpNorm g p μ)


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


/-- **Gauss's Lemma** for integrally closed domains states that a monic polynomial is irreducible
  iff it is irreducible in the fraction field. -/
theorem Monic.irreducible_iff_irreducible_map_fraction_map [IsIntegrallyClosed R] {p : R[X]}
    (h : p.Monic) : Irreducible p ↔ Irreducible (p.map <| algebraMap R K)

{R : Type u_1}
[CommRing R]
{K : Type u_2}
[Field K]
[Algebra R K]
[IsFractionRing R K]
[IsIntegrallyClosed R]
{p : R[X]}
(h : p.Monic)

Irreducible p ↔ Irreducible (Polynomial.map (algebraMap R K) p)


@[to_additive]
theorem mem_smul : t ∈ f • g ↔ ∃ t₁ ∈ f, ∃ t₂ ∈ g, t₁ • t₂ ⊆ t

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{f : Filter α}
{g : Filter β}
{t : Set β}


theorem lmarginal_union' (f : (∀ i, π i) → ℝ≥0∞) (hf : Measurable f) {s t : Finset δ}
    (hst : Disjoint s t) : ∫⋯∫⁻_s ∪ t, f ∂μ = ∫⋯∫⁻_t, ∫⋯∫⁻_s, f ∂μ ∂μ

(μ : (i : δ) → MeasureTheory.Measure (π i))

[∀ (i : δ), MeasureTheory.SigmaFinite (μ i)]


theorem gcd_dvd_gcd_mul_right_right (i j k : ℤ) : gcd i j ∣ gcd i (j * k)


/-- An additive Lie group is a group and a smooth manifold at the same time in which
the addition and negation operations are smooth. -/
class LieAddGroup {𝕜 : Type*} [NontriviallyNormedField 𝕜] {H : Type*} [TopologicalSpace H]
    {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] (I : ModelWithCorners 𝕜 E H) (G : Type*)
    [AddGroup G] [TopologicalSpace G] [ChartedSpace H G] extends SmoothAdd I G : Prop where
  /-- Negation is smooth in an additive Lie group. -/
  smooth_neg : Smooth I I fun a : G => -a

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[AddGroup G]
[TopologicalSpace G]
[ChartedSpace H G]
[self : LieAddGroup I G]


theorem Ring.DimensionLeOne.prime_le_prime_iff_eq [Ring.DimensionLEOne R] {P Q : Ideal R}
    [hP : P.IsPrime] [hQ : Q.IsPrime] (hP0 : P ≠ ⊥) : P ≤ Q ↔ P = Q

{R : Type u_1}
[CommRing R]
[Ring.DimensionLEOne R]
{P Q : Ideal R}
[hP : P.IsPrime]
[hQ : Q.IsPrime]
(hP0 : P ≠ ⊥)


/-- The equivalence `(β →+ γ) ≃ (α →+ γ)` obtained by precomposition with
an additive equivalence `e : α ≃+ β`. -/
@[simps]
def precompEquiv {α β : Type*} [AddMonoid α] [AddMonoid β] (e : α ≃+ β) (γ : Type*) [AddMonoid γ] :
    (β →+ γ) ≃ (α →+ γ)

{α : Type u_1}
{β : Type u_2}
[AddMonoid α]
[AddMonoid β]
(e : α ≃+ β)
(γ : Type u_3)
[AddMonoid γ]
(g : α →+ γ)

(AddMonoidHom.precompEquiv e γ).symm g = g.comp ↑e.symm


@[simp] theorem sizeOf_get [SizeOf α] (as : List α) (i : Fin as.length) : sizeOf (as.get i) < sizeOf as

{α : Type u_1}
[SizeOf α]
(as : List α)
(i : Fin as.length)


theorem connectedComponent_nonempty {x : α} : (connectedComponent x).Nonempty

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


lemma shiftFunctorAdd_eq (a b : ℤ) :
    CategoryTheory.shiftFunctorAdd (CochainComplex C ℤ) a b = shiftFunctorAdd' C a b _ rfl

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

CategoryTheory.shiftFunctorAdd (CochainComplex C ℤ) a b = CochainComplex.shiftFunctorAdd' C a b (a + b) ⋯


lemma truncatedInf_of_not_mem (h : a ∉ upperClosure s) : truncatedInf s a = ⊥

{α : Type u_1}
[SemilatticeInf α]
[BoundedOrder α]
[DecidableRel fun x x_1 => x ≤ x_1]
{s : Finset α}
{a : α}
(h : a ∉ upperClosure ↑s)


(n : ℕ+)
(K : Type w)
(L : Type z)
[Field K]
[Field L]
[Algebra K L]
[IsCyclotomicExtension {n} K L]


theorem add_sub_div_two_lt (h : a < b) : a + (b - a) / 2 < b

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


@[simp] lemma smul_apply (c : CharacterModule A) (r : R) (a : A) : (r • c) a = c (r • a)

{R : Type uR}
[CommRing R]
{A : Type uA}
[AddCommGroup A]
[Module R A]
(c : CharacterModule A)
(r : R)
(a : A)


@[simp]
theorem Γ_obj (X : LocallyRingedSpace.{u}ᵒᵖ) : Γ.obj X = X.unop.presheaf.obj (op ⊤)

AlgebraicGeometry.LocallyRingedSpace.Γ.obj X = (Opposite.unop X).presheaf.obj (Opposite.op ⊤)


theorem smul_subset_of_set_mem_fixedBy {s t : Set α} {g : G} (t_ss_s : t ⊆ s)
    (s_in_fixedBy : s ∈ fixedBy (Set α) g) : g • t ⊆ s

(s_in_fixedBy : s ∈ MulAction.fixedBy (Set α) g)


@[simp]
theorem cons_inj_left {a b : α} (s : Multiset α) : a ::ₘ s = b ::ₘ s ↔ a = b

{α : Type u_1}
{a b : α}
(s : Multiset α)


theorem restrict_eq_domRestrict_codRestrict {f : M →ₗ[R] M₁} {p : Submodule R M}
    {q : Submodule R M₁} (hf : ∀ x, f x ∈ q) :
    (f.restrict fun x _ => hf x) = (f.codRestrict q hf).domRestrict p

{R : Type u_1}
{M : Type u_5}
{M₁ : Type u_6}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₁]
[Module R M]
[Module R M₁]
{f : M →ₗ[R] M₁}
{p : Submodule R M}
{q : Submodule R M₁}
(hf : ∀ (x : M), f x ∈ q)

f.restrict ⋯ = (LinearMap.codRestrict q f hf).domRestrict p


theorem le_nth {n : ℕ} (h : ∀ hf : (setOf p).Finite, n < hf.toFinset.card) : n ≤ nth p n

(h : ∀ (hf : (setOf p).Finite), n < hf.toFinset.card)


theorem multinomial_coe_fill_of_not_mem {m : Fin (n + 1)} {s : Sym α (n - m)} {x : α} (hx : x ∉ s) :
    (fill x m s : Multiset α).multinomial = n.choose m * (s : Multiset α).multinomial

{n : ℕ}
{α : Type u_1}
[DecidableEq α]
{m : Fin (n + 1)}
{s : Sym α (n - ↑m)}
{x : α}
(hx : x ∉ s)

(↑(Sym.fill x m s)).multinomial = n.choose ↑m * (↑s).multinomial


@[simp]
lemma toNNReal_eq_one {r : ℝ} : r.toNNReal = 1 ↔ r = 1


@[simp] theorem truncate_and {x y : BitVec w} :
    (x &&& y).truncate k = x.truncate k &&& y.truncate k

BitVec.truncate k (x &&& y) = BitVec.truncate k x &&& BitVec.truncate k y


theorem continuous_sInf_rng {t₁ : TopologicalSpace α} {T : Set (TopologicalSpace β)} :
    Continuous[t₁, sInf T] f ↔ ∀ t ∈ T, Continuous[t₁, t] f

{α : Type u}
{β : Type v}
{f : α → β}
{t₁ : TopologicalSpace α}
{T : Set (TopologicalSpace β)}


@[simp]
theorem coe_of : (CompHausLike.of P X : Type _) = X

(P : TopCat → Prop)
(X : Type u)
[TopologicalSpace X]
[CompactSpace X]
[T2Space X]
[CompHausLike.HasProp P X]


@[to_additive]
theorem fst_one : (1 : NonemptyInterval α).fst = 1


/-- A version of `GradedMonoid.GSMul` for internally graded objects. -/
class SetLike.GradedSMul {S R N M : Type*} [SetLike S R] [SetLike N M] [SMul R M] [VAdd ιA ιB]
  (A : ιA → S) (B : ιB → N) : Prop where
  /-- Multiplication is homogeneous -/
  smul_mem : ∀ ⦃i : ιA⦄ ⦃j : ιB⦄ {ai bj}, ai ∈ A i → bj ∈ B j → ai • bj ∈ B (i +ᵥ j)

{ιA : Type u_1}
{ιB : Type u_2}
{S : Type u_5}
{R : Type u_6}
{N : Type u_7}
{M : Type u_8}
[SetLike S R]
[SetLike N M]
[SMul R M]
[VAdd ιA ιB]
{A : ιA → S}
{B : ιB → N}
[self : SetLike.GradedSMul A B]
⦃i : ιA⦄
⦃j : ιB⦄
{ai : R}
{bj : M}


@[simp]
lemma star_le_one_iff {x : R} : star x ≤ 1 ↔ x ≤ 1

{R : Type u}
[Semiring R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
{x : R}


theorem findIdx_cons (p : α → Bool) (b : α) (l : List α) :
    (b :: l).findIdx p = bif p b then 0 else (l.findIdx p) + 1

{α : Type u_1}
(p : α → Bool)
(l : List α)
(n : Nat)

List.findIdx.go p l (n + 1) = List.findIdx.go p l n + 1


nonrec theorem IsLocalMaxOn.max (hf : IsLocalMaxOn f s a) (hg : IsLocalMaxOn g s a) :
    IsLocalMaxOn (fun x => max (f x) (g x)) s a

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


@[simp]
theorem coe_id : ⇑(ContinuousOpenMap.id α) = id


theorem isOpen_iInter_of_finite [Finite ι] {s : ι → Set X} (h : ∀ i, IsOpen (s i)) :
    IsOpen (⋂ i, s i)

{X : Type u}
{ι : Sort w}
[TopologicalSpace X]
[Finite ι]
{s : ι → Set X}
(h : ∀ (i : ι), IsOpen (s i))


theorem vecMul_surjective_iff_exists_left_inverse [Fintype m] [Finite n] {A : Matrix m n R} :
    Function.Surjective A.vecMul ↔ ∃ B : Matrix n m R, B * A = 1

{m : Type u}
{n : Type u'}
[DecidableEq n]
{R : Type u_2}
[Semiring R]
[Fintype m]
[Finite n]
{A : Matrix m n R}

(Function.Surjective fun v => Matrix.vecMul v A) ↔ ∃ B, B * A = 1


@[fun_prop]
theorem HasFDerivWithinAt.const_mul (ha : HasFDerivWithinAt a a' s x) (b : 𝔸) :
    HasFDerivWithinAt (fun y => b * a y) (b • a') s x

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


lemma mem_liminf_iff_eventually_mem : (a ∈ liminf s 𝓕) ↔ (∀ᶠ i in 𝓕, a ∈ s i)

{α : Type u_1}
{ι : Type u_4}
{s : ι → Set α}
{𝓕 : Filter ι}
{a : α}

a ∈ Filter.liminf s 𝓕 ↔ ∀ᶠ (i : ι) in 𝓕, a ∈ s i


lemma bijOn_comm {g : β → α} (h : InvOn f g t s) : BijOn f s t ↔ BijOn g t s

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


@[to_additive (attr := simp)]
theorem card_smul_finset (a : α) (s : Finset β) : (a • s).card = s.card

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[AddGroup α]
[AddAction α β]
(a : α)
(s : Finset β)


theorem Prefunctor.pathStar_surjective (hφ : ∀ u, Surjective (φ.star u)) (u : U) :
    Surjective (φ.pathStar u)

(hφ : ∀ (u : U), Function.Surjective (φ.star u))


@[to_additive HasSum.of_add_one_of_neg_add_one]
theorem HasProd.of_add_one_of_neg_add_one {f : ℤ → M}
    (hf₁ : HasProd (fun n : ℕ ↦ f (n + 1)) m) (hf₂ : HasProd (fun n : ℕ ↦ f (-(n + 1))) m') :
    HasProd f (m * f 0 * m')

(hf₂ : HasProd (fun n => f (-(↑n + 1))) m')


theorem get_eq_iff_eq_some {a : Part α} {ha : a.Dom} {b : α} : a.get ha = b ↔ a = some b

{α : Type u_1}
{a : Part α}
{ha : a.Dom}
{b : α}


lemma map_symm_eq_iff_eq_map {M : Sublattice β} {e : β ≃o α} :
    L.map ↑e.symm = M ↔ L = M.map ↑e

{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
{L : Sublattice α}
{M : Sublattice β}
{e : β ≃o α}

Sublattice.map { toFun := ⇑e.symm, map_sup' := ⋯, map_inf' := ⋯ } L = M ↔
  L = Sublattice.map { toFun := ⇑e, map_sup' := ⋯, map_inf' := ⋯ } M


@[simp]
theorem op_unop (S : Subalgebra R Aᵐᵒᵖ) : S.unop.op = S

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


/-- We have that `𝓞 K ⧸ Ideal.span {ζ - 1}` has cardinality equal to the norm of `ζ - 1`.

See the results below to compute this norm in various cases. -/
lemma card_quotient_toInteger_sub_one [NumberField K] {k : ℕ+} (hk : 1 < k)
    (hζ : IsPrimitiveRoot ζ k) :
    Nat.card (𝓞 K ⧸ Ideal.span {hζ.toInteger - 1}) =
      (Algebra.norm ℤ (hζ.toInteger - 1)).natAbs

{K : Type u}
[Field K]
{ζ : K}
[NumberField K]
{k : ℕ+}
(hk : 1 < k)
(hζ : IsPrimitiveRoot ζ ↑k)

Nat.card (𝓞 K ⧸ Ideal.span {hζ.toInteger - 1}) = ((Algebra.norm ℤ) (hζ.toInteger - 1)).natAbs


@[simp]
theorem constVAdd_zero : constVAdd 𝕜 P (0 : V) = refl 𝕜 P

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_10}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]

AffineIsometryEquiv.constVAdd 𝕜 P 0 = AffineIsometryEquiv.refl 𝕜 P


theorem orderTop_smul_not_lt (r : R) (x : HahnSeries Γ V) : ¬ (r • x).orderTop < x.orderTop

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
{V : Type u_3}
[Zero V]
[SMulZeroClass R V]
(r : R)
(x : HahnSeries Γ V)


theorem commensurable_inv (H : Subgroup G) (g : ConjAct G) :
    Commensurable (g • H) H ↔ Commensurable H (g⁻¹ • H)

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


theorem det_eq_sum_mul_adjugate_row (A : Matrix n n α) (i : n) :
    det A = ∑ j : n, A i j * adjugate A j i

{n : Type v}
{α : Type w}
[DecidableEq n]
[Fintype n]
[CommRing α]
(A : Matrix n n α)
(i : n)


theorem setToL1S_smul {E} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedSpace 𝕜 E]
    [NormedSpace 𝕜 F] (T : Set α → E →L[ℝ] F) (h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0)
    (h_add : FinMeasAdditive μ T) (h_smul : ∀ c : 𝕜, ∀ s x, T s (c • x) = c • T s x) (c : 𝕜)
    (f : α →₁ₛ[μ] E) : setToL1S T (c • f) = c • setToL1S T f

(h_zero : ∀ (s : Set α), MeasurableSet s → μ s = 0 → T s = 0)

(h_add : MeasureTheory.FinMeasAdditive μ T)

(h_smul : ∀ (c : 𝕜) (s : Set α) (x : E), (T s) (c • x) = c • (T s) x)

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

MeasureTheory.L1.SimpleFunc.setToL1S T (c • f) = c • MeasureTheory.L1.SimpleFunc.setToL1S T f


/-- The algebra isomorphism between multivariable polynomials in `Option S₁` and
multivariable polynomials with coefficients in polynomials.
-/
@[simps!]
def optionEquivRight : MvPolynomial (Option S₁) R ≃ₐ[R] MvPolynomial S₁ R[X]

(R : Type u)
(S₁ : Type v)
[CommSemiring R]
(a : MvPolynomial (Option S₁) R)

(MvPolynomial.optionEquivRight R S₁) a =
  (MvPolynomial.aeval fun o => o.elim (MvPolynomial.C Polynomial.X) MvPolynomial.X) a


/-- The exponential map in a commutative Banach algebra `𝔸` over a normed field `𝕂` of
characteristic zero has Fréchet derivative `exp 𝕂 x • 1 : 𝔸 →L[𝕂] 𝔸` at any point `x` in the
disk of convergence. -/
theorem hasFDerivAt_exp_of_mem_ball [CharZero 𝕂] {x : 𝔸}
    (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) :
    HasFDerivAt (exp 𝕂) (exp 𝕂 x • (1 : 𝔸 →L[𝕂] 𝔸)) x

(hx : x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)

HasFDerivAt (NormedSpace.exp 𝕂) (NormedSpace.exp 𝕂 x • 1) x


@[simp]
theorem rightHom_comp_inr : (rightHom : N ⋊[φ] G →* G).comp inr = MonoidHom.id _

{N : Type u_1}
{G : Type u_2}
[Group N]
[Group G]
{φ : G →* MulAut N}

SemidirectProduct.rightHom.comp SemidirectProduct.inr = MonoidHom.id G


lemma ComplexEmbedding.exists_comp_symm_eq_of_comp_eq [Algebra k K] [IsGalois k K] (φ ψ : K →+* ℂ)
    (h : φ.comp (algebraMap k K) = ψ.comp (algebraMap k K)) :
    ∃ σ : K ≃ₐ[k] K, φ.comp σ.symm = ψ


/-- To construct a groupoid, one may consider classes of partial homeomorphisms such that
both the function and its inverse have some property. If this property is stable under composition,
one gets a groupoid. `Pregroupoid` bundles the properties needed for this construction, with the
groupoid of smooth functions with smooth inverses as an application. -/
structure Pregroupoid (H : Type*) [TopologicalSpace H] where
  /-- Property describing membership in this groupoid: the pregroupoid "contains"
    all functions `H → H` having the pregroupoid property on some `s : Set H` -/
  property : (H → H) → Set H → Prop
  /-- The pregroupoid property is stable under composition -/
  comp : ∀ {f g u v}, property f u → property g v →
    IsOpen u → IsOpen v → IsOpen (u ∩ f ⁻¹' v) → property (g ∘ f) (u ∩ f ⁻¹' v)
  /-- Pregroupoids contain the identity map (on `univ`) -/
  id_mem : property id univ
  /-- The pregroupoid property is "local", in the sense that `f` has the pregroupoid property on `u`
  iff its restriction to each open subset of `u` has it -/
  locality :
    ∀ {f u}, IsOpen u → (∀ x ∈ u, ∃ v, IsOpen v ∧ x ∈ v ∧ property f (u ∩ v)) → property f u
  /-- If `f = g` on `u` and `property f u`, then `property g u` -/
  congr : ∀ {f g : H → H} {u}, IsOpen u → (∀ x ∈ u, g x = f x) → property f u → property g u

{H : Type u_5}
[TopologicalSpace H]
(self : Pregroupoid H)
{f g : H → H}
{u : Set H}

IsOpen u → (∀ x ∈ u, g x = f x) → self.property f u → self.property g u


theorem ContDiffOn.rpow_const_of_ne (hf : ContDiffOn ℝ n f s) (h : ∀ x ∈ s, f x ≠ 0) :
    ContDiffOn ℝ n (fun x => f x ^ p) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{s : Set E}
{p : ℝ}
{n : ℕ∞}
(hf : ContDiffOn ℝ n f s)
(h : ∀ x ∈ s, f x ≠ 0)


/-- **Removable singularity** theorem, weak version. If `f : ℂ → E` is differentiable in a punctured
neighborhood of a point and is continuous at this point, then it is analytic at this point. -/
theorem analyticAt_of_differentiable_on_punctured_nhds_of_continuousAt {f : ℂ → E} {c : ℂ}
    (hd : ∀ᶠ z in 𝓝[≠] c, DifferentiableAt ℂ f z) (hc : ContinuousAt f c) : AnalyticAt ℂ f c

(hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z)


/-- The category of coalgebras over an additive comonad on a preadditive category is preadditive. -/
@[simps]
instance Comonad.coalgebraPreadditive : Preadditive (Comonad.Coalgebra U)

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
(U : CategoryTheory.Comonad C)
[U.Additive]
(F G : U.Coalgebra)
(n : ℕ)
(α : F ⟶ G)


theorem starConvex_iff_forall_ne_pos (hx : x ∈ s) :
    StarConvex 𝕜 x s ↔
      ∀ ⦃y⦄, y ∈ s → x ≠ y → ∀ ⦃a b : 𝕜⦄, 0 < a → 0 < b → a + b = 1 → a • x + b • y ∈ s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{x : E}
{s : Set E}
(hx : x ∈ s)

StarConvex 𝕜 x s ↔ ∀ ⦃y : E⦄, y ∈ s → x ≠ y → ∀ ⦃a b : 𝕜⦄, 0 < a → 0 < b → a + b = 1 → a • x + b • y ∈ s


theorem exists_apply_eq_finset_sup (p : ι → Seminorm 𝕜 E) {s : Finset ι} (hs : s.Nonempty) (x : E) :
    ∃ i ∈ s, s.sup p x = p i x

{𝕜 : Type u_3}
{E : Type u_7}
{ι : Type u_12}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : ι → Seminorm 𝕜 E)
{s : Finset ι}
(hs : s.Nonempty)
(x : E)


@[simp]
theorem cons_mulVec [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (w : n' → α) :
    (of <| vecCons v A) *ᵥ w = vecCons (dotProduct v w) (of A *ᵥ w)

{α : Type u}
{m : ℕ}
{n' : Type uₙ}
[NonUnitalNonAssocSemiring α]
[Fintype n']
(v : n' → α)
(A : Fin m → n' → α)
(w : n' → α)

(Matrix.of (Matrix.vecCons v A)).mulVec w = Matrix.vecCons (Matrix.dotProduct v w) ((Matrix.of A).mulVec w)


lemma smul_eq_zero_of_left (h : a = 0) (b : M) : a • b = 0

{R : Type u_1}
{M : Type u_3}
[Zero R]
[Zero M]
[SMulWithZero R M]
{a : R}
(h : a = 0)
(b : M)


@[simp]
theorem cast_neg [Zero α] [One α] [Add α] [Neg α] (n : PosNum) : (neg n : α) = -n

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


theorem antitone_const [Preorder α] [Preorder β] {c : β} : Antitone fun _ : α ↦ c

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{c : β}


theorem to_map_eq_zero_iff {x : R} : algebraMap R K x = 0 ↔ x = 0

{R : Type u_1}
[CommRing R]
{K : Type u_5}
[CommRing K]
[Algebra R K]
[IsFractionRing R K]
{x : R}


/-- A conditionally complete lattice is a lattice in which
every nonempty subset which is bounded above has a supremum, and
every nonempty subset which is bounded below has an infimum.
Typical examples are real numbers or natural numbers.

To differentiate the statements from the corresponding statements in (unconditional)
complete lattices, we prefix sInf and subₛ by a c everywhere. The same statements should
hold in both worlds, sometimes with additional assumptions of nonemptiness or
boundedness. -/
class ConditionallyCompleteLattice (α : Type*) extends Lattice α, SupSet α, InfSet α where
  /-- `a ≤ sSup s` for all `a ∈ s`. -/
  le_csSup : ∀ s a, BddAbove s → a ∈ s → a ≤ sSup s
  /-- `sSup s ≤ a` for all `a ∈ upperBounds s`. -/
  csSup_le : ∀ s a, Set.Nonempty s → a ∈ upperBounds s → sSup s ≤ a
  /-- `sInf s ≤ a` for all `a ∈ s`. -/
  csInf_le : ∀ s a, BddBelow s → a ∈ s → sInf s ≤ a
  /-- `a ≤ sInf s` for all `a ∈ lowerBounds s`. -/
  le_csInf : ∀ s a, Set.Nonempty s → a ∈ lowerBounds s → a ≤ sInf s

{α : Type u_5}
[self : ConditionallyCompleteLattice α]
(s : Set α)
(a : α)

s.Nonempty → a ∈ upperBounds s → sSup s ≤ a


theorem HasBasis.tendsto_right_iff (hlb : lb.HasBasis pb sb) :
    Tendsto f la lb ↔ ∀ i, pb i → ∀ᶠ x in la, f x ∈ sb i

{α : Type u_1}
{β : Type u_2}
{ι' : Sort u_5}
{la : Filter α}
{lb : Filter β}
{pb : ι' → Prop}
{sb : ι' → Set β}
{f : α → β}
(hlb : lb.HasBasis pb sb)

Filter.Tendsto f la lb ↔ ∀ (i : ι'), pb i → ∀ᶠ (x : α) in la, f x ∈ sb i


/-- The second part of the third simplicial identity -/
@[reassoc]
theorem δ_comp_σ_succ {n} {i : Fin (n + 1)} : δ i.succ ≫ σ i = 𝟙 ([n] : SimplexCategory)

SimplexCategory.δ i.succ ≫ SimplexCategory.σ i = 𝟙 (SimplexCategory.mk n)


protected theorem bijective (e : P₁ ≃ᵃL[k] P₂) : Bijective e

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]
(e : P₁ ≃ᵃL[k] P₂)


@[simp]
theorem dlookup_kunion_eq_some {a} {b : β a} {l₁ l₂ : List (Sigma β)} :
    dlookup a (kunion l₁ l₂) = some b ↔
      dlookup a l₁ = some b ∨ a ∉ l₁.keys ∧ dlookup a l₂ = some b

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{l₁ l₂ : List (Sigma β)}

List.dlookup a (l₁.kunion l₂) = some b ↔ List.dlookup a l₁ = some b ∨ a ∉ l₁.keys ∧ List.dlookup a l₂ = some b


theorem degree_pow' : ∀ {n : ℕ}, leadingCoeff p ^ n ≠ 0 → degree (p ^ n) = n • degree p

{R : Type u}
[Semiring R]
{p : R[X]}
{n : ℕ}

p.leadingCoeff ^ n ≠ 0 → (p ^ n).degree = n • p.degree


@[simp] theorem freeOn_ground : (freeOn E).E = E


theorem sub_ediv_of_dvd_sub {a b c : Int}
    (hcab : c ∣ a - b) : (a - b) / c = a / c - b / c


/-- An additive semigroup homomorphism `AddHom M N` can equivalently be viewed as an additive
homomorphism `AddHom Mᵐᵒᵖ Nᵐᵒᵖ`. This is the action of the (fully faithful) `ᵐᵒᵖ`-functor on
morphisms. -/
@[simps]
def AddHom.mulOp {M N} [Add M] [Add N] : AddHom M N ≃ AddHom Mᵐᵒᵖ Nᵐᵒᵖ

{M : Type u_2}
{N : Type u_3}
[Add M]
[Add N]
(f : AddHom M N)

∀ (a : Mᵐᵒᵖ), (AddHom.mulOp f) a = (MulOpposite.op ∘ ⇑f ∘ MulOpposite.unop) a


protected lemma Memℒp.piecewise [DecidablePred (· ∈ s)] {g}
    (hs : MeasurableSet s) (hf : Memℒp f p (μ.restrict s)) (hg : Memℒp g p (μ.restrict sᶜ)) :
    Memℒp (s.piecewise f g) p μ

(hf : MeasureTheory.Memℒp f p (μ.restrict s))

(hg : MeasureTheory.Memℒp g p (μ.restrict sᶜ))

MeasureTheory.Memℒp (s.piecewise f g) p μ


@[simp]
theorem iterate_derivative_succ_at_0_eq_zero (n ν : ℕ) :
    (Polynomial.derivative^[ν] (bernsteinPolynomial R n (ν + 1))).eval 0 = 0

Polynomial.eval 0 ((⇑Polynomial.derivative)^[ν] (bernsteinPolynomial R n (ν + 1))) = 0


/-- Construct a closure operator from an inflationary function `f` and a "closedness" predicate `p`
witnessing minimality of `f x` among closed elements greater than `x`. -/
@[simps!]
def ofPred (f : α → α) (p : α → Prop) (hf : ∀ x, x ≤ f x) (hfp : ∀ x, p (f x))
    (hmin : ∀ ⦃x y⦄, x ≤ y → p y → f x ≤ y) : ClosureOperator α

(hmin : ∀ ⦃x y : α⦄, x ≤ y → p y → f x ≤ y)

∀ (a : α), (ClosureOperator.ofPred f p hf hfp hmin).IsClosed a = p a


@[to_additive (attr := simp)]
theorem smul_eq_bot_iff : f • g = ⊥ ↔ f = ⊥ ∨ g = ⊥

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


theorem Inducing.prod_map {f : X → Y} {g : Z → W} (hf : Inducing f) (hg : Inducing g) :
    Inducing (Prod.map f g)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
{W : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[TopologicalSpace W]
{f : X → Y}
{g : Z → W}
(hf : Inducing f)
(hg : Inducing g)


theorem exists_range_iff {p : α → Prop} : (∃ a ∈ range f, p a) ↔ ∃ i, p (f i)

{α : Type u_1}
{ι : Sort u_4}
{f : ι → α}
{p : α → Prop}


@[simp]
theorem treesOfNumNodesEq_zero : treesOfNumNodesEq 0 = {nil}


theorem submatrix_updateColumn_equiv [DecidableEq o] [DecidableEq n] (A : Matrix m n α) (j : n)
    (c : m → α) (e : l ≃ m) (f : o ≃ n) : (A.updateColumn j c).submatrix e f =
    updateColumn (A.submatrix e f) (f.symm j) fun i => c (e i)

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[DecidableEq o]
[DecidableEq n]
(A : Matrix m n α)
(j : n)
(c : m → α)
(e : l ≃ m)
(f : o ≃ n)

(A.updateColumn j c).submatrix ⇑e ⇑f = (A.submatrix ⇑e ⇑f).updateColumn (f.symm j) fun i => c (e i)


@[simp]
theorem Quotient.algebraMap_quotient_of_ramificationIdx_neZero (x : R) :
    algebraMap (R ⧸ p) (S ⧸ P) (Ideal.Quotient.mk p x) = Ideal.Quotient.mk P (f x)

[hfp : NeZero (Ideal.ramificationIdx f p P)]

(algebraMap (R ⧸ p) (S ⧸ P)) ((Ideal.Quotient.mk p) x) = (Ideal.Quotient.mk P) (f x)


@[simp]
theorem mem_diff {x y z : ZFSet.{u}} : z ∈ x \ y ↔ z ∈ x ∧ z ∉ y


/-- If all points are equal to a given point `x`, then `α` is a subsingleton. -/
theorem subsingleton_of_forall_eq (x : α) (h : ∀ y, y = x) : Subsingleton α


/-- Build an isomorphism in the category `CommGrp` from a `MulEquiv`
between `CommGroup`s. -/
@[to_additive (attr := simps)]
def MulEquiv.toCommGrpIso {X Y : CommGrp} (e : X ≃* Y) : X ≅ Y


@[to_additive]
theorem measure_eq_tsum_of_ac (h : IsFundamentalDomain G s μ) (hν : ν ≪ μ) (t : Set α) :
    ν t = ∑' g : G, ν (t ∩ g • s)

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

(hν : ν ≪ μ)


theorem tendsto_inv_atTop_zero : Tendsto (fun r : 𝕜 => r⁻¹) atTop (𝓝 0)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]

Filter.Tendsto (fun r => r⁻¹) Filter.atTop (𝓝 0)


theorem le_succ_of_forall_lt_le {x y : s} (h : ∀ z < x, z ≤ y) : x ≤ succ y

{s : Set ℕ}
[Infinite ↑s]
[DecidablePred fun x => x ∈ s]
{x y : ↑s}
(h : ∀ z < x, z ≤ y)


theorem Ico_succ_right_eq_insert_of_not_isMax (h₁ : a ≤ b) (h₂ : ¬IsMax b) :
    Ico a (succ b) = insert b (Ico a b)

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a b : α}
(h₁ : a ≤ b)
(h₂ : ¬IsMax b)

Set.Ico a (Order.succ b) = insert b (Set.Ico a b)


@[to_additive (attr := simp)]
theorem mem_orbit (a : α) (m : M) : m • a ∈ orbit M a

{M : Type u}
[AddMonoid M]
{α : Type v}
[AddAction M α]
(a : α)
(m : M)


theorem odd_eq (s : Stream' α) : odd s = even (tail s)


/-- A cone extended by an isomorphism is isomorphic to the original cone. -/
@[simps]
def extendIso (s : Cone F) {X : C} (f : X ≅ s.pt) : s.extend f.hom ≅ s

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(s : CategoryTheory.Limits.Cone F)
{X : C}
(f : X ≅ s.pt)

(CategoryTheory.Limits.Cones.extendIso s f).hom.hom = f.hom


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

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


lemma Exact.map_of_preservesLeftHomologyOf (h : S.Exact) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [(S.map F).HasHomology] : (S.map F).Exact


/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` is continuous
on the right or on the left at `b`, then the right (resp., left) derivative of
`u ↦ ∫ x in a..u, f x` at `b` equals `f b`. -/
theorem derivWithin_integral_right (hf : IntervalIntegrable f volume a b) {s t : Set ℝ}
    [FTCFilter b (𝓝[s] b) (𝓝[t] b)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] b))
    (hb : ContinuousWithinAt f t b)
    (hs : UniqueDiffWithinAt ℝ s b := by uniqueDiffWithinAt_Ici_Iic_univ) :
    derivWithin (fun u => ∫ x in a..u, f x) s b = f b

(hf : IntervalIntegrable f MeasureTheory.volume a b)

[intervalIntegral.FTCFilter b (𝓝[s] b) (𝓝[t] b)]

(hmeas : StronglyMeasurableAtFilter f (𝓝[t] b) MeasureTheory.volume)

derivWithin (fun u => ∫ (x : ℝ) in a..u, f x) s b = f b


/-- Given a functor `F : C₁ ⥤ C₂ ⥤ D`, this is the bifunctor which sends
`K₁ : HomologicalComplex C₁ c₁` and `K₂ : HomologicalComplex C₂ c₂` to the bicomplex
which is degree `(i₁, i₂)` consists of `(F.obj (K₁.X i₁)).obj (K₂.X i₂)`. -/
@[simps! obj_obj_X_X obj_obj_X_d obj_obj_d_f obj_map_f_f map_app_f_f]
def mapBifunctorHomologicalComplex :
    HomologicalComplex C₁ c₁ ⥤ HomologicalComplex C₂ c₂ ⥤ HomologicalComplex₂ D c₁ c₂

[∀ (X₁ : C₁), (F.obj X₁).PreservesZeroMorphisms]

((((F.mapBifunctorHomologicalComplex c₁ c₂).obj K₁).obj K₂).X i₁).X i₂ = (F.obj (K₁.X i₁)).obj (K₂.X i₂)


@[simp]
theorem circle.toUnits_apply (z : circle) :
    circle.toUnits z = Units.mk0 ↑z (ne_zero_of_mem_circle z)


theorem equiv_snd_eq_one_of_mem_of_one_mem {g : G} (h1 : 1 ∈ T) (hg : g ∈ S) :
    (hST.equiv g).snd = ⟨1, h1⟩

{G : Type u_1}
[Group G]
{S T : Set G}
(hST : Subgroup.IsComplement S T)
{g : G}
(h1 : 1 ∈ T)
(hg : g ∈ S)


theorem preimage_null (h : QuasiMeasurePreserving f μa μb) {s : Set β} (hs : μb s = 0) :
    μa (f ⁻¹' s) = 0

(h : MeasureTheory.Measure.QuasiMeasurePreserving f μa μb)


theorem nnnorm_eq_of_L2 {β : ι → Type*} [∀ i, SeminormedAddCommGroup (β i)] (x : PiLp 2 β) :
    ‖x‖₊ = NNReal.sqrt (∑ i : ι, ‖x i‖₊ ^ 2)

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


theorem ball_inter_left (x : β) (V W : Set (β × β)) : ball x (V ∩ W) ⊆ ball x V

{β : Type ub}
(x : β)
(V W : Set (β × β))

UniformSpace.ball x (V ∩ W) ⊆ UniformSpace.ball x V


@[to_additive]
theorem isLUB_hasProd (h : ∀ i, 1 ≤ f i) (hf : HasProd f a) :
    IsLUB (Set.range fun s ↦ ∏ i ∈ s, f i) a

{ι : Type u_1}
{α : Type u_3}
[OrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
{a : α}
(h : ∀ (i : ι), 1 ≤ f i)
(hf : HasProd f a)

IsLUB (Set.range fun s => ∏ i ∈ s, f i) a


@[simp]
theorem associated_isOrtho [Invertible (2 : R)] {x y : M} :
    Q.associated.IsOrtho x y ↔ Q.IsOrtho x y

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
{Q : QuadraticMap R M N}
[Invertible 2]
{x y : M}

LinearMap.IsOrtho (QuadraticMap.associated Q) x y ↔ Q.IsOrtho x y


theorem unmop_inj {X Y : Cᴹᵒᵖ} :
    Function.Injective (Quiver.Hom.unmop : (X ⟶ Y) → (unmop' X ⟶ unmop' Y))

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : Cᴹᵒᵖ}


@[simp]
theorem swap_swap : p.swap.swap = p


theorem isIso_of_subset {X Y : PresheafedSpace C} (f : X ⟶ Y)
    [H : PresheafedSpace.IsOpenImmersion f] (U : Opens Y.carrier)
    (hU : (U : Set Y.carrier) ⊆ Set.range f.base) : IsIso (f.c.app <| op U)

{X Y : AlgebraicGeometry.PresheafedSpace C}

[H : AlgebraicGeometry.PresheafedSpace.IsOpenImmersion f]

CategoryTheory.IsIso (f.c.app (Opposite.op U))


/-- A bijection between terms with constants and terms with extra variables. -/
@[simps]
def constantsVarsEquiv : L[[γ]].Term α ≃ L.Term (γ ⊕ α)

{L : FirstOrder.Language}
{α : Type u'}
{γ : Type u_3}

∀ (a : (L.withConstants γ).Term α), FirstOrder.Language.Term.constantsVarsEquiv a = a.constantsToVars


protected theorem le_add_of_nonneg_left {a b : Int} (h : 0 ≤ b) : a ≤ b + a


/-- This structure permits to define a vector bundle when trivializations are given as local
equivalences but there is not yet a topology on the total space or the fibers.
The total space is hence given a topology in such a way that there is a fiber bundle structure for
which the partial equivalences are also partial homeomorphisms and hence vector bundle
trivializations. The topology on the fibers is induced from the one on the total space.

The field `exists_coordChange` is stated as an existential statement (instead of 3 separate
fields), since it depends on propositional information (namely `e e' ∈ pretrivializationAtlas`).
This makes it inconvenient to explicitly define a `coordChange` function when constructing a
`VectorPrebundle`. -/
-- Porting note(#5171): was @[nolint has_nonempty_instance]
structure VectorPrebundle where
  pretrivializationAtlas : Set (Pretrivialization F (π F E))
  pretrivialization_linear' : ∀ e, e ∈ pretrivializationAtlas → e.IsLinear R
  pretrivializationAt : B → Pretrivialization F (π F E)
  mem_base_pretrivializationAt : ∀ x : B, x ∈ (pretrivializationAt x).baseSet
  pretrivialization_mem_atlas : ∀ x : B, pretrivializationAt x ∈ pretrivializationAtlas
  exists_coordChange : ∀ᵉ (e ∈ pretrivializationAtlas) (e' ∈ pretrivializationAtlas),
    ∃ f : B → F →L[R] F, ContinuousOn f (e.baseSet ∩ e'.baseSet) ∧
      ∀ᵉ (b ∈ e.baseSet ∩ e'.baseSet) (v : F), f b v = (e' ⟨b, e.symm b v⟩).2
  totalSpaceMk_inducing : ∀ b : B, Inducing (pretrivializationAt b ∘ .mk b)

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
{E : B → Type u_4}
[NontriviallyNormedField R]
[(x : B) → AddCommMonoid (E x)]
[(x : B) → Module R (E x)]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
[(x : B) → TopologicalSpace (E x)]
(self : VectorPrebundle R F E)
(b : B)

Inducing (↑(self.pretrivializationAt b) ∘ Bundle.TotalSpace.mk b)


theorem ContinuousAt.comp_lowerSemicontinuousWithinAt_antitone {g : γ → δ} {f : α → γ}
    (hg : ContinuousAt g (f x)) (hf : LowerSemicontinuousWithinAt f s x) (gmon : Antitone g) :
    UpperSemicontinuousWithinAt (g ∘ f) s x


/-- For vector spaces, dual annihilators carry direct sum decompositions
to direct sum decompositions. -/
theorem isCompl_dualAnnihilator {W W' : Subspace K V₁} (h : IsCompl W W') :
    IsCompl W.dualAnnihilator W'.dualAnnihilator

{K : Type uK}
[Field K]
{V₁ : Type uV₁}
[AddCommGroup V₁]
[Module K V₁]
{W W' : Subspace K V₁}
(h : IsCompl W W')

IsCompl (Submodule.dualAnnihilator W) (Submodule.dualAnnihilator W')


@[to_additive]
theorem measure_pos_iff_nonempty_of_smulInvariant (hμ : μ ≠ 0) (hU : IsOpen U) :
    0 < μ U ↔ U.Nonempty

[MeasureTheory.SMulInvariantMeasure G α μ]


@[simp] lemma fourierSMulRight_apply (v : V) (w : W) :
    fourierSMulRight L f v w = -(2 * π * I) • L v w • f v

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{V : Type u_2}
{W : Type u_3}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[NormedAddCommGroup W]
[NormedSpace ℝ W]
(L : V →L[ℝ] W →L[ℝ] ℝ)
(f : V → E)
(v : V)
(w : W)

(VectorFourier.fourierSMulRight L f v) w = -(2 * ↑π * Complex.I) • (L v) w • f v


@[simp]
theorem restrictScalars_toSubalgebra {E : IntermediateField L' L} :
    (E.restrictScalars K).toSubalgebra = E.toSubalgebra.restrictScalars K

(K : Type u_1)
{L : Type u_2}
{L' : Type u_3}
[Field K]
[Field L]
[Field L']
[Algebra K L]
[Algebra K L']
[Algebra L' L]
[IsScalarTower K L' L]
{E : IntermediateField L' L}

(IntermediateField.restrictScalars K E).toSubalgebra = Subalgebra.restrictScalars K E.toSubalgebra


@[simp]
theorem smul_comp' {V : Type*} [NormedAddCommGroup V] [NormedSpace 𝕜 V] (f : C^∞⟮I'', N'; 𝕜⟯)
    (g : C^∞⟮I'', N'; 𝓘(𝕜, V), V⟯) (h : C^∞⟮I, N; I'', N'⟯) :
    (f • g).comp h = f.comp h • g.comp h

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{E'' : Type u_7}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{H'' : Type u_8}
[TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''}
{N' : Type u_9}
[TopologicalSpace N']
[ChartedSpace H'' N']
{V : Type u_10}
[NormedAddCommGroup V]
[NormedSpace 𝕜 V]
(f : C^⊤⟮I'', N'; 𝓘(𝕜, 𝕜), 𝕜⟯)
(g : C^⊤⟮I'', N'; 𝓘(𝕜, V), V⟯)
(h : C^⊤⟮I, N; I'', N'⟯)


@[simp]
theorem forget₂_Mon_obj_mul (A : CommMon_ C) : ((forget₂Mon_ C).obj A).mul = A.mul

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

((CommMon_.forget₂Mon_ C).obj A).mul = A.mul


/-- A `FloorSemiring` is an ordered semiring over `α` with a function
`floor : α → ℕ` satisfying `∀ (n : ℕ) (x : α), n ≤ ⌊x⌋ ↔ (n : α) ≤ x)`.
Note that many lemmas require a `LinearOrder`. Please see the above `TODO`. -/
class FloorSemiring (α) [OrderedSemiring α] where
  /-- `FloorSemiring.floor a` computes the greatest natural `n` such that `(n : α) ≤ a`. -/
  floor : α → ℕ
  /-- `FloorSemiring.ceil a` computes the least natural `n` such that `a ≤ (n : α)`. -/
  ceil : α → ℕ
  /-- `FloorSemiring.floor` of a negative element is zero. -/
  floor_of_neg {a : α} (ha : a < 0) : floor a = 0
  /-- A natural number `n` is smaller than `FloorSemiring.floor a` iff its coercion to `α` is
  smaller than `a`. -/
  gc_floor {a : α} {n : ℕ} (ha : 0 ≤ a) : n ≤ floor a ↔ (n : α) ≤ a
  /-- `FloorSemiring.ceil` is the lower adjoint of the coercion `↑ : ℕ → α`. -/
  gc_ceil : GaloisConnection ceil (↑)

{α : Type u_4}
[OrderedSemiring α]
[self : FloorSemiring α]
{a : α}
{n : ℕ}
(ha : 0 ≤ a)


theorem mem_perms_of_finset_iff :
    ∀ {s : Finset α} {f : Perm α}, f ∈ permsOfFinset s ↔ ∀ {x}, f x ≠ x → x ∈ s

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{f : Equiv.Perm α}

f ∈ permsOfFinset s ↔ ∀ {x : α}, f x ≠ x → x ∈ s


theorem pellZd_sub {m n} (h : n ≤ m) : pellZd a1 (m - n) = pellZd a1 m * star (pellZd a1 n)

Pell.pellZd a1 (m - n) = Pell.pellZd a1 m * star (Pell.pellZd a1 n)


theorem Filter.Tendsto.nnrpow {α : Type*} {f : Filter α} {u : α → ℝ≥0} {v : α → ℝ} {x : ℝ≥0}
    {y : ℝ} (hx : Tendsto u f (𝓝 x)) (hy : Tendsto v f (𝓝 y)) (h : x ≠ 0 ∨ 0 < y) :
    Tendsto (fun a => u a ^ v a) f (𝓝 (x ^ y))

{α : Type u_1}
{f : Filter α}
{u : α → ℝ≥0}
{v : α → ℝ}
{x : ℝ≥0}
{y : ℝ}
(hx : Filter.Tendsto u f (𝓝 x))
(hy : Filter.Tendsto v f (𝓝 y))
(h : x ≠ 0 ∨ 0 < y)

Filter.Tendsto (fun a => u a ^ v a) f (𝓝 (x ^ y))


theorem sumElim_comp_inr (ψ : L'' →ᴸ L') : ϕ.sumElim ψ ∘ᴸ LHom.sumInr = ψ

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
(ϕ : L →ᴸ L')
{L'' : FirstOrder.Language}
(ψ : L'' →ᴸ L')

(ϕ.sumElim ψ).comp FirstOrder.Language.LHom.sumInr = ψ


theorem rpow_left_injOn {x : ℝ} (hx : x ≠ 0) : InjOn (fun y : ℝ => y ^ x) { y : ℝ | 0 ≤ y }


lemma atTop_eq_pure_of_isTop [LinearOrder α] {x : α} (hx : IsTop x) :
    (atTop : Filter α) = pure x

{α : Type u}
[LinearOrder α]
{x : α}
(hx : IsTop x)


@[to_additive]
lemma units_inf (S T : Submonoid M) : (S ⊓ T).units = S.units ⊓ T.units

{M : Type u_1}
[AddMonoid M]
(S T : AddSubmonoid M)

(S ⊓ T).addUnits = S.addUnits ⊓ T.addUnits


theorem comp_coprod (f : M₃ →ₗ[R] M₄) (g₁ : M →ₗ[R] M₃) (g₂ : M₂ →ₗ[R] M₃) :
    f.comp (g₁.coprod g₂) = (f.comp g₁).coprod (f.comp g₂)

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
{M₄ : Type z}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[AddCommMonoid M₄]
[Module R M]
[Module R M₂]
[Module R M₃]
[Module R M₄]
(f : M₃ →ₗ[R] M₄)
(g₁ : M →ₗ[R] M₃)
(g₂ : M₂ →ₗ[R] M₃)

f ∘ₗ g₁.coprod g₂ = (f ∘ₗ g₁).coprod (f ∘ₗ g₂)


@[simp]
theorem prod_self_ssubset_prod_self : s₁ ×ˢ s₁ ⊂ s₂ ×ˢ s₂ ↔ s₁ ⊂ s₂

s₁ ×ˢ s₁ ⊂ s₂ ×ˢ s₂ ↔ s₁ ⊂ s₂


protected theorem continuousOn {s} : ContinuousOn e s

{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₂)
{s : Set E}


theorem forget_semilatInf_partOrd_eq_forget_bddOrd_partOrd :
    forget₂ BddLat SemilatInfCat ⋙ forget₂ SemilatInfCat PartOrd =
      forget₂ BddLat BddOrd ⋙ forget₂ BddOrd PartOrd

CategoryTheory.forget₂ BddLat SemilatInfCat ⋙ CategoryTheory.forget₂ SemilatInfCat PartOrd =
  CategoryTheory.forget₂ BddLat BddOrd ⋙ CategoryTheory.forget₂ BddOrd PartOrd


/-- Fundamental theorem of calculus-2: If `f : ℝ → E` is differentiable at every `x` in `[a, b]` and
  its derivative is integrable on `[a, b]`, then `∫ y in a..b, deriv f y` equals `f b - f a`. -/
theorem integral_deriv_eq_sub (hderiv : ∀ x ∈ [[a, b]], DifferentiableAt ℝ f x)
    (hint : IntervalIntegrable (deriv f) volume a b) : ∫ y in a..b, deriv f y = f b - f a

(hint : IntervalIntegrable (deriv f) MeasureTheory.volume a b)

∫ (y : ℝ) in a..b, deriv f y = f b - f a


/-- The Sprague-Grundy theorem which states that every impartial game is equivalent to a game of
 nim, namely the game of nim corresponding to the games Grundy value -/
theorem equiv_nim_grundyValue : ∀ (G : PGame.{u}) [G.Impartial], G ≈ nim (grundyValue G)


theorem vandermonde_succ {n : ℕ} (v : Fin n.succ → R) :
    vandermonde v =
      Fin.cons (fun (j : Fin n.succ) => v 0 ^ (j : ℕ)) fun i =>
        Fin.cons 1 fun j => v i.succ * vandermonde (Fin.tail v) i j

{R : Type u_1}
[CommRing R]
{n : ℕ}
(v : Fin n.succ → R)

Matrix.vandermonde v =
  Fin.cons (fun j => v 0 ^ ↑j) fun i => Fin.cons 1 fun j => v i.succ * Matrix.vandermonde (Fin.tail v) i j


/-- A row partioned matrix in a Star ring when conjugate transposed gives a column partitioned
matrix with the rows of the initial matrix conjugate transposed to become columns. -/
lemma conjTranspose_fromRows_eq_fromColumns_conjTranspose (A₁ : Matrix m₁ n R)
    (A₂ : Matrix m₂ n R) : conjTranspose (fromRows A₁ A₂) =
      fromColumns (conjTranspose A₁) (conjTranspose A₂)

{R : Type u_1}
{m₁ : Type u_3}
{m₂ : Type u_4}
{n : Type u_5}
[Star R]
(A₁ : Matrix m₁ n R)
(A₂ : Matrix m₂ n R)

(A₁.fromRows A₂).conjTranspose = A₁.conjTranspose.fromColumns A₂.conjTranspose


theorem areaForm_swap (x y : E) : ω x y = -ω y x

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


/-- Auxiliary lemma for `condexp_indicator`. -/
theorem condexp_indicator_aux (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict sᶜ] 0) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m])

{α : Type u_1}
{E : Type u_3}
{m m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{μ : MeasureTheory.Measure α}
{f : α → E}
{s : Set α}
(hs : MeasurableSet s)
(hf : f =ᵐ[μ.restrict sᶜ] 0)


/-- The `vectorSpan` of a finite subset of an affinely independent
family has dimension one less than its cardinality. -/
theorem AffineIndependent.finrank_vectorSpan_image_finset [DecidableEq P]
    {p : ι → P} (hi : AffineIndependent k p) {s : Finset ι} {n : ℕ} (hc : Finset.card s = n + 1) :
    finrank k (vectorSpan k (s.image p : Set P)) = n

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
{ι : Type u_4}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
[DecidableEq P]
{p : ι → P}
(hi : AffineIndependent k p)
{s : Finset ι}
{n : ℕ}
(hc : s.card = n + 1)

FiniteDimensional.finrank k ↥(vectorSpan k ↑(Finset.image p s)) = n


@[simp] lemma map_dblX : dblX (W'.map f) (f ∘ P) = f (W'.dblX P)

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{S : Type u_1}
[CommRing S]
(f : R →+* S)
(P : Fin 3 → R)

WeierstrassCurve.Jacobian.dblX (WeierstrassCurve.map W' f) (⇑f ∘ P) = f (W'.dblX P)


@[to_additive]
theorem mulIndicator_apply_ne_one {a : α} : s.mulIndicator f a ≠ 1 ↔ a ∈ s ∩ mulSupport f

{α : Type u_1}
{M : Type u_4}
[One M]
{s : Set α}
{f : α → M}
{a : α}

s.mulIndicator f a ≠ 1 ↔ a ∈ s ∩ Function.mulSupport f


theorem lhopital_zero_atBot_on_Iio (hff' : ∀ x ∈ Iio a, HasDerivAt f (f' x) x)
    (hgg' : ∀ x ∈ Iio a, HasDerivAt g (g' x) x) (hg' : ∀ x ∈ Iio a, g' x ≠ 0)
    (hfbot : Tendsto f atBot (𝓝 0)) (hgbot : Tendsto g atBot (𝓝 0))
    (hdiv : Tendsto (fun x => f' x / g' x) atBot l) : Tendsto (fun x => f x / g x) atBot l

(hff' : ∀ x ∈ Set.Iio a, HasDerivAt f (f' x) x)

(hgg' : ∀ x ∈ Set.Iio a, HasDerivAt g (g' x) x)

(hfbot : Filter.Tendsto f Filter.atBot (𝓝 0))

(hgbot : Filter.Tendsto g Filter.atBot (𝓝 0))

(hdiv : Filter.Tendsto (fun x => f' x / g' x) Filter.atBot l)

Filter.Tendsto (fun x => f x / g x) Filter.atBot l


lemma FarFromTriangleFree.lt_one (hG : G.FarFromTriangleFree ε) : ε < 1

{α : Type u_1}
{𝕜 : Type u_3}
[LinearOrderedField 𝕜]
{G : SimpleGraph α}
{ε : 𝕜}
[Fintype α]
[DecidableRel G.Adj]
[Nonempty α]
(hG : G.FarFromTriangleFree ε)


@[simp, norm_cast]
theorem coe_finset_sup (f : ι → Closeds α) (s : Finset ι) :
    (↑(s.sup f) : Set α) = s.sup ((↑) ∘ f)

{ι : Type u_1}
{α : Type u_2}
[TopologicalSpace α]
(f : ι → TopologicalSpace.Closeds α)
(s : Finset ι)


theorem toIcoMod_le_toIocMod (a b : α) : toIcoMod hp a b ≤ toIocMod hp a b

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


@[simp]
theorem ofMul_lt {a b : α} : ofMul a < ofMul b ↔ a < b

Additive.ofMul a < Additive.ofMul b ↔ a < b


/-- When a right homology data `h` of a short complex `S` is preserved by a functor `F`,
this is the induced right homology data `h.map F` for the short complex `S.map F`. -/
@[simps]
noncomputable def map : (S.map F).RightHomologyData


/-- The identity continuous homomorphism. -/
@[to_additive (attr := simps!) "The identity continuous homomorphism."]
def id : ContinuousMonoidHom A A

(A : Type u_2)
[AddMonoid A]
[TopologicalSpace A]
(x : A)


/--
If `B` is a strict bicategory and `I` is a (1-)category, any functor (of 1-categories) `I ⥤ B` can
be promoted to an oplax functor from `LocallyDiscrete I` to `B`.
-/
@[simps]
def Functor.toOplaxFunctor (F : I ⥤ B) : OplaxFunctor (LocallyDiscrete I) B

{I : Type u₁}
[CategoryTheory.Category.{v₁, u₁} I]
{B : Type u₂}
[CategoryTheory.Bicategory B]
[CategoryTheory.Bicategory.Strict B]
(F : CategoryTheory.Functor I B)
(i : CategoryTheory.LocallyDiscrete I)

F.toOplaxFunctor.mapId i = CategoryTheory.eqToHom ⋯


@[simp]
theorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ

{R : Type u}
{A : Type v}
[CommSemiring R]
[Ring A]
[Algebra R A]
[Subsingleton A]
(a : A)


@[simp] lemma infClosed_univ : InfClosed (univ : Set α)


@[simp]
theorem Tape.move_left_right {Γ} [Inhabited Γ] (T : Tape Γ) :
    (T.move Dir.left).move Dir.right = T

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

Turing.Tape.move Turing.Dir.right (Turing.Tape.move Turing.Dir.left T) = T


/-- If `R` is "smaller" ring than `S` then the span by `R` is smaller than the span by `S`. -/
theorem span_le_restrictScalars [Semiring S] [SMul R S] [Module S M] [IsScalarTower R S M] :
    span R s ≤ (span S s).restrictScalars R

(R : Type u_1)
{M : Type u_4}
(S : Type u_7)
[Semiring R]
[AddCommMonoid M]
[Module R M]
(s : Set M)
[Semiring S]
[SMul R S]
[Module S M]
[IsScalarTower R S M]

Submodule.span R s ≤ Submodule.restrictScalars R (Submodule.span S s)


/-- A version of **Fubini's theorem** in `n` variables, for a natural number `n`. -/
theorem integral_fin_nat_prod_eq_prod {n : ℕ} {E : Fin n → Type*}
    [∀ i, MeasureSpace (E i)] [∀ i, SigmaFinite (volume : Measure (E i))]
    (f : (i : Fin n) → E i → 𝕜) :
    ∫ x : (i : Fin n) → E i, ∏ i, f i (x i) = ∏ i, ∫ x, f i x

[(i : Fin n) → MeasureTheory.MeasureSpace (E i)]

[∀ (i : Fin n), MeasureTheory.SigmaFinite MeasureTheory.volume]

∫ (x : (i : Fin n) → E i), ∏ i : Fin n, f i (x i) = ∏ i : Fin n, ∫ (x : E i), f i x


@[simp] lemma empty_set_smul : (∅ : Set S) • N = ⊥

{R : Type u_2}
{M : Type u_3}
[Semiring R]
{S : Type u_4}
[Monoid S]
[AddCommMonoid M]
[Module R M]
[DistribMulAction S M]
(N : Submodule R M)


@[simp]
theorem iUnion_inf (π₁ π₂ : Prepartition I) : (π₁ ⊓ π₂).iUnion = π₁.iUnion ∩ π₂.iUnion

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π₁ π₂ : BoxIntegral.Prepartition I)


theorem posMulReflectLT_iff_mulPosReflectLT : PosMulReflectLT α ↔ MulPosReflectLT α

{α : Type u_1}
[Mul α]
[IsSymmOp α α fun x x_1 => x * x_1]
[Zero α]
[Preorder α]


@[simp]
theorem lsub_empty {ι} [h : IsEmpty ι] (f : ι → Ordinal) : lsub f = 0

{ι : Type u_4}
[h : IsEmpty ι]
(f : ι → Ordinal.{max u_5 u_4})


/-- If the range of `f` is pairwise disjoint, then the image of any set `s` under `f` is as well. -/
lemma _root_.Pairwise.pairwiseDisjoint (h : Pairwise (Disjoint on f)) (s : Set ι) :
    s.PairwiseDisjoint f

{α : Type u_1}
{ι : Type u_4}
[PartialOrder α]
[OrderBot α]
{f : ι → α}
(h : Pairwise (Disjoint on f))
(s : Set ι)


theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] {x : R}
    (x0 : x ≠ 0) : Squarefree x ↔ Multiset.Nodup (normalizedFactors x)

{R : Type u_1}
[CancelCommMonoidWithZero R]
[UniqueFactorizationMonoid R]
[NormalizationMonoid R]
{x : R}
(x0 : x ≠ 0)

Squarefree x ↔ (UniqueFactorizationMonoid.normalizedFactors x).Nodup


@[to_additive]
lemma piFinset_mul [∀ i, Mul (α i)] (s t : ∀ i, Finset (α i)) :
    piFinset (fun i ↦ s i * t i) = piFinset s * piFinset t

{ι : Type u_5}
{α : ι → Type u_6}
[Fintype ι]
[DecidableEq ι]
[(i : ι) → DecidableEq (α i)]
[(i : ι) → Mul (α i)]
(s t : (i : ι) → Finset (α i))

(Fintype.piFinset fun i => s i * t i) = Fintype.piFinset s * Fintype.piFinset t


/-- If the angle between two vectors is nonzero, the second vector is nonzero. -/
theorem right_ne_zero_of_oangle_ne_zero {x y : V} (h : o.oangle x y ≠ 0) : y ≠ 0

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


/-- From an upper bound on `sqrtTwoAddSeries 0 n = 2 cos (π / 2 ^ (n+1))` of the form
`sqrtTwoAddSeries 0 n ≤ 2 - (a / 2 ^ (n + 1)) ^ 2)`, one can deduce the lower bound `a < π`
thanks to basic trigonometric inequalities as expressed in `pi_gt_sqrtTwoAddSeries`. -/
theorem pi_lower_bound_start (n : ℕ) {a}
    (h : sqrtTwoAddSeries ((0 : ℕ) / (1 : ℕ)) n ≤ (2 : ℝ) - (a / (2 : ℝ) ^ (n + 1)) ^ 2) :
    a < π

(h : (↑0 / ↑1).sqrtTwoAddSeries n ≤ 2 - (a / 2 ^ (n + 1)) ^ 2)


theorem Subring.isClosed_topologicalClosure (s : Subring α) :
    IsClosed (s.topologicalClosure : Set α)

{α : Type u_1}
[TopologicalSpace α]
[Ring α]
[TopologicalRing α]
(s : Subring α)


theorem Int.two_pow_two_pow_sub_pow_two_pow {x y : ℤ} (n : ℕ) (hxy : 4 ∣ x - y) (hx : ¬2 ∣ x) :
    multiplicity 2 (x ^ 2 ^ n - y ^ 2 ^ n) = multiplicity 2 (x - y) + n

multiplicity 2 (x ^ 2 ^ n - y ^ 2 ^ n) = multiplicity 2 (x - y) + ↑n


theorem surjective_restrict {α} {β : α → Type*} [ne : ∀ a, Nonempty (β a)] (p : α → Prop) :
    Surjective fun f : ∀ x, β x ↦ restrict p f

{α : Sort u_5}
{β : α → Type u_4}
[ne : ∀ (a : α), Nonempty (β a)]
(p : α → Prop)

Function.Surjective fun f => Subtype.restrict p f


@[to_additive smul_right_surj_of_divisibleBy]
theorem pow_left_surj_of_rootableBy [RootableBy A α] {n : α} (hn : n ≠ 0) :
    Function.Surjective (fun a => a ^ n : A → A)

(A : Type u_1)
(α : Type u_2)
[AddMonoid A]
[SMul α A]
[Zero α]
[DivisibleBy A α]
{n : α}
(hn : n ≠ 0)


/-- An auxiliary lemma for
`Complex.circleIntegral_sub_inv_smul_of_differentiable_on_off_countable`. This lemma assumes
`w ∉ s` while the main lemma drops this assumption. -/
theorem circleIntegral_sub_inv_smul_of_differentiable_on_off_countable_aux {R : ℝ} {c w : ℂ}
    {f : ℂ → E} {s : Set ℂ} (hs : s.Countable) (hw : w ∈ ball c R \ s)
    (hc : ContinuousOn f (closedBall c R)) (hd : ∀ x ∈ ball c R \ s, DifferentiableAt ℂ f x) :
    (∮ z in C(c, R), (z - w)⁻¹ • f z) = (2 * π * I : ℂ) • f w

(hc : ContinuousOn f (Metric.closedBall c R))

(hd : ∀ x ∈ Metric.ball c R \ s, DifferentiableAt ℂ f x)

(∮ (z : ℂ) in C(c, R), (z - w)⁻¹ • f z) = (2 * ↑π * Complex.I) • f w


@[simp]
theorem transpose_eq_natCast [DecidableEq n] [AddMonoidWithOne α] {M : Matrix n n α} {d : ℕ} :
    Mᵀ = d ↔ M = d

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[AddMonoidWithOne α]
{M : Matrix n n α}
{d : ℕ}


theorem le_max {a : α} {s : Finset α} (as : a ∈ s) : ↑a ≤ s.max

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


/-- We can express `qrSign m n` as a power of `-1` when `m` and `n` are odd. -/
theorem neg_one_pow {m n : ℕ} (hm : Odd m) (hn : Odd n) :
    qrSign m n = (-1) ^ (m / 2 * (n / 2))


@[simp] lemma zpow_addRight : ∀ (n : ℤ), Equiv.addRight a ^ n = Equiv.addRight (n • a)

{α : Type u}
[AddGroup α]
(a : α)
(n : ℤ)


@[trans]
theorem lf_of_le_of_lf {x y z : PGame} (h₁ : x ≤ y) (h₂ : y ⧏ z) : x ⧏ z

{x y z : SetTheory.PGame}
(h₁ : x ≤ y)
(h₂ : y.LF z)


theorem rpow_add_of_nonneg (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) :
    x ^ (y + z) = x ^ y * x ^ z

{x y z : ℝ}
(hx : 0 ≤ x)
(hy : 0 ≤ y)
(hz : 0 ≤ z)


@[to_additive (attr := simp)]
theorem lift_apply_inl (f : M →* P) (g : N →* P) (x : M) : lift f g (inl x) = f x

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[MulOneClass M]
[MulOneClass N]
[Monoid P]
(f : M →* P)
(g : N →* P)
(x : M)

(Monoid.Coprod.lift f g) (Monoid.Coprod.inl x) = f x


/-- The oriented angle between two vectors is zero if and only if they are on the same ray. -/
theorem oangle_eq_zero_iff_sameRay {x y : V} : o.oangle x y = 0 ↔ SameRay ℝ x y


@[simp]
theorem coe_ofLe : (ofLe h : Submodule R K') = LinearMap.range (Submodule.inclusion h)

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{K K' : LieSubalgebra R L}
(h : K ≤ K')

(LieSubalgebra.ofLe h).toSubmodule = LinearMap.range (Submodule.inclusion h)


@[simp]
theorem nodup_cons {a : α} {s : Multiset α} : Nodup (a ::ₘ s) ↔ a ∉ s ∧ Nodup s


theorem le_cons_self (s : Multiset α) (a : α) : s ≤ a ::ₘ s


/-- If `E / L / F` and `E / L' / F` are two field extension towers, `L ≃ₐ[F] L'` is an isomorphism
compatible with `E / L` and `E / L'`, then for any subset `S` of `E`, `L(S)` and `L'(S)` are
equal as intermediate fields of `E / F`. -/
theorem restrictScalars_adjoin_of_algEquiv
    {L L' : Type*} [Field L] [Field L']
    [Algebra F L] [Algebra L E] [Algebra F L'] [Algebra L' E]
    [IsScalarTower F L E] [IsScalarTower F L' E] (i : L ≃ₐ[F] L')
    (hi : algebraMap L E = (algebraMap L' E) ∘ i) (S : Set E) :
    (adjoin L S).restrictScalars F = (adjoin L' S).restrictScalars F

(hi : ⇑(algebraMap L E) = ⇑(algebraMap L' E) ∘ ⇑i)

IntermediateField.restrictScalars F (IntermediateField.adjoin L S) =
  IntermediateField.restrictScalars F (IntermediateField.adjoin L' S)


theorem isReflection_inv : cs.IsReflection t⁻¹

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
{cs : CoxeterSystem M W}
{t : W}
(ht : cs.IsReflection t)


theorem eqToHom_comp_iff {X X' Y : C} (p : X = X') (f : X ⟶ Y) (g : X' ⟶ Y) :
    eqToHom p ≫ g = f ↔ g = eqToHom p.symm ≫ f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X X' Y : C}
(p : X = X')
(f : X ⟶ Y)
(g : X' ⟶ Y)

CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom p) g = f ↔
  g = CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯) f


/-- The identity map is a monoid homomorphism. -/
@[to_additive "The identity map is an additive monoid homomorphism."]
theorem id : IsMonoidHom (@id α)


/-- A (topological) fiber bundle with fiber `F` over a base `B` is a space projecting on `B`
for which the fibers are all homeomorphic to `F`, such that the local situation around each point
is a direct product. -/
class FiberBundle where
  totalSpaceMk_inducing' : ∀ b : B, Inducing (@TotalSpace.mk B F E b)
  trivializationAtlas' : Set (Trivialization F (π F E))
  trivializationAt' : B → Trivialization F (π F E)
  mem_baseSet_trivializationAt' : ∀ b : B, b ∈ (trivializationAt' b).baseSet
  trivialization_mem_atlas' : ∀ b : B, trivializationAt' b ∈ trivializationAtlas'

[TopologicalSpace (Bundle.TotalSpace F E)]


theorem IsBigO.congr_right (h : f =O[l] g₁) (hg : ∀ x, g₁ x = g₂ x) : f =O[l] g₂

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{l : Filter α}
{g₁ g₂ : α → F}
(h : f =O[l] g₁)
(hg : ∀ (x : α), g₁ x = g₂ x)


theorem y_le_one {D : ℝ} (x : E) (Dpos : 0 < D) : y D x ≤ 1

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
{D : ℝ}
(x : E)
(Dpos : 0 < D)


@[simp]
theorem trunc_C (n) (a : R) : trunc (n + 1) (C R a) = Polynomial.C a

{R : Type u_1}
[Semiring R]
(n : ℕ)
(a : R)

PowerSeries.trunc (n + 1) ((PowerSeries.C R) a) = Polynomial.C a


@[simp]
theorem toPiFork_π_app_zero : K.toPiFork.ι = Pi.lift K.ι

{I : CategoryTheory.Limits.MulticospanIndex C}

K.toPiFork.ι = CategoryTheory.Limits.Pi.lift K.ι


theorem filter_congr_decidable (s : Finset α) (p : α → Prop) (h : DecidablePred p)
    [DecidablePred p] : @filter α p h s = s.filter p

{α : Type u_1}
(s : Finset α)
(p : α → Prop)
(h : DecidablePred p)
[DecidablePred p]


@[simp]
lemma equation_zero : W.Equation 0 0 ↔ W.a₆ = 0

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


/-- Auxiliary lemma for `biprod.uniqueUpToIso`. -/
theorem biprod.conePointUniqueUpToIso_hom (X Y : C) [HasBinaryBiproduct X Y] {b : BinaryBicone X Y}
    (hb : b.IsBilimit) :
    (hb.isLimit.conePointUniqueUpToIso (BinaryBiproduct.isLimit _ _)).hom =
      biprod.lift b.fst b.snd

{b : CategoryTheory.Limits.BinaryBicone X Y}

(hb.isLimit.conePointUniqueUpToIso (CategoryTheory.Limits.BinaryBiproduct.isLimit X Y)).hom =
  CategoryTheory.Limits.biprod.lift b.fst b.snd


@[to_additive]
theorem inv_mem_nhds_one {S : Set G} (hS : S ∈ (𝓝 1 : Filter G)) : S⁻¹ ∈ 𝓝 (1 : G)

(G : Type w)
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{S : Set G}
(hS : S ∈ 𝓝 1)


theorem IsSt.unique {x : ℝ*} {r s : ℝ} (hr : IsSt x r) (hs : IsSt x s) : r = s

{x : ℝ*}
{r s : ℝ}
(hr : x.IsSt r)
(hs : x.IsSt s)


@[simp]
lemma natDegree_Φ [Nontrivial R] (n : ℤ) : (W.Φ n).natDegree = n.natAbs ^ 2

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
[Nontrivial R]
(n : ℤ)


@[reassoc (attr := simp)]
theorem cokernelIsoOfEq_inv_comp_desc {Z} {f g : X ⟶ Y} [HasCokernel f] [HasCokernel g] (h : f = g)
    (e : Y ⟶ Z) (he) :
    (cokernelIsoOfEq h).inv ≫ cokernel.desc _ e he = cokernel.desc _ e (by simp [← h, he])

(CategoryTheory.Limits.cokernelIsoOfEq h).inv ≫ CategoryTheory.Limits.cokernel.desc f e he =
  CategoryTheory.Limits.cokernel.desc g e ⋯


@[simp]
lemma homologyMap_comp [HasHomology S₁] [HasHomology S₂] [HasHomology S₃]
    (φ₁ : S₁ ⟶ S₂) (φ₂ : S₂ ⟶ S₃) :
    homologyMap (φ₁ ≫ φ₂) = homologyMap φ₁ ≫ homologyMap φ₂

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

(φ₁ : S₁ ⟶ S₂)

(φ₂ : S₂ ⟶ S₃)

CategoryTheory.ShortComplex.homologyMap (CategoryTheory.CategoryStruct.comp φ₁ φ₂) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.homologyMap φ₁)
    (CategoryTheory.ShortComplex.homologyMap φ₂)


theorem IsInaccessible.mk {c} (h₁ : ℵ₀ < c) (h₂ : c ≤ c.ord.cof) (h₃ : ∀ x < c, (2^x) < c) :
    IsInaccessible c

{c : Cardinal.{u_2}}
(h₁ : ℵ₀ < c)
(h₂ : c ≤ c.ord.cof)
(h₃ : ∀ x < c, 2 ^ x < c)


/-- For nonzero `a : F`, `quadraticChar F a = 1 ↔ IsSquare a`. -/
theorem quadraticChar_one_iff_isSquare {a : F} (ha : a ≠ 0) :
    quadraticChar F a = 1 ↔ IsSquare a

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]
{a : F}
(ha : a ≠ 0)


/-- The square
```
  Y --inr--> X ⊞ Y
  |            |
  0           fst
  |            |
  v            v
  0 ---0-----> X
```
is a pullback square.
-/
@[simp]
theorem inr_fst (X Y : C) [HasBinaryBiproduct X Y] :
    IsPullback biprod.inr (0 : Y ⟶ 0) biprod.fst (0 : 0 ⟶ X)

CategoryTheory.IsPullback CategoryTheory.Limits.biprod.inr 0 CategoryTheory.Limits.biprod.fst 0


theorem mulRightMap_eq_mulMap_comp {ι : Type*} [DecidableEq ι] (n : ι → N) :
    mulRightMap M n = mulMap M N ∘ₗ LinearMap.lTensor M (Finsupp.total ι N R n) ∘ₗ
      (TensorProduct.finsuppScalarRight R M ι).symm.toLinearMap

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
(M : Submodule R S)
{N : Submodule R S}
{ι : Type u_1}
[DecidableEq ι]
(n : ι → ↥N)

M.mulRightMap n =
  M.mulMap N ∘ₗ LinearMap.lTensor (↥M) (Finsupp.total ι (↥N) R n) ∘ₗ ↑(TensorProduct.finsuppScalarRight R (↥M) ι).symm


theorem exists_subset_part_bijOn : ∃ r ⊆ s, Set.BijOn P.part r P.parts

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


@[simp] theorem carry_zero : carry 0 x y c = c

∀ {w : Nat} {x y : BitVec w} {c : Bool}, BitVec.carry 0 x y c = c


@[simp]
theorem isCompl_toDual_iff : IsCompl (toDual a) (toDual b) ↔ IsCompl a b

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

IsCompl (OrderDual.toDual a) (OrderDual.toDual b) ↔ IsCompl a b


theorem closedBall_add_closedBall [ProperSpace E] (hε : 0 ≤ ε) (hδ : 0 ≤ δ) (a b : E) :
    closedBall a ε + closedBall b δ = closedBall (a + b) (ε + δ)

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{δ ε : ℝ}
[ProperSpace E]
(hε : 0 ≤ ε)
(hδ : 0 ≤ δ)
(a b : E)

Metric.closedBall a ε + Metric.closedBall b δ = Metric.closedBall (a + b) (ε + δ)


lemma Subgraph.Connected.induce_verts {H : G.Subgraph} (h : H.Connected) :
    (G.induce H.verts).Connected

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


@[simp]
theorem unmop_comp {X Y Z : Cᴹᵒᵖ} {f : X ⟶ Y} {g : Y ⟶ Z} :
    (f ≫ g).unmop = f.unmop ≫ g.unmop

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y Z : Cᴹᵒᵖ}
{f : X ⟶ Y}
{g : Y ⟶ Z}


/-- An induction principle for finite types, analogous to `Nat.rec`. It effectively says
that every `Fintype` is either `Empty` or `Option α`, up to an `Equiv`. -/
theorem Finite.induction_empty_option {P : Type u → Prop} (of_equiv : ∀ {α β}, α ≃ β → P α → P β)
    (h_empty : P PEmpty) (h_option : ∀ {α} [Fintype α], P α → P (Option α)) (α : Type u)
    [Finite α] : P α

(of_equiv : ∀ {α β : Type u}, α ≃ β → P α → P β)

(h_option : ∀ {α : Type u} [inst : Fintype α], P α → P (Option α))


/-- Union of two disjoint prepartitions. -/
@[simps]
def disjUnion (π₁ π₂ : Prepartition I) (h : Disjoint π₁.iUnion π₂.iUnion) : Prepartition I

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π₁ π₂ : BoxIntegral.Prepartition I)
(h : Disjoint π₁.iUnion π₂.iUnion)

(π₁.disjUnion π₂ h).boxes = π₁.boxes ∪ π₂.boxes


lemma nonneg_of_isRat {n : ℤ} {d : ℕ} [LinearOrderedRing A] :
    (NormNum.IsRat e n d) → (decide (n = 0)) → (0 ≤ (e : A))

{A : Type u_1}
{e : A}
{n : ℤ}
{d : ℕ}
[LinearOrderedRing A]

Mathlib.Meta.NormNum.IsRat e n d → decide (n = 0) = true → 0 ≤ e


@[simp]
theorem ofConjAct_toConjAct (x : G) : ofConjAct (toConjAct x) = x

ConjAct.ofConjAct (ConjAct.toConjAct x) = x


theorem equivFunOnFinite_symm_eq_sum [Fintype α] [AddCommMonoid M] (f : α → M) :
    equivFunOnFinite.symm f = ∑ a, Finsupp.single a (f a)

{α : Type u_1}
{M : Type u_8}
[Fintype α]
[AddCommMonoid M]
(f : α → M)

Finsupp.equivFunOnFinite.symm f = ∑ a : α, Finsupp.single a (f a)


theorem rel_append : (Forall₂ R ⇒ Forall₂ R ⇒ Forall₂ R) (· ++ ·) (· ++ ·)

{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}

(List.Forall₂ R ⇒ List.Forall₂ R ⇒ List.Forall₂ R) (fun x x_1 => x ++ x_1) fun x x_1 => x ++ x_1


/-- Typeclass for purely inseparable field extensions: an algebraic extension `E / F` is purely
inseparable if and only if the minimal polynomial of every element of `E ∖ F` is not separable. -/
class IsPurelyInseparable : Prop where
  isIntegral : Algebra.IsIntegral F E
  inseparable' (x : E) : IsSeparable F x → x ∈ (algebraMap F E).range

{F : Type u}
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
[self : IsPurelyInseparable F E]
(x : E)


@[simp]
theorem mul_apply (e₁ e₂ : AddAut A) (a : A) : (e₁ * e₂) a = e₁ (e₂ a)

(A : Type u_1)
[Add A]
(e₁ e₂ : AddAut A)
(a : A)


theorem inter_symmDiff_distrib_left (s t u : Set α) : s ∩ t ∆ u = (s ∩ t) ∆ (s ∩ u)

s ∩ symmDiff t u = symmDiff (s ∩ t) (s ∩ u)


@[simp]
theorem rename_rename (f : σ → τ) (g : τ → α) (p : MvPolynomial σ R) :
    rename g (rename f p) = rename (g ∘ f) p

{σ : Type u_1}
{τ : Type u_2}
{α : Type u_3}
{R : Type u_4}
[CommSemiring R]
(f : σ → τ)
(g : τ → α)
(p : MvPolynomial σ R)

(MvPolynomial.rename g) ((MvPolynomial.rename f) p) = (MvPolynomial.rename (g ∘ f)) p


theorem solution_pow (a₁ a₂ : 𝕎 k) : ∃ x : k, x ^ (p - 1) = a₂.coeff 0 / a₁.coeff 0

(p : ℕ)
[hp : Fact (Nat.Prime p)]
{k : Type u_1}
[Field k]
[IsAlgClosed k]
(a₁ a₂ : WittVector p k)

∃ x, x ^ (p - 1) = a₂.coeff 0 / a₁.coeff 0


@[to_additive negPart_nonneg] lemma one_le_leOnePart (a : α) : 1 ≤ a⁻ᵐ

{α : Type u_1}
[Lattice α]
[AddGroup α]
(a : α)


/-- Two equivalence relations are equal iff their underlying binary operations are equal. -/
theorem eq_iff_rel_eq {r₁ r₂ : Setoid α} : r₁ = r₂ ↔ r₁.Rel = r₂.Rel


@[simp]
theorem BinaryFan.mk_snd {P : C} (π₁ : P ⟶ X) (π₂ : P ⟶ Y) : (BinaryFan.mk π₁ π₂).snd = π₂

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y P : C}
(π₁ : P ⟶ X)
(π₂ : P ⟶ Y)

(CategoryTheory.Limits.BinaryFan.mk π₁ π₂).snd = π₂


lemma LieAlgebra.ad_lie (x y z : L) :
    (ad R L x) ⁅y, z⁆ = ⁅ad R L x y, z⁆ + ⁅y, ad R L x z⁆

(R : Type u)
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(x y z : L)

((LieAlgebra.ad R L) x) ⁅y, z⁆ = ⁅((LieAlgebra.ad R L) x) y, z⁆ + ⁅y, ((LieAlgebra.ad R L) x) z⁆


/-- Left multiplication by an element of a type with distributive multiplication is an `AddHom`. -/
@[simps (config := .asFn)]
def mulLeft [Distrib R] (r : R) : AddHom R R


theorem IsUniversalColimit.map_reflective
    {Gl : C ⥤ D} {Gr : D ⥤ C} (adj : Gl ⊣ Gr) [Gr.Full] [Gr.Faithful]
    {F : J ⥤ D} {c : Cocone (F ⋙ Gr)}
    (H : IsUniversalColimit c)
    [∀ X (f : X ⟶ Gl.obj c.pt), HasPullback (Gr.map f) (adj.unit.app c.pt)]
    [∀ X (f : X ⟶ Gl.obj c.pt), PreservesLimit (cospan (Gr.map f) (adj.unit.app c.pt)) Gl] :
    IsUniversalColimit (Gl.mapCocone c)

{c : CategoryTheory.Limits.Cocone (F.comp Gr)}

(H : CategoryTheory.IsUniversalColimit c)

[∀ (X : D) (f : X ⟶ Gl.obj c.pt), CategoryTheory.Limits.HasPullback (Gr.map f) (adj.unit.app c.pt)]

[(X : D) →
    (f : X ⟶ Gl.obj c.pt) →
      CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan (Gr.map f) (adj.unit.app c.pt)) Gl]


/--
In a monoidal category, we can take the tensor product of objects, `X ⊗ Y` and of morphisms `f ⊗ g`.
Tensor product does not need to be strictly associative on objects, but there is a
specified associator, `α_ X Y Z : (X ⊗ Y) ⊗ Z ≅ X ⊗ (Y ⊗ Z)`. There is a tensor unit `𝟙_ C`,
with specified left and right unitor isomorphisms `λ_ X : 𝟙_ C ⊗ X ≅ X` and `ρ_ X : X ⊗ 𝟙_ C ≅ X`.
These associators and unitors satisfy the pentagon and triangle equations.

See <https://stacks.math.columbia.edu/tag/0FFK>.
-/
-- Porting note: The Mathport did not translate the temporary notation
class MonoidalCategory (C : Type u) [𝒞 : Category.{v} C] extends MonoidalCategoryStruct C where
  tensorHom_def {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
    f ⊗ g = (f ▷ X₂) ≫ (Y₁ ◁ g) := by
      aesop_cat
  /-- Tensor product of identity maps is the identity: `(𝟙 X₁ ⊗ 𝟙 X₂) = 𝟙 (X₁ ⊗ X₂)` -/
  tensor_id : ∀ X₁ X₂ : C, 𝟙 X₁ ⊗ 𝟙 X₂ = 𝟙 (X₁ ⊗ X₂) := by aesop_cat
  /--
  Composition of tensor products is tensor product of compositions:
  `(f₁ ⊗ g₁) ∘ (f₂ ⊗ g₂) = (f₁ ∘ f₂) ⊗ (g₁ ⊗ g₂)`
  -/
  tensor_comp :
    ∀ {X₁ Y₁ Z₁ X₂ Y₂ Z₂ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (g₁ : Y₁ ⟶ Z₁) (g₂ : Y₂ ⟶ Z₂),
      (f₁ ≫ g₁) ⊗ (f₂ ≫ g₂) = (f₁ ⊗ f₂) ≫ (g₁ ⊗ g₂) := by
    aesop_cat
  whiskerLeft_id : ∀ (X Y : C), X ◁ 𝟙 Y = 𝟙 (X ⊗ Y) := by
    aesop_cat
  id_whiskerRight : ∀ (X Y : C), 𝟙 X ▷ Y = 𝟙 (X ⊗ Y) := by
    aesop_cat
  /-- Naturality of the associator isomorphism: `(f₁ ⊗ f₂) ⊗ f₃ ≃ f₁ ⊗ (f₂ ⊗ f₃)` -/
  associator_naturality :
    ∀ {X₁ X₂ X₃ Y₁ Y₂ Y₃ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (f₃ : X₃ ⟶ Y₃),
      ((f₁ ⊗ f₂) ⊗ f₃) ≫ (α_ Y₁ Y₂ Y₃).hom = (α_ X₁ X₂ X₃).hom ≫ (f₁ ⊗ (f₂ ⊗ f₃)) := by
    aesop_cat
  /--
  Naturality of the left unitor, commutativity of `𝟙_ C ⊗ X ⟶ 𝟙_ C ⊗ Y ⟶ Y` and `𝟙_ C ⊗ X ⟶ X ⟶ Y`
  -/
  leftUnitor_naturality :
    ∀ {X Y : C} (f : X ⟶ Y), 𝟙_ _ ◁ f ≫ (λ_ Y).hom = (λ_ X).hom ≫ f := by
    aesop_cat
  /--
  Naturality of the right unitor: commutativity of `X ⊗ 𝟙_ C ⟶ Y ⊗ 𝟙_ C ⟶ Y` and `X ⊗ 𝟙_ C ⟶ X ⟶ Y`
  -/
  rightUnitor_naturality :
    ∀ {X Y : C} (f : X ⟶ Y), f ▷ 𝟙_ _ ≫ (ρ_ Y).hom = (ρ_ X).hom ≫ f := by
    aesop_cat
  /--
  The pentagon identity relating the isomorphism between `X ⊗ (Y ⊗ (Z ⊗ W))` and `((X ⊗ Y) ⊗ Z) ⊗ W`
  -/
  pentagon :
    ∀ W X Y Z : C,
      (α_ W X Y).hom ▷ Z ≫ (α_ W (X ⊗ Y) Z).hom ≫ W ◁ (α_ X Y Z).hom =
        (α_ (W ⊗ X) Y Z).hom ≫ (α_ W X (Y ⊗ Z)).hom := by
    aesop_cat
  /--
  The identity relating the isomorphisms between `X ⊗ (𝟙_ C ⊗ Y)`, `(X ⊗ 𝟙_ C) ⊗ Y` and `X ⊗ Y`
  -/
  triangle :
    ∀ X Y : C, (α_ X (𝟙_ _) Y).hom ≫ X ◁ (λ_ Y).hom = (ρ_ X).hom ▷ Y := by
    aesop_cat

[self : CategoryTheory.MonoidalCategory C]

CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.CategoryStruct.id Y) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.MonoidalCategory.tensorObj X Y)


theorem IsPositive.conj_orthogonalProjection (U : Submodule 𝕜 E) {T : E →L[𝕜] E} (hT : T.IsPositive)
    [CompleteSpace U] :
    (U.subtypeL ∘L
        orthogonalProjection U ∘L T ∘L U.subtypeL ∘L orthogonalProjection U).IsPositive

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
(U : Submodule 𝕜 E)
{T : E →L[𝕜] E}
(hT : T.IsPositive)
[CompleteSpace ↥U]

(U.subtypeL.comp ((orthogonalProjection U).comp (T.comp (U.subtypeL.comp (orthogonalProjection U))))).IsPositive


theorem to_implicitFunctionOfComplemented (hf : HasStrictFDerivAt f f' a) (hf' : range f' = ⊤)
    (hker : (ker f').ClosedComplemented) :
    HasStrictFDerivAt (hf.implicitFunctionOfComplemented f f' hf' hker (f a))
      (ker f').subtypeL 0

(hker : (LinearMap.ker f').ClosedComplemented)

HasStrictFDerivAt (HasStrictFDerivAt.implicitFunctionOfComplemented f f' hf hf' hker (f a)) (LinearMap.ker f').subtypeL
  0


theorem limNthHom_add (r s : R) :
    limNthHom f_compat (r + s) = limNthHom f_compat r + limNthHom f_compat s

(f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), (ZMod.castHom ⋯ (ZMod (p ^ k1))).comp (f k2) = f k1)

PadicInt.limNthHom f_compat (r + s) = PadicInt.limNthHom f_compat r + PadicInt.limNthHom f_compat s


theorem gfpApprox_antitone : Antitone (gfpApprox f x)

{α : Type u}
[CompleteLattice α]
(f : α →o α)
(x : α)


theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.Coprime n) :
    IsPrimitiveRoot (exp (2 * π * I * (i / n))) n

IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I * (↑i / ↑n))) n


lemma indicator_prod_one {t : Set κ} {j : κ} :
    (s ×ˢ t).indicator (1 : ι × κ → M₀) (i, j) = s.indicator 1 i * t.indicator 1 j

{ι : Type u_1}
{κ : Type u_2}
{M₀ : Type u_4}
[MulZeroOneClass M₀]
{s : Set ι}
{i : ι}
{t : Set κ}
{j : κ}

(s ×ˢ t).indicator 1 (i, j) = s.indicator 1 i * t.indicator 1 j


@[simp]
theorem map_bot : (⊥ : AffineSubspace k P₁).map f = ⊥

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


@[simp] lemma op_tensorHom {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
    (f ⊗ g).op = f.op ⊗ g.op

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

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


theorem union_distrib_iInter₂_left (s : Set α) (t : ∀ i, κ i → Set α) :
    (s ∪ ⋂ (i) (j), t i j) = ⋂ (i) (j), s ∪ t i j

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
(s : Set α)
(t : (i : ι) → κ i → Set α)

s ∪ ⋂ i, ⋂ j, t i j = ⋂ i, ⋂ j, s ∪ t i j


theorem _root_.MeasureTheory.Integrable.integral_norm_condDistrib (hX : AEMeasurable X μ)
    (hY : AEMeasurable Y μ) (hf_int : Integrable f (μ.map fun a => (X a, Y a))) :
    Integrable (fun a => ∫ y, ‖f (X a, y)‖ ∂condDistrib Y X μ (X a)) μ

(hf_int : MeasureTheory.Integrable f (MeasureTheory.Measure.map (fun a => (X a, Y a)) μ))

MeasureTheory.Integrable (fun a => ∫ (y : Ω), ‖f (X a, y)‖ ∂(ProbabilityTheory.condDistrib Y X μ) (X a)) μ


/-- The `Bicone` used in order to obtain the existence of
the biproduct of a functor `J ⥤ Karoubi C` when the category `C` is additive. -/
@[simps]
def bicone [HasFiniteBiproducts C] {J : Type} [Finite J] (F : J → Karoubi C) : Bicone F

(F : J → CategoryTheory.Idempotents.Karoubi C)

(CategoryTheory.Idempotents.Karoubi.Biproducts.bicone F).pt.X = ⨁ fun j => (F j).X


theorem filter_def (f : Π₀ i, β i) : f.filter p = mk (f.support.filter p) fun i => f i.1

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]

DFinsupp.filter p f = DFinsupp.mk (Finset.filter p f.support) fun i => f ↑i


theorem count_le_card (hp : (setOf p).Finite) (n : ℕ) : count p n ≤ hp.toFinset.card

{p : ℕ → Prop}
[DecidablePred p]
(hp : (setOf p).Finite)
(n : ℕ)


theorem principal_coprod_principal (s : Set α) (t : Set β) :
    (𝓟 s).coprod (𝓟 t) = 𝓟 (sᶜ ×ˢ tᶜ)ᶜ

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


lemma LipschitzWith.uniformly_bounded [PseudoMetricSpace α] (g : α → ι → ℝ) {K : ℝ≥0}
    (hg : ∀ i, LipschitzWith K (g · i)) (a₀ : α) (hga₀b : Memℓp (g a₀) ∞) (a : α) :
    Memℓp (g a) ∞

(g : α → ι → ℝ)

(hg : ∀ (i : ι), LipschitzWith K fun x => g x i)


theorem EventuallyLE.cardinal_bInter {S : Set ι} (hS : #S < c)
    {s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) :
    ⋂ i ∈ S, s i ‹_› ≤ᶠ[l] ⋂ i ∈ S, t i ‹_›

(h : ∀ (i : ι) (hi : i ∈ S), s i hi ≤ᶠ[l] t i hi)

⋂ i, ⋂ (h : i ∈ S), s i h ≤ᶠ[l] ⋂ i, ⋂ (h : i ∈ S), t i h


theorem moveLeft_lf_of_le {x y : PGame} (h : x ≤ y) (i) : x.moveLeft i ⧏ y

{x y : SetTheory.PGame}
(h : x ≤ y)
(i : x.LeftMoves)


@[simp] theorem arrowCongr_symm {α₁ α₂ β₁ β₂ : Sort*} (e₁ : α₁ ≃ α₂) (e₂ : β₁ ≃ β₂) :
    (arrowCongr e₁ e₂).symm = arrowCongr e₁.symm e₂.symm

{α₁ : Sort u_1}
{α₂ : Sort u_2}
{β₁ : Sort u_3}
{β₂ : Sort u_4}
(e₁ : α₁ ≃ α₂)
(e₂ : β₁ ≃ β₂)

(e₁.arrowCongr e₂).symm = e₁.symm.arrowCongr e₂.symm


@[reassoc (attr := simp)]
lemma lift_snd {S : C} (k : IsKernelPair f a b) (p q : S ⟶ X) (w : p ≫ f = q ≫ f) :
    k.lift p q w ≫ b = q

(w : CategoryTheory.CategoryStruct.comp p f = CategoryTheory.CategoryStruct.comp q f)

CategoryTheory.CategoryStruct.comp (k.lift p q w) b = q


/-- Given a trifunctor `F : C₁ ⥤ C₂ ⥤ C₃ ⥤ C₄` and a map `p : I₁ × I₂ × I₃ → J`,
this is the functor
`GradedObject I₁ C₁ ⥤ GradedObject I₂ C₂ ⥤ GradedObject I₃ C₃ ⥤ GradedObject J C₄`
sending `X₁ : GradedObject I₁ C₁`, `X₂ : GradedObject I₂ C₂` and `X₃ : GradedObject I₃ C₃`
to the `J`-graded object sending `j` to the coproduct of
`((F.obj (X₁ i₁)).obj (X₂ i₂)).obj (X₃ i₃)` for `p ⟨i₁, i₂, i₃⟩ = j`. -/
@[simps]
noncomputable def mapTrifunctorMap
    [∀ X₁ X₂ X₃, HasMap ((((mapTrifunctor F I₁ I₂ I₃).obj X₁).obj X₂).obj X₃) p] :
    GradedObject I₁ C₁ ⥤ GradedObject I₂ C₂ ⥤ GradedObject I₃ C₃ ⥤ GradedObject J C₄

(F : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ (CategoryTheory.Functor C₃ C₄)))

[∀ (X₁ : CategoryTheory.GradedObject I₁ C₁) (X₂ : CategoryTheory.GradedObject I₂ C₂)
    (X₃ : CategoryTheory.GradedObject I₃ C₃),
    ((((CategoryTheory.GradedObject.mapTrifunctor F I₁ I₂ I₃).obj X₁).obj X₂).obj X₃).HasMap p]

{X₁ Y₁ : CategoryTheory.GradedObject I₁ C₁}

(((CategoryTheory.GradedObject.mapTrifunctorMap F p).map φ).app X₂).app X₃ i =
  CategoryTheory.GradedObject.mapTrifunctorMapMap F p φ (CategoryTheory.CategoryStruct.id X₂)
    (CategoryTheory.CategoryStruct.id X₃) i


@[simp]
theorem moveLeft_nim' {o : Ordinal.{u}} (i) :
    (nim o).moveLeft i = nim (toLeftMovesNim.symm i).val

{o : Ordinal.{u}}
(i : (SetTheory.PGame.nim o).LeftMoves)

(SetTheory.PGame.nim o).moveLeft i = SetTheory.PGame.nim ↑(SetTheory.PGame.toLeftMovesNim.symm i)


theorem indepSets_piiUnionInter_of_disjoint [IsProbabilityMeasure μ] {s : ι → Set (Set Ω)}
    {S T : Set ι} (h_indep : iIndepSets s μ) (hST : Disjoint S T) :
    IndepSets (piiUnionInter s S) (piiUnionInter s T) μ

(h_indep : ProbabilityTheory.iIndepSets s μ)

ProbabilityTheory.IndepSets (piiUnionInter s S) (piiUnionInter s T) μ


/-- `LinearEquiv.prodComm` is isometric. -/
@[simps!]
def IsometryEquiv.prodComm (Q₁ : QuadraticMap R M₁ P) (Q₂ : QuadraticMap R M₂ P) :
    (Q₁.prod Q₂).IsometryEquiv (Q₂.prod Q₁)

{R : Type u_2}
{M₁ : Type u_3}
{M₂ : Type u_4}
{P : Type u_7}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid P]
[Module R M₁]
[Module R M₂]
[Module R P]
(Q₁ : QuadraticMap R M₁ P)
(Q₂ : QuadraticMap R M₂ P)

∀ (a : M₂ × M₁), (QuadraticMap.IsometryEquiv.prodComm Q₁ Q₂).invFun a = a.swap


/-- Localization of modules is an exact functor, proven here for `LocalizedModule`.
See `IsLocalizedModule.map_exact` for the more general version. -/
lemma map_exact (g : M₀ →ₗ[R] M₁) (h : M₁ →ₗ[R] M₂) (ex : Exact g h) :
    Exact (map S (mkLinearMap S M₀) (mkLinearMap S M₁) g)
    (map S (mkLinearMap S M₁) (mkLinearMap S M₂) h)

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M₀ : Type u_6}
[AddCommGroup M₀]
[Module R M₀]
{M₁ : Type u_7}
[AddCommGroup M₁]
[Module R M₁]
{M₂ : Type u_8}
[AddCommGroup M₂]
[Module R M₂]
(g : M₀ →ₗ[R] M₁)
(h : M₁ →ₗ[R] M₂)
(ex : Function.Exact ⇑g ⇑h)

Function.Exact ⇑((IsLocalizedModule.map S (LocalizedModule.mkLinearMap S M₀) (LocalizedModule.mkLinearMap S M₁)) g)
  ⇑((IsLocalizedModule.map S (LocalizedModule.mkLinearMap S M₁) (LocalizedModule.mkLinearMap S M₂)) h)


/-- A `SubtractionMonoid` is a `SubNegMonoid` with involutive negation and such that
`-(a + b) = -b + -a` and `a + b = 0 → -a = b`. -/
class SubtractionMonoid (G : Type u) extends SubNegMonoid G, InvolutiveNeg G where
  protected neg_add_rev (a b : G) : -(a + b) = -b + -a
  /-- Despite the asymmetry of `neg_eq_of_add`, the symmetric version is true thanks to the
  involutivity of negation. -/
  protected neg_eq_of_add (a b : G) : a + b = 0 → -a = b

{G : Type u}
[self : SubtractionMonoid G]
(a b : G)


@[simp]
theorem range_quot_mk (r : α → α → Prop) : range (Quot.mk r) = univ


theorem exists_mul_self (x : ℚ) : (∃ q, q * q = x) ↔ Rat.sqrt x * Rat.sqrt x = x


lemma Set.Infinite.exists_accPt_principal [CompactSpace X] (hs : s.Infinite) : ∃ x, AccPt x (𝓟 s)

{X : Type u}
[TopologicalSpace X]
{s : Set X}
[CompactSpace X]
(hs : s.Infinite)


@[simp] theorem isSuffixOf_cons_nil : isSuffixOf (a::as) ([] : List α) = false

{α : Type u_1}
[BEq α]
{a : α}
{as : List α}


/-- Given `F : D ⥤ C ⥤ D`, `Y : C`, `e : F.flip.obj X ≅ 𝟭 D` and `X : GradedObject J D`,
this is the isomorphism `((mapBifunctor F J I).obj X).obj ((single₀ I).obj Y) a ≅ Y a.2`
when `a : J × I` is such that `a.2 = 0`. -/
@[simps!]
noncomputable def mapBifunctorObjObjSingle₀Iso (a : J × I) (ha : a.2 = 0) :
    ((mapBifunctor F J I).obj X).obj ((single₀ I).obj Y) a ≅ X a.1

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

(e : F.flip.obj Y ≅ CategoryTheory.Functor.id D)

(CategoryTheory.GradedObject.mapBifunctorObjObjSingle₀Iso F Y e X a ha).hom =
  CategoryTheory.CategoryStruct.comp
    ((F.obj (X a.1)).map (CategoryTheory.GradedObject.singleObjApplyIsoOfEq 0 Y a.2 ha).hom) (e.hom.app (X a.1))


theorem erase_add_single (a : α) (f : α →₀ M) : f.erase a + single a (f a) = f

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

Finsupp.erase a f + Finsupp.single a (f a) = f


lemma of_injective {f : F} (hf : Injective f) [NeZero a] : NeZero (f a)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[FunLike F α β]
[ZeroHomClass F α β]
{a : α}
{f : F}
(hf : Function.Injective ⇑f)
[NeZero a]


{F : Type u_1}
{A : Type u_2}
{B : Type u_3}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[NormedRing B]
[NormedAlgebra ℂ B]
[CompleteSpace B]
[StarRing B]
[CstarRing B]
[EquivLike F A B]
[NonUnitalAlgEquivClass F ℂ A B]
[StarAlgEquivClass F ℂ A B]
(φ : F)


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

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(b : HilbertBasis ι 𝕜 E)

Orthonormal 𝕜 fun i => b.repr.symm (lp.single 2 i 1)


@[to_additive]
theorem mul_lt_of_lt_of_le_one [CovariantClass α α (· * ·) (· ≤ ·)] {a b c : α} (hbc : b < c)
    (ha : a ≤ 1) :
    b * a < c

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


theorem l_ciSup_set (gc : GaloisConnection l u) {s : Set γ} {f : γ → α} (hf : BddAbove (f '' s))
    (hne : s.Nonempty) : l (⨆ i : s, f i) = ⨆ i : s, l (f i)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[ConditionallyCompleteLattice α]
[ConditionallyCompleteLattice β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{s : Set γ}
{f : γ → α}
(hf : BddAbove (f '' s))
(hne : s.Nonempty)


lemma map_mapRingHom_evalEval (x y : R) :
    (p.map <| mapRingHom f).evalEval (f x) (f y) = f (p.evalEval x y)

{R : Type u_1}
{S : Type u_2}
[Semiring R]
[Semiring S]
(f : R →+* S)
(p : R[X][Y])
(x y : R)

Polynomial.evalEval (f x) (f y) (Polynomial.map (Polynomial.mapRingHom f) p) = f (Polynomial.evalEval x y p)


@[simp]
lemma mk_ofNat (n : ℕ) (h : 0 < n) :
    @Eq ℕ+ (⟨no_index (OfNat.ofNat n), h⟩ : ℕ+) (haveI : NeZero n := ⟨h.ne'⟩; OfNat.ofNat n)


@[to_additive (attr := simp)]
lemma inv_smul_finset_distrib (a : α) (s : Finset α) : (a • s)⁻¹ = op a⁻¹ • s⁻¹

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


/-- The factorization axiom for two classes of morphisms `W₁` and `W₂` in a category `C`. It
asserts that any morphism can be factored as a morphism in `W₁` followed by a morphism
in `W₂`. -/
class HasFactorization : Prop where
  nonempty_mapFactorizationData {X Y : C} (f : X ⟶ Y) : Nonempty (MapFactorizationData W₁ W₂ f)

{W₁ W₂ : CategoryTheory.MorphismProperty C}


theorem exp_one_lt_d9 : exp 1 < 2.7182818286


@[simp] theorem isOrtho_inr_inr_iff {Q₁ : QuadraticMap R M₁ P} {Q₂ : QuadraticMap R M₂ P}
    (m₂ m₂' : M₂) :
    (Q₁.prod Q₂).IsOrtho (0, m₂) (0, m₂') ↔ Q₂.IsOrtho m₂ m₂'

{R : Type u_2}
{M₁ : Type u_3}
{M₂ : Type u_4}
{P : Type u_7}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid P]
[Module R M₁]
[Module R M₂]
[Module R P]
{Q₁ : QuadraticMap R M₁ P}
{Q₂ : QuadraticMap R M₂ P}
(m₂ m₂' : M₂)


@[to_additive (attr := simp)]
theorem image_one {f : α → β} : f '' 1 = {f 1}

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


/--
  To prove Fermat's Last Theorem for `n = 3`, it is enough to show that that for all `a`, `b`, `c`
  in `ℤ` such that `c ≠ 0`, `¬ 3 ∣ a`, `¬ 3 ∣ b`, `a` and `b` are coprime and `3 ∣ c`, we have
  `a ^ 3 + b ^ 3 ≠ c ^ 3`.
-/
theorem fermatLastTheoremThree_of_three_dvd_only_c
    (H : ∀ a b c : ℤ, c ≠ 0 → ¬ 3 ∣ a → ¬ 3 ∣ b  → 3 ∣ c → IsCoprime a b → a ^ 3 + b ^ 3 ≠ c ^ 3) :
    FermatLastTheoremFor 3

(H : ∀ (a b c : ℤ), c ≠ 0 → ¬3 ∣ a → ¬3 ∣ b → 3 ∣ c → IsCoprime a b → a ^ 3 + b ^ 3 ≠ c ^ 3)


@[to_additive]
theorem isComplement'_def : IsComplement' H K ↔ IsComplement (H : Set G) (K : Set G)

{G : Type u_1}
[Group G]
{H K : Subgroup G}

H.IsComplement' K ↔ Subgroup.IsComplement ↑H ↑K


theorem isThreeCycle_swap_mul_swap_same {a b c : α} (ab : a ≠ b) (ac : a ≠ c) (bc : b ≠ c) :
    IsThreeCycle (swap a b * swap a c)

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{a b c : α}
(ab : a ≠ b)
(ac : a ≠ c)
(bc : b ≠ c)

(Equiv.swap a b * Equiv.swap a c).IsThreeCycle


@[simp]
lemma map₁_id : YonedaCollection.map₁ (𝟙 F) (X := X) = id

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

{F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

CategoryTheory.OverPresheafAux.YonedaCollection.map₁ (CategoryTheory.CategoryStruct.id F) = id


@[simp]
lemma toGradedObjectMap_apply {K L : HomologicalComplex₂ C c₁ c₂} (φ : K ⟶ L) (i₁ : I₁) (i₂ : I₂) :
    toGradedObjectMap φ ⟨i₁, i₂⟩ = (φ.f i₁).f i₂

HomologicalComplex₂.toGradedObjectMap φ (i₁, i₂) = (φ.f i₁).f i₂


@[simp]
theorem map_id_obj (x : X) (U) : (map (𝟙 X) x).obj U = U

(U : TopologicalSpace.OpenNhds ((𝟙 X) x))

(TopologicalSpace.OpenNhds.map (𝟙 X) x).obj U = U


@[simp]
theorem abs_conj (z : ℂ) : Complex.abs (conj z) = Complex.abs z

Complex.abs ((starRingEnd ℂ) z) = Complex.abs z


theorem count_nth_of_lt_card_finite {n : ℕ} (hp : (setOf p).Finite) (hlt : n < hp.toFinset.card) :
    count p (nth p n) = n

{p : ℕ → Prop}
[DecidablePred p]
{n : ℕ}
(hp : (setOf p).Finite)
(hlt : n < hp.toFinset.card)


theorem tanh_mul_I : tanh (x * I) = tan x * I

Complex.tanh (x * Complex.I) = Complex.tan x * Complex.I


lemma evenKernel_functional_equation (a : UnitAddCircle) (x : ℝ) :
    evenKernel a x = 1 / x ^ (1 / 2 : ℝ) * cosKernel a (1 / x)

HurwitzZeta.evenKernel a x = 1 / x ^ (1 / 2) * HurwitzZeta.cosKernel a (1 / x)


/-- Conjugacy classes form a partition of G, stated in terms of cardinality. -/
theorem sum_conjClasses_card_eq_card [Fintype <| ConjClasses G] [Fintype G]
    [∀ x : ConjClasses G, Fintype x.carrier] :
    ∑ x : ConjClasses G, x.carrier.toFinset.card = Fintype.card G

[(x : ConjClasses G) → Fintype ↑x.carrier]


@[simp]
theorem exp_le_one_iff {x : ℝ} : exp x ≤ 1 ↔ x ≤ 0


/-- The operator norm of the projection is at most `1`. -/
theorem norm_normedMk_le (S : AddSubgroup M) : ‖S.normedMk‖ ≤ 1

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


theorem HasGradientWithinAt.congr_of_eventuallyEq_of_mem (h : HasGradientWithinAt f f' s x)
    (h₁ : f₁ =ᶠ[𝓝[s] x] f) (hx : x ∈ s) : HasGradientWithinAt f₁ f' s x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}
{s : Set F}
{f₁ : F → 𝕜}
(h : HasGradientWithinAt f f' s x)
(h₁ : f₁ =ᶠ[𝓝[s] x] f)
(hx : x ∈ s)


/-- An epimorphism in `SimplexCategory` must decrease lengths-/
theorem len_le_of_epi {x y : SimplexCategory} {f : x ⟶ y} : Epi f → y.len ≤ x.len


@[to_additive norm_le_zero_iff']
theorem norm_le_zero_iff''' [T0Space E] {a : E} : ‖a‖ ≤ 0 ↔ a = 1

{E : Type u_6}
[SeminormedGroup E]
[T0Space E]
{a : E}


@[to_additive (attr := simp)]
theorem mkOfCompact_one [CompactSpace α] : mkOfCompact (1 : C(α, β)) = 1

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[Zero β]
[CompactSpace α]

BoundedContinuousFunction.mkOfCompact 0 = 0


@[to_additive]
theorem prod_extend_by_one [CommMonoid α] (s : Finset ι) (f : ι → α) :
    ∏ i, (if i ∈ s then f i else 1) = ∏ i ∈ s, f i

{α : Type u_1}
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
[CommMonoid α]
(s : Finset ι)
(f : ι → α)

(∏ i : ι, if i ∈ s then f i else 1) = ∏ i ∈ s, f i


@[simp]
theorem toFun_eq_coe {f : SpectralMap α β} : f.toFun = (f : α → β)

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
{f : SpectralMap α β}


theorem isOpen_sigma_iff {s : Set (Sigma σ)} : IsOpen s ↔ ∀ i, IsOpen (Sigma.mk i ⁻¹' s)

{ι : Type u_5}
{σ : ι → Type u_7}
[(i : ι) → TopologicalSpace (σ i)]
{s : Set (Sigma σ)}

IsOpen s ↔ ∀ (i : ι), IsOpen (Sigma.mk i ⁻¹' s)


lemma isBoundedUnder_le_add [Add R]
    [CovariantClass R R (fun a b ↦ a + b) (· ≤ ·)] [CovariantClass R R (fun a b ↦ b + a) (· ≤ ·)]
    {u v : α → R} (u_bdd_le : f.IsBoundedUnder (· ≤ ·) u) (v_bdd_le : f.IsBoundedUnder (· ≤ ·) v) :
    f.IsBoundedUnder (· ≤ ·) (u + v)

[CovariantClass R R (fun a b => a + b) fun x x_1 => x ≤ x_1]

[CovariantClass R R (fun a b => b + a) fun x x_1 => x ≤ x_1]

(u_bdd_le : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f u)

(v_bdd_le : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f v)

Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f (u + v)


lemma StrictMono.image_Iio_subset (h : StrictMono f) : f '' Iio b ⊆ Iio (f b)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{b : α}
(h : StrictMono f)


theorem IsIntegralClosure.isMaximal_of_isMaximal_comap (I : Ideal A) [I.IsPrime]
    (hI : IsMaximal (I.comap (algebraMap R A))) : IsMaximal I

(hI : (Ideal.comap (algebraMap R A) I).IsMaximal)


@[reassoc] -- Porting note: simp can solve both versions
theorem biprod.inl_fst {X Y : C} [HasBinaryBiproduct X Y] :
    (biprod.inl : X ⟶ X ⊞ Y) ≫ (biprod.fst : X ⊞ Y ⟶ X) = 𝟙 X

CategoryTheory.Limits.biprod.inl ≫ CategoryTheory.Limits.biprod.fst = 𝟙 X


/-- Given an element `a` of a commutative semigroup with zero, there exists another element whose
    product with zero equals `a` iff `a` equals zero. -/
@[simp]
theorem zero_dvd_iff : 0 ∣ a ↔ a = 0

{α : Type u_1}
[SemigroupWithZero α]
{a : α}


@[to_additive (attr := measurability)]
theorem _root_.List.aestronglyMeasurable_prod' (l : List (α → M))
    (hl : ∀ f ∈ l, AEStronglyMeasurable f μ) : AEStronglyMeasurable l.prod μ

(hl : ∀ f ∈ l, MeasureTheory.AEStronglyMeasurable f μ)


/-- The preimage of a submonoid under a monoid hom is a submonoid of the domain. -/
@[to_additive
      "The preimage of an `AddSubmonoid` under an `AddMonoid` hom is
      an `AddSubmonoid` of the domain."]
theorem IsSubmonoid.preimage {N : Type*} [Monoid N] {f : M → N} (hf : IsMonoidHom f) {s : Set N}
    (hs : IsSubmonoid s) : IsSubmonoid (f ⁻¹' s)

{M : Type u_1}
[AddMonoid M]
{N : Type u_3}
[AddMonoid N]
{f : M → N}
(hf : IsAddMonoidHom f)
{s : Set N}
(hs : IsAddSubmonoid s)


theorem biproduct.map_lift_mapBiprod (g : ∀ j, W ⟶ f j) :
    -- Porting note: twice we need haveI to tell Lean about hasBiproduct_of_preserves F f
    haveI : HasBiproduct fun j => F.obj (f j) := hasBiproduct_of_preserves F f
    F.map (biproduct.lift g) ≫ (F.mapBiproduct f).hom = biproduct.lift fun j => F.map (g j)

F.map (CategoryTheory.Limits.biproduct.lift g) ≫ (F.mapBiproduct f).hom =
  CategoryTheory.Limits.biproduct.lift fun j => F.map (g j)


@[simp] lemma inv_addRight : (Equiv.addRight a)⁻¹ = Equiv.addRight (-a)


@[simp]
theorem map_cons (f : α → β) (a) : ∀ s, map f (cons a s) = cons (f a) (map f s)

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

Stream'.Seq.map f (Stream'.Seq.cons a s) = Stream'.Seq.cons (f a) (Stream'.Seq.map f s)


theorem continuous_id : Continuous (@OrderHom.id α _)

{α : Type u}
[OmegaCompletePartialOrder α]