@[to_additive (attr := simp, aesop safe apply (rule_sets := [finsetNonempty]))]
theorem inv_nonempty_iff : s⁻¹.Nonempty ↔ s.Nonempty

{α : Type u_2}
[DecidableEq α]
[Inv α]
{s : Finset α}


theorem le_iInf_iSup [CompleteLattice α] {f : ∀ a, κ a → α} :
    (⨆ g : ∀ a, κ a, ⨅ a, f a (g a)) ≤ ⨅ a, ⨆ b, f a b

{α : Type u}
{ι : Sort w}
{κ : ι → Sort w'}
[CompleteLattice α]
{f : (a : ι) → κ a → α}


@[simp] theorem any_eq (p : α → β → Bool) (l : AssocList α β) :
    any p l = l.toList.any fun (a, b) => p a b

{α : Type u_1}
{β : Type u_2}
(p : α → β → Bool)
(l : Batteries.AssocList α β)

Batteries.AssocList.any p l =
  l.toList.any fun x =>
    match x with
    | (a, b) => p a b


theorem sup_apply (p q : Seminorm 𝕜 E) (x : E) : (p ⊔ q) x = p x ⊔ q x

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]
(p q : Seminorm 𝕜 E)
(x : E)


theorem Dart.toProd_injective : Function.Injective (Dart.toProd : G.Dart → V × V)


lemma autIsoFibers_inv_app (A : PointedGaloisObject F) (b : F.obj A) :
    (autIsoFibers F).inv.app A b = (evaluationEquivOfIsGalois F A A.pt).symm b

(F : CategoryTheory.Functor C FintypeCat)

(A : CategoryTheory.PreGaloisCategory.PointedGaloisObject F)

(CategoryTheory.PreGaloisCategory.autIsoFibers F).inv.app A b =
  (CategoryTheory.PreGaloisCategory.evaluationEquivOfIsGalois F A.obj A.pt).symm b


theorem monotone_projIic : Monotone (projIic a)


theorem GoodProducts.head!_eq_o_of_maxProducts [Inhabited I] (l : ↑(MaxProducts C ho)) :
    l.val.val.head! = term I ho

(hsC : Profinite.NobelingProof.contained C (Order.succ o))

(ho : o < Ordinal.type fun x x_1 => x < x_1)

(l : ↑(Profinite.NobelingProof.GoodProducts.MaxProducts C ho))

(↑↑l).head! = Profinite.NobelingProof.term I ho


theorem IsPreconnected.measurableSet (h : IsPreconnected s) : MeasurableSet s

{α : Type u_1}
{s : Set α}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[LinearOrder α]
[OrderClosedTopology α]
(h : IsPreconnected s)


theorem apply_norm_eq_sqrt_inner_adjoint_left (A : E →L[𝕜] F) (x : E) :
    ‖A x‖ = √(re ⟪(A† ∘L A) x, x⟫)

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

‖A x‖ = √(RCLike.re ⟪((ContinuousLinearMap.adjoint A).comp A) x, x⟫_𝕜)


theorem mk' (h : ∀ A B : C, ∃ (c : BinaryCofan A B) (_ : IsColimit c), Mono c.inl) : MonoCoprod C

(h : ∀ (A B : C), ∃ c x, CategoryTheory.Mono c.inl)


@[simp]
theorem piCongrRight_symm {ι : Type*} {Y₁ Y₂ : ι → Type*} [∀ i, TopologicalSpace (Y₁ i)]
    [∀ i, TopologicalSpace (Y₂ i)] (F : ∀ i, Y₁ i ≃ₜ Y₂ i) :
    (piCongrRight F).symm = piCongrRight fun i => (F i).symm

{ι : Type u_6}
{Y₁ : ι → Type u_7}
{Y₂ : ι → Type u_8}
[(i : ι) → TopologicalSpace (Y₁ i)]
[(i : ι) → TopologicalSpace (Y₂ i)]
(F : (i : ι) → Y₁ i ≃ₜ Y₂ i)

(Homeomorph.piCongrRight F).symm = Homeomorph.piCongrRight fun i => (F i).symm


@[to_additive]
theorem measure_set_eq (hs : IsFundamentalDomain G s μ) (ht : IsFundamentalDomain G t μ) {A : Set α}
    (hA₀ : MeasurableSet A) (hA : ∀ g : G, (fun x => g • x) ⁻¹' A = A) : μ (A ∩ s) = μ (A ∩ t)

[MeasureTheory.SMulInvariantMeasure G α μ]

(hs : MeasureTheory.IsFundamentalDomain G s μ)

(ht : MeasureTheory.IsFundamentalDomain G t μ)

(hA : ∀ (g : G), (fun x => g • x) ⁻¹' A = A)


@[to_additive]
theorem Pi.hasProd {f : ι → ∀ x, π x} {g : ∀ x, π x} :
    HasProd f g ↔ ∀ x, HasProd (fun i ↦ f i x) (g x)

{α : Type u_1}
{ι : Type u_5}
{π : α → Type u_6}
[(x : α) → CommMonoid (π x)]
[(x : α) → TopologicalSpace (π x)]
{f : ι → (x : α) → π x}
{g : (x : α) → π x}

HasProd f g ↔ ∀ (x : α), HasProd (fun i => f i x) (g x)


@[to_additive mem_add_wellApproximable_iff]
theorem mem_wellApproximable_iff {A : Type*} [SeminormedGroup A] {δ : ℕ → ℝ} {a : A} :
    a ∈ wellApproximable A δ ↔
      a ∈ blimsup (fun n => approxOrderOf A n (δ n)) atTop fun n => 0 < n

{A : Type u_1}
[SeminormedAddGroup A]
{δ : ℕ → ℝ}
{a : A}

a ∈ addWellApproximable A δ ↔ a ∈ Filter.blimsup (fun n => approxAddOrderOf A n (δ n)) Filter.atTop fun n => 0 < n


@[simp]
theorem cardQuot_top : cardQuot (⊤ : Submodule R M) = 1

(R : Type u_1)
(M : Type u_2)
[Ring R]
[AddCommGroup M]
[Module R M]


@[simp]
theorem map_insert [DecidableEq α] [DecidableEq β] (f : α ↪ β) (a : α) (s : Finset α) :
    (insert a s).map f = insert (f a) (s.map f)

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

Finset.map f (insert a s) = insert (f a) (Finset.map f s)


theorem rank_le_width [StrongRankCondition R] {m n : ℕ} (A : Matrix (Fin m) (Fin n) R) :
    A.rank ≤ n

{R : Type u_5}
[CommRing R]
[StrongRankCondition R]
{m n : ℕ}
(A : Matrix (Fin m) (Fin n) R)


lemma Real.dist_le_of_mem_Icc_01 {x y : ℝ} (hx : x ∈ Icc (0 : ℝ) 1) (hy : y ∈ Icc (0 : ℝ) 1) :
    dist x y ≤ 1

{x y : ℝ}
(hx : x ∈ Set.Icc 0 1)
(hy : y ∈ Set.Icc 0 1)


theorem dvd_iff_le (hv : Integers v O) {x y : O} :
    x ∣ y ↔ v (algebraMap O F y) ≤ v (algebraMap O F x)

{F : Type u}
{Γ₀ : Type v}
[Field F]
[LinearOrderedCommGroupWithZero Γ₀]
{v : Valuation F Γ₀}
{O : Type w}
[CommRing O]
[Algebra O F]
(hv : v.Integers O)
{x y : O}

x ∣ y ↔ v ((algebraMap O F) y) ≤ v ((algebraMap O F) x)


theorem ext_iff_val {a1 a2 : { x // p x }} : a1 = a2 ↔ a1.1 = a2.1

{α : Sort u_1}
{p : α → Prop}
{a1 a2 : { x // p x }}


@[to_additive]
theorem Commute.of_orderOf_dvd_two [IsCancelMul G] (h : ∀ g : G, orderOf g ∣ 2) (a b : G) :
    Commute a b

{G : Type u}
[Monoid G]
[IsCancelMul G]
(h : ∀ (g : G), orderOf g ∣ 2)
(a b : G)


/-- Order isomorphism between `α → β` and `β`, where `α` has a unique element. -/
@[simps! toEquiv apply]
def funUnique (α β : Type*) [Unique α] [Preorder β] : (α → β) ≃o β

(α : Type u_6)
(β : Type u_7)
[Unique α]
[Preorder β]

(OrderIso.funUnique α β).toEquiv = Equiv.funUnique α β


protected theorem toFinset_diff [DecidableEq α] (hs : s.Finite) (ht : t.Finite)
    (h : (s \ t).Finite) : h.toFinset = hs.toFinset \ ht.toFinset

{α : Type u}
{s t : Set α}
[DecidableEq α]
(hs : s.Finite)
(ht : t.Finite)
(h : (s \ t).Finite)


/-- Multiplying the first vector passed to `oangle` by a negative real produces the same angle
as negating that vector. -/
@[simp]
theorem oangle_smul_left_of_neg (x y : V) {r : ℝ} (hr : r < 0) :
    o.oangle (r • x) y = o.oangle (-x) y

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


/-- Induction on the well-founded `Sym2.GameAdd` relation. -/
theorem GameAdd.induction {C : α → α → Prop} :
    WellFounded rα →
      (∀ a₁ b₁, (∀ a₂ b₂, Sym2.GameAdd rα s(a₂, b₂) s(a₁, b₁) → C a₂ b₂) → C a₁ b₁) →
        ∀ a b, C a b

WellFounded rα →
  (∀ (a₁ b₁ : α), (∀ (a₂ b₂ : α), Sym2.GameAdd rα s(a₂, b₂) s(a₁, b₁) → C a₂ b₂) → C a₁ b₁) → ∀ (a b : α), C a b


@[rify_simps] lemma ratCast_le (a b : ℚ) : a ≤ b ↔ (a : ℝ) ≤ (b : ℝ)

a ≤ b ↔ ↑a ≤ ↑b


lemma List.nat_divisors_prod (l : List ℕ) : divisors l.prod = (l.map divisors).prod

l.prod.divisors = (List.map Nat.divisors l).prod


lemma r_mul_max_le {x : Fin 2 → ℤ} (hx : x ≠ 0) : r z * ‖x‖ ≤ Complex.abs (x 0 * z + x 1)

EisensteinSeries.r z * ‖x‖ ≤ Complex.abs (↑(x 0) * ↑z + ↑(x 1))


theorem sub_apply (f g : P →ᴬ[R] W) (x : P) : (f - g) x = f x - g x

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


theorem C_ne_zero {r : R} (h : r ≠ 0) : (C r : HahnSeries Γ R) ≠ 0

{Γ : Type u_1}
{R : Type u_3}
[OrderedCancelAddCommMonoid Γ]
[NonAssocSemiring R]
{r : R}
(h : r ≠ 0)


/-- The defining property of the weak operator topology: a function `f` tends to
`A : E →WOT[𝕜] F` along filter `l` iff `⟪y, (f a) x⟫` tends to `⟪y, A x⟫` along the same filter. -/
lemma tendsto_iff_forall_inner_apply_tendsto [CompleteSpace F] {α : Type*} {l : Filter α}
    {f : α → E →WOT[𝕜] F} {A : E →WOT[𝕜] F} :
    Tendsto f l (𝓝 A) ↔ ∀ x y, Tendsto (fun a => ⟪y, (f a) x⟫_𝕜) l (𝓝 ⟪y, A x⟫_𝕜)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[Module 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{α : Type u_4}
{l : Filter α}
{f : α → E →WOT[𝕜]F}
{A : E →WOT[𝕜]F}

Filter.Tendsto f l (𝓝 A) ↔ ∀ (x : E) (y : F), Filter.Tendsto (fun a => ⟪y, (f a) x⟫_𝕜) l (𝓝 ⟪y, A x⟫_𝕜)


theorem denseEmbedding_id {α : Type*} [TopologicalSpace α] : DenseEmbedding (id : α → α)


/-- Rotating triangles gives an endofunctor on the category of triangles in `C`.
-/
@[simps]
def rotate : Triangle C ⥤ Triangle C

(T : CategoryTheory.Pretriangulated.Triangle C)

(CategoryTheory.Pretriangulated.rotate C).obj T = T.rotate


/-- A singleton has zero diameter -/
@[simp]
theorem diam_singleton : diam ({x} : Set α) = 0

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


@[simp, norm_cast]
theorem coe_bot : ((⊥ : Interval α) : Set α) = ∅


theorem unique_iff_subsingleton_and_nonempty (α : Sort u) :
    Nonempty (Unique α) ↔ Subsingleton α ∧ Nonempty α


theorem div_eq_zero_iff (hq0 : q ≠ 0) : p / q = 0 ↔ degree p < degree q

{R : Type u}
[Field R]
{p q : R[X]}
(hq0 : q ≠ 0)


@[to_additive]
lemma exists_right_transversal (H : Subgroup G) (g : G) :
    ∃ S ∈ rightTransversals (H : Set G), g ∈ S

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

∃ S ∈ Subgroup.rightTransversals ↑H, g ∈ S


@[simp]
theorem smul_apply [SMul β α] (r : β) (A : Matrix m n α) (i : m) (j : n) :
    (r • A) i j = r • (A i j)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{β : Type w}
[SMul β α]
(r : β)
(A : Matrix m n α)
(i : m)
(j : n)


theorem toMeasure_apply (hs : MeasurableSet s) : p.toMeasure s = ∑' x, s.indicator p x

{α : Type u_1}
[MeasurableSpace α]
(p : PMF α)
(s : Set α)
(hs : MeasurableSet s)

p.toMeasure s = ∑' (x : α), s.indicator (⇑p) x


protected theorem disjoint_iff [OrderBot α] [OrderBot β] {x y : α × β} :
    Disjoint x y ↔ Disjoint x.1 y.1 ∧ Disjoint x.2 y.2

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[PartialOrder β]
[OrderBot α]
[OrderBot β]
{x y : α × β}


theorem DifferentiableOn.comp' {g : F → G} {t : Set F} (hg : DifferentiableOn K g t)
    (hf : DifferentiableOn K f s) (st : Set.MapsTo f s t) :
    DifferentiableOn K (fun x => g (f x)) s

{K : Type u_1}
[NontriviallyNormedField K]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace K E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace K F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace K G]
{f : E → F}
{s : Set E}
{g : F → G}
{t : Set F}
(hg : DifferentiableOn K g t)
(hf : DifferentiableOn K f s)
(st : Set.MapsTo f s t)


theorem Pi.continuous_precomp {ι' : Type*} (φ : ι' → ι) :
    Continuous (· ∘ φ : (ι → X) → (ι' → X))

{X : Type u}
{ι : Type u_5}
[TopologicalSpace X]
{ι' : Type u_8}
(φ : ι' → ι)


@[to_additive]
theorem Nonempty.mul : s.Nonempty → t.Nonempty → (s * t).Nonempty


@[to_additive (attr := simp)]
theorem prod_ite_eq [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
    (∏ x ∈ s, ite (a = x) (b x) 1) = ite (a ∈ s) (b a) 1

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
[DecidableEq α]
(s : Finset α)
(a : α)
(b : α → β)

(∏ x ∈ s, if a = x then b x else 1) = if a ∈ s then b a else 1


@[to_additive]
theorem comap_comap {P : Type*} [Group P] [TopologicalSpace P] (K : OpenSubgroup P) (f₂ : N →* P)
    (hf₂ : Continuous f₂) (f₁ : G →* N) (hf₁ : Continuous f₁) :
    (K.comap f₂ hf₂).comap f₁ hf₁ = K.comap (f₂.comp f₁) (hf₂.comp hf₁)

{G : Type u_1}
[Group G]
[TopologicalSpace G]
{N : Type u_2}
[Group N]
[TopologicalSpace N]
{P : Type u_3}
[Group P]
[TopologicalSpace P]
(K : OpenSubgroup P)
(f₂ : N →* P)
(hf₂ : Continuous ⇑f₂)
(f₁ : G →* N)
(hf₁ : Continuous ⇑f₁)

OpenSubgroup.comap f₁ hf₁ (OpenSubgroup.comap f₂ hf₂ K) = OpenSubgroup.comap (f₂.comp f₁) ⋯ K


theorem toWithTop_top :
    have : Decidable (⊤ : PartENat).Dom := Part.noneDecidable
    toWithTop ⊤ = ⊤

let_fun this := Part.noneDecidable;
⊤.toWithTop = ⊤


/-- `exp` is entire -/
theorem analyticOn_cexp : AnalyticOn ℂ exp univ


theorem convex_Iic (r : β) : Convex 𝕜 (Iic r)

{𝕜 : Type u_1}
{β : Type u_4}
[OrderedSemiring 𝕜]
[OrderedAddCommMonoid β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
(r : β)


theorem uIcc_eq : uIcc a b = piFinset fun i => uIcc (a i) (b i)

{ι : Type u_1}
{α : ι → Type u_2}
[Fintype ι]
[DecidableEq ι]
[(i : ι) → DecidableEq (α i)]
[(i : ι) → Lattice (α i)]
[(i : ι) → LocallyFiniteOrder (α i)]
(a b : (i : ι) → α i)

Finset.uIcc a b = Fintype.piFinset fun i => Finset.uIcc (a i) (b i)


@[simp]
theorem arctan_neg (x : ℝ) : arctan (-x) = -arctan x


@[simp]
theorem C_mul_monomial : C a * monomial n b = monomial n (a * b)

{R : Type u}
{a b : R}
{n : ℕ}
[Semiring R]

Polynomial.C a * (Polynomial.monomial n) b = (Polynomial.monomial n) (a * b)


/-- A finite measure `μ` on `α ⧸ G` satisfying `QuotientMeasureEqMeasurePreimage` has finite
covolume. -/
@[to_additive]
theorem QuotientMeasureEqMeasurePreimage.covolume_ne_top
    (μ : Measure (Quotient α_mod_G)) [QuotientMeasureEqMeasurePreimage ν μ] [IsFiniteMeasure μ] :
    covolume G α ν < ∞

[MeasureTheory.VAddInvariantMeasure G α ν]

(μ : MeasureTheory.Measure (Quotient (AddAction.orbitRel G α)))


theorem add_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
    toSimpleFunc (f + g) =ᵐ[μ] toSimpleFunc f + toSimpleFunc g

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

↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc (f + g)) =ᵐ[μ]
  ↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc f) + ↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc g)


/-- Given a property of germs of functions and sets in the model space, then one defines
a corresponding property in a charted space, by requiring that it holds at the preferred chart at
this point. (When the property is local and invariant, it will in fact hold using any chart, see
`liftPropWithinAt_indep_chart`). We require continuity in the lifted property, as otherwise one
single chart might fail to capture the behavior of the function.
-/
@[mk_iff liftPropWithinAt_iff']
structure LiftPropWithinAt (P : (H → H') → Set H → H → Prop) (f : M → M') (s : Set M) (x : M) :
    Prop where
  continuousWithinAt : ContinuousWithinAt f s x
  prop : P (chartAt H' (f x) ∘ f ∘ (chartAt H x).symm) ((chartAt H x).symm ⁻¹' s) (chartAt H x x)

(self : ChartedSpace.LiftPropWithinAt P f s x)


theorem eval₂_list_prod_noncomm (ps : List R[X])
    (hf : ∀ p ∈ ps, ∀ (k), Commute (f <| coeff p k) x) :
    eval₂ f x ps.prod = (ps.map (Polynomial.eval₂ f x)).prod

(hf : ∀ p ∈ ps, ∀ (k : ℕ), Commute (f (p.coeff k)) x)

Polynomial.eval₂ f x ps.prod = (List.map (Polynomial.eval₂ f x) ps).prod


@[simp]
theorem realize_iExs [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} {v' : Fin 0 → M} :
    BoundedFormula.Realize (φ.iExs f) v v' ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a))

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{β : Type v'}
{γ : Type u_3}
[Finite γ]
{f : α → β ⊕ γ}
{φ : L.Formula α}
{v : β → M}
{v' : Fin 0 → M}

FirstOrder.Language.BoundedFormula.Realize (FirstOrder.Language.Formula.iExs f φ) v v' ↔
  ∃ i, φ.Realize fun a => Sum.elim v i (f a)


/-- Any `CommMagma G` that satisfies `IsRightCancelMul G` also satisfies `IsCancelMul G`. -/
@[to_additive AddCommMagma.IsRightCancelAdd.toIsCancelAdd "Any `AddCommMagma G` that satisfies
`IsRightCancelAdd G` also satisfies `IsCancelAdd G`."]
lemma CommMagma.IsRightCancelMul.toIsCancelMul (G : Type u) [CommMagma G] [IsRightCancelMul G] :
    IsCancelMul G


@[simp]
theorem preimage_coe_Ico_top : (some : α → WithTop α) ⁻¹' Ico a ⊤ = Ici a

WithTop.some ⁻¹' Set.Ico ↑a ⊤ = Set.Ici a


@[simp]
theorem card_lt_ofNat {o} {n : ℕ} [n.AtLeastTwo] :
    card o < (no_index (OfNat.ofNat n)) ↔ o < OfNat.ofNat n

{o : Ordinal.{u_3}}
{n : ℕ}
[n.AtLeastTwo]

o.card < OfNat.ofNat n ↔ o < OfNat.ofNat n


@[simp]
theorem contMDiffWithinAt_diffeomorph_comp_iff {m} (h : M ≃ₘ^n⟮I, J⟯ N) {f : M' → M} (hm : m ≤ n)
    {s x} : ContMDiffWithinAt I' J m (h ∘ f) s x ↔ ContMDiffWithinAt I' I m f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{G : Type u_7}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{n m : ℕ∞}
(h : M ≃ₘ^n⟮I, J⟯ N)
{f : M' → M}
(hm : m ≤ n)
{s : Set M'}
{x : M'}

ContMDiffWithinAt I' J m (⇑h ∘ f) s x ↔ ContMDiffWithinAt I' I m f s x


@[simp]
theorem integralSum_neg (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) (π : TaggedPrepartition I) :
    integralSum (-f) vol π = -integralSum f vol π

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
(f : (ι → ℝ) → E)
(vol : ι →ᵇᵃ[⊤] E →L[ℝ] F)
(π : BoxIntegral.TaggedPrepartition I)

BoxIntegral.integralSum (-f) vol π = -BoxIntegral.integralSum f vol π


/-- Twice the angle between a vector and its negation is 0. -/
-- @[simp] -- Porting note (#10618): simp can prove this
theorem two_zsmul_oangle_neg_self_right (x : V) : (2 : ℤ) • o.oangle x (-x) = 0

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


theorem hasLineDerivAt (f : QuadraticMap 𝕜 E F) (a b : E) :
    HasLineDerivAt 𝕜 f (polar f a b) a b

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : QuadraticMap 𝕜 E F)
(a b : E)

HasLineDerivAt 𝕜 (⇑f) (QuadraticMap.polar (⇑f) a b) a b


protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x

(hf : AkraBazziRecurrence.GrowsPolynomially f)

(hg : AkraBazziRecurrence.GrowsPolynomially g)

AkraBazziRecurrence.GrowsPolynomially fun x => f x * g x


@[simp]
theorem recTopCoe_top {C : ℕ∞ → Sort*} (d : C ⊤) (f : ∀ a : ℕ, C a) :
    @recTopCoe C d f ⊤ = d

{C : ℕ∞ → Sort u_1}
(d : C ⊤)
(f : (a : ℕ) → C ↑a)


/-- If `{s i | p i}` is a basis of a filter `l` and `V ∈ l`, then `{s i | p i ∧ s i ⊆ V}`
is a basis of `l`. -/
theorem HasBasis.restrict_subset (h : l.HasBasis p s) {V : Set α} (hV : V ∈ l) :
    l.HasBasis (fun i => p i ∧ s i ⊆ V) s

{α : Type u_1}
{ι : Sort u_4}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}
(h : l.HasBasis p s)
{V : Set α}
(hV : V ∈ l)


theorem expand_one_apply (f : MvPolynomial σ R) : expand 1 f = f

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]
(f : MvPolynomial σ R)


/-- **Sum of a Geometric Series** -/
theorem NNReal.hasSum_geometric {r : ℝ≥0} (hr : r < 1) : HasSum (fun n : ℕ ↦ r ^ n) (1 - r)⁻¹


theorem le_sin_mul {x : ℝ} (hx : 0 ≤ x) (hx' : x ≤ 1) : x ≤ sin (π / 2 * x)


@[simp]
lemma image_subtype_val_Ico_Iio {a b : α} (c : Ico a b) : Subtype.val '' Iio c = Ico a c

{α : Type u_1}
[Preorder α]
{a b : α}
(c : ↑(Set.Ico a b))


@[simp]
theorem erase_of_not_mem_support {f : α →₀ M} {a} (haf : a ∉ f.support) : erase a f = f

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


/-- **Integration by parts for line derivatives**
Version with a general bilinear form `B`.
If `B f g` is integrable, as well as `B f' g` and `B f g'` where `f'` and `g'` are derivatives
of `f` and `g` in a given direction `v`, then `∫ B f g' = - ∫ B f' g`. -/
theorem integral_bilinear_hasLineDerivAt_right_eq_neg_left_of_integrable
    {f f' : E → F} {g g' : E → G} {v : E} {B : F →L[ℝ] G →L[ℝ] W}
    (hf'g : Integrable (fun x ↦ B (f' x) (g x)) μ) (hfg' : Integrable (fun x ↦ B (f x) (g' x)) μ)
    (hfg : Integrable (fun x ↦ B (f x) (g x)) μ)
    (hf : ∀ x, HasLineDerivAt ℝ f (f' x) x v) (hg : ∀ x, HasLineDerivAt ℝ g (g' x) x v) :
    ∫ x, B (f x) (g' x) ∂μ = - ∫ x, B (f' x) (g x) ∂μ

(hf'g : MeasureTheory.Integrable (fun x => (B (f' x)) (g x)) μ)

(hfg' : MeasureTheory.Integrable (fun x => (B (f x)) (g' x)) μ)

(hfg : MeasureTheory.Integrable (fun x => (B (f x)) (g x)) μ)

(hf : ∀ (x : E), HasLineDerivAt ℝ f (f' x) x v)

(hg : ∀ (x : E), HasLineDerivAt ℝ g (g' x) x v)


@[simp]
lemma symm_castOrderIso (h : n = m) : (castOrderIso h).symm = castOrderIso h.symm

(Fin.castOrderIso h).symm = Fin.castOrderIso ⋯


/-- An additive functor takes homotopies to homotopies. -/
@[simps]
def Functor.mapHomotopy (F : V ⥤ W) [F.Additive] {f g : C ⟶ D} (h : Homotopy f g) :
    Homotopy ((F.mapHomologicalComplex c).map f) ((F.mapHomologicalComplex c).map g)

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
{W : Type u_2}
[CategoryTheory.Category.{u_3, u_2} W]
[CategoryTheory.Preadditive W]
(F : V ⥤ W)
[F.Additive]
{f g : C ⟶ D}
(h : Homotopy f g)
(i j : ι)

(F.mapHomotopy h).hom i j = F.map (h.hom i j)


@[norm_cast, simp]
theorem isSquare_intCast_iff {z : ℤ} : IsSquare (z : ℚ) ↔ IsSquare z


/-- If `K` is a `n`-th cyclotomic extension of `ℚ`, then there are `φ n / n` complex places
of `K`. Note that this uses `1 / 2 = 0` in the cases `n = 1, 2`. -/
theorem nrComplexPlaces_eq_totient_div_two [h : IsCyclotomicExtension {n} ℚ K] :
    haveI := IsCyclotomicExtension.numberField {n} ℚ K
    NrComplexPlaces K = φ n / 2

(n : ℕ+)
(K : Type u)
[Field K]
[CharZero K]
[h : IsCyclotomicExtension {n} ℚ K]

NumberField.InfinitePlace.NrComplexPlaces K = (↑n).totient / 2


@[simp]
lemma graphOn_singleton (f : α → β) (x : α) : graphOn f {x} = {(x, f x)}

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


@[simp] theorem eq_false_imp_eq_true : ∀(b:Bool), (b = false → b = true) ↔ (b = true)


theorem sum_lt {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ s, F i) < t

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{α : Type u_1}
{F : α → ℚ}
{t : ℚ}
{s : Finset α}


theorem max_const (hf : LocallyLipschitz f) (a : ℝ) : LocallyLipschitz fun x => max (f x) a

{α : Type u}
[PseudoEMetricSpace α]
{f : α → ℝ}
(hf : LocallyLipschitz f)
(a : ℝ)


theorem indexOf_append_of_mem {a : α} (h : a ∈ l₁) : indexOf a (l₁ ++ l₂) = indexOf a l₁

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

List.indexOf a (l₁ ++ l₂) = List.indexOf a l₁


theorem IsRelPrime.mul_dvd_of_right_isPrimal (H : IsRelPrime x y) (H1 : x ∣ z) (H2 : y ∣ z)
    (hy : IsPrimal y) : x * y ∣ z

{α : Type u_1}
[CommMonoid α]
{x y z : α}
(H : IsRelPrime x y)
(H1 : x ∣ z)
(H2 : y ∣ z)
(hy : IsPrimal y)


@[simp]
theorem zero_apply (a : α) : (0 : CentroidHom α) a = 0

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
(a : α)


theorem le_of_sub_one_lt {a b : Int} (H : a - 1 < b) : a ≤ b


theorem degree_smul_le_of_le {n : ℕ} {a : R} {f : R[X]} (hf : degree f ≤ n) :
    degree (a • f) ≤ n

{R : Type u_1}
[Semiring R]
{n : ℕ}
{a : R}
{f : R[X]}
(hf : f.degree ≤ ↑n)


/-- The antipodal map is smooth. -/
theorem contMDiff_neg_sphere {n : ℕ} [Fact (finrank ℝ E = n + 1)] :
    ContMDiff (𝓡 n) (𝓡 n) ∞ fun x : sphere (0 : E) 1 => -x

[Fact (FiniteDimensional.finrank ℝ E = n + 1)]

ContMDiff 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ⊤ fun x => -x


theorem List.toFinset_card_le : l.toFinset.card ≤ l.length

{α : Type u_1}
[DecidableEq α]
(l : List α)


theorem contMDiffAt_proj {p : TotalSpace F E} : ContMDiffAt (IB.prod 𝓘(𝕜, F)) IB n (π F E) p

[TopologicalSpace (Bundle.TotalSpace F E)]

ContMDiffAt (IB.prod 𝓘(𝕜, F)) IB n Bundle.TotalSpace.proj p


@[to_additive (attr := simp)]
theorem mul_le_mul_iff_right [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    [ContravariantClass α α (swap (· * ·)) (· ≤ ·)] (a : α) {b c : α} :
    b * a ≤ c * a ↔ b ≤ c

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

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


@[ext] theorem ext {c c' : CharacterModule A} (h : ∀ x, c x = c' x) : c = c'

(A : Type uA)
[AddCommGroup A]
{c c' : CharacterModule A}
(h : ∀ (x : A), c x = c' x)


@[to_additive (attr := simp)]
theorem preimage_mul_left_one : (a * ·) ⁻¹' 1 = {a⁻¹}


theorem unitOfDetInvertible_eq_nonsingInvUnit [Invertible A.det] :
    unitOfDetInvertible A = nonsingInvUnit A (isUnit_of_invertible _)

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

A.unitOfDetInvertible = A.nonsingInvUnit ⋯


/-- If the components of a filtration are finitely generated, then the filtration is stable iff
its associated submodule of is finitely generated. -/
theorem submodule_fg_iff_stable (hF' : ∀ i, (F.N i).FG) : F.submodule.FG ↔ F.Stable

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
(F : I.Filtration M)
(hF' : ∀ (i : ℕ), (F.N i).FG)


theorem preimage_mk_frontier : mk ⁻¹' frontier t = frontier (mk ⁻¹' t)

{X : Type u_1}
[TopologicalSpace X]
{t : Set (SeparationQuotient X)}

SeparationQuotient.mk ⁻¹' frontier t = frontier (SeparationQuotient.mk ⁻¹' t)


lemma BoundaryLE.false_of_isTruncGE {j : ι} (hj : e.BoundaryLE j) [e.IsTruncGE] : False

{ι : Type u_1}
{ι' : Type u_2}
{c : ComplexShape ι}
{c' : ComplexShape ι'}
{e : c.Embedding c'}
{j : ι}
(hj : e.BoundaryLE j)
[e.IsTruncGE]


theorem inits_core_eq (l : List α) (s : Stream' α) :
    initsCore l s = l::initsCore (l ++ [head s]) (tail s)

{α : Type u}
(l : List α)
(s : Stream' α)

Stream'.initsCore l s = Stream'.cons l (Stream'.initsCore (l ++ [s.head]) s.tail)


theorem map_le_map_iff' {f : F} (hf : ker f = ⊥) {p p'} : map f p ≤ map f p' ↔ p ≤ p'

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_4}
{M₂ : Type u_5}
[Semiring R]
[Semiring R₂]
[AddCommGroup M]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]
{F : Type u_8}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
{f : F}
(hf : LinearMap.ker f = ⊥)
{p p' : Submodule R M}

Submodule.map f p ≤ Submodule.map f p' ↔ p ≤ p'


@[continuity]
theorem continuous_snd : Continuous (@Prod.snd X Y)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]


theorem injective_of_isPartialInv {α β} {f : α → β} {g} (H : IsPartialInv f g) :
    Injective f

{α : Type u_4}
{β : Sort u_5}
{f : α → β}
{g : β → Option α}
(H : Function.IsPartialInv f g)


theorem Icc_coe_coe : Icc (a : WithBot α) b = (Icc a b).map Embedding.some

(α : Type u_1)
[PartialOrder α]
[OrderBot α]
[LocallyFiniteOrder α]
(a b : α)

Finset.Icc ↑a ↑b = Finset.map Function.Embedding.some (Finset.Icc a b)


@[simp]
theorem coe_inj {a b : Regular α} : (a : α) = b ↔ a = b

{α : Type u_1}
[HeytingAlgebra α]
{a b : Heyting.Regular α}


theorem ite_dite_distrib_left {a : α} {b : q → α} {c : ¬q → α} :
    ite p a (dite q b c) = dite q (fun hq ↦ ite p a <| b hq) fun hq ↦ ite p a <| c hq

{α : Sort u_1}
{p q : Prop}
[Decidable p]
[Decidable q]
{a : α}
{b : q → α}
{c : ¬q → α}

(if p then a else dite q b c) = if hq : q then if p then a else b hq else if p then a else c hq


theorem Function.Surjective.isLieAbelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] {f : L₁ →ₗ⁅R⁆ L₂}
    (h₁ : Function.Surjective f) (h₂ : IsLieAbelian L₁) : IsLieAbelian L₂

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieRing L₂]
[LieAlgebra R L₁]
[LieAlgebra R L₂]
{f : L₁ →ₗ⁅R⁆ L₂}
(h₁ : Function.Surjective ⇑f)
(h₂ : IsLieAbelian L₁)


/-- Definition of the infimum of two congruence relations. -/
theorem inf_iff_and {c d : RingCon R} {x y} : (c ⊓ d) x y ↔ c x y ∧ d x y

{R : Type u_2}
[Add R]
[Mul R]
{c d : RingCon R}
{x y : R}


theorem covariant_lt_of_covariant_le_of_contravariant_eq [ContravariantClass M N μ (· = ·)]
    [PartialOrder N] [CovariantClass M N μ (· ≤ ·)] : CovariantClass M N μ (· < ·)

[ContravariantClass M N μ fun x x_1 => x = x_1]

[CovariantClass M N μ fun x x_1 => x ≤ x_1]

CovariantClass M N μ fun x x_1 => x < x_1


@[to_additive]
theorem mk'_eq_mk' {x y : G} : mk' N x = mk' N y ↔ ∃ z ∈ N, x * z = y

{G : Type u}
[Group G]
(N : Subgroup G)
[nN : N.Normal]
{x y : G}

(QuotientGroup.mk' N) x = (QuotientGroup.mk' N) y ↔ ∃ z ∈ N, x * z = y


@[simp] lemma toENat_eq_zero {a : Cardinal} : toENat a = 0 ↔ a = 0


@[simp]
theorem monic_restriction {p : R[X]} : Monic (restriction p) ↔ Monic p


theorem lt_inducedMap_iff : b < inducedMap α β a ↔ ∃ q : ℚ, b < q ∧ (q : α) < a

b < LinearOrderedField.inducedMap α β a ↔ ∃ q, b < ↑q ∧ ↑q < a


protected theorem eq_tsub_iff_add_eq_of_le (hc : AddLECancellable c) (h : c ≤ b) :
    a = b - c ↔ a + c = b

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


lemma smul_nonneg_iff : 0 ≤ a • b ↔ 0 ≤ a ∧ 0 ≤ b ∨ a ≤ 0 ∧ b ≤ 0

{α : Type u_1}
{β : Type u_2}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[PosSMulStrictMono α β]
{a : α}
{b : β}


/-- If `w` is a nontorsion weight function, then a multivariate polynomial has weighted total
  degree zero if and only if for every `m ∈ p.support` and `x : σ`, `m x = 0`. -/
theorem weightedTotalDegree_eq_zero_iff (hw : NonTorsionWeight w) (p : MvPolynomial σ R) :
    p.weightedTotalDegree w = 0 ↔ ∀ (m : σ →₀ ℕ) (_ : m ∈ p.support) (x : σ), m x = 0

MvPolynomial.weightedTotalDegree w p = 0 ↔ ∀ m ∈ p.support, ∀ (x : σ), m x = 0


theorem tsub_add_eq_add_tsub (h : b ≤ a) : a - b + c = a + c - b

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


/-- An uncurried version of `Finset.prod_product`. -/
@[to_additive "An uncurried version of `Finset.sum_product`"]
theorem prod_product' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
    ∏ x ∈ s ×ˢ t, f x.1 x.2 = ∏ x ∈ s, ∏ y ∈ t, f x y

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[AddCommMonoid β]
{s : Finset γ}
{t : Finset α}
{f : γ → α → β}

∑ x ∈ s ×ˢ t, f x.1 x.2 = ∑ x ∈ s, ∑ y ∈ t, f x y


@[simp] lemma pow_addRight (n : ℕ) : Equiv.addRight a ^ n = Equiv.addRight (n • a)

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


/-- In a preadditive category, if the coproduct over `f : J → C` exists,
    then the biproduct over `f` exists. -/
theorem HasBiproduct.of_hasCoproduct (f : J → C) [HasCoproduct f] : HasBiproduct f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{J : Type}
[Finite J]
(f : J → C)
[CategoryTheory.Limits.HasCoproduct f]


theorem subset_eq_empty {s t : Set α} (h : t ⊆ s) (e : s = ∅) : t = ∅

{α : Type u}
{s t : Set α}
(h : t ⊆ s)
(e : s = ∅)


theorem eval_apply (n : ℕ) (f : AdicCompletion I M) : eval I M n f = f.1 n

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(M : Type u_2)
[AddCommGroup M]
[Module R M]
(n : ℕ)
(f : AdicCompletion I M)


/-- If `m : ℕ` is coprime with `n`,
then the minimal polynomial of a primitive `n`-th root of unity `μ`
has `μ ^ m` as root. -/
theorem pow_isRoot_minpoly {m : ℕ} (hcop : Nat.Coprime m n) :
    IsRoot (map (Int.castRingHom K) (minpoly ℤ μ)) (μ ^ m)

{n : ℕ}
{K : Type u_1}
[CommRing K]
{μ : K}
(h : IsPrimitiveRoot μ n)
[IsDomain K]
[CharZero K]
{m : ℕ}
(hcop : m.Coprime n)

(Polynomial.map (Int.castRingHom K) (minpoly ℤ μ)).IsRoot (μ ^ m)


/-- The `sSup` of a non-empty set is its least upper bound for a conditionally
complete lattice with a top. -/
theorem isLUB_sSup' {β : Type*} [ConditionallyCompleteLattice β] {s : Set (WithTop β)}
    (hs : s.Nonempty) : IsLUB s (sSup s)

{β : Type u_5}
[ConditionallyCompleteLattice β]
{s : Set (WithTop β)}
(hs : s.Nonempty)


theorem fg_of_linearEquiv (e : M ≃ₗ[R] P) (h : (⊤ : Submodule R P).FG) : (⊤ : Submodule R M).FG

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{P : Type u_3}
[AddCommMonoid P]
[Module R P]
(e : M ≃ₗ[R] P)
(h : ⊤.FG)


/-- A finitely generated torsion module over a Dedekind domain is an internal direct sum of its
`p i ^ e i`-torsion submodules for some prime ideals `p i` and numbers `e i`. -/
theorem exists_isInternal_prime_power_torsion [Module.Finite R M] (hM : Module.IsTorsion R M) :
    ∃ (P : Finset <| Ideal R) (_ : DecidableEq P) (_ : ∀ p ∈ P, Prime p) (e : P → ℕ),
      DirectSum.IsInternal fun p : P => torsionBySet R M (p ^ e p : Ideal R)

{R : Type u}
[CommRing R]
[IsDomain R]
{M : Type v}
[AddCommGroup M]
[Module R M]
[IsDedekindDomain R]
[Module.Finite R M]
(hM : Module.IsTorsion R M)

∃ P x, ∃ (_ : ∀ p ∈ P, Prime p), ∃ e, DirectSum.IsInternal fun p => Submodule.torsionBySet R M ↑(↑p ^ e p)


theorem constr_pow_mul (pb : PowerBasis A S) {y : S'} (hy : aeval y (minpoly A pb.gen) = 0)
    (x x' : S) : pb.basis.constr A (fun i => y ^ (i : ℕ)) (x * x') =
      pb.basis.constr A (fun i => y ^ (i : ℕ)) x * pb.basis.constr A (fun i => y ^ (i : ℕ)) x'

(hy : (Polynomial.aeval y) (minpoly A pb.gen) = 0)

((pb.basis.constr A) fun i => y ^ ↑i) (x * x') =
  ((pb.basis.constr A) fun i => y ^ ↑i) x * ((pb.basis.constr A) fun i => y ^ ↑i) x'


@[simp]
theorem map_eq_zero [Semiring S] [Nontrivial S] (f : R →+* S) : p.map f = 0 ↔ p = 0

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


theorem formPerm_apply_getElem (xs : List α) (w : Nodup xs) (i : Nat) (h : i < xs.length) :
    formPerm xs xs[i] =
      xs[(i + 1) % xs.length]'(Nat.mod_lt _ (i.zero_le.trans_lt h))

{α : Type u_1}
[DecidableEq α]
(xs : List α)
(w : xs.Nodup)
(i : ℕ)
(h : i < xs.length)

xs.formPerm xs[i] = xs[(i + 1) % xs.length]


@[simp] theorem congr_toLinearEquiv (f : A ≃ₐ[S] B) (g : C ≃ₐ[R] D) :
    (Algebra.TensorProduct.congr f g).toLinearEquiv =
      TensorProduct.AlgebraTensorModule.congr f.toLinearEquiv g.toLinearEquiv

{R : Type uR}
{S : Type uS}
{A : Type uA}
{B : Type uB}
{C : Type uC}
{D : Type uD}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
[Semiring A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
[Semiring B]
[Algebra R B]
[Algebra S B]
[IsScalarTower R S B]
[Semiring C]
[Algebra R C]
[Semiring D]
[Algebra R D]
(f : A ≃ₐ[S] B)
(g : C ≃ₐ[R] D)


protected theorem mul_self_le_mul_self {a b : Int} (h1 : 0 ≤ a) (h2 : a ≤ b) : a * a ≤ b * b


theorem mem_antidiagonalTuple {n : ℕ} {k : ℕ} {x : Fin k → ℕ} :
    x ∈ antidiagonalTuple k n ↔ ∑ i, x i = n

x ∈ Multiset.Nat.antidiagonalTuple k n ↔ ∑ i : Fin k, x i = n


@[simp]
theorem id_app {X : Scheme} (U : X.Opens) :
    (𝟙 X : _).app U = 𝟙 _

{X : AlgebraicGeometry.Scheme}
(U : X.Opens)

AlgebraicGeometry.Scheme.Hom.app (𝟙 X) U = 𝟙 (X.presheaf.obj (Opposite.op U))


theorem coe_injective : Function.Injective ((↑) : LieSubmodule R L M → Set M)

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]


theorem or_congr_right' {c : Prop} (h : ¬a → (b ↔ c)) : a ∨ b ↔ a ∨ c


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem sigma_nonempty : (s.sigma t).Nonempty ↔ ∃ i ∈ s, (t i).Nonempty

{ι : Type u_1}
{α : ι → Type u_2}
{s : Finset ι}
{t : (i : ι) → Finset (α i)}


theorem nextn : ∀ {s}, ValidFor l (m₁ ++ m₂) r s →
    ∀ n, s.nextn n ⟨utf8Len m₁⟩ = ⟨utf8Len m₁ + utf8Len (m₂.take n)⟩

Substring.ValidFor l (m₁ ++ m₂) r s →
  ∀ (n : Nat),
    s.nextn n { byteIdx := String.utf8Len m₁ } = { byteIdx := String.utf8Len m₁ + String.utf8Len (List.take n m₂) }


private theorem sdiff_sup_self' : y \ x ⊔ x = y ⊔ x

{α : Type u}
{x y : α}
[GeneralizedBooleanAlgebra α]


/-- A side of a right-angled triangle divided by the tangent of the opposite angle equals the
adjacent side, version subtracting vectors. -/
theorem norm_div_tan_oangle_sub_left_of_oangle_eq_pi_div_two {x y : V}
    (h : o.oangle x y = ↑(π / 2)) : ‖y‖ / Real.Angle.tan (o.oangle (x - y) x) = ‖x‖

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


/-- The averaging of a uniformly integrable sequence is also uniformly integrable. -/
theorem uniformIntegrable_average
    {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    (hp : 1 ≤ p) {f : ℕ → α → E} (hf : UniformIntegrable f p μ) :
    UniformIntegrable (fun (n : ℕ) => (n : ℝ)⁻¹ • (∑ i ∈ Finset.range n, f i)) p μ

(hf : MeasureTheory.UniformIntegrable f p μ)

MeasureTheory.UniformIntegrable (fun n => (↑n)⁻¹ • ∑ i ∈ Finset.range n, f i) p μ


@[to_additive]
lemma prod_eq_one_iff_of_le_one (hf : f ≤ 1) : ∏ i, f i = 1 ↔ f = 1

{ι : Type u_1}
{M : Type u_4}
[Fintype ι]
[OrderedCommMonoid M]
{f : ι → M}
(hf : f ≤ 1)


@[to_additive minimalPeriod_eq_one_iff_fixedBy]
theorem minimalPeriod_eq_one_iff_fixedBy {a : α} {g : G} :
    Function.minimalPeriod (fun x => g • x) a = 1 ↔ a ∈ fixedBy α g

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

Function.minimalPeriod (fun x => g • x) a = 1 ↔ a ∈ MulAction.fixedBy α g


@[simp] theorem lt_compl_self [Nontrivial α] : a < aᶜ ↔ a = ⊥

{α : Type u_2}
[HeytingAlgebra α]
{a : α}
[Nontrivial α]


@[to_additive (attr := simp)]
theorem mem_one : a ∈ (1 : Finset α) ↔ a = 1


/-- Swapping the factors of a cartesian product of categories twice is naturally isomorphic
to the identity functor.
-/
@[simps]
def symmetry : swap C D ⋙ swap D C ≅ 𝟭 (C × D)

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₂)
[CategoryTheory.Category.{v₂, u₂} D]
(X : C × D)

(CategoryTheory.Prod.symmetry C D).inv.app X = CategoryTheory.CategoryStruct.id X


@[simp]
theorem splitOnP_nil : [].splitOnP p = [[]]


/-- A closed embedding is an embedding with closed image. -/
@[mk_iff]
structure ClosedEmbedding (f : X → Y) extends Embedding f : Prop where
  /-- The range of a closed embedding is a closed set. -/
  isClosed_range : IsClosed <| range f

{X : Type u_1}
{Y : Type u_2}
[tX : TopologicalSpace X]
[tY : TopologicalSpace Y]
(f : X → Y)

ClosedEmbedding f ↔ Embedding f ∧ IsClosed (Set.range f)


theorem odd_card_of_involutive (hφ : FixedPointFree φ) (h2 : Function.Involutive φ) :
    Odd (Nat.card G)

{G : Type u_1}
[Group G]
{φ : G →* G}
[Finite G]
(hφ : MonoidHom.FixedPointFree ⇑φ)
(h2 : Function.Involutive ⇑φ)


/-- If `r` is a positive constant, `x ↦ f x / r` tends to infinity along a filter
if and only if `f` tends to infinity along the same filter. -/
lemma tendsto_div_const_atTop_of_pos (hr : 0 < r) :
    Tendsto (fun x ↦ f x / r) l atTop ↔ Tendsto f l atTop

{α : Type u_3}
{β : Type u_4}
[LinearOrderedSemifield α]
{l : Filter β}
{f : β → α}
{r : α}
(hr : 0 < r)

Filter.Tendsto (fun x => f x / r) l Filter.atTop ↔ Filter.Tendsto f l Filter.atTop


@[simp]
theorem toFun_eq_coe : f.toFun = ⇑f

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)


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

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Star A]
[Semiring B]
[Algebra R B]
[Star B]
{f g : A →⋆ₐ[R] B}
(h : ∀ (x : A), f x = g x)


@[simp]
theorem ofInjective_apply (f : A →ₐ[R] B) (hf : Function.Injective f) (x : A) :
    ↑(ofInjective f hf x) = f x

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(hf : Function.Injective ⇑f)
(x : A)


theorem succ_castPred_eq_add_one {a : Fin (n + 1)} (ha : a ≠ last n) :
    (a.castPred ha).succ = a + 1

{n : ℕ}
{a : Fin (n + 1)}
(ha : a ≠ Fin.last n)


@[to_additive (attr := simp)]
-- Porting note: removed dot notation
theorem mrange_mk' : MonoidHom.mrange c.mk' = ⊤

{M : Type u_1}
[AddZeroClass M]
{c : AddCon M}


theorem rpow_def_of_nonneg {x : ℝ} (hx : 0 ≤ x) (y : ℝ) :
    x ^ y = if x = 0 then if y = 0 then 1 else 0 else exp (log x * y)

x ^ y = if x = 0 then if y = 0 then 1 else 0 else rexp (Real.log x * y)


/-- `IsSkeletonOf C D F` says that `F : D ⥤ C` exhibits `D` as a skeletal full subcategory of `C`,
in particular `F` is a (strong) equivalence and `D` is skeletal.
-/
structure IsSkeletonOf (F : D ⥤ C) : Prop where
  /-- The category `D` has isomorphic objects equal -/
  skel : Skeletal D
  /-- The functor `F` is an equivalence -/
  eqv : F.IsEquivalence := by infer_instance

(self : CategoryTheory.IsSkeletonOf C D F)


@[to_additive]
theorem inv_unique (hy : x * y = 1) (hz : x * z = 1) : y = z

{M : Type u_4}
[AddCommMonoid M]
{x y z : M}
(hy : x + y = 0)
(hz : x + z = 0)


@[simp, measurability]
theorem measurableSet_Iio : MeasurableSet (Iio a)

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{a : α}


/-- The preimage of a strictly convex set under an affine map is strictly convex. -/
theorem StrictConvex.affine_preimage {s : Set F} (hs : StrictConvex 𝕜 s) {f : E →ᵃ[𝕜] F}
    (hf : Continuous f) (hfinj : Injective f) : StrictConvex 𝕜 (f ⁻¹' s)

{𝕜 : Type u_1}
{E : Type u_3}
{F : Type u_4}
[OrderedRing 𝕜]
[TopologicalSpace E]
[TopologicalSpace F]
[AddCommGroup E]
[AddCommGroup F]
[Module 𝕜 E]
[Module 𝕜 F]
{s : Set F}
(hs : StrictConvex 𝕜 s)
{f : E →ᵃ[𝕜] F}
(hf : Continuous ⇑f)
(hfinj : Function.Injective ⇑f)


theorem pell_dioph :
    Dioph fun v : Vector3 ℕ 4 => ∃ h : 1 < v &0, xn h (v &1) = v &2 ∧ yn h (v &1) = v &3

Dioph fun v =>
  ∃ (h : 1 < v (Fin2.ofNat' 0)),
    Pell.xn h (v (Fin2.ofNat' 1)) = v (Fin2.ofNat' 2) ∧ Pell.yn h (v (Fin2.ofNat' 1)) = v (Fin2.ofNat' 3)


@[simp]
theorem coe_prodCongr (h₁ : M ≃ₘ^n⟮I, I'⟯ M') (h₂ : N ≃ₘ^n⟮J, J'⟯ N') :
    ⇑(h₁.prodCongr h₂) = Prod.map h₁ h₂

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{G : Type u_7}
[TopologicalSpace G]
{G' : Type u_8}
[TopologicalSpace G']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{J : ModelWithCorners 𝕜 F G}
{J' : ModelWithCorners 𝕜 F G'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{N' : Type u_12}
[TopologicalSpace N']
[ChartedSpace G' N']
{n : ℕ∞}
(h₁ : M ≃ₘ^n⟮I, I'⟯ M')
(h₂ : N ≃ₘ^n⟮J, J'⟯ N')


theorem iff_self_iff (a : Prop) : (a ↔ a) ↔ True


/-- Dropping the elements up to `l₁.length + i` in `l₁ + l₂` is the same as dropping the elements
up to `i` in `l₂`. -/
@[simp]
theorem drop_append {l₁ l₂ : List α} (i : Nat) : drop (l₁.length + i) (l₁ ++ l₂) = drop i l₂

{α : Type u_1}
{l₁ l₂ : List α}
(i : Nat)

List.drop (l₁.length + i) (l₁ ++ l₂) = List.drop i l₂


theorem Antivary.comp_right (h : Antivary f g) (k : ι' → ι) : Antivary (f ∘ k) (g ∘ k)

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


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

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

MeasureTheory.AEStronglyMeasurable (fun x => (List.map (fun f => f x) l).sum) μ


@[elab_as_elim]
protected theorem inductionOn₃
    {s₃ : Setoid φ}
    {motive : Quotient s₁ → Quotient s₂ → Quotient s₃ → Prop}
    (q₁ : Quotient s₁)
    (q₂ : Quotient s₂)
    (q₃ : Quotient s₃)
    (h : (a : α) → (b : β) → (c : φ) → motive (Quotient.mk s₁ a) (Quotient.mk s₂ b) (Quotient.mk s₃ c))
    : motive q₁ q₂ q₃

(h : ∀ (a : α) (b : β) (c : φ), motive (Quotient.mk s₁ a) (Quotient.mk s₂ b) (Quotient.mk s₃ c))


theorem tendsto_const_div_atTop_nhds_zero_nat (C : ℝ) :
    Tendsto (fun n : ℕ ↦ C / n) atTop (𝓝 0)

Filter.Tendsto (fun n => C / ↑n) Filter.atTop (𝓝 0)


theorem real_inner_self_nonneg {x : F} : 0 ≤ ⟪x, x⟫_ℝ

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{x : F}


theorem pos_of_pos (h : 0 < x) : 0 < smoothTransition x


theorem typein_lt_type (r : α → α → Prop) [IsWellOrder α r] (a : α) : typein r a < type r

{α : Type u}
(r : α → α → Prop)
[IsWellOrder α r]
(a : α)


lemma intCast_cast_add (x y : ZMod n) : (cast (x + y) : ℤ) = (cast x + cast y) % n


theorem le_insertNth_iff {i : Fin (n + 1)} {x : α i} {p : ∀ j, α (i.succAbove j)} {q : ∀ j, α j} :
    q ≤ i.insertNth x p ↔ q i ≤ x ∧ (fun j ↦ q (i.succAbove j)) ≤ p

{n : ℕ}
{α : Fin (n + 1) → Type u}
[(i : Fin (n + 1)) → Preorder (α i)]
{i : Fin (n + 1)}
{x : α i}
{p : (j : Fin n) → α (i.succAbove j)}
{q : (j : Fin (n + 1)) → α j}

q ≤ i.insertNth x p ↔ q i ≤ x ∧ (fun j => q (i.succAbove j)) ≤ p


theorem degree_eq_card_roots' {p : K[X]} {i : K →+* L} (p_ne_zero : p.map i ≠ 0)
    (hsplit : Splits i p) : (p.map i).degree = Multiset.card (p.map i).roots

{K : Type v}
{L : Type w}
[CommRing K]
[Field L]
{p : K[X]}
{i : K →+* L}
(p_ne_zero : Polynomial.map i p ≠ 0)
(hsplit : Polynomial.Splits i p)

(Polynomial.map i p).degree = ↑(Multiset.card (Polynomial.map i p).roots)


theorem foldl_assoc : ∀ {l : List α} {a₁ a₂}, (l <*> a₁ ⋆ a₂) = a₁ ⋆ l <*> a₂

{α : Type u}
{op : α → α → α}
[ha : Std.Associative op]
{l : List α}
{a₁ a₂ : α}

List.foldl op (op a₁ a₂) l = op a₁ (List.foldl op a₂ l)


@[simp] lemma lift_sdiff_comp (a b : α) : lift a \ comp b = lift (a ⊓ b)

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

Booleanisation.lift a \ Booleanisation.comp b = Booleanisation.lift (a ⊓ b)


@[simp]
theorem coe_neg_one : ↑(-1 : SignType) = (-1 : α)


@[simp, rclike_simps]
theorem normSq_conj (z : K) : normSq (conj z) = normSq z

RCLike.normSq ((starRingEnd K) z) = RCLike.normSq z


nonrec theorem hasSum_nat_add_iff {f : ℕ → ℝ≥0} (k : ℕ) {a : ℝ≥0} :
    HasSum (fun n => f (n + k)) a ↔ HasSum f (a + ∑ i ∈ range k, f i)

HasSum (fun n => f (n + k)) a ↔ HasSum f (a + ∑ i ∈ Finset.range k, f i)


@[simp]
theorem span_empty : span (∅ : Set α) = ⊥


theorem bind_eq_none' {o : Option α} {f : α → Option β} :
    o.bind f = none ↔ ∀ b a, a ∈ o → b ∉ f a

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

o.bind f = none ↔ ∀ (b : β) (a : α), a ∈ o → ¬b ∈ f a


@[simp]
theorem coe_copy (f : FrameHom α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : FrameHom α β)
(f' : α → β)
(h : f' = ⇑f)


@[simp]
theorem fst_compl [HasCompl α] [HasCompl β] (a : α × β) : aᶜ.1 = a.1ᶜ

{α : Type u_2}
{β : Type u_3}
[HasCompl α]
[HasCompl β]
(a : α × β)


theorem of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) :
    FormallyUnramified R B

{R : Type u}
[CommSemiring R]
{A B : Type u}
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[Algebra.FormallyUnramified R A]
(e : A ≃ₐ[R] B)


@[simp]
theorem infEdist_thickening (hδ : 0 < δ) (s : Set E) (x : E) :
    infEdist x (thickening δ s) = infEdist x s - ENNReal.ofReal δ

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{δ : ℝ}
(hδ : 0 < δ)
(s : Set E)
(x : E)

EMetric.infEdist x (Metric.thickening δ s) = EMetric.infEdist x s - ENNReal.ofReal δ


theorem integral_piecewise {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    (a : α) (g : β → E) :
    ∫ b, g b ∂piecewise hs κ η a = if a ∈ s then ∫ b, g b ∂κ a else ∫ b, g b ∂η a

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ η : ProbabilityTheory.Kernel α β}
{s : Set α}
{hs : MeasurableSet s}
[DecidablePred fun x => x ∈ s]
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(a : α)
(g : β → E)

∫ (b : β), g b ∂(ProbabilityTheory.Kernel.piecewise hs κ η) a =
  if a ∈ s then ∫ (b : β), g b ∂κ a else ∫ (b : β), g b ∂η a


theorem mul_mem_sup {S T : Subalgebra R A} {x y : A} (hx : x ∈ S) (hy : y ∈ T) : x * y ∈ S ⊔ T

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{S T : Subalgebra R A}
{x y : A}
(hx : x ∈ S)
(hy : y ∈ T)


@[to_additive]
theorem smul_set_iInter_subset (a : α) (t : ι → Set β) : (a • ⋂ i, t i) ⊆ ⋂ i, a • t i

{α : Type u_2}
{β : Type u_3}
{ι : Sort u_5}
[SMul α β]
(a : α)
(t : ι → Set β)


@[simp]
theorem coe_of_injective_castLE_symm {n k : ℕ} (h : n ≤ k) (i : Fin k) (hi) :
    ((Equiv.ofInjective _ (castLE_injective h)).symm ⟨i, hi⟩ : ℕ) = i

{n k : ℕ}
(h : n ≤ k)
(i : Fin k)
(hi : i ∈ Set.range (Fin.castLE h))

↑((Equiv.ofInjective (Fin.castLE h) ⋯).symm ⟨i, hi⟩) = ↑i


@[to_additive (attr := simp)]
theorem traverse_mul' :
    Function.comp (traverse F) ∘ (HMul.hMul : FreeSemigroup α → FreeSemigroup α → FreeSemigroup α) =
      fun x y ↦ (· * ·) <$> traverse F x <*> traverse F y

{α β : Type u}
{m : Type u → Type u}
[Applicative m]
(F : α → m β)
[LawfulApplicative m]

Function.comp (traverse F) ∘ HMul.hMul = fun x y =>
  Seq.seq ((fun x x_1 => x * x_1) <$> traverse F x) fun x => traverse F y


@[simp]
theorem curry_symm_apply (f : α →o β →o γ) (x : α × β) : curry.symm f x = f x.1 x.2

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
(f : α →o β →o γ)
(x : α × β)

((RelIso.symm OrderHom.curry) f) x = (f x.1) x.2


theorem continuousAt_log (hx : x ≠ 0) : ContinuousAt log x


theorem mem_extChartAt_ind_source (x : M) (hx : x ∈ s) :
    x ∈ (extChartAt I (fs.c (fs.ind x hx))).source

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(fs : SmoothBumpCovering ι I M s)
(x : M)
(hx : x ∈ s)


/-- A morphism of module objects. -/
@[ext]
structure Hom (M N : Mod_ A) where
  hom : M.X ⟶ N.X
  act_hom : M.act ≫ hom = (A.X ◁ hom) ≫ N.act := by aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{A : Mon_ C}
{M N : Mod_ A}
(self : M.Hom N)

M.act ≫ self.hom = A.X ◁ self.hom ≫ N.act


@[simp]
theorem mem_cons {α} (x y : α) (ys : Thunk (LazyList α)) :
    x ∈ @LazyList.cons α y ys ↔ x = y ∨ x ∈ ys.get

{α : Type u_1}
(x y : α)
(ys : Thunk (LazyList α))

x ∈ LazyList.cons y ys ↔ x = y ∨ x ∈ ys.get


theorem integral_inter_add_diff (ht : MeasurableSet t) (hfs : IntegrableOn f s μ) :
    ∫ x in s ∩ t, f x ∂μ + ∫ x in s \ t, f x ∂μ = ∫ x in s, f x ∂μ

(hfs : MeasureTheory.IntegrableOn f s μ)

∫ (x : X) in s ∩ t, f x ∂μ + ∫ (x : X) in s \ t, f x ∂μ = ∫ (x : X) in s, f x ∂μ


/-- Congruence relations are symmetric. -/
@[to_additive "Additive congruence relations are symmetric."]
protected theorem symm {x y} : c x y → c y x

{M : Type u_1}
[Add M]
(c : AddCon M)
{x y : M}


/-- The *open mapping theorem* for holomorphic functions, local version: is a function `g : E → ℂ`
is analytic at a point `z₀`, then either it is constant in a neighborhood of `z₀`, or it maps every
neighborhood of `z₀` to a neighborhood of `z₀`. For the particular case of a holomorphic function on
`ℂ`, see `AnalyticAt.eventually_constant_or_nhds_le_map_nhds_aux`. -/
theorem AnalyticAt.eventually_constant_or_nhds_le_map_nhds {z₀ : E} (hg : AnalyticAt ℂ g z₀) :
    (∀ᶠ z in 𝓝 z₀, g z = g z₀) ∨ 𝓝 (g z₀) ≤ map g (𝓝 z₀)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{g : E → ℂ}
{z₀ : E}
(hg : AnalyticAt ℂ g z₀)

(∀ᶠ (z : E) in 𝓝 z₀, g z = g z₀) ∨ 𝓝 (g z₀) ≤ Filter.map g (𝓝 z₀)


@[to_additive]
theorem smooth_finset_prod' (h : ∀ i ∈ t, Smooth I' I (f i)) : Smooth I' I (∏ i ∈ t, f i)

{ι : Type u_1}
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{H : Type u_3}
[TopologicalSpace H]
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[AddCommMonoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothAdd I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{t : Finset ι}
{f : ι → M → G}
(h : ∀ i ∈ t, Smooth I' I (f i))


/-- A morphism between two commutative squares consists of 4 morphisms
which extend these two squares into a commuting cube. -/
@[ext]
structure Hom (sq₁ sq₂ : Square C) where
  /-- the top-left morphism -/
  τ₁ : sq₁.X₁ ⟶ sq₂.X₁
  /-- the top-right morphism -/
  τ₂ : sq₁.X₂ ⟶ sq₂.X₂
  /-- the bottom-left morphism -/
  τ₃ : sq₁.X₃ ⟶ sq₂.X₃
  /-- the bottom-right morphism -/
  τ₄ : sq₁.X₄ ⟶ sq₂.X₄
  comm₁₂ : sq₁.f₁₂ ≫ τ₂ = τ₁ ≫ sq₂.f₁₂ := by aesop_cat
  comm₁₃ : sq₁.f₁₃ ≫ τ₃ = τ₁ ≫ sq₂.f₁₃ := by aesop_cat
  comm₂₄ : sq₁.f₂₄ ≫ τ₄ = τ₂ ≫ sq₂.f₂₄ := by aesop_cat
  comm₃₄ : sq₁.f₃₄ ≫ τ₄ = τ₃ ≫ sq₂.f₃₄ := by aesop_cat

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

CategoryTheory.CategoryStruct.comp sq₁.f₁₂ self.τ₂ = CategoryTheory.CategoryStruct.comp self.τ₁ sq₂.f₁₂


theorem smul_mem_span_smul' {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R (s • t)) : k • x ∈ span R (s • t)

{R : Type u}
{S : Type v}
{A : Type w}
[Semiring R]
[Semiring S]
[AddCommMonoid A]
[Module R S]
[Module S A]
[Module R A]
[IsScalarTower R S A]
{s : Set S}
(hs : Submodule.span R s = ⊤)
{t : Set A}
{k : S}
{x : A}
(hx : x ∈ Submodule.span R (s • t))


{α : Type u_1}
[Preorder α]
[LocallyFiniteOrderTop α]
(a : α)


/-- Units of a monoid divide any element of the monoid. -/
@[simp]
theorem dvd (hu : IsUnit u) : u ∣ a

{α : Type u_1}
[Monoid α]
{a u : α}
(hu : IsUnit u)


@[elab_as_elim]
theorem Quotient.induction_on_pi {ι : Type*} {α : ι → Sort*} [s : ∀ i, Setoid (α i)]
    {p : (∀ i, Quotient (s i)) → Prop} (f : ∀ i, Quotient (s i))
    (h : ∀ a : ∀ i, α i, p fun i ↦ ⟦a i⟧) : p f

(h : ∀ (a : (i : ι) → α i), p fun i => ⟦a i⟧)


theorem smul_ne_zero_iff_ne (a : α) {x : β} : a • x ≠ 0 ↔ x ≠ 0

{α : Type u}
{β : Type v}
[Group α]
[AddMonoid β]
[DistribMulAction α β]
(a : α)
{x : β}


theorem admissible_A' (q r : ℕ+) : Admissible (A' q r)

ADEInequality.Admissible (ADEInequality.A' q r)


theorem sum_casesOn {f : α → β ⊕ γ} {g : α → β → σ} {h : α → γ → σ} (hf : Primrec f)
    (hg : Primrec₂ g) (hh : Primrec₂ h) : @Primrec _ σ _ _ fun a => Sum.casesOn (f a) (g a) (h a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
[Primcodable σ]
{f : α → β ⊕ γ}
{g : α → β → σ}
{h : α → γ → σ}
(hf : Primrec f)
(hg : Primrec₂ g)
(hh : Primrec₂ h)

Primrec fun a => Sum.casesOn (f a) (g a) (h a)


lemma compProd_of_not_isSFiniteKernel (μ : Measure α) (κ : Kernel α β) (h : ¬ IsSFiniteKernel κ) :
    μ ⊗ₘ κ = 0

(h : ¬ProbabilityTheory.IsSFiniteKernel κ)


theorem apply_eq_iff {b : Basis ι R M} {x : M} {i : ι} : b i = x ↔ b.repr x = Finsupp.single i 1

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{b : Basis ι R M}
{x : M}
{i : ι}


protected theorem star_inv' [DivisionSemiring α] [StarRing α] (s : Set α) : s⁻¹⋆ = s⋆⁻¹

{α : Type u_1}
[DivisionSemiring α]
[StarRing α]
(s : Set α)


private lemma filter_pairs_lt (k : ℕ) :
    (pairs σ k).filter (fun (s, _) ↦ s.card < k) =
      (range k).disjiUnion (powersetCard · univ) ((pairwise_disjoint_powersetCard _).set_pairwise _)
        ×ˢ univ

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

Finset.filter
    (fun x =>
      match x with
      | (s, snd) => s.card < k)
    (MvPolynomial.NewtonIdentities.pairs σ k) =
  (Finset.range k).disjiUnion (fun x => Finset.powersetCard x Finset.univ) ⋯ ×ˢ Finset.univ


@[simp]
theorem colimitPresheafObjIsoComponentwiseLimit_inv_ι_app (F : J ⥤ PresheafedSpace.{_, _, v} C)
    (U : Opens (Limits.colimit F).carrier) (j : J) :
    (colimitPresheafObjIsoComponentwiseLimit F U).inv ≫ (colimit.ι F j).c.app (op U) =
      limit.π _ (op j)

[∀ (X : TopCat), CategoryTheory.Limits.HasLimitsOfShape Jᵒᵖ (TopCat.Presheaf C X)]

(F : J ⥤ AlgebraicGeometry.PresheafedSpace C)

(U : TopologicalSpace.Opens ↑↑(CategoryTheory.Limits.colimit F))

(AlgebraicGeometry.PresheafedSpace.colimitPresheafObjIsoComponentwiseLimit F U).inv ≫
    (CategoryTheory.Limits.colimit.ι F j).c.app (Opposite.op U) =
  CategoryTheory.Limits.limit.π (AlgebraicGeometry.PresheafedSpace.componentwiseDiagram F U) (Opposite.op j)


theorem add_le_add_iff_of_lt_aleph0 {α β γ : Cardinal} (γ₀ : γ < Cardinal.aleph0) :
    α + γ ≤ β + γ ↔ α ≤ β

α + γ ≤ β + γ ↔ α ≤ β


/-- If `G` acts on `A`, then it acts also on `A → B`, by `(g • F) a = F (g⁻¹ • a)`. -/
@[to_additive (attr := simps) arrowAddAction
      "If `G` acts on `A`, then it acts also on `A → B`, by `(g +ᵥ F) a = F (g⁻¹ +ᵥ a)`"]
def arrowAction {G A B : Type*} [DivisionMonoid G] [MulAction G A] : MulAction G (A → B)

{G : Type u_4}
{A : Type u_5}
{B : Type u_6}
[DivisionMonoid G]
[MulAction G A]
(g : G)
(F : A → B)
(a : A)


theorem mem_insert_coe {s : Finset α} {x y : α} : x ∈ insert y s ↔ x ∈ insert y (s : Set α)

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{x y : α}


theorem le_iff_nonempty_imp_le_and_iUnion_subset :
    π₁ ≤ π₂ ↔
      (∀ J ∈ π₁, ∀ J' ∈ π₂, (J ∩ J' : Set (ι → ℝ)).Nonempty → J ≤ J') ∧ π₁.iUnion ⊆ π₂.iUnion

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

π₁ ≤ π₂ ↔ (∀ J ∈ π₁, ∀ J' ∈ π₂, (↑J ∩ ↑J').Nonempty → J ≤ J') ∧ π₁.iUnion ⊆ π₂.iUnion


@[simp] lemma egauge_zero_left_eq_top : egauge 𝕜 0 x = ∞ ↔ x ≠ 0

(𝕜 : Type u_1)
[NNNorm 𝕜]
[Nonempty 𝕜]
{E : Type u_2}
[Zero E]
[SMulZeroClass 𝕜 E]
{x : E}


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

{f : ℕ → Ω → β}

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

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


@[simp]
lemma inl_snd :
    (inl φ).comp (snd φ) (add_zero (-1)) = 0

(CochainComplex.mappingCone.inl φ).comp (CochainComplex.mappingCone.snd φ) ⋯ = 0


/-- Given `w : TwoSquare T L R B` and `X₃ : C₃`, this is the obvious functor
`CostructuredArrow L X₃ ⥤ CostructuredArrow R (B.obj X₃)`. -/
@[simps! obj map]
def costructuredArrowRightwards (X₃ : C₃) :
    CostructuredArrow L X₃ ⥤ CostructuredArrow R (B.obj X₃)

(X : CategoryTheory.CostructuredArrow L X₃)

(w.costructuredArrowRightwards X₃).obj X =
  (CategoryTheory.CostructuredArrow.pre T R (B.obj X₃)).obj
    ((CategoryTheory.Comma.mapLeft (CategoryTheory.Functor.fromPUnit (B.obj X₃)) w).obj
      (CategoryTheory.CostructuredArrow.mk (B.map X.hom)))


lemma lintegral_exponentialPDF_eq_antiDeriv {r : ℝ} (hr : 0 < r) (x : ℝ) :
    ∫⁻ y in Iic x, exponentialPDF r y
    = ENNReal.ofReal (if 0 ≤ x then 1 - exp (-(r * x)) else 0)

∫⁻ (y : ℝ) in Set.Iic x, ProbabilityTheory.exponentialPDF r y =
  ENNReal.ofReal (if 0 ≤ x then 1 - rexp (-(r * x)) else 0)


@[to_additive]
theorem map_eq_one_iff [OneHomClass F M N] (f : F) (hf : Function.Injective f)
    {x : M} :
    f x = 1 ↔ x = 1

{M : Type u_4}
{N : Type u_5}
{F : Type u_9}
[One M]
[One N]
[FunLike F M N]
[OneHomClass F M N]
(f : F)
(hf : Function.Injective ⇑f)
{x : M}


/--
(Implementation) Given the appropriate product and equalizer cones, build the cone for `F` which is
limiting if the given cones are also.
-/
@[simps]
def buildLimit
    (hs : ∀ f : Σp : J × J, p.1 ⟶ p.2, s ≫ c₂.π.app ⟨f⟩ = c₁.π.app ⟨f.1.1⟩ ≫ F.map f.2)
    (ht : ∀ f : Σp : J × J, p.1 ⟶ p.2, t ≫ c₂.π.app ⟨f⟩ = c₁.π.app ⟨f.1.2⟩)
    (i : Fork s t) : Cone F

{c₂ : CategoryTheory.Limits.Fan fun f => F.obj f.fst.2}

(hs : ∀ (f : (p : J × J) × (p.1 ⟶ p.2)), s ≫ c₂.π.app { as := f } = c₁.π.app { as := f.fst.1 } ≫ F.map f.snd)

(ht : ∀ (f : (p : J × J) × (p.1 ⟶ p.2)), t ≫ c₂.π.app { as := f } = c₁.π.app { as := f.fst.2 })

(CategoryTheory.Limits.HasLimitOfHasProductsOfHasEqualizers.buildLimit s t hs ht i).π.app j = i.ι ≫ c₁.π.app { as := j }


@[to_additive]
protected lemma mul_div_cancel_left (h : IsUnit a) (b : α) : a * b / a = b

{α : Type u}
[DivisionCommMonoid α]
{a : α}
(h : IsUnit a)
(b : α)


lemma IsClosed.isLocallyClosed (hs : IsClosed s) : IsLocallyClosed s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(hs : IsClosed s)


/-- The polar coordinates partial homeomorphism in `ℝ^2`, mapping `(r cos θ, r sin θ)` to `(r, θ)`.
It is a homeomorphism between `ℝ^2 - (-∞, 0]` and `(0, +∞) × (-π, π)`. -/
@[simps]
def polarCoord : PartialHomeomorph (ℝ × ℝ) (ℝ × ℝ)

↑polarCoord q = (√(q.1 ^ 2 + q.2 ^ 2), (Complex.equivRealProd.symm q).arg)


theorem normSq_zpow (z : ℤ) : normSq (a ^ z) = normSq a ^ z

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

Quaternion.normSq (a ^ z) = Quaternion.normSq a ^ z


theorem isSubfield_iUnion_of_directed {ι : Type*} [Nonempty ι] {s : ι → Set F}
    (hs : ∀ i, IsSubfield (s i)) (directed : ∀ i j, ∃ k, s i ⊆ s k ∧ s j ⊆ s k) :
    IsSubfield (⋃ i, s i)

(directed : ∀ (i j : ι), ∃ k, s i ⊆ s k ∧ s j ⊆ s k)


theorem lt_of_le_not_le : ∀ {a b : α}, a ≤ b → ¬b ≤ a → a < b


/--
A version of Riesz lemma: given a strict closed subspace `F`, one may find an element of norm `≤ R`
which is at distance at least `1` of every element of `F`. Here, `R` is any given constant
strictly larger than the norm of an element of norm `> 1`. For a version without an `R`, see
`riesz_lemma`.

Since we are considering a general nontrivially normed field, there may be a gap in possible norms
(for instance no element of norm in `(1,2)`). Hence, we can not allow `R` arbitrarily close to `1`,
and require `R > ‖c‖` for some `c : 𝕜` with norm `> 1`.
-/
theorem riesz_lemma_of_norm_lt {c : 𝕜} (hc : 1 < ‖c‖) {R : ℝ} (hR : ‖c‖ < R) {F : Subspace 𝕜 E}
    (hFc : IsClosed (F : Set E)) (hF : ∃ x : E, x ∉ F) :
    ∃ x₀ : E, ‖x₀‖ ≤ R ∧ ∀ y ∈ F, 1 ≤ ‖x₀ - y‖

{𝕜 : Type u_1}
[NormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{c : 𝕜}
(hc : 1 < ‖c‖)
{R : ℝ}
(hR : ‖c‖ < R)
{F : Subspace 𝕜 E}
(hFc : IsClosed ↑F)
(hF : ∃ x, x ∉ F)

∃ x₀, ‖x₀‖ ≤ R ∧ ∀ y ∈ F, 1 ≤ ‖x₀ - y‖


/-- Composition of `f : α ↪ β` and `g : β ↪ γ`. -/
@[trans, simps (config := { simpRhs := true })]
protected def trans {α β γ} (f : α ↪ β) (g : β ↪ γ) : α ↪ γ

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
(f : α ↪ β)
(g : β ↪ γ)


@[simp]
theorem sumArrowEquivProdArrow_symm_apply_inr (f : α → γ) (g : β → γ) (b : β) :
    ((sumArrowEquivProdArrow α β γ).symm (f, g)) (inr b) = g b

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

(Equiv.sumArrowEquivProdArrow α β γ).symm (f, g) (Sum.inr b) = g b


theorem CondIndepFun.neg_left {_mβ : MeasurableSpace β} {_mβ' : MeasurableSpace β'} [Neg β]
    [MeasurableNeg β] (hfg : CondIndepFun m' hm' f g μ) :
    CondIndepFun m' hm' (-f) g μ

(hfg : ProbabilityTheory.CondIndepFun m' hm' f g μ)

ProbabilityTheory.CondIndepFun m' hm' (-f) g μ


@[simp]
theorem BinaryBiproduct.bicone_inl : (BinaryBiproduct.bicone X Y).inl = biprod.inl

(CategoryTheory.Limits.BinaryBiproduct.bicone X Y).inl = CategoryTheory.Limits.biprod.inl


theorem dvd_lcm_right (x y : R) : y ∣ lcm x y

{R : Type u}
[EuclideanDomain R]
[DecidableEq R]
(x y : R)


@[simp]
theorem associator_hom_hom (X Y Z : Mon_ C) : (α_ X Y Z).hom.hom = (α_ X.X Y.X Z.X).hom

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
(X Y Z : Mon_ C)


@[to_additive]
theorem UniformContinuous.inv [UniformSpace β] {f : β → α} (hf : UniformContinuous f) :
    UniformContinuous fun x => (f x)⁻¹

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[Group α]
[UniformGroup α]
[UniformSpace β]
{f : β → α}
(hf : UniformContinuous f)


lemma compl_prod_eq_union {α β : Type*} (s : Set α) (t : Set β) :
    (s ×ˢ t)ᶜ = (sᶜ ×ˢ univ) ∪ (univ ×ˢ tᶜ)

{α : Type u_5}
{β : Type u_6}
(s : Set α)
(t : Set β)

(s ×ˢ t)ᶜ = sᶜ ×ˢ Set.univ ∪ Set.univ ×ˢ tᶜ


theorem map_mkQ_eq_top {N : Submodule R M} [Module.Finite R M] :
    N.map (Submodule.mkQ (𝔪 • ⊤)) = ⊤ ↔ N = ⊤

{R : Type u_1}
[CommRing R]
[LocalRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N : Submodule R M}
[Module.Finite R M]

Submodule.map (LocalRing.maximalIdeal R • ⊤).mkQ N = ⊤ ↔ N = ⊤


@[to_additive (attr := mono)]
theorem smul_subset_smul : s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ • t₁ ⊆ s₂ • t₂

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[SMul α β]
{s₁ s₂ : Finset α}
{t₁ t₂ : Finset β}

s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ • t₁ ⊆ s₂ • t₂


theorem restrict_preimage (f : α →ₛ β) {s : Set α} (hs : MeasurableSet s) {t : Set β}
    (ht : (0 : β) ∉ t) : restrict f s ⁻¹' t = s ∩ f ⁻¹' t

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Zero β]
(f : MeasureTheory.SimpleFunc α β)
{s : Set α}
(hs : MeasurableSet s)
{t : Set β}
(ht : 0 ∉ t)


theorem degrees_esymm [Nontrivial R] (n : ℕ) (hpos : 0 < n) (hn : n ≤ Fintype.card σ) :
    (esymm σ R n).degrees = (univ : Finset σ).val

(σ : Type u_1)
(R : Type u_2)
[CommSemiring R]
[Fintype σ]
[Nontrivial R]
(n : ℕ)
(hpos : 0 < n)
(hn : n ≤ Fintype.card σ)

(MvPolynomial.esymm σ R n).degrees = Finset.univ.val


theorem insert_nonempty (u v : ZFSet) : (insert u v).Nonempty


@[simp]
theorem mem_fieldRange {y : L'} : y ∈ f.fieldRange ↔ ∃ x, f x = y

{K : Type u_1}
{L : Type u_2}
{L' : Type u_3}
[Field K]
[Field L]
[Field L']
[Algebra K L]
[Algebra K L']
{f : L →ₐ[K] L'}
{y : L'}


theorem IsTorsionBy.quotient (N : Submodule R M) {r : R}
    (h : IsTorsionBy R M r) : IsTorsionBy R (M⧸N) r

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(N : Submodule R M)
{r : R}
(h : Module.IsTorsionBy R M r)


/-- The shadow of `falling m 𝒜` is disjoint from the `n`-sized elements of `𝒜`, thanks to the
antichain property. -/
theorem IsAntichain.disjoint_slice_shadow_falling {m n : ℕ}
    (h𝒜 : IsAntichain (· ⊆ ·) (𝒜 : Set (Finset α))) : Disjoint (𝒜 # m) (∂ (falling n 𝒜))

(h𝒜 : IsAntichain (fun x x_1 => x ⊆ x_1) ↑𝒜)

Disjoint (𝒜 # m) (∂ (Finset.falling n 𝒜))


@[simp]
theorem toAddMonoidAlgebra_add [Semiring M] [∀ m : M, Decidable (m ≠ 0)] (f g : ⨁ _ : ι, M) :
    (f + g).toAddMonoidAlgebra = toAddMonoidAlgebra f + toAddMonoidAlgebra g

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[Semiring M]
[(m : M) → Decidable (m ≠ 0)]
(f g : ⨁ (x : ι), M)

(f + g).toAddMonoidAlgebra = f.toAddMonoidAlgebra + g.toAddMonoidAlgebra


lemma eq_one_of_mul_eq_one_right (H : m * n = 1) : m = 1


/-- If `a^(p-1) = 1 mod p`, but `a^((p-1)/q) ≠ 1 mod p` for all prime factors `q` of `p-1`, then `p`
is prime. This is true because `a` has order `p-1` in the multiplicative group mod `p`, so this
group must itself have order `p-1`, which only happens when `p` is prime.
-/
theorem lucas_primality (p : ℕ) (a : ZMod p) (ha : a ^ (p - 1) = 1)
    (hd : ∀ q : ℕ, q.Prime → q ∣ p - 1 → a ^ ((p - 1) / q) ≠ 1) : p.Prime

(hd : ∀ (q : ℕ), Nat.Prime q → q ∣ p - 1 → a ^ ((p - 1) / q) ≠ 1)


@[to_additive]
theorem StrictAntiOn.inv (hf : StrictAntiOn f s) : StrictMonoOn (fun x => (f x)⁻¹) s

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

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


theorem MvPolynomial.continuous_eval : Continuous fun x ↦ eval x p

{X : Type u_1}
{σ : Type u_2}
[TopologicalSpace X]
[CommSemiring X]
[TopologicalSemiring X]
(p : MvPolynomial σ X)

Continuous fun x => (MvPolynomial.eval x) p


@[simp] theorem sub_eq : Nat.sub x y = x - y


theorem Submodule.exists_finiteIndex_of_cover :
    ∃ k ∈ s, (p k).toAddSubgroup.FiniteIndex

{R : Type u_1}
{M : Type u_2}
{ι : Type u_3}
[Ring R]
[AddCommGroup M]
[Module R M]
{p : ι → Submodule R M}
{s : Finset ι}
(hcovers : ⋃ i ∈ s, ↑(p i) = Set.univ)


theorem mk_surjective_eq_arrow_of_le (le : #β ≤ #α) : #{f : α → β | Surjective f} = #(α → β)

{α β : Type u}
[Infinite α]
(le : #β ≤ #α)

#↑{f | Function.Surjective f} = #(α → β)


theorem summable_norm_apply (p : FormalMultilinearSeries 𝕜 E F) {x : E}
    (hx : x ∈ EMetric.ball (0 : E) p.radius) : Summable fun n : ℕ => ‖p n fun _ => x‖

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
{x : E}
(hx : x ∈ EMetric.ball 0 p.radius)


theorem mul_apply [MulZeroClass β] [ContinuousMul β] (f g : C₀(α, β)) : (f * g) x = f x * g x

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
(x : α)
[MulZeroClass β]
[ContinuousMul β]
(f g : α →C₀ β)


/-- The `simp` normal form for a quadratic map is `DFunLike.coe`, not `toFun`. -/
@[simp]
theorem toFun_eq_coe : Q.toFun = ⇑Q

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(Q : QuadraticMap R M N)


theorem cycle_eq : ∀ (l : List α) (h : l ≠ []), cycle l h = l ++ₛ cycle l h

Stream'.cycle l h = l ++ₛ Stream'.cycle l h


theorem eq_replicate {a : α} {n} {s : Multiset α} :
    s = replicate n a ↔ card s = n ∧ ∀ b ∈ s, b = a

{α : Type u_1}
{a : α}
{n : ℕ}
{s : Multiset α}

s = Multiset.replicate n a ↔ Multiset.card s = n ∧ ∀ b ∈ s, b = a


theorem LinearMap.withSeminorms_induced [hι : Nonempty ι] {q : SeminormFamily 𝕜₂ F ι}
    (hq : WithSeminorms q) (f : E →ₛₗ[σ₁₂] F) :
    WithSeminorms (topology := induced f inferInstance) (q.comp f)

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_5}
{F : Type u_6}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[NormedField 𝕜₂]
[AddCommGroup F]
[Module 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
[TopologicalSpace F]
[hι : Nonempty ι]
{q : SeminormFamily 𝕜₂ F ι}
(hq : WithSeminorms q)
(f : E →ₛₗ[σ₁₂] F)


theorem map_equiv_eq_comap_symm (f : R ≃+* S) (K : NonUnitalSubring R) :
    K.map (f : R →ₙ+* S) = K.comap f.symm

{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
(f : R ≃+* S)
(K : NonUnitalSubring R)

NonUnitalSubring.map (↑f) K = NonUnitalSubring.comap f.symm K


@[simp]
theorem forget₂_bialgebra_obj (X : HopfAlgebraCat R) :
    (forget₂ (HopfAlgebraCat R) (BialgebraCat R)).obj X = BialgebraCat.of R X

{R : Type u}
[CommRing R]
(X : HopfAlgebraCat R)

(CategoryTheory.forget₂ (HopfAlgebraCat R) (BialgebraCat R)).obj X = BialgebraCat.of R ↑X.toBundled


theorem forall₂_and_left {p : α → Prop} :
    ∀ l u, Forall₂ (fun a b => p a ∧ R a b) l u ↔ (∀ a ∈ l, p a) ∧ Forall₂ R l u

{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
{p : α → Prop}
(l : List α)
(u : List β)

List.Forall₂ (fun a b => p a ∧ R a b) l u ↔ (∀ (a : α), a ∈ l → p a) ∧ List.Forall₂ R l u


@[simp, norm_cast]
lemma coe_neg {α : Type*} [One α] [SubtractionMonoid α] (s : SignType) :
    (↑(-s) : α) = -↑s

{α : Type u_2}
[One α]
[SubtractionMonoid α]
(s : SignType)


@[reassoc]
theorem prod.leftUnitor_inv_naturality [HasBinaryProducts C] (f : X ⟶ Y) :
    (prod.leftUnitor X).inv ≫ prod.map (𝟙 _) f = f ≫ (prod.leftUnitor Y).inv

(CategoryTheory.Limits.prod.leftUnitor X).inv ≫ CategoryTheory.Limits.prod.map (𝟙 (⊤_ C)) f =
  f ≫ (CategoryTheory.Limits.prod.leftUnitor Y).inv


@[simp]
lemma smul_lt_iff_lt_one_left [SMulPosStrictMono α β] [SMulPosReflectLT α β] (hb : 0 < b) :
    a • b < b ↔ a < 1

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Monoid α]
[Zero β]
[MulAction α β]
[Preorder α]
[Preorder β]
[SMulPosStrictMono α β]
[SMulPosReflectLT α β]
(hb : 0 < b)


/-- A finite-dimensional subspace is complete. -/
theorem Submodule.complete_of_finiteDimensional (s : Submodule 𝕜 E) [FiniteDimensional 𝕜 s] :
    IsComplete (s : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
[AddCommGroup E]
[UniformSpace E]
[T2Space E]
[UniformAddGroup E]
[Module 𝕜 E]
[ContinuousSMul 𝕜 E]
(s : Submodule 𝕜 E)
[FiniteDimensional 𝕜 ↥s]


@[to_additive]
theorem map_comp_map {M'' N''} [MulOneClass M''] [MulOneClass N''] (f' : M' →* M'') (g' : N' →* N'')
    (f : M →* M') (g : N →* N') : (map f' g').comp (map f g) = map (f'.comp f) (g'.comp g)

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[MulOneClass M]
[MulOneClass N]
[MulOneClass M']
[MulOneClass N']
{M'' : Type u_6}
{N'' : Type u_7}
[MulOneClass M'']
[MulOneClass N'']
(f' : M' →* M'')
(g' : N' →* N'')
(f : M →* M')
(g : N →* N')

(Monoid.Coprod.map f' g').comp (Monoid.Coprod.map f g) = Monoid.Coprod.map (f'.comp f) (g'.comp g)


/-- Note that this goal could also be stated `(Codisjoint on f) a b` -/
theorem Codisjoint.map_orderIso [SemilatticeSup α] [OrderTop α] [SemilatticeSup β] [OrderTop β]
    {a b : α} (f : α ≃o β) (ha : Codisjoint a b) : Codisjoint (f a) (f b)

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderTop α]
[SemilatticeSup β]
[OrderTop β]
{a b : α}
(f : α ≃o β)
(ha : Codisjoint a b)


/-- If `e` is an `orderIso` between `Fin n` and `Fin m`, then `n = m` and `e` is the identity
map. In this lemma we state that for each `i : Fin n` we have `(e i : ℕ) = (i : ℕ)`. -/
@[simp] lemma coe_orderIso_apply (e : Fin n ≃o Fin m) (i : Fin n) : (e i : ℕ) = i

{m n : ℕ}
(e : Fin n ≃o Fin m)
(i : Fin n)


theorem exists_finset_of_mem_iSup {ι : Type*} {f : ι → IntermediateField F E} {x : E}
    (hx : x ∈ ⨆ i, f i) : ∃ s : Finset ι, x ∈ ⨆ i ∈ s, f i

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{ι : Type u_3}
{f : ι → IntermediateField F E}
{x : E}
(hx : x ∈ ⨆ i, f i)


theorem Basis.base_of_base_subset (hIX : M.Basis I X) (hB : M.Base B) (hBX : B ⊆ X) : M.Base I

{α : Type u_1}
{M : Matroid α}
{I X B : Set α}
(hIX : M.Basis I X)
(hB : M.Base B)
(hBX : B ⊆ X)


@[to_additive]
theorem numerator_isUnit (s : S) : IsUnit (numeratorHom (s : R) : R[S⁻¹])

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
(s : ↥S)


@[simp]
lemma image_val_inj : (D : Set α) = ↑E ↔ D = E

{α : Type u_2}
{A : Set α}
{D E : Set ↑A}

Subtype.val '' D = Subtype.val '' E ↔ D = E


/-- If `s ⊆ t` and `t` is bounded below, then so is `s`. -/
theorem BddBelow.mono ⦃s t : Set α⦄ (h : s ⊆ t) : BddBelow t → BddBelow s

{α : Type u}
[Preorder α]
⦃s t : Set α⦄
(h : s ⊆ t)


@[simp high]
theorem coe_sumCoords_of_fintype [Fintype ι] : (b.sumCoords : M → R) = ∑ i, b.coord i

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
[Fintype ι]


@[simp] theorem append_nil (as : Array α) : as ++ #[] = as


theorem continuous_swap : Continuous (Prod.swap : X × Y → Y × X)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]


theorem volume_pi [∀ i, MeasureSpace (α i)] :
    (volume : Measure (∀ i, α i)) = Measure.pi fun _ => volume

[(i : ι) → MeasureTheory.MeasureSpace (α i)]

MeasureTheory.volume = MeasureTheory.Measure.pi fun x => MeasureTheory.volume


theorem gcd_add_one (x y : Nat) : gcd (x + 1) y = gcd (y % (x + 1)) (x + 1)


theorem pointReflection_apply (x y : P) : pointReflection x y = x -ᵥ y +ᵥ x

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[AddTorsor G P]
(x y : P)

(Equiv.pointReflection x) y = x -ᵥ y +ᵥ x


theorem changeOriginSeries_summable_aux₂ (hr : (r : ℝ≥0∞) < p.radius) (k : ℕ) :
    Summable fun s : Σl : ℕ, { s : Finset (Fin (k + l)) // s.card = l } =>
      ‖p (k + s.1)‖₊ * r ^ s.1

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

Summable fun s => ‖p (k + s.fst)‖₊ * r ^ s.fst


@[to_additive]
private lemma wellFoundedOn_devosMulRel :
    {x : Finset α × Finset α | x.1.Nonempty ∧ x.2.Nonempty}.WellFoundedOn
      (DevosMulRel : Finset α × Finset α → Finset α × Finset α → Prop)

{α : Type u_1}
[AddGroup α]
[DecidableEq α]

{x | x.1.Nonempty ∧ x.2.Nonempty}.WellFoundedOn DevosAddRel


lemma superset_antisymm [IsAntisymm α (· ⊆ ·)] : a ⊆ b → b ⊆ a → b = a

{α : Type u}
[HasSubset α]
{a b : α}
[IsAntisymm α fun x x_1 => x ⊆ x_1]


@[simp]
theorem num_mul (c1 c2 : NumDenSameDeg 𝒜 x) : ((c1 * c2).num : A) = c1.num * c2.num

(c1 c2 : HomogeneousLocalization.NumDenSameDeg 𝒜 x)


/-- The other direction does not hold because of the `u`-`u` cross terms on the RHS. -/
theorem image2_distrib_subset_right {f : δ → γ → ε} {g : α → β → δ} {f₁ : α → γ → α'}
    {f₂ : β → γ → β'} {g' : α' → β' → ε} (h_distrib : ∀ a b c, f (g a b) c = g' (f₁ a c) (f₂ b c)) :
    image2 f (image2 g s t) u ⊆ image2 g' (image2 f₁ s u) (image2 f₂ t u)

{f : δ → γ → ε}

{g : α → β → δ}

{f₁ : α → γ → α'}

{f₂ : β → γ → β'}

(h_distrib : ∀ (a : α) (b : β) (c : γ), f (g a b) c = g' (f₁ a c) (f₂ b c))

Set.image2 f (Set.image2 g s t) u ⊆ Set.image2 g' (Set.image2 f₁ s u) (Set.image2 f₂ t u)


lemma mul_eq_one_iff_inv_eq₀ (ha : a ≠ 0) : a * b = 1 ↔ a⁻¹ = b

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b : G₀}
(ha : a ≠ 0)


theorem dist_inversion_mul_dist_center_eq (hx : x ≠ c) (hy : y ≠ c) :
    dist (inversion c R x) y * dist x c = dist x (inversion c R y) * dist y c

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{c x y : P}
{R : ℝ}
(hx : x ≠ c)
(hy : y ≠ c)

dist (EuclideanGeometry.inversion c R x) y * dist x c = dist x (EuclideanGeometry.inversion c R y) * dist y c


/-- If a function `f` is twice differentiable on `ℝ`, and `f''` is nonnegative on `ℝ`,
then `f` is convex on `ℝ`. -/
theorem convexOn_univ_of_deriv2_nonneg {f : ℝ → ℝ} (hf' : Differentiable ℝ f)
    (hf'' : Differentiable ℝ (deriv f)) (hf''_nonneg : ∀ x, 0 ≤ (deriv^[2] f) x) :
    ConvexOn ℝ univ f

(hf''_nonneg : ∀ (x : ℝ), 0 ≤ deriv^[2] f x)


/-- This will be a special case of `LinearMap.toMatrix_id_eq_basis_toMatrix`. -/
theorem LinearMap.toMatrix_id : LinearMap.toMatrix v₁ v₁ id = 1

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

(LinearMap.toMatrix v₁ v₁) LinearMap.id = 1


@[simp]
theorem cocone_inl (s : CommSq f g h i) : s.cocone.inl = h

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


theorem sigma_eq_empty_iff : s.sigma t = ∅ ↔ ∀ i ∈ s, t i = ∅

{ι : Type u_1}
{α : ι → Type u_3}
{s : Set ι}
{t : (i : ι) → Set (α i)}


@[simp]
theorem pi_cons (m : Multiset α) (t : ∀ a, Multiset (β a)) (a : α) :
    pi (a ::ₘ m) t = (t a).bind fun b => (pi m t).map <| Pi.cons m a b

{α : Type u_1}
[DecidableEq α]
{β : α → Type u_2}
(m : Multiset α)
(t : (a : α) → Multiset (β a))
(a : α)

(a ::ₘ m).pi t = (t a).bind fun b => Multiset.map (Multiset.Pi.cons m a b) (m.pi t)


/-- If a multilinear map in finitely many variables on normed spaces satisfies the inequality
`‖f m‖ ≤ C * ∏ i, ‖m i‖` on a shell `ε i / ‖c i‖ < ‖m i‖ < ε i` for some positive numbers `ε i`
and elements `c i : 𝕜`, `1 < ‖c i‖`, then it satisfies this inequality for all `m`. -/
theorem bound_of_shell {ε : ι → ℝ} {C : ℝ} (hε : ∀ i, 0 < ε i) {c : ι → 𝕜} (hc : ∀ i, 1 < ‖c i‖)
    (hf : ∀ m : ∀ i, E i, (∀ i, ε i / ‖c i‖ ≤ ‖m i‖) → (∀ i, ‖m i‖ < ε i) → ‖f m‖ ≤ C * ∏ i, ‖m i‖)
    (m : ∀ i, E i) : ‖f m‖ ≤ C * ∏ i, ‖m i‖

(hf : ∀ (m : (i : ι) → E i), (∀ (i : ι), ε i / ‖c i‖ ≤ ‖m i‖) → (∀ (i : ι), ‖m i‖ < ε i) → ‖f m‖ ≤ C * ∏ i : ι, ‖m i‖)


@[simp]
theorem volume_ball (a r : ℝ) : volume (Metric.ball a r) = ofReal (2 * r)

MeasureTheory.volume (Metric.ball a r) = ENNReal.ofReal (2 * r)


@[simp, norm_cast]
lemma coe_withBot (f : LatticeHom α β) : ⇑f.withBot = Option.map f

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)


@[simp]
theorem symm_toNonUnitalRingHom_comp_toNonUnitalRingHom (e : R ≃+* S) :
    e.symm.toNonUnitalRingHom.comp e.toNonUnitalRingHom = NonUnitalRingHom.id _

{R : Type u_4}
{S : Type u_5}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
(e : R ≃+* S)

e.symm.toNonUnitalRingHom.comp e.toNonUnitalRingHom = NonUnitalRingHom.id R


@[to_additive]
theorem prod_Ico_succ_div_top (hmn : m ≤ n) :
    (∏ i ∈ Ico m (n + 1), f i) / f n = ∏ i ∈ Ico m n, f i

{M : Type u_3}
(f : ℕ → M)
{m n : ℕ}
[CommGroup M]
(hmn : m ≤ n)

(∏ i ∈ Finset.Ico m (n + 1), f i) / f n = ∏ i ∈ Finset.Ico m n, f i


@[to_additive (attr := simp, norm_cast)]
theorem const_inv [Inv G] (a : G) : (↑(a⁻¹) : Germ l G) = (↑a)⁻¹

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


theorem prod_mono {S T : NonUnitalSubalgebra R A} {S₁ T₁ : NonUnitalSubalgebra R B} :
    S ≤ T → S₁ ≤ T₁ → prod S S₁ ≤ prod T T₁

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[IsScalarTower R B B]
[SMulCommClass R B B]
{S T : NonUnitalSubalgebra R A}
{S₁ T₁ : NonUnitalSubalgebra R B}


theorem exp_hasFPowerSeriesAt_zero : HasFPowerSeriesAt (exp 𝕂) (expSeries 𝕂 𝔸) 0

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]

HasFPowerSeriesAt (NormedSpace.exp 𝕂) (NormedSpace.expSeries 𝕂 𝔸) 0


theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b)

{α : Type u_2}
[Inf α]
[HImp α]
(a b : α)


theorem ChainClosure.succ_fixpoint (hc₁ : ChainClosure r c₁) (hc₂ : ChainClosure r c₂)
    (hc : SuccChain r c₂ = c₂) : c₁ ⊆ c₂

{α : Type u_1}
{r : α → α → Prop}
{c₁ c₂ : Set α}
(hc₁ : ChainClosure r c₁)
(hc₂ : ChainClosure r c₂)
(hc : SuccChain r c₂ = c₂)


theorem basis_toMatrix_mul_linearMap_toMatrix_mul_basis_toMatrix
    [Fintype κ'] [DecidableEq ι] [DecidableEq ι'] :
    c.toMatrix c' * LinearMap.toMatrix b' c' f * b'.toMatrix b = LinearMap.toMatrix b c f

{ι : Type u_1}
{ι' : Type u_2}
{κ : Type u_3}
{κ' : Type u_4}
{R : Type u_5}
{M : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{N : Type u_9}
[AddCommMonoid N]
[Module R N]
(b : Basis ι R M)
(b' : Basis ι' R M)
(c : Basis κ R N)
(c' : Basis κ' R N)
(f : M →ₗ[R] N)
[Fintype ι']
[Finite κ]
[Fintype ι]
[Fintype κ']
[DecidableEq ι]
[DecidableEq ι']

c.toMatrix ⇑c' * (LinearMap.toMatrix b' c') f * b'.toMatrix ⇑b = (LinearMap.toMatrix b c) f


@[simp]
theorem coe_copy (f : InfTopHom α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

{α : Type u_3}
{β : Type u_4}
[Inf α]
[Top α]
[Inf β]
[Top β]
(f : InfTopHom α β)
(f' : α → β)
(h : f' = ⇑f)


protected theorem add_nsmul (n : ℕ) : a ≡ b [PMOD p] → a + n • p ≡ b [PMOD p]

{α : Type u_1}
[AddCommGroup α]
{p a b : α}
(n : ℕ)


@[simp]
theorem naturality {X Y : Cᵒᵖ} (α : coyoneda.obj X ⟶ coyoneda.obj Y) {Z Z' : C} (f : Z' ⟶ Z)
    (h : unop X ⟶ Z') : α.app Z' h ≫ f = α.app Z (h ≫ f)

(α : CategoryTheory.coyoneda.obj X ⟶ CategoryTheory.coyoneda.obj Y)

CategoryTheory.CategoryStruct.comp (α.app Z' h) f = α.app Z (CategoryTheory.CategoryStruct.comp h f)


theorem sum_const_nat {m : ℕ} {f : α → ℕ} (h₁ : ∀ x ∈ s, f x = m) :
    ∑ x ∈ s, f x = card s * m

{α : Type u_3}
{s : Finset α}
{m : ℕ}
{f : α → ℕ}
(h₁ : ∀ x ∈ s, f x = m)


theorem map_mono (h : I ≤ J) : map f I ≤ map f J

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
{f : F}
{I J : Ideal R}
(h : I ≤ J)


theorem coe_prod (v : PrimeMultiset) : (v.prod : ℕ) = (v : Multiset ℕ).prod


/-- The conjugate of the golden ratio is irrational. -/
theorem goldConj_irrational : Irrational ψ


@[simp] protected theorem lt_irrefl (a : Char) : ¬ a < a


/-- The sets of `s`-factored and of `s ∪ {N}`-factored numbers are the same when `N` is not prime.
See `Nat.equivProdNatFactoredNumbers` for when `N` is prime. -/
lemma factoredNumbers_insert (s : Finset ℕ) {N : ℕ} (hN : ¬ N.Prime) :
    factoredNumbers (insert N s) = factoredNumbers s

(s : Finset ℕ)
{N : ℕ}
(hN : ¬Nat.Prime N)

Nat.factoredNumbers (insert N s) = Nat.factoredNumbers s


theorem mem_sInf_arrows {s : Set (Subgroupoid C)} {c d : C} {p : c ⟶ d} :
    p ∈ (sInf s).arrows c d ↔ ∀ S ∈ s, p ∈ S.arrows c d

{s : Set (CategoryTheory.Subgroupoid C)}


theorem zero_le_powHalf (n : ℕ) : 0 ≤ powHalf n


/-- The proposition that a square
```
  P --fst--> X
  |          |
 snd         f
  |          |
  v          v
  Y ---g---> Z

```
is a pullback square. (Also known as a fibered product or cartesian square.)
-/
structure IsPullback {P X Y Z : C} (fst : P ⟶ X) (snd : P ⟶ Y) (f : X ⟶ Z) (g : Y ⟶ Z) extends
  CommSq fst snd f g : Prop where
  /-- the pullback cone is a limit -/
  isLimit' : Nonempty (IsLimit (PullbackCone.mk _ _ w))

(self : CategoryTheory.IsPullback fst snd f g)

Nonempty (CategoryTheory.Limits.IsLimit (CategoryTheory.Limits.PullbackCone.mk fst snd ⋯))


theorem dist_right_pointReflection (p q : P) :
    dist q (Equiv.pointReflection p q) = ‖(2 : 𝕜)‖ * dist p q

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(𝕜 : Type u_6)
[NormedField 𝕜]
[NormedSpace 𝕜 V]
(p q : P)

dist q ((Equiv.pointReflection p) q) = ‖2‖ * dist p q


@[to_additive (attr := mono)]
theorem toSubmonoid_strictMono : StrictMono (toSubmonoid : Subgroup G → Submonoid G)


theorem continuous_ultrafilter_extend (f : α → γ) : Continuous (Ultrafilter.extend f)

{α : Type u}
{γ : Type u_1}
[TopologicalSpace γ]
[T2Space γ]
[CompactSpace γ]
(f : α → γ)


/-- The Radon-Nikodym derivative of `f ν` with respect to `ν` is `f`. -/
theorem rnDeriv_withDensity₀ (ν : Measure α) [SigmaFinite ν] {f : α → ℝ≥0∞}
    (hf : AEMeasurable f ν) :
    (ν.withDensity f).rnDeriv ν =ᵐ[ν] f

{α : Type u_1}
{m : MeasurableSpace α}
(ν : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite ν]
{f : α → ℝ≥0∞}
(hf : AEMeasurable f ν)


theorem WellFounded.iSup_eq_monotonicSequenceLimit [CompleteLattice α]
    (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) :
    iSup a = monotonicSequenceLimit a

{α : Type u_1}
[CompleteLattice α]
(h : WellFounded fun x x_1 => x > x_1)
(a : ℕ →o α)


theorem place_conjugate (φ : K →+* ℂ) : place (conjugate φ) = place φ

NumberField.place (NumberField.ComplexEmbedding.conjugate φ) = NumberField.place φ


lemma mono_homologyMap_mor₁_iff :
    Mono ((homologyFunctor C n₁).map T.mor₁) ↔ δ T n₀ n₁ h = 0

(T : CategoryTheory.Pretriangulated.Triangle (DerivedCategory C))

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

CategoryTheory.Mono ((DerivedCategory.homologyFunctor C n₁).map T.mor₁) ↔
  DerivedCategory.HomologySequence.δ T n₀ n₁ h = 0


theorem Nonempty.eq_univ [Subsingleton α] : s.Nonempty → s = univ

{α : Type u}
{s : Set α}
[Subsingleton α]


theorem inf_left_idem (a b : α) : a ⊓ (a ⊓ b) = a ⊓ b

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


@[to_additive]
theorem is_left_invariant_prehaar {K₀ : PositiveCompacts G} {U : Set G} (hU : (interior U).Nonempty)
    (g : G) (K : Compacts G) :
    prehaar (K₀ : Set G) U (K.map _ <| continuous_mul_left g) = prehaar (K₀ : Set G) U K

{K₀ : TopologicalSpace.PositiveCompacts G}

MeasureTheory.Measure.haar.prehaar (↑K₀) U (TopologicalSpace.Compacts.map (fun b => g * b) ⋯ K) =
  MeasureTheory.Measure.haar.prehaar (↑K₀) U K


@[simp]
theorem mirror_trailingCoeff : p.mirror.trailingCoeff = p.leadingCoeff

{R : Type u_1}
[Semiring R]
(p : Polynomial R)


@[simp, norm_cast] lemma ofReal_ofNat (n : ℕ) [n.AtLeastTwo] :
    ofReal' (no_index (OfNat.ofNat n)) = OfNat.ofNat n


theorem semanticallyEquivalent_toPrenex (φ : L.BoundedFormula α n) :
    (∅ : L.Theory).SemanticallyEquivalent φ φ.toPrenex

{L : FirstOrder.Language}
{α : Type u'}
{n : ℕ}
(φ : L.BoundedFormula α n)


@[to_additive]
theorem TopologicalGroup.of_nhds_one {G : Type u} [Group G] [TopologicalSpace G]
    (hmul : Tendsto (uncurry ((· * ·) : G → G → G)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1))
    (hinv : Tendsto (fun x : G => x⁻¹) (𝓝 1) (𝓝 1))
    (hleft : ∀ x₀ : G, 𝓝 x₀ = map (x₀ * ·) (𝓝 1))
    (hconj : ∀ x₀ : G, Tendsto (x₀ * · * x₀⁻¹) (𝓝 1) (𝓝 1)) : TopologicalGroup G

(hmul : Filter.Tendsto (Function.uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1))

(hinv : Filter.Tendsto (fun x => x⁻¹) (𝓝 1) (𝓝 1))

(hleft : ∀ (x₀ : G), 𝓝 x₀ = Filter.map (fun x => x₀ * x) (𝓝 1))

(hconj : ∀ (x₀ : G), Filter.Tendsto (fun x => x₀ * x * x₀⁻¹) (𝓝 1) (𝓝 1))


@[simp] theorem prod_bot : f ×ˢ (⊥ : Filter β) = ⊥

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


/-- If `C` is equivalent to `D`, then `C ⥤ E` is equivalent to `D ⥤ E`. -/
@[simps! functor inverse unitIso counitIso]
def congrLeft (e : C ≌ D) : C ⥤ E ≌ D ⥤ E

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
(e : C ≌ D)

e.congrLeft.functor = (CategoryTheory.whiskeringLeft D C E).obj e.inverse


/-- Division of rational functions. -/
protected irreducible_def div : RatFunc K → RatFunc K → RatFunc K

{K : Type u_1}
[CommRing K]
[IsDomain K]

∀ (x x_1 : RatFunc K),
  x.div x_1 =
    match x, x_1 with
    | { toFractionRing := p }, { toFractionRing := q } => { toFractionRing := p / q }


theorem lt_max_of_lt_left (h : a < b) : a < max b c

{α : Type u}
[LinearOrder α]
{a b c : α}
(h : a < b)


/--
The category of subterminal objects is equivalent to the category of monomorphisms to the terminal
object (which is in turn equivalent to the subobjects of the terminal object).
-/
@[simps]
def subterminalsEquivMonoOverTerminal [HasTerminal C] : Subterminals C ≌ MonoOver (⊤_ C)

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Limits.HasTerminal C]

(CategoryTheory.subterminalsEquivMonoOverTerminal C).unitIso =
  CategoryTheory.NatIso.ofComponents (fun X => CategoryTheory.Iso.refl X) ⋯


theorem card_filter_univ_succ' (p : Fin (n + 1) → Prop) [DecidablePred p] :
    (univ.filter p).card = ite (p 0) 1 0 + (univ.filter (p ∘ Fin.succ)).card

{n : ℕ}
(p : Fin (n + 1) → Prop)
[DecidablePred p]

(Finset.filter p Finset.univ).card = (if p 0 then 1 else 0) + (Finset.filter (p ∘ Fin.succ) Finset.univ).card


/-- If a set belongs to the algebra of sets generated by `𝒜` then it can be written as a finite
union of finite intersections of sets which are in `𝒜` or have their complement in `𝒜`. -/
theorem mem_generateSetAlgebra_elim (s_mem : s ∈ generateSetAlgebra 𝒜) :
    ∃ A : Set (Set (Set α)), A.Finite ∧ (∀ a ∈ A, a.Finite) ∧
    (∀ᵉ (a ∈ A) (t ∈ a), t ∈ 𝒜 ∨ tᶜ ∈ 𝒜) ∧ s = ⋃ a ∈ A, ⋂ t ∈ a, t

(s_mem : s ∈ MeasureTheory.generateSetAlgebra 𝒜)

∃ A, A.Finite ∧ (∀ a ∈ A, a.Finite) ∧ (∀ a ∈ A, ∀ t ∈ a, t ∈ 𝒜 ∨ tᶜ ∈ 𝒜) ∧ s = ⋃ a ∈ A, ⋂ t ∈ a, t


theorem snd_sumFinsuppEquivProdFinsupp {α β γ : Type*} [Zero γ] (f : α ⊕ β →₀ γ) (y : β) :
    (sumFinsuppEquivProdFinsupp f).2 y = f (Sum.inr y)

{α : Type u_13}
{β : Type u_14}
{γ : Type u_15}
[Zero γ]
(f : α ⊕ β →₀ γ)
(y : β)

(Finsupp.sumFinsuppEquivProdFinsupp f).2 y = f (Sum.inr y)


theorem toNonUnitalRing_injective :
    Function.Injective (@toNonUnitalRing R)


theorem HasFTaylorSeriesUpToOn.restrictScalars (h : HasFTaylorSeriesUpToOn n f p' s) :
    HasFTaylorSeriesUpToOn n f (fun x => (p' x).restrictScalars 𝕜) s

{p' : E → FormalMultilinearSeries 𝕜' E F}

HasFTaylorSeriesUpToOn n f (fun x => FormalMultilinearSeries.restrictScalars 𝕜 (p' x)) s


theorem smul_of [MulOneClass G] (g : G) (r : k) : r • of k G g = single g r

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[MulOneClass G]
(g : G)
(r : k)

r • (MonoidAlgebra.of k G) g = MonoidAlgebra.single g r


theorem differentiable_sin : Differentiable ℝ sin


lemma measurable_measure_stieltjesOfMeasurableRat (hf : Measurable f) :
    Measurable fun a ↦ (stieltjesOfMeasurableRat f hf a).measure

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℚ → ℝ}
(hf : Measurable f)

Measurable fun a => (ProbabilityTheory.stieltjesOfMeasurableRat f hf a).measure


@[simp, norm_cast]
theorem coe_subset_coe {S T : A} : (S : Set B) ⊆ T ↔ S ≤ T

{A : Type u_1}
{B : Type u_2}
[i : SetLike A B]
{S T : A}

↑S ⊆ ↑T ↔ S ≤ T


theorem continuous_coe_fun :
    Continuous (DFunLike.coe : ContinuousMultilinearMap 𝕜 E F → (Π i, E i) → F)

{𝕜 : Type u_1}
{ι : Type u_2}
{E : ι → Type u_3}
{F : Type u_4}
[NormedField 𝕜]
[(i : ι) → TopologicalSpace (E i)]
[(i : ι) → AddCommGroup (E i)]
[(i : ι) → Module 𝕜 (E i)]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[∀ (i : ι), ContinuousSMul 𝕜 (E i)]


/-- The explicit left homology data of a short complex of modules that is
given by a kernel and a quotient given by the `LinearMap` API. -/
@[simps]
def moduleCatLeftHomologyData : S.LeftHomologyData

(S : CategoryTheory.ShortComplex (ModuleCat R))

S.moduleCatLeftHomologyData.i = (LinearMap.ker S.g).subtype


protected theorem dense (hp_ne_top : p ≠ ∞) : Dense (Lp.simpleFunc E p μ : Set (Lp E p μ))

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[Fact (1 ≤ p)]
(hp_ne_top : p ≠ ⊤)

Dense ↑(MeasureTheory.Lp.simpleFunc E p μ)


@[simp]
theorem strictAnti_comp_ofDual_iff : StrictAnti (f ∘ ofDual) ↔ StrictMono f

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

StrictAnti (f ∘ ⇑OrderDual.ofDual) ↔ StrictMono f


@[simp, reassoc]
lemma eqToHom_comp_homOfLE {a b c : X} (hab : a = b) (hbc : b ≤ c) :
    eqToHom hab ≫ homOfLE hbc = homOfLE ((le_of_eq hab).trans hbc)

{X : Type u}
[Preorder X]
{a b c : X}
(hab : a = b)
(hbc : b ≤ c)

CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom hab) (CategoryTheory.homOfLE hbc) = CategoryTheory.homOfLE ⋯


@[to_additive (attr := simp)]
theorem conj_eq_one_iff : a * b * a⁻¹ = 1 ↔ b = 1


theorem inner_smul_right (x y : F) {r : 𝕜} : ⟪x, r • y⟫ = r * ⟪x, y⟫

{𝕜 : Type u_1}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
[c : InnerProductSpace.Core 𝕜 F]
(x y : F)
{r : 𝕜}


@[simp]
theorem PreservesEqualizer.iso_hom :
    (PreservesEqualizer.iso G f g).hom = equalizerComparison f g G

[CategoryTheory.Limits.HasEqualizer (G.map f) (G.map g)]

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.parallelPair f g) G]

(CategoryTheory.Limits.PreservesEqualizer.iso G f g).hom = CategoryTheory.Limits.equalizerComparison f g G


@[simp]
lemma leftShift_units_smul (a n' : ℤ) (hn' : n + a = n') (x : Rˣ) :
    (x • γ).leftShift a n' hn' = x • γ.leftShift a n' hn'

(γ : CochainComplex.HomComplex.Cochain K L n)


@[to_additive]
theorem prod_fintype [Fintype α] (f : α →₀ M) (g : α → M → N) (h : ∀ i, g i 0 = 1) :
    f.prod g = ∏ i, g i (f i)

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[CommMonoid N]
[Fintype α]
(f : α →₀ M)
(g : α → M → N)
(h : ∀ (i : α), g i 0 = 1)


@[simp]
theorem coe_one : ⇑(1 : P ≃ᵃⁱ[𝕜] P) = id

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


@[to_additive Left.pow_neg]
theorem Left.pow_lt_one_of_lt [CovariantClass M M (· * ·) (· < ·)] {n : ℕ} {x : M} (hn : 0 < n)
    (h : x < 1) : x ^ n < 1

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


@[reassoc (attr := simp)]
lemma f_pOpcycles : S.f ≫ S.pOpcycles = 0

CategoryTheory.CategoryStruct.comp S.f S.pOpcycles = 0


/-- `HomOrthogonal.matrixDecomposition` as an additive equivalence. -/
@[simps!]
noncomputable def matrixDecompositionAddEquiv (o : HomOrthogonal s) {α β : Type} [Finite α]
    [Finite β] {f : α → ι} {g : β → ι} :
    ((⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)) ≃+
      ∀ i : ι, Matrix (g ⁻¹' {i}) (f ⁻¹' {i}) (End (s i))

(z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b))

o.matrixDecompositionAddEquiv z i j k =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.biproduct.components z ↑k ↑j) (CategoryTheory.eqToHom ⋯))


theorem nfp_add_eq_mul_omega {a b} (hba : b ≤ a * omega) : nfp (a + ·) b = a * omega

{a b : Ordinal.{u_1}}
(hba : b ≤ a * Ordinal.omega)

Ordinal.nfp (fun x => a + x) b = a * Ordinal.omega


theorem DiophList.forall (l : List (Set <| α → ℕ)) (d : l.Forall Dioph) :
    Dioph {v | l.Forall fun S : Set (α → ℕ) => v ∈ S}

{α : Type u}
(l : List (Set (α → ℕ)))
(d : List.Forall Dioph l)

Dioph {v | List.Forall (fun S => v ∈ S) l}


theorem prodXSubSMul.coeff (x : R) (g : G) (n : ℕ) :
    g • (prodXSubSMul G R x).coeff n = (prodXSubSMul G R x).coeff n

(G : Type u_2)
[Group G]
[Fintype G]
(R : Type u_3)
[CommRing R]
[MulSemiringAction G R]
(x : R)
(g : G)
(n : ℕ)


theorem AntivaryOn.dual_right : AntivaryOn f g s → MonovaryOn f (toDual ∘ g) s

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

AntivaryOn f g s → MonovaryOn f (⇑OrderDual.toDual ∘ g) s


@[reassoc (attr := simp)]
theorem counit_naturality {X Y : D} (f : X ⟶ Y) :
    F.map (G.map f) ≫ adj.counit.app Y = adj.counit.app X ≫ f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
{G : CategoryTheory.Functor D C}
(adj : F ⊣ G)
{X Y : D}
(f : X ⟶ Y)

CategoryTheory.CategoryStruct.comp (F.map (G.map f)) (adj.counit.app Y) =
  CategoryTheory.CategoryStruct.comp (adj.counit.app X) f


lemma strictMono_natAdd (n) : StrictMono (natAdd n : Fin m → Fin (n + m))


nonrec theorem IsLocalMax.add (hf : IsLocalMax f a) (hg : IsLocalMax g a) :
    IsLocalMax (fun x => f x + g x) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[OrderedAddCommMonoid β]
{f g : α → β}
{a : α}
(hf : IsLocalMax f a)
(hg : IsLocalMax g a)


/-- The product of two dense embeddings is a dense embedding. -/
protected theorem prod {e₁ : α → β} {e₂ : γ → δ} (de₁ : DenseEmbedding e₁)
    (de₂ : DenseEmbedding e₂) : DenseEmbedding fun p : α × γ => (e₁ p.1, e₂ p.2)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[TopologicalSpace δ]
{e₁ : α → β}
{e₂ : γ → δ}
(de₁ : DenseEmbedding e₁)
(de₂ : DenseEmbedding e₂)

DenseEmbedding fun p => (e₁ p.1, e₂ p.2)


theorem eval₂_congr (g₁ g₂ : σ → S₁)
    (h : ∀ {i : σ} {c : σ →₀ ℕ}, i ∈ c.support → coeff c p ≠ 0 → g₁ i = g₂ i) :
    p.eval₂ f g₁ = p.eval₂ f g₂

(h : ∀ {i : σ} {c : σ →₀ ℕ}, i ∈ c.support → MvPolynomial.coeff c p ≠ 0 → g₁ i = g₂ i)

MvPolynomial.eval₂ f g₁ p = MvPolynomial.eval₂ f g₂ p


@[simp]
theorem preimage_coe_Ico : (some : α → WithBot α) ⁻¹' Ico a b = Ico a b

WithBot.some ⁻¹' Set.Ico ↑a ↑b = Set.Ico a b


theorem map_coe (hf : UniformContinuous f) (a : α) : (Completion.map f) a = f a

{α : Type u_1}
[UniformSpace α]
{β : Type u_2}
[UniformSpace β]
{f : α → β}
(hf : UniformContinuous f)
(a : α)

UniformSpace.Completion.map f (↑α a) = ↑β (f a)


theorem HasDerivAt.cos (hf : HasDerivAt f f' x) :
    HasDerivAt (fun x => Real.cos (f x)) (-Real.sin (f x) * f') x

{f : ℝ → ℝ}
{f' x : ℝ}
(hf : HasDerivAt f f' x)


theorem contMDiffWithinAt_univ : ContMDiffWithinAt I I' n f univ x ↔ ContMDiffAt I I' n f x

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

ContMDiffWithinAt I I' n f Set.univ x ↔ ContMDiffAt I I' n f x


@[simp]
theorem neg_apply (f : NormedAddGroupHom V₁ V₂) (v : V₁) :
    (-f : NormedAddGroupHom V₁ V₂) v = -f v

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
(f : NormedAddGroupHom V₁ V₂)
(v : V₁)


/-- There are permutations with cycleType `m` if and only if
  its sum is at most `Fintype.card α` and its members are at least 2. -/
theorem Equiv.Perm.exists_with_cycleType_iff {m : Multiset ℕ} :
    (∃ g : Equiv.Perm α, g.cycleType = m) ↔
      (m.sum ≤ Fintype.card α ∧ ∀ a ∈ m, 2 ≤ a)

(α : Type u_1)
[DecidableEq α]
[Fintype α]
{m : Multiset ℕ}

(∃ g, g.cycleType = m) ↔ m.sum ≤ Fintype.card α ∧ ∀ a ∈ m, 2 ≤ a


@[simp] theorem suffix_append (l₁ l₂ : List α) : l₂ <:+ l₁ ++ l₂


/-- Proof that `F` is bounded by one one the edges. -/
lemma F_edge_le_one (f : ℂ → E) (ε : ℝ) (hε : ε > 0) (z : ℂ)
    (hB : BddAbove ((norm ∘ f) '' (verticalClosedStrip 0 1))) (hz : z ∈ re ⁻¹' {0, 1}) :
    ‖F f ε z‖ ≤ 1

(hB : BddAbove (norm ∘ f '' Complex.HadamardThreeLines.verticalClosedStrip 0 1))

‖Complex.HadamardThreeLines.F f ε z‖ ≤ 1


@[reassoc (attr := simp)]
theorem inr_isoIsPushout_hom (h : IsPushout f g inl inr) (h' : IsPushout f g inl' inr') :
    inr ≫ (h.isoIsPushout h').hom = inr'

(h : CategoryTheory.IsPushout f g inl inr)

(h' : CategoryTheory.IsPushout f g inl' inr')

inr ≫ (CategoryTheory.IsPushout.isoIsPushout X Y h h').hom = inr'


@[to_additive (attr := simp) addCentralizer_eq_top_iff_subset]
theorem centralizer_eq_top_iff_subset : centralizer S = Set.univ ↔ S ⊆ center M

{M : Type u_1}
{S : Set M}
[AddSemigroup M]

S.addCentralizer = Set.univ ↔ S ⊆ Set.addCenter M