/-- `Π i : Fin 2, α i` is equivalent to `α 0 × α 1`. See also `finTwoArrowEquiv` for a
non-dependent version and `prodEquivPiFinTwo` for a version with inputs `α β : Type u`. -/
@[simps (config := .asFn)]
def piFinTwoEquiv (α : Fin 2 → Type u) : (∀ i, α i) ≃ α 0 × α 1

⇑(piFinTwoEquiv α).symm = fun p => Fin.cons p.1 (Fin.cons p.2 finZeroElim)


@[to_additive]
theorem Nonempty.subset_one_iff (h : s.Nonempty) : s ⊆ 1 ↔ s = 1

{α : Type u_2}
[Zero α]
{s : Set α}
(h : s.Nonempty)


@[simp]
theorem floor_one : ⌊(1 : α)⌋ = 1

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]


/-- The Bochner integral is equal to a sum over any set that includes `f.range` (except `0`). -/
theorem integral_eq_sum_of_subset [DecidablePred fun x : F => x ≠ 0] {f : α →ₛ F} {s : Finset F}
    (hs : (f.range.filter fun x => x ≠ 0) ⊆ s) :
    f.integral μ = ∑ x ∈ s, (μ (f ⁻¹' {x})).toReal • x

(hs : Finset.filter (fun x => x ≠ 0) f.range ⊆ s)

MeasureTheory.SimpleFunc.integral μ f = ∑ x ∈ s, (μ (↑f ⁻¹' {x})).toReal • x


theorem hasGradientWithinAt_const : HasGradientWithinAt (fun _ => c) 0 s x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
(x : F)
(s : Set F)
(c : 𝕜)


theorem IsChain.superChain_succChain (hs₁ : IsChain r s) (hs₂ : ¬IsMaxChain r s) :
    SuperChain r s (SuccChain r s)

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
(hs₁ : IsChain r s)
(hs₂ : ¬IsMaxChain r s)


@[to_additive]
lemma mem_stabilizer_finset_iff_subset_smul_finset {s : Finset α} :
    a ∈ stabilizer G s ↔ s ⊆ a • s

{G : Type u_1}
{α : Type u_3}
[AddGroup G]
[AddAction G α]
{a : G}
[DecidableEq α]
{s : Finset α}

a ∈ AddAction.stabilizer G s ↔ s ⊆ a +ᵥ s


theorem bihimp_eq' : a ⇔ b = a ⊓ b ⊔ aᶜ ⊓ bᶜ

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


/-- `DFunLike.coe` as a `MonoidHom`. -/
@[to_additive (attr := simps) "`DFunLike.coe` as an `AddMonoidHom`."]
def coeFnMonoidHom [MulOneClass Y] : LocallyConstant X Y →* X → Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[AddZeroClass Y]

∀ (a : LocallyConstant X Y) (a_1 : X), LocallyConstant.coeFnAddMonoidHom a a_1 = a a_1


theorem down_sInf [InfSet α] (s : Set (ULift.{v} α)) : (sInf s).down = sInf (ULift.up ⁻¹' s)

{α : Type u_1}
[InfSet α]
(s : Set (ULift.{v, u_1} α))


@[simp, norm_cast]
theorem edist_le_coe {x y : α} {c : ℝ≥0} : edist x y ≤ c ↔ nndist x y ≤ c

{α : Type u}
[PseudoMetricSpace α]
{x y : α}
{c : ℝ≥0}


/-- A general sufficient condition for bounding `levyProkhorovEDist` from above. -/
lemma levyProkhorovEDist_le_of_forall_add_pos_le (μ ν : Measure Ω) (δ : ℝ≥0∞)
    (h : ∀ ε B, 0 < ε → ε < ∞ → MeasurableSet B →
      μ B ≤ ν (thickening (δ + ε).toReal B) + δ + ε ∧
      ν B ≤ μ (thickening (δ + ε).toReal B) + δ + ε) :
    levyProkhorovEDist μ ν ≤ δ

(h :
  ∀ (ε : ℝ≥0∞) (B : Set Ω),
    0 < ε →
      ε < ⊤ →
        MeasurableSet B →
          μ B ≤ ν (Metric.thickening (δ + ε).toReal B) + δ + ε ∧ ν B ≤ μ (Metric.thickening (δ + ε).toReal B) + δ + ε)

MeasureTheory.levyProkhorovEDist μ ν ≤ δ


theorem HasDerivWithinAt.cpow_const (hf : HasDerivWithinAt f f' s x)
    (h0 : f x ∈ slitPlane) :
    HasDerivWithinAt (fun x => f x ^ c) (c * f x ^ (c - 1) * f') s x

{f : ℂ → ℂ}
{s : Set ℂ}
{f' x c : ℂ}
(hf : HasDerivWithinAt f f' s x)
(h0 : f x ∈ Complex.slitPlane)


@[simp]
theorem toOuterMeasure_apply_inter_support :
    p.toOuterMeasure (s ∩ p.support) = p.toOuterMeasure s


@[to_additive (attr := ext)]
theorem ext (h : ∀ a, f a = g a) : f = g

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[AddZeroClass α]
[AddZeroClass β]
{f g : α →+o β}
(h : ∀ (a : α), f a = g a)


@[simp]
theorem integral_smul {𝕜 : Type*} [RCLike 𝕜] [NormedSpace 𝕜 E] [SMulCommClass 𝕜 ℂ E] (a : 𝕜)
    (f : ℂ → E) (c : ℂ) (R : ℝ) : (∮ z in C(c, R), a • f z) = a • ∮ z in C(c, R), f z

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{𝕜 : Type u_2}
[RCLike 𝕜]
[NormedSpace 𝕜 E]
[SMulCommClass 𝕜 ℂ E]
(a : 𝕜)
(f : ℂ → E)
(c : ℂ)
(R : ℝ)

(∮ (z : ℂ) in C(c, R), a • f z) = a • ∮ (z : ℂ) in C(c, R), f z


@[simp]
theorem inr_smul [Zero R] [Zero S] [SMulWithZero S R] [SMul S A] (r : S) (m : A) :
    (↑(r • m) : Unitization R A) = r • (m : Unitization R A)

{S : Type u_2}
(R : Type u_3)
{A : Type u_4}
[Zero R]
[Zero S]
[SMulWithZero S R]
[SMul S A]
(r : S)
(m : A)


theorem Squarefree.ne_zero [MonoidWithZero R] [Nontrivial R] {m : R} (hm : Squarefree (m : R)) :
    m ≠ 0

{R : Type u_1}
[MonoidWithZero R]
[Nontrivial R]
{m : R}
(hm : Squarefree m)


theorem results_of_terminates' (s : Computation α) [T : Terminates s] {a} (h : a ∈ s) :
    Results s a (length s)

{α : Type u}
(s : Computation α)
[T : s.Terminates]
{a : α}
(h : a ∈ s)


lemma eq_iff_eq_of_lt_iff_lt_of_gt_iff_gt {x' y' : α}
    (ltc : (x < y) ↔ (x' < y')) (gtc : (y < x) ↔ (y' < x')) :
    x = y ↔ x' = y'

{α : Type u_2}
[LinearOrder α]
{x y x' y' : α}
(ltc : x < y ↔ x' < y')
(gtc : y < x ↔ y' < x')


protected theorem add_mem_iff_right : x ∈ p → (x + y ∈ p ↔ y ∈ p)

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
{module_M : Module R M}
(p : Submodule R M)
{x y : M}


@[simp]
theorem natDegree_iterate_comp (k : ℕ) :
    (p.comp^[k] q).natDegree = p.natDegree ^ k * q.natDegree

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
{p q : R[X]}
(k : ℕ)


theorem memℓp_zero_iff {f : ∀ i, E i} : Memℓp f 0 ↔ Set.Finite { i | f i ≠ 0 }

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
{f : (i : α) → E i}


@[simp] lemma mod_succ (n : ℕ) : n % n.succ = n


theorem filter_product_right (q : β → Prop) [DecidablePred q] :
    ((s ×ˢ t).filter fun x : α × β => q x.2) = s ×ˢ t.filter q

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
(q : β → Prop)
[DecidablePred q]

Finset.filter (fun x => q x.2) (s ×ˢ t) = s ×ˢ Finset.filter q t


theorem IsUnit.neg [Monoid α] [HasDistribNeg α] {a : α} : IsUnit a → IsUnit (-a)

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


@[simp]
lemma τ₁_ofEpiOfIsIsoOfMono_f' (φ : S₁ ⟶ S₂) (h : LeftHomologyData S₁)
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] : φ.τ₁ ≫ (ofEpiOfIsIsoOfMono φ h).f' = h.f'

CategoryTheory.CategoryStruct.comp φ.τ₁ (CategoryTheory.ShortComplex.LeftHomologyData.ofEpiOfIsIsoOfMono φ h).f' = h.f'


@[simp, reassoc]
theorem braiding_inv_tensor_left (X Y Z : C) :
    (β_ (X ⊗ Y) Z).inv  =
      (α_ Z X Y).inv ≫ (β_ X Z).inv ▷ Y ≫ (α_ X Z Y).hom ≫
        X ◁ (β_ Y Z).inv ≫ (α_ X Y Z).inv

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


@[simp]
theorem LinearIsometryEquiv.integrable_comp_iff {φ : α → H} (L : H ≃ₗᵢ[𝕜] E) :
    Integrable (fun a : α ↦ L (φ a)) μ ↔ Integrable φ μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_5}
[NormedAddCommGroup E]
{𝕜 : Type u_6}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
{H : Type u_7}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{φ : α → H}
(L : H ≃ₗᵢ[𝕜] E)

MeasureTheory.Integrable (fun a => L (φ a)) μ ↔ MeasureTheory.Integrable φ μ


/-- Let `X` be a normal paracompact topological space (e.g., any extended metric space). Let `E` be
a topological real vector space. Let `t : X → Set E` be a family of convex sets. Suppose that for
each point `x : X`, there exists a neighborhood `U ∈ 𝓝 X` and a function `g : X → E` that is
continuous on `U` and sends each `y ∈ U` to a point of `t y`. Then there exists a continuous map
`g : C(X, E)` such that `g x ∈ t x` for all `x`. See also
`exists_continuous_forall_mem_convex_of_local_const`. -/
theorem exists_continuous_forall_mem_convex_of_local (ht : ∀ x, Convex ℝ (t x))
    (H : ∀ x : X, ∃ U ∈ 𝓝 x, ∃ g : X → E, ContinuousOn g U ∧ ∀ y ∈ U, g y ∈ t y) :
    ∃ g : C(X, E), ∀ x, g x ∈ t x

(H : ∀ (x : X), ∃ U ∈ 𝓝 x, ∃ g, ContinuousOn g U ∧ ∀ y ∈ U, g y ∈ t y)


/-- Define an embedding `(Π a : α, β a) ↪ (Π a : α, γ a)` from a family of embeddings
`e : Π a, (β a ↪ γ a)`. This embedding sends `f` to `fun a ↦ e a (f a)`. -/
@[simps]
def piCongrRight {α : Sort*} {β γ : α → Sort*} (e : ∀ a, β a ↪ γ a) : (∀ a, β a) ↪ ∀ a, γ a

{α : Sort u_1}
{β : α → Sort u_2}
{γ : α → Sort u_3}
(e : (a : α) → β a ↪ γ a)
(f : (a : α) → β a)
(a : α)

(Function.Embedding.piCongrRight e) f a = (e a) (f a)


/-- When both maps `S.f` and `S.g` of a short complex `S` are zero, this is the homology map
data (for the identity of `S`) which relates the homology data
`HomologyData.ofIsLimitKernelFork` and `ofZeros` . -/
@[simps]
def compatibilityOfZerosOfIsLimitKernelFork (hf : S.f = 0) (hg : S.g = 0)
    (c : KernelFork S.g) (hc : IsLimit c) :
    HomologyMapData (𝟙 S)
      (HomologyData.ofIsLimitKernelFork S hf c hc)
      (HomologyData.ofZeros S hf hg)

(c : CategoryTheory.Limits.KernelFork S.g)

(CategoryTheory.ShortComplex.HomologyMapData.compatibilityOfZerosOfIsLimitKernelFork hf hg c hc).left =
  CategoryTheory.ShortComplex.LeftHomologyMapData.compatibilityOfZerosOfIsLimitKernelFork S hf hg c hc


@[simp]
theorem map_map {α β γ : Type*} {n : ℕ} (g : β → γ) (f : α → β) (s : Sym α n) :
    Sym.map g (Sym.map f s) = Sym.map (g ∘ f) s

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
{n : ℕ}
(g : β → γ)
(f : α → β)
(s : Sym α n)


theorem biInter_basis_nhds [T1Space X] {ι : Sort*} {p : ι → Prop} {s : ι → Set X} {x : X}
    (h : (𝓝 x).HasBasis p s) : ⋂ (i) (_ : p i), s i = {x}

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{ι : Sort u_3}
{p : ι → Prop}
{s : ι → Set X}
{x : X}
(h : (𝓝 x).HasBasis p s)


/-- A monoidal natural transformation is a natural transformation between (lax) monoidal functors
additionally satisfying:
`F.μ X Y ≫ app (X ⊗ Y) = (app X ⊗ app Y) ≫ G.μ X Y`
-/
@[ext]
structure MonoidalNatTrans (F G : LaxMonoidalFunctor C D) extends
  NatTrans F.toFunctor G.toFunctor where
  /-- The unit condition for a monoidal natural transformation. -/
  unit : F.ε ≫ app (𝟙_ C) = G.ε := by aesop_cat
  /-- The tensor condition for a monoidal natural transformation. -/
  tensor : ∀ X Y, F.μ _ _ ≫ app (X ⊗ Y) = (app X ⊗ app Y) ≫ G.μ _ _ := by aesop_cat

{F G : CategoryTheory.LaxMonoidalFunctor C D}

(self : CategoryTheory.MonoidalNatTrans F G)

F.μ X Y ≫ self.app (CategoryTheory.MonoidalCategory.tensorObj X Y) =
  CategoryTheory.MonoidalCategory.tensorHom (self.app X) (self.app Y) ≫ G.μ X Y


theorem finset_sup_apply_le {p : ι → Seminorm 𝕜 E} {s : Finset ι} {x : E} {a : ℝ} (ha : 0 ≤ a)
    (h : ∀ i, i ∈ s → p i x ≤ a) : s.sup p x ≤ a

{𝕜 : Type u_3}
{E : Type u_7}
{ι : Type u_12}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : ι → Seminorm 𝕜 E}
{s : Finset ι}
{x : E}
{a : ℝ}
(ha : 0 ≤ a)
(h : ∀ i ∈ s, (p i) x ≤ a)


theorem toSubgraph_adj_getVert {u v} (w : G.Walk u v) {i : ℕ} (hi : i < w.length) :
    w.toSubgraph.Adj (w.getVert i) (w.getVert (i + 1))

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(w : G.Walk u v)
{i : ℕ}
(hi : i < w.length)


/-- `MulOpposite.op` as a homeomorphism. -/
@[to_additive (attr := simps!) "`AddOpposite.op` as a homeomorphism."]
def opHomeomorph : M ≃ₜ Mᵐᵒᵖ

∀ (a : M), MulOpposite.opHomeomorph a = MulOpposite.op a


@[to_additive]
theorem mem_smul_set_iff_inv_smul_mem : x ∈ a • A ↔ a⁻¹ • x ∈ A

{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[AddAction α β]
{A : Set β}
{a : α}
{x : β}


@[to_additive]
theorem isometry_mul_right [Mul M] [PseudoEMetricSpace M] [IsometricSMul Mᵐᵒᵖ M] (a : M) :
    Isometry fun x => x * a

{M : Type u}
[Mul M]
[PseudoEMetricSpace M]
[IsometricSMul Mᵐᵒᵖ M]
(a : M)


/-- If `f` is locally integrable, decays exponentially at infinity, and is `O(x ^ (-b))` at 0, then
its Mellin transform is holomorphic on `b < s.re`. -/
theorem mellin_differentiableAt_of_isBigO_rpow_exp [NormedSpace ℂ E] {a b : ℝ}
    (ha : 0 < a) {f : ℝ → E} {s : ℂ} (hfc : LocallyIntegrableOn f <| Ioi 0)
    (hf_top : f =O[atTop] fun t => exp (-a * t)) (hf_bot : f =O[𝓝[>] 0] (· ^ (-b)))
    (hs_bot : b < s.re) : DifferentiableAt ℂ (mellin f) s

(hfc : MeasureTheory.LocallyIntegrableOn f (Set.Ioi 0) MeasureTheory.volume)

(hf_top : f =O[Filter.atTop] fun t => rexp (-a * t))


/-- A functor `F` is continuous if the precomposition with `F.op` sends sheaves of `Type t`
to sheaves. -/
class IsContinuous : Prop where
  op_comp_isSheafOfTypes (G : SheafOfTypes.{t} K) : Presieve.IsSheaf J (F.op ⋙ G.val)

{J : CategoryTheory.GrothendieckTopology C}

{K : CategoryTheory.GrothendieckTopology D}

CategoryTheory.Presieve.IsSheaf J (F.op.comp G.val)


theorem QuotientMap.continuous_lift_prod_left (hf : QuotientMap f) {g : X × Y → Z}
    (hg : Continuous fun p : X₀ × Y => g (f p.1, p.2)) : Continuous g

(hg : Continuous fun p => g (f p.1, p.2))


@[to_additive (attr := simp)]
theorem period_inv (g : G) (a : α) : period g⁻¹ a = period g a

{α : Type v}
{G : Type u}
[AddGroup G]
[AddAction G α]
(g : G)
(a : α)

AddAction.period (-g) a = AddAction.period g a


/-- The class number of a principal ideal domain is `1`. -/
theorem card_classGroup_eq_one [IsPrincipalIdealRing R] : Fintype.card (ClassGroup R) = 1

{R : Type u_1}
[CommRing R]
[IsDomain R]
[IsPrincipalIdealRing R]


/-- Sum of types is commutative up to an equivalence. This is `Sum.swap` as an equivalence. -/
@[simps (config := .asFn) apply]
def sumComm (α β) : α ⊕ β ≃ β ⊕ α


theorem integrable_comp_mul_right_iff (g : ℝ → F) {R : ℝ} (hR : R ≠ 0) :
    (Integrable fun x => g (x * R)) ↔ Integrable g

{F : Type u_1}
[NormedAddCommGroup F]
(g : ℝ → F)
{R : ℝ}
(hR : R ≠ 0)

MeasureTheory.Integrable (fun x => g (x * R)) MeasureTheory.volume ↔ MeasureTheory.Integrable g MeasureTheory.volume


theorem fderiv_zero_of_not_differentiableAt (h : ¬DifferentiableAt 𝕜 f x) : fderiv 𝕜 f x = 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
(h : ¬DifferentiableAt 𝕜 f x)


@[mono]
protected theorem leftLim : Antitone (leftLim f)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Antitone f)


theorem IsBigO.isBoundedUnder_le {c : F} (h : f =O[l] fun _x => c) :
    IsBoundedUnder (· ≤ ·) l (norm ∘ f)

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{l : Filter α}
{c : F}
(h : f =O[l] fun _x => c)

Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l (norm ∘ f)


theorem mul_le_left {x y : Icc (0 : α) 1} : x * y ≤ x

{α : Type u_1}
[OrderedSemiring α]
{x y : ↑(Set.Icc 0 1)}


@[to_additive]
theorem innerRegular_inv_iff : μ.inv.InnerRegular ↔ μ.InnerRegular

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
{μ : MeasureTheory.Measure G}
[Group G]
[TopologicalGroup G]


@[to_additive (attr := simp)]
theorem closure_closure_coe_preimage {s : Set M} : closure (((↑) : closure s → M) ⁻¹' s) = ⊤

{M : Type u_1}
[MulOneClass M]
{s : Set M}

Submonoid.closure (Subtype.val ⁻¹' s) = ⊤


/-- The **Heine–Borel theorem**: In a proper space, the closure of a bounded set is compact. -/
theorem _root_.Bornology.IsBounded.isCompact_closure [ProperSpace α] (h : IsBounded s) :
    IsCompact (closure s)

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
[ProperSpace α]
(h : Bornology.IsBounded s)


@[to_additive (attr := simp)]
theorem op_ofNat [NatCast α] (n : ℕ) [n.AtLeastTwo] :
    op (no_index (OfNat.ofNat n : α)) = OfNat.ofNat n

{α : Type u_1}
[NatCast α]
(n : ℕ)
[n.AtLeastTwo]

AddOpposite.op (OfNat.ofNat n) = OfNat.ofNat n


theorem nnnorm_eq_sum {p : ℝ≥0∞} [Fact (1 ≤ p)] {β : ι → Type*} (hp : p ≠ ∞)
    [∀ i, SeminormedAddCommGroup (β i)] (f : PiLp p β) :
    ‖f‖₊ = (∑ i, ‖f i‖₊ ^ p.toReal) ^ (1 / p.toReal)

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

‖f‖₊ = (∑ i : ι, ‖f i‖₊ ^ p.toReal) ^ (1 / p.toReal)


@[simp]
theorem Ioc_union_Ico_eq_Ioo (h₁ : a < b) (h₂ : b < c) : Ioc a b ∪ Ico b c = Ioo a c

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


theorem equiv_pure_of_mem {s : Computation α} {a} (h : a ∈ s) : s ~ pure a

{α : Type u}
{s : Computation α}
{a : α}
(h : a ∈ s)


@[to_additive]
theorem measure_ne_zero_iff_nonempty_of_isMulLeftInvariant [Regular μ] (hμ : μ ≠ 0) {s : Set G}
    (hs : IsOpen s) : μ s ≠ 0 ↔ s.Nonempty

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
{μ : MeasureTheory.Measure G}
[Group G]
[TopologicalGroup G]
[μ.IsMulLeftInvariant]
[μ.Regular]
(hμ : μ ≠ 0)
{s : Set G}
(hs : IsOpen s)


@[simp]
theorem length_sublists' : ∀ l : List α, length (sublists' l) = 2 ^ length l


@[simp]
lemma ε_app_f_zero [Limits.HasZeroObject C] (X : SimplicialObject.Augmented C) :
    (ε.app X).f 0 = X.hom.app (op [0])

(X : CategoryTheory.SimplicialObject.Augmented C)

(AlgebraicTopology.AlternatingFaceMapComplex.ε.app X).f 0 = X.hom.app (Opposite.op [0])


@[simp]
theorem distortion_bot (I : Box ι) : distortion (⊥ : Prepartition I) = 0

{ι : Type u_1}
[Fintype ι]
(I : BoxIntegral.Box ι)


theorem element_of_chain_eq_pow_second_of_chain {q r : Associates M} {n : ℕ} (hn : n ≠ 0)
    {c : Fin (n + 1) → Associates M} (h₁ : StrictMono c) (h₂ : ∀ {r}, r ≤ q ↔ ∃ i, r = c i)
    (hr : r ∣ q) (hq : q ≠ 0) : ∃ i : Fin (n + 1), r = c 1 ^ (i : ℕ)

(h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i)


protected theorem MulAction.bijective₀ (ha : a ≠ 0) : Function.Bijective (a • · : β → β)

{α : Type u}
{β : Type v}
[GroupWithZero α]
[MulAction α β]
{a : α}
(ha : a ≠ 0)


theorem isList_of_mem {a : Lists α} : ∀ {l : Lists α}, a ∈ l → IsList l


nonrec theorem ContinuousWithinAt.div (hf : ContinuousWithinAt f s a)
    (hg : ContinuousWithinAt g s a) (h₀ : g a ≠ 0) : ContinuousWithinAt (f / g) s a

{α : Type u_1}
{G₀ : Type u_3}
[GroupWithZero G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
[ContinuousMul G₀]
{f g : α → G₀}
[TopologicalSpace α]
{s : Set α}
{a : α}
(hf : ContinuousWithinAt f s a)
(hg : ContinuousWithinAt g s a)
(h₀ : g a ≠ 0)


theorem X_dvd_iff_modMonomial_eq_zero {i : σ} {x : MvPolynomial σ R} :
    X i ∣ x ↔ x %ᵐᵒⁿᵒᵐⁱᵃˡ Finsupp.single i 1 = 0

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
{i : σ}
{x : MvPolynomial σ R}

MvPolynomial.X i ∣ x ↔ x.modMonomial (Finsupp.single i 1) = 0


theorem _root_.Set.PairwiseDisjoint.exists_mem_filter {ι : Type*} {l : ι → Filter α} {t : Set ι}
    (hd : t.PairwiseDisjoint l) (ht : t.Finite) :
    ∃ s : ι → Set α, (∀ i, s i ∈ l i) ∧ t.PairwiseDisjoint s

{α : Type u}
{ι : Type u_2}
{l : ι → Filter α}
{t : Set ι}
(hd : t.PairwiseDisjoint l)
(ht : t.Finite)

∃ s, (∀ (i : ι), s i ∈ l i) ∧ t.PairwiseDisjoint s


theorem exists_of_modifyNth (f : α → α) {n} {l : List α} (h : n < l.length) :
    ∃ l₁ a l₂, l = l₁ ++ a :: l₂ ∧ l₁.length = n ∧ modifyNth f n l = l₁ ++ f a :: l₂

{α : Type u_1}
(f : α → α)
{n : Nat}
{l : List α}
(h : n < l.length)

∃ l₁ a l₂, l = l₁ ++ a :: l₂ ∧ l₁.length = n ∧ List.modifyNth f n l = l₁ ++ f a :: l₂


/-- When `S₁.g` and `S₂.g` are zero and we have chosen colimit cokernel coforks `c₁` and `c₂`
for `S₁.f` and `S₂.f` respectively, the action on homology of a morphism `φ : S₁ ⟶ S₂` of
short complexes is given by the unique morphism `f : c₁.pt ⟶ c₂.pt` such that
`φ.τ₂ ≫ c₂.π = c₁.π ≫ f`. -/
@[simps]
def ofIsColimitCokernelCofork (φ : S₁ ⟶ S₂)
    (hg₁ : S₁.g = 0) (c₁ : CokernelCofork S₁.f) (hc₁ : IsColimit c₁)
    (hg₂ : S₂.g = 0) (c₂ : CokernelCofork S₂.f) (hc₂ : IsColimit c₂) (f : c₁.pt ⟶ c₂.pt)
    (comm : φ.τ₂ ≫ c₂.π = c₁.π ≫ f) :
    HomologyMapData φ (HomologyData.ofIsColimitCokernelCofork S₁ hg₁ c₁ hc₁)
      (HomologyData.ofIsColimitCokernelCofork S₂ hg₂ c₂ hc₂)

(c₁ : CategoryTheory.Limits.CokernelCofork S₁.f)

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

(c₂ : CategoryTheory.Limits.CokernelCofork S₂.f)

(hc₂ : CategoryTheory.Limits.IsColimit c₂)

(comm :
  CategoryTheory.CategoryStruct.comp φ.τ₂ (CategoryTheory.Limits.Cofork.π c₂) =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Cofork.π c₁) f)

(CategoryTheory.ShortComplex.HomologyMapData.ofIsColimitCokernelCofork φ hg₁ c₁ hc₁ hg₂ c₂ hc₂ f comm).left =
  CategoryTheory.ShortComplex.LeftHomologyMapData.ofIsColimitCokernelCofork φ hg₁ c₁ hc₁ hg₂ c₂ hc₂ f comm


@[simp]
theorem zipLeft_nil_right : zipLeft as ([] : List β) = as.map fun a => (a, none)

as.zipLeft [] = List.map (fun a => (a, none)) as


theorem succNthDefiningPoly_degree [IsDomain k] (n : ℕ) (a₁ a₂ : 𝕎 k) (bs : Fin (n + 1) → k)
    (ha₁ : a₁.coeff 0 ≠ 0) (ha₂ : a₂.coeff 0 ≠ 0) :
    (succNthDefiningPoly p n a₁ a₂ bs).degree = p

(p : ℕ)
[hp : Fact (Nat.Prime p)]
{k : Type u_1}
[CommRing k]
[CharP k p]
[IsDomain k]
(n : ℕ)
(a₁ a₂ : WittVector p k)
(bs : Fin (n + 1) → k)
(ha₁ : a₁.coeff 0 ≠ 0)
(ha₂ : a₂.coeff 0 ≠ 0)

(WittVector.RecursionMain.succNthDefiningPoly p n a₁ a₂ bs).degree = ↑p


@[simps]
noncomputable instance : Category.{w} (ShrinkHoms C)

[CategoryTheory.LocallySmall.{w, v, u} C]

∀ {X Y Z : CategoryTheory.ShrinkHoms.{u} C} (f : X ⟶ Y) (g : Y ⟶ Z),
  f ≫ g =
    (equivShrink (X.fromShrinkHoms ⟶ Z.fromShrinkHoms))
      ((equivShrink (X.fromShrinkHoms ⟶ Y.fromShrinkHoms)).symm f ≫
        (equivShrink (Y.fromShrinkHoms ⟶ Z.fromShrinkHoms)).symm g)


nonrec theorem ContinuousWithinAt.div_const {a} (hf : ContinuousWithinAt f s a) (y : G₀) :
    ContinuousWithinAt (fun x => f x / y) s a

{α : Type u_1}
{G₀ : Type u_3}
[DivInvMonoid G₀]
[TopologicalSpace G₀]
[ContinuousMul G₀]
{f : α → G₀}
{s : Set α}
[TopologicalSpace α]
{a : α}
(hf : ContinuousWithinAt f s a)
(y : G₀)


@[simp]
theorem nnnorm_algebraMap' [NormOneClass 𝕜'] (x : 𝕜) : ‖algebraMap 𝕜 𝕜' x‖₊ = ‖x‖₊

{𝕜 : Type u_1}
(𝕜' : Type u_2)
[NormedField 𝕜]
[SeminormedRing 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormOneClass 𝕜']
(x : 𝕜)


theorem kahler_apply_apply (x y : E) : o.kahler x y = ⟪x, y⟫ + ω x y • Complex.I

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

(o.kahler x) y = ↑⟪x, y⟫_ℝ + (o.areaForm x) y • Complex.I


theorem outerMeasure_exists_compact {U : Opens G} (hU : μ.outerMeasure U ≠ ∞) {ε : ℝ≥0}
    (hε : ε ≠ 0) : ∃ K : Compacts G, (K : Set G) ⊆ U ∧ μ.outerMeasure U ≤ μ.outerMeasure K + ε

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
[R1Space G]
{U : TopologicalSpace.Opens G}
(hU : μ.outerMeasure ↑U ≠ ⊤)
{ε : ℝ≥0}
(hε : ε ≠ 0)

∃ K, ↑K ⊆ ↑U ∧ μ.outerMeasure ↑U ≤ μ.outerMeasure ↑K + ↑ε


@[to_additive] lemma topology_eq_inf :
    instTopologicalSpaceUnits =
      .induced (val : Mˣ → M) ‹_› ⊓ .induced (fun u ↦ ↑u⁻¹ : Mˣ → M) ‹_›

{M : Type u_1}
[TopologicalSpace M]
[Monoid M]

Units.instTopologicalSpaceUnits =
  TopologicalSpace.induced Units.val inst✝ ⊓ TopologicalSpace.induced (fun u => ↑u⁻¹) inst✝


theorem Ioo_zero_top_eq_iUnion_Ico_zpow {y : ℝ≥0∞} (hy : 1 < y) (h'y : y ≠ ⊤) :
    Ioo (0 : ℝ≥0∞) (∞ : ℝ≥0∞) = ⋃ n : ℤ, Ico (y ^ n) (y ^ (n + 1))

{y : ENNReal}
(hy : 1 < y)
(h'y : y ≠ ⊤)

Set.Ioo 0 ⊤ = ⋃ n, Set.Ico (y ^ n) (y ^ (n + 1))


/-- Reformulation of the reflection formula in terms of `Gammaℝ`. -/
lemma Gammaℝ_one_sub_mul_Gammaℝ_one_add (s : ℂ) :
    Gammaℝ (1 - s) * Gammaℝ (1 + s) = (cos (π * s / 2))⁻¹

(1 - s).Gammaℝ * (1 + s).Gammaℝ = (Complex.cos (↑π * s / 2))⁻¹


@[simp]
theorem coe_toLinearEquiv (e : E ≃ₛₗᵢ[σ₁₂] E₂) : ⇑e.toLinearEquiv = e

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


theorem degree_lt_degree_mul_X (hp : p ≠ 0) : p.degree < (p * X).degree

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


theorem monad_seq_eq_seq {α β : Type u} (q : PMF (α → β)) (p : PMF α) : q <*> p = q.seq p


/-- Every value of the ordinal approximants are greater or equal than every fixed point of f
  that is smaller then the initial value -/
lemma le_gfpApprox_of_mem_fixedPoints {a : α}
    (h_a : a ∈ fixedPoints f) (h_le_init : a ≤ x) (i : Ordinal) : a ≤ gfpApprox f x i

{α : Type u}
[CompleteLattice α]
(f : α →o α)
(x : α)
{a : α}
(h_a : a ∈ Function.fixedPoints ⇑f)
(h_le_init : a ≤ x)
(i : Ordinal.{u})


theorem infsep_pos : 0 < s.infsep ↔ 0 < s.einfsep ∧ s.einfsep < ∞

0 < s.infsep ↔ 0 < s.einfsep ∧ s.einfsep < ⊤


@[simp]
theorem tan_pi_div_six : tan (π / 6) = 1 / sqrt 3


theorem self_eq_zero (H : B.IsAlt) (x : M) : B x x = 0

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
(H : B.IsAlt)
(x : M)


theorem smul [NormedField 𝕜] [NormedSpace 𝕜 β] (hT : DominatedFinMeasAdditive μ T C) (c : 𝕜) :
    DominatedFinMeasAdditive μ (fun s => c • T s) (‖c‖ * C)

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

MeasureTheory.DominatedFinMeasAdditive μ (fun s => c • T s) (‖c‖ * C)


@[simp]
theorem codRestrict_top (p) (f : r ≺i s) (H H₂) : (codRestrict p f H H₂).top = ⟨f.top, H₂⟩

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(p : Set β)
(f : r ≺i s)
(H : ∀ (a : α), f.toRelEmbedding a ∈ p)
(H₂ : f.top ∈ p)

(PrincipalSeg.codRestrict p f H H₂).top = ⟨f.top, H₂⟩


theorem hasBasis_generate (s : Set (Set α)) :
    (generate s).HasBasis (fun t => Set.Finite t ∧ t ⊆ s) fun t => ⋂₀ t

(Filter.generate s).HasBasis (fun t => t.Finite ∧ t ⊆ s) fun t => ⋂₀ t


theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) :
    HasFPowerSeriesAt f p x

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


@[to_additive] lemma prod_subset {s : Finset ι} {f : ι → α} (h : ∀ i, f i ≠ 1 → i ∈ s) :
    ∏ i ∈ s, f i = ∏ i, f i

{ι : Type u_6}
{α : Type u_8}
[Fintype ι]
[CommMonoid α]
{s : Finset ι}
{f : ι → α}
(h : ∀ (i : ι), f i ≠ 1 → i ∈ s)


@[elab_as_elim]
theorem set_cases {p : Set α → Prop} (h0 : p ∅) (h1 : p univ) (s) : p s

{α : Type u_1}
[Subsingleton α]
{p : Set α → Prop}
(h0 : p ∅)
(h1 : p Set.univ)
(s : Set α)


theorem utf8Len_le_of_prefix (h : cs₁ <+: cs₂) : utf8Len cs₁ ≤ utf8Len cs₂


/-- The ternary Cantor set is a subset of [0,1]. -/
lemma cantorSet_subset_unitInterval : cantorSet ⊆ Set.Icc 0 1


theorem eval_ker : LinearMap.ker (eval K V) = ⊥

(K : Type uK)
(V : Type uV)
[CommRing K]
[AddCommGroup V]
[Module K V]
[Module.Free K V]

LinearMap.ker (Module.Dual.eval K V) = ⊥


@[simp]
theorem integrable_zero_measure {_ : MeasurableSpace α} {f : α → β} :
    Integrable f (0 : Measure α)

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]

∀ {x : MeasurableSpace α} {f : α → β}, MeasureTheory.Integrable f 0


theorem _root_.Pairwise.exists_mem_filter_of_disjoint {ι : Type*} [Finite ι] {l : ι → Filter α}
    (hd : Pairwise (Disjoint on l)) :
    ∃ s : ι → Set α, (∀ i, s i ∈ l i) ∧ Pairwise (Disjoint on s)

{α : Type u}
{ι : Type u_2}
[Finite ι]
{l : ι → Filter α}
(hd : Pairwise (Disjoint on l))

∃ s, (∀ (i : ι), s i ∈ l i) ∧ Pairwise (Disjoint on s)


/-- The weighted sum is unaffected by changing the weights to the
corresponding indicator function and adding points to the set. -/
theorem weightedVSubOfPoint_indicator_subset (w : ι → k) (p : ι → P) (b : P) {s₁ s₂ : Finset ι}
    (h : s₁ ⊆ s₂) :
    s₁.weightedVSubOfPoint p b w = s₂.weightedVSubOfPoint p b (Set.indicator (↑s₁) w)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(w : ι → k)
(p : ι → P)
(b : P)
{s₁ s₂ : Finset ι}
(h : s₁ ⊆ s₂)

(s₁.weightedVSubOfPoint p b) w = (s₂.weightedVSubOfPoint p b) ((↑s₁).indicator w)


@[simp]
theorem _root_.Submodule.range_subtypeL (p : Submodule R₁ M₁) : range p.subtypeL = p

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
(p : Submodule R₁ M₁)


@[simp]
theorem map_id' (s : Multiset α) : map (fun x => x) s = s


@[to_additive (attr := simp)]
theorem one_comp [One γ] (g : C(α, β)) : (1 : C(β, γ)).comp g = 1

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


theorem enoughProjectives_of_enoughInjectives_op [EnoughInjectives Cᵒᵖ] : EnoughProjectives C

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


private theorem enumOrd_mem_aux (hS : Unbounded (· < ·) S) (o) :
    enumOrd S o ∈ S ∩ Set.Ici (blsub.{u, u} o fun c _ => enumOrd S c)

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

Ordinal.enumOrd S o ∈ S ∩ Set.Ici (o.blsub fun c x => Ordinal.enumOrd S c)


@[simp]
theorem comp_apply (g : β →ₙ+* γ) (f : α →ₙ+* β) (x : α) : g.comp f x = g (f x)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
[NonUnitalNonAssocSemiring γ]
(g : β →ₙ+* γ)
(f : α →ₙ+* β)
(x : α)


theorem Btw.btw.antisymm {a b c : α} (h : btw a b c) : btw c b a → a = b ∨ b = c ∨ c = a

{α : Type u_1}
[CircularPartialOrder α]
{a b c : α}
(h : btw a b c)


theorem EuclideanSpace.inner_piLp_equiv_symm (x y : ι → 𝕜) :
    ⟪(WithLp.equiv 2 _).symm x, (WithLp.equiv 2 _).symm y⟫ = Matrix.dotProduct (star x) y

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
[Fintype ι]
(x y : ι → 𝕜)

⟪(WithLp.equiv 2 (ι → 𝕜)).symm x, (WithLp.equiv 2 (ι → 𝕜)).symm y⟫_𝕜 = Matrix.dotProduct (star x) y


theorem exp_series_hasSum_exp' (x : 𝔸) : HasSum (fun n => (n !⁻¹ : 𝕂) • x ^ n) (exp 𝕂 x)

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

HasSum (fun n => (↑n.factorial)⁻¹ • x ^ n) (NormedSpace.exp 𝕂 x)


theorem nnnorm_inner_le_nnnorm (x y : E) : ‖⟪x, y⟫‖₊ ≤ ‖x‖₊ * ‖y‖₊

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y : E)

‖⟪x, y⟫_𝕜‖₊ ≤ ‖x‖₊ * ‖y‖₊


theorem iCondIndepSets.piiUnionInter_of_not_mem {π : ι → Set (Set Ω)} {a : ι} {S : Finset ι}
    (hp_ind : iCondIndepSets m' hm' π μ) (haS : a ∉ S) :
    CondIndepSets m' hm' (piiUnionInter π S) (π a) μ

(hp_ind : ProbabilityTheory.iCondIndepSets m' hm' π μ)

ProbabilityTheory.CondIndepSets m' hm' (piiUnionInter π ↑S) (π a) μ


@[simp]
theorem finRange_eq_nil {n : ℕ} : finRange n = [] ↔ n = 0


theorem _root_.Irreducible.maximalIdeal_eq {ϖ : R} (h : Irreducible ϖ) :
    maximalIdeal R = Ideal.span {ϖ}

{R : Type u}
[CommRing R]
[IsDomain R]
[DiscreteValuationRing R]
{ϖ : R}
(h : Irreducible ϖ)

LocalRing.maximalIdeal R = Ideal.span {ϖ}


theorem pairwiseDisjoint_iUnion {g : ι' → Set ι} (h : Directed (· ⊆ ·) g) :
    (⋃ n, g n).PairwiseDisjoint f ↔ ∀ ⦃n⦄, (g n).PairwiseDisjoint f

{α : Type u_1}
{ι : Type u_4}
{ι' : Type u_5}
[PartialOrder α]
[OrderBot α]
{f : ι → α}
{g : ι' → Set ι}
(h : Directed (fun x x_1 => x ⊆ x_1) g)

(⋃ n, g n).PairwiseDisjoint f ↔ ∀ ⦃n : ι'⦄, (g n).PairwiseDisjoint f


lemma equiv_shift : equiv W L (f.shift a) =
    (L.commShiftIso a).hom.app X ≫ (equiv W L f)⟦a⟧' ≫ (L.commShiftIso a).inv.app Y

[CategoryTheory.Localization.HasSmallLocalizedHom W X Y]

(f : CategoryTheory.Localization.SmallHom W X Y)

[CategoryTheory.Localization.HasSmallLocalizedHom W ((CategoryTheory.shiftFunctor C a).obj X)
    ((CategoryTheory.shiftFunctor C a).obj Y)]

(CategoryTheory.Localization.SmallHom.equiv W L) (f.shift a) =
  CategoryTheory.CategoryStruct.comp ((L.commShiftIso a).hom.app X)
    (CategoryTheory.CategoryStruct.comp
      ((CategoryTheory.shiftFunctor D a).map ((CategoryTheory.Localization.SmallHom.equiv W L) f))
      ((L.commShiftIso a).inv.app Y))


theorem smul_snd (s : S) (a : 𝓜(𝕜, A)) : (s • a).snd = s • a.snd

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
{S : Type u_3}
[Monoid S]
[DistribMulAction S A]
[SMulCommClass 𝕜 S A]
[ContinuousConstSMul S A]
[IsScalarTower S A A]
[SMulCommClass S A A]
(s : S)
(a : 𝓜(𝕜, A))


@[simp]
theorem comp_continuousOn_iff (h : X ≃ₜ Y) (f : Z → X) (s : Set Z) :
    ContinuousOn (h ∘ f) s ↔ ContinuousOn f s

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(h : X ≃ₜ Y)
(f : Z → X)
(s : Set Z)

ContinuousOn (⇑h ∘ f) s ↔ ContinuousOn f s


@[simp]
lemma div_ofNat_re (z : ℂ) (n : ℕ) [n.AtLeastTwo] :
    (z / no_index (OfNat.ofNat n)).re = z.re / OfNat.ofNat n

(z / OfNat.ofNat n).re = z.re / OfNat.ofNat n


@[mono]
theorem nhdsSet_mono (h : s ⊆ t) : 𝓝ˢ s ≤ 𝓝ˢ t

{X : Type u_1}
[TopologicalSpace X]
{s t : Set X}
(h : s ⊆ t)


theorem contMDiffWithinAt_const : ContMDiffWithinAt I I' n (fun _ : M => c) s 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']
{s : Set M}
{x : M}
{n : ℕ∞}
{c : M'}

ContMDiffWithinAt I I' n (fun x => c) s x


lemma mor₂_eq_zero_of_epi₁ (h : Epi T.mor₁) : T.mor₂ = 0

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


theorem IsBigO.prod_left_fst : (fun x => (f' x, g' x)) =O[l] k' → f' =O[l] k'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
{G' : Type u_8}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
[SeminormedAddCommGroup G']
{f' : α → E'}
{g' : α → F'}
{k' : α → G'}
{l : Filter α}


/-- A set `C` is called perfect if it is closed and all of its
points are accumulation points of itself.
Note that we do not require `C` to be nonempty. -/
@[mk_iff perfect_def]
structure Perfect (C : Set α) : Prop where
  closed : IsClosed C
  acc : Preperfect C

{α : Type u_1}
[TopologicalSpace α]
{C : Set α}
(self : Perfect C)


theorem eq_one_of_mul_eq_one_right {a b : Int} (H : 0 ≤ a) (H' : a * b = 1) : a = 1


theorem compl_sdiff_compl : xᶜ \ yᶜ = y \ x

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


theorem splits_of_natDegree_eq_one {f : K[X]} (hf : natDegree f = 1) : Splits i f

{K : Type v}
{L : Type w}
[CommRing K]
[Field L]
(i : K →+* L)
{f : K[X]}
(hf : f.natDegree = 1)


@[field_simps]
lemma four_ne_zero [OfNat α 4] [NeZero (4 : α)] : (4 : α) ≠ 0

{α : Type u_2}
[Zero α]
[OfNat α 4]
[NeZero 4]


@[measurability]
theorem measurableSet_lt [SecondCountableTopology α] {f g : δ → α} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { a | f a < g a }

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[MeasurableSpace δ]
[LinearOrder α]
[OrderClosedTopology α]
[SecondCountableTopology α]
{f g : δ → α}
(hf : Measurable f)
(hg : Measurable g)


@[measurability]
theorem Measurable.prod {f : α → β × γ} (hf₁ : Measurable fun a => (f a).1)
    (hf₂ : Measurable fun a => (f a).2) : Measurable f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
{mγ : MeasurableSpace γ}
{f : α → β × γ}
(hf₁ : Measurable fun a => (f a).1)
(hf₂ : Measurable fun a => (f a).2)


lemma MutuallySingular.singularPart (h : μ ⟂ₘ ν) (ν' : Measure α) :
    μ.singularPart ν' ⟂ₘ ν

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(h : μ ⟂ₘ ν)
(ν' : MeasureTheory.Measure α)


theorem initiallySmall_of_essentiallySmall [EssentiallySmall.{w} J] : InitiallySmall.{w} J

[CategoryTheory.EssentiallySmall.{w, v, u} J]


theorem le_rootMultiplicity_mul {p q : R[X]} (x : R) (hpq : p * q ≠ 0) :
    rootMultiplicity x p + rootMultiplicity x q ≤ rootMultiplicity x (p * q)

{R : Type u}
[CommRing R]
{p q : R[X]}
(x : R)
(hpq : p * q ≠ 0)

Polynomial.rootMultiplicity x p + Polynomial.rootMultiplicity x q ≤ Polynomial.rootMultiplicity x (p * q)


lemma closedEmbedding_cfcAux : ClosedEmbedding hA.cfcAux

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


lemma mk'_smul_mk' (x : R) (m : M) (s t : S) :
    IsLocalization.mk' A x s • mk' f m t = mk' f (x • m) (s * t)

{R : Type u_1}
[CommSemiring R]
{S : Submonoid R}
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
(A : Type u_5)
[CommSemiring A]
[Algebra R A]
[Module A M']
[IsLocalization S A]
[Module R M]
[Module R M']
[IsScalarTower R A M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
(x : R)
(m : M)
(s t : ↥S)

IsLocalization.mk' A x s • IsLocalizedModule.mk' f m t = IsLocalizedModule.mk' f (x • m) (s * t)


theorem tendsto_const_smul_iff₀ {f : β → α} {l : Filter β} {a : α} {c : G₀} (hc : c ≠ 0) :
    Tendsto (fun x => c • f x) l (𝓝 <| c • a) ↔ Tendsto f l (𝓝 a)

{α : Type u_2}
{β : Type u_3}
{G₀ : Type u_4}
[TopologicalSpace α]
[GroupWithZero G₀]
[MulAction G₀ α]
[ContinuousConstSMul G₀ α]
{f : β → α}
{l : Filter β}
{a : α}
{c : G₀}
(hc : c ≠ 0)

Filter.Tendsto (fun x => c • f x) l (𝓝 (c • a)) ↔ Filter.Tendsto f l (𝓝 a)


/-- The identity comonad. -/
@[simps!]
def id : Comonad C

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

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


/-- See note [comp_of_eq lemmas] -/
theorem ContMDiffAt.comp_of_eq {g : M' → M''} {x : M} {y : M'} (hg : ContMDiffAt I' I'' n g y)
    (hf : ContMDiffAt I I' n f x) (hx : f x = y) : ContMDiffAt I I'' n (g ∘ 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']
{E'' : Type u_8}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{H'' : Type u_9}
[TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''}
{M'' : Type u_10}
[TopologicalSpace M'']
[ChartedSpace H'' M'']
{f : M → M'}
{n : ℕ∞}
{g : M' → M''}
{x : M}
{y : M'}
(hg : ContMDiffAt I' I'' n g y)
(hf : ContMDiffAt I I' n f x)
(hx : f x = y)


theorem le_def [LE α] [LE β] {a b : α ⊕ₗ β} : a ≤ b ↔ Lex (· ≤ ·) (· ≤ ·) (ofLex a) (ofLex b)

{α : Type u_1}
{β : Type u_2}
[LE α]
[LE β]
{a b : Lex (α ⊕ β)}

a ≤ b ↔ Sum.Lex (fun x x_1 => x ≤ x_1) (fun x x_1 => x ≤ x_1) (ofLex a) (ofLex b)


theorem toLinearMap_injective {F : Type*} [FunLike F M M₃] [SemilinearMapClass F σ M M₃]
    {f g : F} (h : (f : M →ₛₗ[σ] M₃) = (g : M →ₛₗ[σ] M₃)) :
    f = g

{R : Type u_1}
{S : Type u_6}
{M : Type u_9}
{M₃ : Type u_12}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₃]
[Module R M]
[Module S M₃]
{σ : R →+* S}
{F : Type u_17}
[FunLike F M M₃]
[SemilinearMapClass F σ M M₃]
{f g : F}
(h : ↑f = ↑g)


theorem top_prod (s : Subring S) : (⊤ : Subring R).prod s = s.comap (RingHom.snd R S)

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(s : Subring S)

⊤.prod s = Subring.comap (RingHom.snd R S) s


theorem derivWithin_const_sub (hxs : UniqueDiffWithinAt 𝕜 s x) (c : F) :
    derivWithin (fun y => c - f y) s x = -derivWithin f s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
(hxs : UniqueDiffWithinAt 𝕜 s x)
(c : F)


@[simp]
theorem Iic_union_Ioc_eq_Iic (h : a ≤ b) : Iic a ∪ Ioc a b = Iic b

{α : Type u_1}
[LinearOrder α]
{a b : α}
(h : a ≤ b)


theorem exists_pos_bound_of_bound {V W : Type*} [SeminormedAddCommGroup V]
    [SeminormedAddCommGroup W] {f : V → W} (M : ℝ) (h : ∀ x, ‖f x‖ ≤ M * ‖x‖) :
    ∃ N, 0 < N ∧ ∀ x, ‖f x‖ ≤ N * ‖x‖

{V : Type u_1}
{W : Type u_2}
[SeminormedAddCommGroup V]
[SeminormedAddCommGroup W]
{f : V → W}
(M : ℝ)
(h : ∀ (x : V), ‖f x‖ ≤ M * ‖x‖)


theorem iInter_subset : ∀ (s : ι → Set β) (i : ι), ⋂ i, s i ⊆ s i

{β : Type u_2}
{ι : Sort u_4}
(s : ι → Set β)
(i : ι)


/-- `Multiset.map f` preserves `count` if `f` is injective -/
theorem count_map_eq_count' [DecidableEq β] (f : α → β) (s : Multiset α) (hf : Function.Injective f)
    (x : α) : (s.map f).count (f x) = s.count x

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

Multiset.count (f x) (Multiset.map f s) = Multiset.count x s


@[simp]
theorem forget_obj_hom {f} : ((forget X).obj f).hom = f.arrow

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

((CategoryTheory.MonoOver.forget X).obj f).hom = f.arrow


lemma NumberField.InfinitePlace.isUnramified [IsUnramifiedAtInfinitePlaces k K]
    (w : InfinitePlace K) : IsUnramified k w

(k : Type u_1)
[Field k]
{K : Type u_2}
[Field K]
[Algebra k K]
[IsUnramifiedAtInfinitePlaces k K]
(w : NumberField.InfinitePlace K)


protected theorem pow_succ (n m : Nat) : n^(succ m) = n^m * n


theorem one_le_norm_mul_norm_symm [RingHomIsometric σ₁₂] [Nontrivial E] (e : E ≃SL[σ₁₂] F) :
    1 ≤ ‖(e : E →SL[σ₁₂] F)‖ * ‖(e.symm : F →SL[σ₂₁] E)‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{σ₂₁ : 𝕜₂ →+* 𝕜}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[RingHomIsometric σ₂₁]
[RingHomIsometric σ₁₂]
[Nontrivial E]
(e : E ≃SL[σ₁₂] F)


@[simp]
theorem quot_neg (x : Prequotient F) :
    -- Porting note: Lean can't see `Quot.mk Setoid.r x` is a `ColimitType F` even with type
    -- annotation unless we use `by exact` to change the elaboration order.
    (by exact Quot.mk Setoid.r (neg x) : ColimitType F) = -(by exact Quot.mk Setoid.r x)

{J : Type v}
[CategoryTheory.SmallCategory J]
(F : J ⥤ RingCat)
(x : RingCat.Colimits.Prequotient F)

Quot.mk Setoid.r x.neg = -Quot.mk Setoid.r x


@[simp]
theorem card_pi (f : ι →₀ Finset α) : f.pi.card = f.prod fun i => (f i).card

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


theorem image_image₂_antidistrib {g : γ → δ} {f' : β' → α' → δ} {g₁ : β → β'} {g₂ : α → α'}
    (h_antidistrib : ∀ a b, g (f a b) = f' (g₁ b) (g₂ a)) :
    (image₂ f s t).image g = image₂ f' (t.image g₁) (s.image g₂)

{f : α → β → γ}

(h_antidistrib : ∀ (a : α) (b : β), g (f a b) = f' (g₁ b) (g₂ a))

Finset.image g (Finset.image₂ f s t) = Finset.image₂ f' (Finset.image g₁ t) (Finset.image g₂ s)


theorem Intersecting.ne_bot (hs : s.Intersecting) (ha : a ∈ s) : a ≠ ⊥

{α : Type u_1}
[SemilatticeInf α]
[OrderBot α]
{s : Set α}
{a : α}
(hs : s.Intersecting)
(ha : a ∈ s)


/-- A point `a` is in the closure of `s` iff all basis sets containing `a` intersect `s`. -/
theorem IsTopologicalBasis.mem_closure_iff {b : Set (Set α)} (hb : IsTopologicalBasis b) {s : Set α}
    {a : α} : a ∈ closure s ↔ ∀ o ∈ b, a ∈ o → (o ∩ s).Nonempty

(hb : TopologicalSpace.IsTopologicalBasis b)


@[simp] lemma toFinset_Icc (a b : α) [Fintype (Icc a b)] : (Icc a b).toFinset = Finset.Icc a b

{α : Type u_3}
[Preorder α]
[LocallyFiniteOrder α]
(a b : α)
[Fintype ↑(Set.Icc a b)]


@[simp]
theorem abelianizationCongr_refl :
    (MulEquiv.refl G).abelianizationCongr = MulEquiv.refl (Abelianization G)


/-- Parallelogram law -/
theorem parallelogram_law {x y : E} : ⟪x + y, x + y⟫ + ⟪x - y, x - y⟫ = 2 * (⟪x, x⟫ + ⟪y, y⟫)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{x y : E}

⟪x + y, x + y⟫_𝕜 + ⟪x - y, x - y⟫_𝕜 = 2 * (⟪x, x⟫_𝕜 + ⟪y, y⟫_𝕜)


theorem uniformity_basis_edist_le :
    (𝓤 α).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) fun ε => { p : α × α | edist p.1 p.2 ≤ ε }

(𝓤 α).HasBasis (fun ε => 0 < ε) fun ε => {p | edist p.1 p.2 ≤ ε}


theorem natSepDegree_X_pow {n : ℕ} : (X ^ n : F[X]).natSepDegree = if n = 0 then 0 else 1

(Polynomial.X ^ n).natSepDegree = if n = 0 then 0 else 1


/-- A seminormed ring is a ring endowed with a seminorm which satisfies the inequality
`‖x y‖ ≤ ‖x‖ ‖y‖`. -/
class SeminormedRing (α : Type*) extends Norm α, Ring α, PseudoMetricSpace α where
  /-- The distance is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = norm (x - y)
  /-- The norm is submultiplicative. -/
  norm_mul : ∀ a b, norm (a * b) ≤ norm a * norm b

{α : Type u_5}
[self : SeminormedRing α]
(x y : α)


@[simp, reassoc]
theorem colimitFlipCompColimIsoColimitCompColim_ι_ι_hom (j) (k) :
    colimit.ι (F.flip.obj k) j ≫ colimit.ι (F.flip ⋙ colim) k ≫
      (colimitFlipCompColimIsoColimitCompColim F).hom =
        (colimit.ι _ k ≫ colimit.ι (F ⋙ colim) j : _ ⟶ colimit (F⋙ colim))

[CategoryTheory.Limits.HasColimitsOfShape (J × K) C]

[CategoryTheory.Limits.HasColimitsOfShape (K × J) C]

CategoryTheory.Limits.colimit.ι (F.flip.obj k) j ≫
    CategoryTheory.Limits.colimit.ι (F.flip ⋙ CategoryTheory.Limits.colim) k ≫
      (CategoryTheory.Limits.colimitFlipCompColimIsoColimitCompColim F).hom =
  CategoryTheory.Limits.colimit.ι (F.obj j) k ≫ CategoryTheory.Limits.colimit.ι (F ⋙ CategoryTheory.Limits.colim) j


@[simp]
theorem nextCoeff_C_eq_zero (c : R) : nextCoeff (C c) = 0


@[to_additive (attr := simp)]
theorem coprod_apply (p : M × N) : f.coprod g p = f p.1 * g p.2

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[Mul M]
[Mul N]
[CommSemigroup P]
(f : M →ₙ* P)
(g : N →ₙ* P)
(p : M × N)


theorem quasispectrumRestricts_iff_spectrumRestricts_inr (S : Type*) {R A : Type*} [Semifield R]
    [Field S] [NonUnitalRing A] [Algebra R S] [Module R A] [Module S A] [IsScalarTower S A A]
    [SMulCommClass S A A] [IsScalarTower R S A] {a : A} {f : S → R} :
    QuasispectrumRestricts a f ↔ SpectrumRestricts (a : Unitization S A) f

(S : Type u_3)
{R : Type u_4}
{A : Type u_5}
[Semifield R]
[Field S]
[NonUnitalRing A]
[Algebra R S]
[Module R A]
[Module S A]
[IsScalarTower S A A]
[SMulCommClass S A A]
[IsScalarTower R S A]
{a : A}
{f : S → R}

QuasispectrumRestricts a f ↔ SpectrumRestricts (↑a) f


@[simp] lemma sized_singleton : ({s} : Set (Finset α)).Sized r ↔ s.card = r


/-- `Solution` is the same as `Solution'` with the additional assumption that `λ ^ 2 ∣ a + b`. -/
structure Solution extends Solution' hζ where
  hab : λ ^ 2 ∣ a + b

(self : FermatLastTheoremForThreeGen.Solution hζ)

(hζ.toInteger - 1) ^ 2 ∣ self.a + self.b


/-- If a p-group acts on `α` and the cardinality of `α` is a multiple
  of `p`, and the action has one fixed point, then it has another fixed point. -/
theorem exists_fixed_point_of_prime_dvd_card_of_fixed_point (hpα : p ∣ Nat.card α) {a : α}
    (ha : a ∈ fixedPoints G α) : ∃ b, b ∈ fixedPoints G α ∧ a ≠ b

{p : ℕ}
{G : Type u_1}
[Group G]
(hG : IsPGroup p G)
[hp : Fact (Nat.Prime p)]
(α : Type u_2)
[MulAction G α]
[Finite α]
(hpα : p ∣ Nat.card α)
{a : α}
(ha : a ∈ MulAction.fixedPoints G α)


@[to_additive]
theorem mul_mk'_eq_mk'_of_mul (x₁ x₂) (y : S) : f.toMap x₁ * f.mk' x₂ y = f.mk' (x₁ * x₂) y

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(f : S.LocalizationMap N)
(x₁ x₂ : M)
(y : ↥S)


theorem IsSeparator.def {G : C} :
    IsSeparator G → ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), (∀ h : G ⟶ X, h ≫ f = h ≫ g) → f = g

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

CategoryTheory.IsSeparator G →
  ∀ ⦃X Y : C⦄ (f g : X ⟶ Y),
    (∀ (h : G ⟶ X), CategoryTheory.CategoryStruct.comp h f = CategoryTheory.CategoryStruct.comp h g) → f = g


theorem isUnit_of_isUnit_ι {m : M} (h : IsUnit (ι Q m)) : IsUnit (Q m)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
[Invertible 2]
{m : M}
(h : IsUnit ((CliffordAlgebra.ι Q) m))


lemma two_mul_div_two_add_one_of_odd (h : Odd n) : 2 * (n / 2) + 1 = n


theorem image_add_const_uIcc : (fun x => x + a) '' [[b, c]] = [[b + a, c + a]]

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


/-- If `ξ` is rational, then the good rational approximations to `ξ` have bounded
numerator and denominator. -/
theorem den_le_and_le_num_le_of_sub_lt_one_div_den_sq {ξ q : ℚ}
    (h : |ξ - q| < 1 / (q.den : ℚ) ^ 2) :
    q.den ≤ ξ.den ∧ ⌈ξ * q.den⌉ - 1 ≤ q.num ∧ q.num ≤ ⌊ξ * q.den⌋ + 1

q.den ≤ ξ.den ∧ ⌈ξ * ↑q.den⌉ - 1 ≤ q.num ∧ q.num ≤ ⌊ξ * ↑q.den⌋ + 1


theorem comap_smallSets (l : Filter β) (f : α → Set β) :
    comap f l.smallSets = l.lift' (preimage f ∘ powerset)

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

Filter.comap f l.smallSets = l.lift' (Set.preimage f ∘ Set.powerset)


/-- If the only elements outside `s` are those left fixed by `σ`, then mapping by `σ` has no effect.
-/
theorem image_perm {s : Set α} {σ : Equiv.Perm α} (hs : { a : α | σ a ≠ a } ⊆ s) : σ '' s = s

{α : Type u_1}
{s : Set α}
{σ : Equiv.Perm α}
(hs : {a | σ a ≠ a} ⊆ s)


lemma traceForm_isSymm : LinearMap.IsSymm (traceForm R L M)

(R : Type u_1)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]

LinearMap.IsSymm (LieModule.traceForm R L M)


theorem smul_mem (p : Submodule (A ⊗[R] B) M) (a : A) {m : M} (hm : m ∈ p) : a • m ∈ p

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{M : Type u_4}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[Semiring A]
[Semiring B]
[Module A M]
[Module B M]
[Algebra R A]
[Algebra R B]
[IsScalarTower R A M]
[IsScalarTower R B M]
[SMulCommClass A B M]
(p : Submodule (A ⊗[R] B) M)
(a : A)
{m : M}
(hm : m ∈ p)


/-- Isomorphism between `M ∗ PUnit` and `M`. -/
@[simps! (config := .asFn)]
def coprodUnit : AddMonoid.Coprod M PUnit ≃+ M


theorem log_add_one_le_harmonic (n : ℕ) :
    Real.log ↑(n+1) ≤ harmonic n


/-- Measure `μ` *has no atoms* if the measure of each singleton is zero.

NB: Wikipedia assumes that for any measurable set `s` with positive `μ`-measure,
there exists a measurable `t ⊆ s` such that `0 < μ t < μ s`. While this implies `μ {x} = 0`,
the converse is not true. -/
class NoAtoms {m0 : MeasurableSpace α} (μ : Measure α) : Prop where
  measure_singleton : ∀ x, μ {x} = 0

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[self : MeasureTheory.NoAtoms μ]
(x : α)


/-- `intercalate [x]` is the left inverse of `splitOn x`  -/
theorem intercalate_splitOn (x : α) [DecidableEq α] : [x].intercalate (xs.splitOn x) = xs

{α : Type u}
(xs : List α)
(x : α)
[DecidableEq α]

[x].intercalate (List.splitOn x xs) = xs


@[to_additive]
theorem Commute.function_commute_mul_right (h : Commute a b) :
    Function.Commute (· * a) (· * b)

{G : Type u_3}
[Semigroup G]
{a b : G}
(h : Commute a b)

Function.Commute (fun x => x * a) fun x => x * b


theorem MemUnion.elim {x : α} {a b : Set α} {P : Prop} (H₁ : x ∈ a ∪ b) (H₂ : x ∈ a → P)
    (H₃ : x ∈ b → P) : P

{α : Type u}
{x : α}
{a b : Set α}
{P : Prop}
(H₁ : x ∈ a ∪ b)
(H₂ : x ∈ a → P)
(H₃ : x ∈ b → P)


@[simp]
theorem factorization_zero_right (n : ℕ) : n.factorization 0 = 0


theorem natAbs_inj_of_nonneg_of_nonneg {a b : ℤ} (ha : 0 ≤ a) (hb : 0 ≤ b) :
    natAbs a = natAbs b ↔ a = b


theorem card_Iio : (Iio b).card = (∏ i, (Iic (b i)).card) - 1

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

(Finset.Iio b).card = ∏ i : ι, (Finset.Iic (b i)).card - 1


theorem exists_of_linearIndependent_of_finite_span {t : Finset V}
    (hs : LinearIndependent K (fun x => x : s → V)) (hst : s ⊆ (span K ↑t : Submodule K V)) :
    ∃ t' : Finset V, ↑t' ⊆ s ∪ ↑t ∧ s ⊆ ↑t' ∧ t'.card = t.card

(hs : LinearIndependent K fun (x : ↑s) => ↑x)

∃ t', ↑t' ⊆ s ∪ ↑t ∧ s ⊆ ↑t' ∧ t'.card = t.card


@[to_additive]
theorem sum_card_orderOf_eq_card_pow_eq_one [Fintype G] [DecidableEq G] (hn : n ≠ 0) :
    (∑ m ∈ (Finset.range n.succ).filter (· ∣ n),
        (Finset.univ.filter fun x : G => orderOf x = m).card) =
      (Finset.univ.filter fun x : G => x ^ n = 1).card

{G : Type u_1}
[Monoid G]
{n : ℕ}
[Fintype G]
[DecidableEq G]
(hn : n ≠ 0)

∑ m ∈ Finset.filter (fun x => x ∣ n) (Finset.range n.succ), (Finset.filter (fun x => orderOf x = m) Finset.univ).card =
  (Finset.filter (fun x => x ^ n = 1) Finset.univ).card


theorem adjoin_rootSet : Algebra.adjoin K (f.rootSet (SplittingField f)) = ⊤

Algebra.adjoin K (f.rootSet f.SplittingField) = ⊤


nonrec theorem neg (hf : CircleIntegrable f c R) : CircleIntegrable (-f) c R

{E : Type u_1}
[NormedAddCommGroup E]
{f : ℂ → E}
{c : ℂ}
{R : ℝ}
(hf : CircleIntegrable f c R)


/-- Being finitely-presented is preserved by localizations. -/
theorem finitePresentation_localizationPreserves : LocalizationPreserves @FinitePresentation


@[simp]
lemma FixedPoints.mem_addSubmonoid (a : α) : a ∈ addSubmonoid M α ↔ ∀ m : M, m • a = a

(M : Type u)
(α : Type v)
[Monoid M]
[AddMonoid α]
[DistribMulAction M α]
(a : α)

a ∈ FixedPoints.addSubmonoid M α ↔ ∀ (m : M), m • a = a


lemma isNilpotent_sum {ι : Type*} {s : Finset ι} {f : ι → R}
    (hnp : ∀ i ∈ s, IsNilpotent (f i)) :
    IsNilpotent (∑ i ∈ s, f i)

{R : Type u_1}
[CommSemiring R]
{ι : Type u_3}
{s : Finset ι}
{f : ι → R}
(hnp : ∀ i ∈ s, IsNilpotent (f i))


@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
    (hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
    C r

(ha : ∀ (x y : P), C x → C y → C (x + y))


theorem convex_Ico (r s : β) : Convex 𝕜 (Ico r s)

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


theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{J : FractionalIdeal S P}


@[simp]
theorem seq_destruct_cons (a : α) (s) : Seq.destruct (cons a s) = some (some a, s)

{α : Type u}
(a : α)
(s : Stream'.WSeq α)

Stream'.Seq.destruct (Stream'.WSeq.cons a s) = some (some a, s)


lemma finiteCoproduct.hom_ext {B : CompHausLike P} (f g : finiteCoproduct X ⟶ B)
    (h : ∀ a : α, finiteCoproduct.ι X a ≫ f = finiteCoproduct.ι X a ≫ g) : f = g

(f g : CompHausLike.finiteCoproduct X ⟶ B)

(h :
  ∀ (a : α),
    CategoryTheory.CategoryStruct.comp (CompHausLike.finiteCoproduct.ι X a) f =
      CategoryTheory.CategoryStruct.comp (CompHausLike.finiteCoproduct.ι X a) g)


theorem setIntegral_nonneg_ae (hs : MeasurableSet s) (hf : ∀ᵐ x ∂μ, x ∈ s → 0 ≤ f x) :
    0 ≤ ∫ x in s, f x ∂μ

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{f : X → ℝ}
{s : Set X}
(hs : MeasurableSet s)
(hf : ∀ᵐ (x : X) ∂μ, x ∈ s → 0 ≤ f x)


theorem div_add_mod (a b : Int) : b * a.div b + mod a b = a


@[simp]
theorem sum_neg (xs : IntList) : (-xs).sum = -(xs.sum)


@[simp] theorem coe_toRealHom : ⇑toRealHom = toReal


/-- The measurable Vitali covering theorem. Assume one is given a family `t` of closed sets with
nonempty interior, such that each `a ∈ t` is included in a ball `B (x, r)` and covers a definite
proportion of the ball `B (x, 3 r)` for a given measure `μ` (think of the situation where `μ` is
a doubling measure and `t` is a family of balls). Consider a (possibly non-measurable) set `s`
at which the family is fine, i.e., every point of `s` belongs to arbitrarily small elements of `t`.
Then one can extract from `t` a disjoint subfamily that covers almost all `s`.

For more flexibility, we give a statement with a parameterized family of sets.
-/
theorem exists_disjoint_covering_ae [MetricSpace α] [MeasurableSpace α] [OpensMeasurableSpace α]
    [SecondCountableTopology α] (μ : Measure α) [IsLocallyFiniteMeasure μ] (s : Set α) (t : Set ι)
    (C : ℝ≥0) (r : ι → ℝ) (c : ι → α) (B : ι → Set α) (hB : ∀ a ∈ t, B a ⊆ closedBall (c a) (r a))
    (μB : ∀ a ∈ t, μ (closedBall (c a) (3 * r a)) ≤ C * μ (B a))
    (ht : ∀ a ∈ t, (interior (B a)).Nonempty) (h't : ∀ a ∈ t, IsClosed (B a))
    (hf : ∀ x ∈ s, ∀ ε > (0 : ℝ), ∃ a ∈ t, r a ≤ ε ∧ c a = x) :
    ∃ u ⊆ t, u.Countable ∧ u.PairwiseDisjoint B ∧ μ (s \ ⋃ a ∈ u, B a) = 0

(hB : ∀ a ∈ t, B a ⊆ Metric.closedBall (c a) (r a))

(μB : ∀ a ∈ t, μ (Metric.closedBall (c a) (3 * r a)) ≤ ↑C * μ (B a))

(hf : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ t, r a ≤ ε ∧ c a = x)


theorem _root_.LinearMap.BilinForm.toQuadraticMap_isOrtho [IsCancelAdd R]
    [NoZeroDivisors R] [CharZero R] {B : BilinMap R M R} {x y : M} (h : B.IsSymm) :
    B.toQuadraticMap.IsOrtho x y ↔ B.IsOrtho x y

{R : Type u_3}
{M : Type u_4}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[IsCancelAdd R]
[NoZeroDivisors R]
[CharZero R]
{B : LinearMap.BilinMap R M R}
{x y : M}
(h : LinearMap.IsSymm B)

B.toQuadraticMap.IsOrtho x y ↔ LinearMap.IsOrtho B x y


/-- The open sets of an open subscheme corresponds to the open sets containing in the image. -/
@[simps]
def IsOpenImmersion.opensEquiv {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] :
    X.Opens ≃ { U : Y.Opens // U ≤ f.opensRange }

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
[AlgebraicGeometry.IsOpenImmersion f]
(U : X.Opens)

↑((AlgebraicGeometry.IsOpenImmersion.opensEquiv f) U) = (AlgebraicGeometry.Scheme.Hom.opensFunctor f).obj U


@[simp]
theorem diagonal_dotProduct (i : m) : diagonal v i ⬝ᵥ w = v i * w i

{m : Type u_2}
{α : Type v}
[Fintype m]
[DecidableEq m]
[NonUnitalNonAssocSemiring α]
(v w : m → α)
(i : m)


lemma ball_subset_trichotomy :
    ball x r ⊆ ball y s ∨ ball y s ⊆ ball x r ∨ Disjoint (ball x r) (ball y s)

{X : Type u_1}
[PseudoMetricSpace X]
[IsUltrametricDist X]
(x y : X)
(r s : ℝ)

Metric.ball x r ⊆ Metric.ball y s ∨ Metric.ball y s ⊆ Metric.ball x r ∨ Disjoint (Metric.ball x r) (Metric.ball y s)


@[simp] theorem congr_mk {ra : α → α → Prop} {rb : β → β → Prop} (e : α ≃ β)
    (eq : ∀ a₁ a₂ : α, ra a₁ a₂ ↔ rb (e a₁) (e a₂)) (a : α) :
    Quot.congr e eq (Quot.mk ra a) = Quot.mk rb (e a)

(eq : ∀ (a₁ a₂ : α), ra a₁ a₂ ↔ rb (e a₁) (e a₂))

(Quot.congr e eq) (Quot.mk ra a) = Quot.mk rb (e a)


@[to_additive (attr := simp)]
theorem dist_inv_inv [Group G] [PseudoMetricSpace G] [IsometricSMul G G]
    [IsometricSMul Gᵐᵒᵖ G] (a b : G) : dist a⁻¹ b⁻¹ = dist a b

{G : Type v}
[AddGroup G]
[PseudoMetricSpace G]
[IsometricVAdd G G]
[IsometricVAdd Gᵃᵒᵖ G]
(a b : G)


@[simp]
theorem Ico_erase_left (a b : α) : (Ico a b).erase a = Ioo a b

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrder α]
[DecidableEq α]
(a b : α)

(Finset.Ico a b).erase a = Finset.Ioo a b


@[simp]
theorem zero_eq_edist {x y : γ} : 0 = edist x y ↔ x = y


theorem map_mem_span_algebraMap_image {S T : Type*} [CommSemiring S] [Semiring T] [Algebra R S]
    [Algebra R T] [Algebra S T] [IsScalarTower R S T] (x : S) (a : Set S)
    (hx : x ∈ Submodule.span R a) : algebraMap S T x ∈ Submodule.span R (algebraMap S T '' a)

{R : Type u}
[CommSemiring R]
{S : Type u_1}
{T : Type u_2}
[CommSemiring S]
[Semiring T]
[Algebra R S]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
(x : S)
(a : Set S)
(hx : x ∈ Submodule.span R a)

(algebraMap S T) x ∈ Submodule.span R (⇑(algebraMap S T) '' a)


theorem iff_exists_open (f : X → Y) :
    IsLocallyConstant f ↔ ∀ x, ∃ U : Set X, IsOpen U ∧ x ∈ U ∧ ∀ x' ∈ U, f x' = f x

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

IsLocallyConstant f ↔ ∀ (x : X), ∃ U, IsOpen U ∧ x ∈ U ∧ ∀ x' ∈ U, f x' = f x


@[simp, nolint simpNF]
theorem rightDual_ρ [RightRigidCategory V] (h : H) : Xᘁ.ρ h = (X.ρ (h⁻¹ : H))ᘁ

(X : Action V ((CategoryTheory.forget₂ Grp MonCat).obj H))


theorem minimal_nonempty_open_eq_singleton [T0Space X] {s : Set X} (hs : IsOpen s)
    (hne : s.Nonempty) (hmin : ∀ t, t ⊆ s → t.Nonempty → IsOpen t → t = s) : ∃ x, s = {x}

(hmin : ∀ t ⊆ s, t.Nonempty → IsOpen t → t = s)


@[simp]
theorem mem_cons {h} : b ∈ s.cons a h ↔ b = a ∨ b ∈ s

{α : Type u_1}
{s : Finset α}
{a b : α}
{h : a ∉ s}


/-- A relation `r` is said to be finite dimensional iff there is a relation series of `r` with the
  maximum length. -/
class FiniteDimensional : Prop where
  /-- A relation `r` is said to be finite dimensional iff there is a relation series of `r` with the
    maximum length. -/
  exists_longest_relSeries : ∃ x : RelSeries r, ∀ y : RelSeries r, y.length ≤ x.length

{α : Type u_1}
{r : Rel α α}
[self : r.FiniteDimensional]

∃ x, ∀ (y : RelSeries r), y.length ≤ x.length


@[simp]
theorem coe_degree (G' : Subgraph G) (v : G'.verts) [Fintype (G'.coe.neighborSet v)]
    [Fintype (G'.neighborSet v)] : G'.coe.degree v = G'.degree v

{V : Type u}
{G : SimpleGraph V}
(G' : G.Subgraph)
(v : ↑G'.verts)
[Fintype ↑(G'.coe.neighborSet v)]
[Fintype ↑(G'.neighborSet ↑v)]


/-- Evaluation as a `MonoidHom` -/
@[to_additive (attr := simps!) "Evaluation as an `AddMonoidHom`"]
def evalMonoidHom [MulOneClass Y] (x : X) : LocallyConstant X Y →* Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[MulOneClass Y]
(x : X)

∀ (a : LocallyConstant X Y), (LocallyConstant.evalMonoidHom x) a = a x


protected theorem div_add_div_same {a b c : ℝ≥0∞} : a / c + b / c = (a + b) / c


@[simp]
theorem some_single_none [Zero M] (m : M) : (single none m : Option α →₀ M).some = 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
(m : M)


protected theorem coe_zero : ((0 : S) : A) = 0

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[Star A]
(S : NonUnitalStarSubalgebra R A)


theorem div_le_iff' (hb : 0 < b) : a / b ≤ c ↔ a ≤ b * c

{α : Type u_2}
[LinearOrderedSemifield α]
{a b c : α}
(hb : 0 < b)


/-- A `LiftStruct` for a commutative square in the opposite category
gives a `LiftStruct` for the corresponding square in the original category. -/
@[simps]
def unop {A B X Y : Cᵒᵖ} {f : A ⟶ X} {i : A ⟶ B} {p : X ⟶ Y} {g : B ⟶ Y} {sq : CommSq f i p g}
    (l : LiftStruct sq) : LiftStruct sq.unop

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{A B X Y : Cᵒᵖ}
{f : A ⟶ X}
{i : A ⟶ B}
{p : X ⟶ Y}
{g : B ⟶ Y}
{sq : CategoryTheory.CommSq f i p g}
(l : sq.LiftStruct)


theorem Γ_map_morphismRestrict {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) :
    Scheme.Γ.map (f ∣_ U).op =
      Y.presheaf.map (eqToHom U.openEmbedding_obj_top.symm).op ≫
        f.app U ≫ X.presheaf.map (eqToHom (f ⁻¹ᵁ U).openEmbedding_obj_top).op

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(U : Y.Opens)

AlgebraicGeometry.Scheme.Γ.map (f ∣_ U).op =
  Y.presheaf.map (CategoryTheory.eqToHom ⋯).op ≫
    AlgebraicGeometry.Scheme.Hom.app f U ≫ X.presheaf.map (CategoryTheory.eqToHom ⋯).op


/-- A language is algebraic when it has no relation symbols. -/
class IsAlgebraic : Prop where
  /-- There are no relation symbols in the language. -/
  empty_relations : ∀ n, IsEmpty (L.Relations n)

{L : FirstOrder.Language}
[self : L.IsAlgebraic]
(n : ℕ)


private irreducible_def add : RingQuot r → RingQuot r → RingQuot r

{R : Type u_1}
[Semiring R]
(r : R → R → Prop)

∀ (x x_1 : RingQuot r),
  RingQuot.add r x x_1 =
    match x, x_1 with
    | { toQuot := a }, { toQuot := b } => { toQuot := Quot.map₂ (fun x x_2 => x + x_2) ⋯ ⋯ a b }


theorem vonMangoldt_ne_zero_iff {n : ℕ} : Λ n ≠ 0 ↔ IsPrimePow n

ArithmeticFunction.vonMangoldt n ≠ 0 ↔ IsPrimePow n


/-- The internal hom functor given by the monoidal closed structure. -/
@[simps]
def internalHom [MonoidalClosed C] : Cᵒᵖ ⥤ C ⥤ C

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

∀ {X Y : Cᵒᵖ} (f : X ⟶ Y), CategoryTheory.MonoidalClosed.internalHom.map f = CategoryTheory.MonoidalClosed.pre f.unop


theorem mem_Icc_of_Ico (h : x ∈ Ico a b) : x ∈ Icc a b

{α : Type u_1}
[Preorder α]
{a b x : α}
(h : x ∈ Set.Ico a b)


theorem t'_iji (i j : D.J) : D.t' i j i = pullback.fst _ _ ≫ D.t i j ≫ inv (pullback.snd _ _)

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
(D : CategoryTheory.GlueData C)
(i j : D.J)

D.t' i j i =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.pullback.fst (D.f i j) (D.f i i))
    (CategoryTheory.CategoryStruct.comp (D.t i j)
      (CategoryTheory.inv (CategoryTheory.Limits.pullback.snd (D.f j i) (D.f j i))))


theorem diophFn_vec (f : Vector3 ℕ n → ℕ) : DiophFn f ↔ Dioph {v | f (v ∘ fs) = v fz}

Dioph.DiophFn f ↔ Dioph {v | f (v ∘ Fin2.fs) = v Fin2.fz}


@[simp] theorem length_drop : ∀ (i : Nat) (l : List α), length (drop i l) = length l - i


@[simp]
lemma homMk₄_app_two :
    (homMk₄ app₀ app₁ app₂ app₃ app₄ w₀ w₁ w₂ w₃).app ⟨2, by valid⟩ = app₂

{f g : CategoryTheory.ComposableArrows C 4}

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

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

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

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

(CategoryTheory.ComposableArrows.homMk₄ app₀ app₁ app₂ app₃ app₄ w₀ w₁ w₂ w₃).app ⟨2, ⋯⟩ = app₂


theorem tendsto_nat_nhds_top : Tendsto (fun n : ℕ => ↑n) atTop (𝓝 ∞)

Filter.Tendsto (fun n => ↑n) Filter.atTop (𝓝 ⊤)


theorem sq_add_sq (R : Type*) [CommRing R] [IsDomain R] (p : ℕ) [NeZero p] [CharP R p] (x : ℤ) :
    ∃ a b : ℕ, ((a : R) ^ 2 + (b : R) ^ 2) = x

(R : Type u_3)
[CommRing R]
[IsDomain R]
(p : ℕ)
[NeZero p]
[CharP R p]
(x : ℤ)


/-- A function on `Box ι` is called box additive if for every box `J` and a partition `π` of `J`
we have `f J = ∑ Ji ∈ π.boxes, f Ji`. A function is called box additive on subboxes of `I : Box ι`
if the same property holds for `J ≤ I`. We formalize these two notions in the same definition
using `I : WithBot (Box ι)`: the value `I = ⊤` corresponds to functions box additive on the whole
space. -/
structure BoxAdditiveMap (ι M : Type*) [AddCommMonoid M] (I : WithTop (Box ι)) where
  /-- The function underlying this additive map. -/
  toFun : Box ι → M
  sum_partition_boxes' : ∀ J : Box ι, ↑J ≤ I → ∀ π : Prepartition J, π.IsPartition →
    ∑ Ji ∈ π.boxes, toFun Ji = toFun J

(self : BoxIntegral.BoxAdditiveMap ι M I)

↑J ≤ I → ∀ (π : BoxIntegral.Prepartition J), π.IsPartition → ∑ Ji ∈ π.boxes, self.toFun Ji = self.toFun J


/-- Conditions for an element to be multiplicatively central -/
@[to_additive]
structure IsMulCentral [Mul M] (z : M) : Prop where
  /-- multiplication commutes -/
  comm (a : M) : z * a = a * z
  /-- associative property for left multiplication -/
  left_assoc (b c : M) : z * (b * c) = (z * b) * c
  /-- middle associative multiplication property -/
  mid_assoc (a c : M) : (a * z) * c = a * (z * c)
  /-- associative property for right multiplication -/
  right_assoc (a b : M) : (a * b) * z = a * (b * z)

{M : Type u_1}
[Mul M]
{z : M}
(self : IsMulCentral z)
(a : M)


@[to_additive]
lemma mulIndicator_iInter_apply (h1 : (⊥ : M) = 1) (s : ι → Set α) (f : α → M) (x : α) :
    mulIndicator (⋂ i, s i) f x = ⨅ i, mulIndicator (s i) f x

{ι : Sort u_1}
{α : Type u_2}
{M : Type u_4}
[CompleteLattice M]
[One M]
[Nonempty ι]
(h1 : ⊥ = 1)
(s : ι → Set α)
(f : α → M)
(x : α)

(⋂ i, s i).mulIndicator f x = ⨅ i, (s i).mulIndicator f x


/-- This result shows that there always exists a next term in the sequence. -/
theorem seq_next {x : 𝓞 K} (hx : x ≠ 0) :
    ∃ y : 𝓞 K, y ≠ 0 ∧
      (∀ w, w ≠ w₁ → w y < w x) ∧
      |Algebra.norm ℚ (y : K)| ≤ B

(hB : NumberField.mixedEmbedding.minkowskiBound K 1 < ↑(NumberField.mixedEmbedding.convexBodyLTFactor K) * ↑B)

∃ y, y ≠ 0 ∧ (∀ (w : NumberField.InfinitePlace K), w ≠ w₁ → w ↑y < w ↑x) ∧ |(Algebra.norm ℚ) ↑y| ≤ ↑B


theorem le_rpow_self_of_one_le {x : ℝ≥0∞} {z : ℝ} (hx : 1 ≤ x) (h_one_le : 1 ≤ z) : x ≤ x ^ z


theorem right_dom_of_append_dom [Append α] {a b : Part α} (hab : Dom (a ++ b)) : b.Dom

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


@[simp] lemma floorRoot_one_right (hn : n ≠ 0) : floorRoot n 1 = 1


theorem bounded_le_of_bounded_lt [Preorder α] (h : Bounded (· < ·) s) : Bounded (· ≤ ·) s

(h : Set.Bounded (fun x x_1 => x < x_1) s)


/-- If `a` is in the family compression and can be compressed, then its compression is in the
original family. -/
theorem sup_sdiff_mem_of_mem_compression (ha : a ∈ 𝓒 u v s) (hva : v ≤ a) (hua : Disjoint u a) :
    (a ⊔ u) \ v ∈ s

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
[DecidableRel Disjoint]
[DecidableRel fun x x_1 => x ≤ x_1]
{s : Finset α}
{u v a : α}
[DecidableEq α]
(ha : a ∈ UV.compression u v s)
(hva : v ≤ a)
(hua : Disjoint u a)


@[simp, reassoc]
theorem whiskerRight_toSheafify_sheafifyCompIso_hom :
    whiskerRight (J.toSheafify _) _ ≫ (J.sheafifyCompIso F P).hom = J.toSheafify _

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Category.{max v u, w₁} D]

[CategoryTheory.Category.{max v u, w₂} E]

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) D]

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) E]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ E]

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ F]

[(X : C) →
    (W : J.Cover X) →
      (P : CategoryTheory.Functor Cᵒᵖ D) → CategoryTheory.Limits.PreservesLimit (W.index P).multicospan F]

CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerRight (J.toSheafify P) F) (J.sheafifyCompIso F P).hom =
  J.toSheafify (P.comp F)


@[to_additive]
theorem hasProd_lt (h : f ≤ g) (hi : f i < g i) (hf : HasProd f a₁) (hg : HasProd g a₂) :
    a₁ < a₂

{ι : Type u_1}
{α : Type u_3}
[OrderedCommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
[OrderClosedTopology α]
{f g : ι → α}
{a₁ a₂ : α}
{i : ι}
(h : f ≤ g)
(hi : f i < g i)
(hf : HasProd f a₁)
(hg : HasProd g a₂)


/-- The natural functor from `Fintype` to `LightProfinite`, endowing a finite type with the
discrete topology. -/
@[simps!]
def FintypeCat.toLightProfinite : FintypeCat ⥤ LightProfinite


/-- If `C` has (small) wide equalizers and a weakly initial object, then it has an initial object.

The initial object is constructed as the wide equalizer of all endomorphisms on the given weakly
initial object.
-/
theorem hasInitial_of_weakly_initial_and_hasWideEqualizers [HasWideEqualizers.{v} C] {T : C}
    (hT : ∀ X, Nonempty (T ⟶ X)) : HasInitial C


theorem bernoulliFun_eval_one (k : ℕ) : bernoulliFun k 1 = bernoulliFun k 0 + ite (k = 1) 1 0

bernoulliFun k 1 = bernoulliFun k 0 + if k = 1 then 1 else 0


theorem frange_single {x : α} {y : M} : frange (single x y) ⊆ {y}

{α : Type u_1}
{M : Type u_5}
[Zero M]
{x : α}
{y : M}


protected theorem neg_add_lt_left_of_lt_add {a b c : Int} (h : a < b + c) : -b + a < c


theorem galoisConnection (f : Y ⟶ X) : GaloisConnection (Sieve.pushforward f) (Sieve.pullback f)

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

GaloisConnection (CategoryTheory.Sieve.pushforward f) (CategoryTheory.Sieve.pullback f)


@[simp]
lemma piecewise_apply_right {C₁ C₂ : Set X} (h₁ : IsClosed C₁) (h₂ : IsClosed C₂)
    (h : C₁ ∪ C₂ = Set.univ) (f : LocallyConstant C₁ Z) (g : LocallyConstant C₂ Z)
    (hfg : ∀ (x : X) (hx : x ∈ C₁ ∩ C₂), f ⟨x, hx.1⟩ = g ⟨x, hx.2⟩)
    [DecidablePred (· ∈ C₁)] (x : X) (hx : x ∈ C₂) :
    piecewise h₁ h₂ h f g hfg x = g ⟨x, hx⟩

(hfg : ∀ (x : X) (hx : x ∈ C₁ ∩ C₂), f ⟨x, ⋯⟩ = g ⟨x, ⋯⟩)

(LocallyConstant.piecewise h₁ h₂ h f g hfg) x = g ⟨x, hx⟩


lemma leRec_trans {n m k} {motive : (m : ℕ) → n ≤ m → Sort*} (refl le_succ_of_le)
    (hnm : n ≤ m) (hmk : m ≤ k) :
    leRec (motive := motive) refl le_succ_of_le (Nat.le_trans hnm hmk) =
      leRec
        (leRec refl (fun _ h => le_succ_of_le h) hnm)
        (fun _ h => le_succ_of_le <| Nat.le_trans hnm h) hmk

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

Nat.leRec refl le_succ_of_le ⋯ =
  Nat.leRec (Nat.leRec refl (fun x h => le_succ_of_le h) hnm) (fun x h => le_succ_of_le ⋯) hmk


theorem card_le_one : s.card ≤ 1 ↔ ∀ a ∈ s, ∀ b ∈ s, a = b


theorem Real.tendsto_pow_div_factorial_atTop (x : ℝ) :
    Tendsto (fun n ↦ x ^ n / n ! : ℕ → ℝ) atTop (𝓝 0)

Filter.Tendsto (fun n => x ^ n / ↑n !) Filter.atTop (𝓝 0)


/-- Evaluation on a particular element of the module `M` is an additive map on quadratic maps. -/
@[simps! apply]
def evalAddMonoidHom (m : M) : QuadraticMap R M N →+ N

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

∀ (a : QuadraticMap R M N), (QuadraticMap.evalAddMonoidHom m) a = a m


theorem updateRow_conjTranspose [DecidableEq n] [Star α] :
    updateRow Mᴴ j (star c) = (updateColumn M j c)ᴴ

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{M : Matrix m n α}
{j : n}
{c : m → α}
[DecidableEq n]
[Star α]

M.conjTranspose.updateRow j (star c) = (M.updateColumn j c).conjTranspose


@[simp, norm_cast]
theorem coe_add [∀ i, AddZeroClass (β i)] (g₁ g₂ : Π₀ i, β i) : ⇑(g₁ + g₂) = g₁ + g₂

{ι : Type u}
{β : ι → Type v}
[(i : ι) → AddZeroClass (β i)]
(g₁ g₂ : Π₀ (i : ι), β i)


/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dOne` gives a simpler expression for the 1st differential: that is, the following
square commutes:
```
  C¹(G, A) ---d¹-----> C²(G, A)
    |                      |
    |                      |
    |                      |
    v                      v
  Fun(G, A) -dOne-> Fun(G × G, A)
```
where the vertical arrows are `oneCochainsLequiv` and `twoCochainsLequiv` respectively.
-/
theorem dOne_comp_eq : dOne A ∘ₗ oneCochainsLequiv A =
    twoCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 1 2

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)

groupCohomology.dOne A ∘ₗ ↑(groupCohomology.oneCochainsLequiv A) =
  ↑(groupCohomology.twoCochainsLequiv A) ∘ₗ (groupCohomology.inhomogeneousCochains A).d 1 2


@[simp]
theorem sym2_zero : (0 : Multiset α).sym2 = 0


theorem GoodProducts.linearIndependentEmpty :
    LinearIndependent ℤ (eval (∅ : Set (I → Bool)))

LinearIndependent ℤ (Profinite.NobelingProof.GoodProducts.eval ∅)


/-- Given an open cover `{ Xᵢ }` of `X` and an open cover `{ Yⱼ }` of `Y`, then
`X ×[Z] Y` is covered by `Xᵢ ×[Z] Yⱼ`. -/
@[simps! J obj map]
def openCoverOfLeftRight (𝒰X : X.OpenCover) (𝒰Y : Y.OpenCover) (f : X ⟶ Z) (g : Y ⟶ Z) :
    (pullback f g).OpenCover

{X Y Z : AlgebraicGeometry.Scheme}
(𝒰X : X.OpenCover)
(𝒰Y : Y.OpenCover)
(f : X ⟶ Z)
(g : Y ⟶ Z)
(ij : 𝒰X.J × 𝒰Y.J)

(AlgebraicGeometry.Scheme.Pullback.openCoverOfLeftRight 𝒰X 𝒰Y f g).obj ij =
  CategoryTheory.Limits.pullback (𝒰X.map ij.1 ≫ f) (𝒰Y.map ij.2 ≫ g)


theorem Sbtw.trans_left [NoZeroSMulDivisors R V] {w x y z : P} (h₁ : Sbtw R w y z)
    (h₂ : Sbtw R w x y) : Sbtw R w x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[NoZeroSMulDivisors R V]
{w x y z : P}
(h₁ : Sbtw R w y z)
(h₂ : Sbtw R w x y)


theorem existsUnique_mem (ha : a ∈ s) : ∃! t, t ∈ P.parts ∧ a ∈ t

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


/-- If `M / R` and `M' / R'` are modules, `i : R → R'` is a surjective map which maps zero to zero,
`j : M →+ M'` is an injective group homomorphism, such that the scalar multiplications on `M` and
`M'` are compatible, then the rank of `M / R` is smaller than or equal to the rank of `M' / R'`.
As a special case, taking `R = R'` it is `LinearMap.lift_rank_le_of_injective`. -/
theorem lift_rank_le_of_surjective_injective (i : ZeroHom R R') (j : M →+ M')
    (hi : Surjective i) (hj : Injective j) (hc : ∀ (r : R) (m : M), j (r • m) = i r • j m) :
    lift.{v'} (Module.rank R M) ≤ lift.{v} (Module.rank R' M')

Cardinal.lift.{v', v} (Module.rank R M) ≤ Cardinal.lift.{v, v'} (Module.rank R' M')


@[to_additive (attr := simp)]
theorem lift_of_comp (j : N →* P) : f.lift (f.isUnit_comp j) = j

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
(j : N →+ P)


@[simp]
theorem counit_single (i : ι) (a : A) : counit (Finsupp.single i a) = counit (R := R) a

(R : Type u)
(ι : Type v)
(A : Type w)
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[Coalgebra R A]
(i : ι)
(a : A)

Coalgebra.counit (Finsupp.single i a) = Coalgebra.counit a


/-- Isomorphism between `PUnit ∗ M` and `M`. -/
@[simps! (config := .asFn)]
def punitCoprod : AddMonoid.Coprod PUnit M ≃+ M


theorem toReal_sub_of_le {a b : ℝ≥0∞} (h : b ≤ a) (ha : a ≠ ∞) :
    (a - b).toReal = a.toReal - b.toReal


theorem cauchy_add : ∀ a b, (a + b : ℝ).cauchy = a.cauchy + b.cauchy


@[continuity, fun_prop]
lemma _root_.Continuous.fourierPowSMulRight {f : V → E} (hf : Continuous f) (n : ℕ) :
    Continuous (fun v ↦ fourierPowSMulRight L f v n)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{V : Type u_2}
{W : Type u_3}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[NormedAddCommGroup W]
[NormedSpace ℝ W]
(L : V →L[ℝ] W →L[ℝ] ℝ)
{f : V → E}
(hf : Continuous f)
(n : ℕ)

Continuous fun v => VectorFourier.fourierPowSMulRight L f v n


/-- If the sign of the angle between two vectors is negative, the first vector is nonzero. -/
theorem left_ne_zero_of_oangle_sign_eq_neg_one {x y : V} (h : (o.oangle x y).sign = -1) : x ≠ 0

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


theorem commonNeighbors_eq (v w : V) : G.commonNeighbors v w = G.neighborSet v ∩ G.neighborSet w

{V : Type u}
(G : SimpleGraph V)
(v w : V)


/-- The right homology functor `ShortComplex C ⥤ C`, where the right homology of a
short complex `S` is understood as a kernel of the obvious map `S.fromOpcycles : S.opcycles ⟶ S.X₃`
where `S.opcycles` is a cokernel of `S.f : S.X₁ ⟶ S.X₂`. -/
@[simps]
noncomputable def rightHomologyFunctor : ShortComplex C ⥤ C

(CategoryTheory.ShortComplex.rightHomologyFunctor C).obj S = S.rightHomology


theorem sum_comm [Countable ι] (κ : ι → ι → Kernel α β) :
    (Kernel.sum fun n => Kernel.sum (κ n)) = Kernel.sum fun m => Kernel.sum fun n => κ n m

(κ : ι → ι → ProbabilityTheory.Kernel α β)

(ProbabilityTheory.Kernel.sum fun n => ProbabilityTheory.Kernel.sum (κ n)) =
  ProbabilityTheory.Kernel.sum fun m => ProbabilityTheory.Kernel.sum fun n => κ n m


theorem evalAt_mul : evalAt (g * h) X = 𝒅ₕ (L_apply I g h) (evalAt h X)

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

(LeftInvariantDerivation.evalAt (g * h)) X = (𝒅ₕ ⋯) ((LeftInvariantDerivation.evalAt h) X)


@[simp]
theorem continuous_projRestricts (h : ∀ i, J i → K i) : Continuous (ProjRestricts C h)

{I : Type u}
(C : Set (I → Bool))
{J K : I → Prop}
[(i : I) → Decidable (J i)]
[(i : I) → Decidable (K i)]
(h : ∀ (i : I), J i → K i)

Continuous (Profinite.NobelingProof.ProjRestricts C h)


theorem omegaLimit_mono_left {f₁ f₂ : Filter τ} (hf : f₁ ≤ f₂) : ω f₁ ϕ s ⊆ ω f₂ ϕ s

{τ : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace β]
(ϕ : τ → α → β)
(s : Set α)
{f₁ f₂ : Filter τ}
(hf : f₁ ≤ f₂)


@[to_additive]
theorem prod_eraseNone (f : α → M) (s : Finset (Option α)) :
    ∏ x ∈ eraseNone s, f x = ∏ x ∈ s, Option.elim' 1 f x

{α : Type u_1}
{M : Type u_2}
[CommMonoid M]
(f : α → M)
(s : Finset (Option α))

∏ x ∈ Finset.eraseNone s, f x = ∏ x ∈ s, Option.elim' 1 f x


theorem Homeomorph.isLocalHomeomorph (f : X ≃ₜ Y) : IsLocalHomeomorph f

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


theorem roots_expand_pow_map_iterateFrobenius :
    (expand R (p ^ n) f).roots.map (iterateFrobenius R p n) = p ^ n • f.roots

{R : Type u_1}
[CommRing R]
[IsDomain R]
{p n : ℕ}
[ExpChar R p]
{f : R[X]}
[PerfectRing R p]

Multiset.map (⇑(iterateFrobenius R p n)) ((Polynomial.expand R (p ^ n)) f).roots = p ^ n • f.roots


theorem degree_pos_iff_exists_adj : 0 < G.degree v ↔ ∃ w, G.Adj v w

{V : Type u_1}
(G : SimpleGraph V)
(v : V)
[Fintype ↑(G.neighborSet v)]


lemma pullback.hom_ext {X Y Z W : Stonean} (f : X ⟶ Z) {i : Y ⟶ Z} (hi : OpenEmbedding i)
    (a : W ⟶ (pullback.cone f hi).pt) (b : W ⟶ (pullback.cone f hi).pt)
    (hfst : a ≫ pullback.fst f hi = b ≫ pullback.fst f hi) : a = b

(a b : W ⟶ (Stonean.pullback.cone f hi).pt)

(hfst : a ≫ Stonean.pullback.fst f hi = b ≫ Stonean.pullback.fst f hi)


@[to_additive]
theorem mul_def : s * t = (s ×ˢ t).image fun p : α × α => p.1 * p.2

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

s * t = Finset.image (fun p => p.1 * p.2) (s ×ˢ t)


theorem le_toReal_sub {a b : ℝ≥0∞} (hb : b ≠ ∞) : a.toReal - b.toReal ≤ (a - b).toReal


theorem tendsto_swap_uniformity : Tendsto (@Prod.swap α α) (𝓤 α) (𝓤 α)


theorem sub_apply (f g : M →SL[σ₁₂] M₂) (x : M) : (f - g) x = f x - g x

{R : Type u_1}
[Ring R]
{R₂ : Type u_2}
[Ring R₂]
{M : Type u_4}
[TopologicalSpace M]
[AddCommGroup M]
{M₂ : Type u_5}
[TopologicalSpace M₂]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
[TopologicalAddGroup M₂]
(f g : M →SL[σ₁₂] M₂)
(x : M)


@[simp]
theorem infPrepartition_toPrepartition (π : TaggedPrepartition I) (π' : Prepartition I) :
    (π.infPrepartition π').toPrepartition = π.toPrepartition ⊓ π'

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.TaggedPrepartition I)
(π' : BoxIntegral.Prepartition I)


@[simp]
theorem tensorDistribEquiv_toLinearMap :
    (tensorDistribEquiv R (M₁ := M₁) (M₂ := M₂)).toLinearMap = tensorDistrib R R

(R : Type uR)
(M₁ : Type uM₁)
(M₂ : Type uM₂)
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
[Module.Free R M₁]
[Module.Finite R M₁]
[Module.Free R M₂]
[Module.Finite R M₂]

↑(LinearMap.BilinMap.tensorDistribEquiv R) = LinearMap.BilinMap.tensorDistrib R R


/-- The functor `F.sheafPushforwardContinuous A J K : Sheaf K A ⥤ Sheaf J A`
is induced by the precomposition with `F.op`. -/
@[simps!]
def sheafPushforwardContinuousCompSheafToPresheafIso :
    F.sheafPushforwardContinuous A J K ⋙ sheafToPresheaf J A ≅
      sheafToPresheaf K A ⋙ (whiskeringLeft _ _ _).obj F.op

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

∀ (X_1 : Cᵒᵖ),
  ((F.sheafPushforwardContinuousCompSheafToPresheafIso A J K).inv.app X).app X_1 =
    CategoryTheory.CategoryStruct.id (X.val.obj (Opposite.op (F.obj (Opposite.unop X_1))))


/-- The type of families of functors `A → C ⥤ D` which are compatible with
the shift by `A` on the category `D`. -/
structure SingleFunctors where
  /-- a family of functors `C ⥤ D` indexed by the elements of the additive monoid `A` -/
  functor (a : A) : C ⥤ D
  /-- the isomorphism `functor a' ⋙ shiftFunctor D n ≅ functor a` when `n + a = a'` -/
  shiftIso (n a a' : A) (ha' : n + a = a') : functor a' ⋙ shiftFunctor D n ≅ functor a
  /-- `shiftIso 0` is the obvious isomorphism. -/
  shiftIso_zero (a : A) :
    shiftIso 0 a a (zero_add a) = isoWhiskerLeft _ (shiftFunctorZero D A)
  /-- `shiftIso (m + n)` is determined by `shiftIso m` and `shiftIso n`. -/
  shiftIso_add (n m a a' a'' : A) (ha' : n + a = a') (ha'' : m + a' = a'') :
    shiftIso (m + n) a a'' (by rw [add_assoc, ha', ha'']) =
      isoWhiskerLeft _ (shiftFunctorAdd D m n) ≪≫ (Functor.associator _ _ _).symm ≪≫
        isoWhiskerRight (shiftIso m a' a'' ha'') _ ≪≫ shiftIso n a a' ha'

(self : CategoryTheory.SingleFunctors C D A)

self.shiftIso 0 a a ⋯ = CategoryTheory.isoWhiskerLeft (self.functor a) (CategoryTheory.shiftFunctorZero D A)


@[simp]
theorem mk_tensor {X₁ Y₁ X₂ Y₂ : F C} (f : X₁ ⟶ᵐ Y₁) (g : X₂ ⟶ᵐ Y₂) :
    ⟦f.tensor g⟧ = @MonoidalCategory.tensorHom (F C) _ _ _ _ _ _ ⟦f⟧ ⟦g⟧

{X₁ Y₁ X₂ Y₂ : CategoryTheory.FreeMonoidalCategory C}

⟦f.tensor g⟧ = CategoryTheory.MonoidalCategory.tensorHom ⟦f⟧ ⟦g⟧


/-- If multiplying by `1` on either side is the identity, `1` is regular. -/
@[to_additive "If adding `0` on either side is the identity, `0` is regular."]
theorem isRegular_one : IsRegular (1 : R)


/-- Data for the general version of the implicit function theorem. It holds two functions
`f : E → F` and `g : E → G` (named `leftFun` and `rightFun`) and a point `a` (named `pt`) such that

* both functions are strictly differentiable at `a`;
* the derivatives are surjective;
* the kernels of the derivatives are complementary subspaces of `E`. -/
-- Porting note(#5171): linter not yet ported @[nolint has_nonempty_instance]
structure ImplicitFunctionData (𝕜 : Type*) [NontriviallyNormedField 𝕜] (E : Type*)
    [NormedAddCommGroup E] [NormedSpace 𝕜 E] [CompleteSpace E] (F : Type*) [NormedAddCommGroup F]
    [NormedSpace 𝕜 F] [CompleteSpace F] (G : Type*) [NormedAddCommGroup G] [NormedSpace 𝕜 G]
    [CompleteSpace G] where
  leftFun : E → F
  leftDeriv : E →L[𝕜] F
  rightFun : E → G
  rightDeriv : E →L[𝕜] G
  pt : E
  left_has_deriv : HasStrictFDerivAt leftFun leftDeriv pt
  right_has_deriv : HasStrictFDerivAt rightFun rightDeriv pt
  left_range : range leftDeriv = ⊤
  right_range : range rightDeriv = ⊤
  isCompl_ker : IsCompl (ker leftDeriv) (ker rightDeriv)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[CompleteSpace G]
(self : ImplicitFunctionData 𝕜 E F G)


@[reassoc (attr := simp)]
lemma d_comp_XIsoOfEq_hom (K : HomologicalComplex V c) {p₂ p₃ : ι} (h : p₂ = p₃) (p₁ : ι) :
    K.d p₁ p₂ ≫ (K.XIsoOfEq h).hom = K.d p₁ p₃


theorem IsPeriodicPt.minimalPeriod_dvd (hx : IsPeriodicPt f n x) : minimalPeriod f x ∣ n

{α : Type u_1}
{f : α → α}
{x : α}
{n : ℕ}
(hx : Function.IsPeriodicPt f n x)


@[simp]
theorem SetLike.coe_gOne {S : Type*} [SetLike S R] [One R] [Zero ι] (A : ι → S)
    [SetLike.GradedOne A] : ↑(@GradedMonoid.GOne.one _ (fun i => A i) _ _) = (1 : R)

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[SetLike S R]
[One R]
[Zero ι]
(A : ι → S)
[SetLike.GradedOne A]


/-- A subgroup of a group `G` is a subset containing 1, closed under multiplication
and closed under multiplicative inverse. -/
structure Subgroup (G : Type*) [Group G] extends Submonoid G where
  /-- `G` is closed under inverses -/
  inv_mem' {x} : x ∈ carrier → x⁻¹ ∈ carrier

{G : Type u_5}
[Group G]
(self : Subgroup G)
{x : G}


@[simp]
theorem deriv_cosh : deriv cosh = sinh


@[simp] lemma counit_pow (a : A) (n : ℕ) : counit (R := R) (a ^ n) = counit a ^ n

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Bialgebra R A]
(a : A)
(n : ℕ)

Coalgebra.counit (a ^ n) = Coalgebra.counit a ^ n


@[to_additive (attr := congr)]
theorem finprod_congr_Prop {p q : Prop} {f : p → M} {g : q → M} (hpq : p = q)
    (hfg : ∀ h : q, f (hpq.mpr h) = g h) : finprod f = finprod g

{M : Type u_2}
[AddCommMonoid M]
{p q : Prop}
{f : p → M}
{g : q → M}
(hpq : p = q)
(hfg : ∀ (h : q), f ⋯ = g h)


theorem Pairwise.filter_map {S : β → β → Prop} (f : α → Option β)
    (H : ∀ a a' : α, R a a' → ∀ b ∈ f a, ∀ b' ∈ f a', S b b') {l : List α} (p : Pairwise R l) :
    Pairwise S (filterMap f l)

(H : ∀ (a a' : α), R a a' → ∀ (b : β), b ∈ f a → ∀ (b' : β), b' ∈ f a' → S b b')


@[simp]
theorem degree_C_mul_T (n : ℤ) (a : R) (a0 : a ≠ 0) : degree (C a * T n) = n

{R : Type u_1}
[Semiring R]
(n : ℤ)
(a : R)
(a0 : a ≠ 0)

(LaurentPolynomial.C a * LaurentPolynomial.T n).degree = ↑n


@[to_additive (attr := simp)]
theorem tprod_ite_eq (b : β) [DecidablePred (· = b)] (a : α) :
    ∏' b', (if b' = b then a else 1) = a

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
(b : β)
[DecidablePred fun x => x = b]
(a : α)

(∏' (b' : β), if b' = b then a else 1) = a


protected theorem add_left_cancel_iff {a b c : PartENat} (ha : a ≠ ⊤) : a + b = a + c ↔ b = c


theorem Ioc_union_Ioi' (h₁ : c ≤ b) : Ioc a b ∪ Ioi c = Ioi (min a c)

{α : Type u_1}
[LinearOrder α]
{a b c : α}
(h₁ : c ≤ b)

Set.Ioc a b ∪ Set.Ioi c = Set.Ioi (min a c)


theorem isConnected_iff_connectedSpace {s : Set α} : IsConnected s ↔ ConnectedSpace s

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


theorem sub_def (xs ys : IntList) :
    xs - ys = List.zipWithAll (fun x y => x.getD 0 - y.getD 0) xs ys


theorem inducedMap_inv_self (b : β) : inducedMap γ β (inducedMap β γ b) = b

LinearOrderedField.inducedMap γ β (LinearOrderedField.inducedMap β γ b) = b


theorem mem_selfAdjointMatricesSubmodule' :
    A ∈ selfAdjointMatricesSubmodule J ↔ J.IsSelfAdjoint A

{R₃ : Type u_7}
[CommRing R₃]
{n : Type u_11}
[Fintype n]
(J A : Matrix n n R₃)
[DecidableEq n]


/-- Note that `star_one` is already a global simp lemma, but this one works with dsimp too -/
@[simp]
theorem star_one : star (1 : FreeMonoid α) = 1


@[to_additive add_const]
theorem Antitone.mul_const' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] (hf : Antitone f) (a : α) :
    Antitone fun x => f x * a

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


theorem dedup_cons_of_mem' {a : α} {l : List α} (h : a ∈ dedup l) : dedup (a :: l) = dedup l

{α : Type u_1}
[DecidableEq α]
{a : α}
{l : List α}
(h : a ∈ l.dedup)


@[simp]
theorem div_smul {R} [Monoid R] [DistribMulAction R K[X]] [IsScalarTower R K[X] K[X]] (c : R)
    (p q : K[X]) :
    algebraMap _ (RatFunc K) (c • p) / algebraMap _ _ q =
      c • (algebraMap _ _ p / algebraMap _ _ q)

{K : Type u}
[CommRing K]
[IsDomain K]
{R : Type u_1}
[Monoid R]
[DistribMulAction R K[X]]
[IsScalarTower R K[X] K[X]]
(c : R)
(p q : K[X])

(algebraMap K[X] (RatFunc K)) (c • p) / (algebraMap K[X] (RatFunc K)) q =
  c • ((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q)


theorem hitting_mem_Icc {m : ι} (hnm : n ≤ m) (ω : Ω) : hitting u s n m ω ∈ Set.Icc n m

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
[ConditionallyCompleteLinearOrder ι]
{u : ι → Ω → β}
{s : Set β}
{n m : ι}
(hnm : n ≤ m)
(ω : Ω)

MeasureTheory.hitting u s n m ω ∈ Set.Icc n m


theorem toInt_eq_toNat_bmod (x : BitVec n) : x.toInt = Int.bmod x.toNat (2^n)


theorem nfpBFamily_fp {i hi} (H : IsNormal (f i hi)) (a) :
    f i hi (nfpBFamily.{u, v} o f a) = nfpBFamily.{u, v} o f a

{f : (b : Ordinal.{u}) → b < o → Ordinal.{max u v} → Ordinal.{max u v}}

f i hi (o.nfpBFamily f a) = o.nfpBFamily f a


@[to_additive]
theorem UniformContinuous.div [UniformSpace β] {f : β → α} {g : β → α} (hf : UniformContinuous f)
    (hg : UniformContinuous g) : UniformContinuous fun x => f x / g x

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
[UniformSpace β]
{f g : β → α}
(hf : UniformContinuous f)
(hg : UniformContinuous g)


@[simp]
theorem snd_zero [Zero R] [Zero M] : (0 : tsze R M).snd = 0

{R : Type u}
{M : Type v}
[Zero R]
[Zero M]


/-- `yoneda'` induces an equivalence of category between `Type u` and
`SheafOfTypes typesGrothendieckTopology`. -/
@[simps!]
noncomputable def typeEquiv : Type u ≌ SheafOfTypes typesGrothendieckTopology

∀ {X Y : Type uᵒᵖ} (f : X ⟶ Y) (g : Opposite.unop X ⟶ α) (a : Opposite.unop Y),
  (CategoryTheory.typeEquiv.functor.obj α).val.map f g a = g (f.unop a)


theorem map_apply' (f : α → γ) (g : β → δ) (p : α × β) : map f g p = (f p.1, g p.2)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(f : α → γ)
(g : β → δ)
(p : α × β)


@[simp]
theorem map_coe (f : α → β) (a : α) : map f a = f a

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


theorem normNoninc_iff_norm_le_one : f.NormNoninc ↔ ‖f‖ ≤ 1

{V : Type u_1}
{W : Type u_2}
[SeminormedAddCommGroup V]
[SeminormedAddCommGroup W]
{f : NormedAddGroupHom V W}


@[simp]
theorem refl_trans : (refl R E).trans e = e

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

(LinearIsometryEquiv.refl R E).trans e = e


theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b

{α : Type u_2}
(β : Type u_3)
[LinearOrderedField α]
[LinearOrderedField β]
[Archimedean α]
(a b : α)

LinearOrderedField.cutMap β (a + b) = LinearOrderedField.cutMap β a + LinearOrderedField.cutMap β b


@[to_additive add_le_of_nonpos_right]
theorem mul_le_of_le_one_right' [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} (h : b ≤ 1) :
    a * b ≤ a

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


theorem fromBlocks_submatrix_sum_swap_sum_swap {l m n o α : Type*} (A : Matrix n l α)
    (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α) :
    (fromBlocks A B C D).submatrix Sum.swap Sum.swap = fromBlocks D C B A

{l : Type u_14}
{m : Type u_15}
{n : Type u_16}
{o : Type u_17}
{α : Type u_18}
(A : Matrix n l α)
(B : Matrix n m α)
(C : Matrix o l α)
(D : Matrix o m α)

(Matrix.fromBlocks A B C D).submatrix Sum.swap Sum.swap = Matrix.fromBlocks D C B A


theorem Perm.join_congr :
    ∀ {l₁ l₂ : List (List α)} (_ : List.Forall₂ (· ~ ·) l₁ l₂), l₁.join ~ l₂.join

List.Forall₂ (fun x x_1 => x ~ x_1) l₁ l₂ → l₁.join ~ l₂.join


theorem ContinuousAt.prod_map {f : X → Z} {g : Y → W} {p : X × Y} (hf : ContinuousAt f p.fst)
    (hg : ContinuousAt g p.snd) : ContinuousAt (fun p : X × Y => (f p.1, g p.2)) p

{X : Type u}
{Y : Type v}
{Z : Type u_1}
{W : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[TopologicalSpace W]
{f : X → Z}
{g : Y → W}
{p : X × Y}
(hf : ContinuousAt f p.1)
(hg : ContinuousAt g p.2)

ContinuousAt (fun p => (f p.1, g p.2)) p


/-- In a finite measure space, assume that any open set can be approximated from inside by closed
sets. Then the measure is weakly regular. -/
theorem weaklyRegular_of_finite [BorelSpace α] (μ : Measure α) [IsFiniteMeasure μ]
    (H : InnerRegularWRT μ IsClosed IsOpen) : WeaklyRegular μ

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
[BorelSpace α]
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure μ]
(H : μ.InnerRegularWRT IsClosed IsOpen)


theorem to₂ {f : α × β → σ} (hf : Computable f) : Computable₂ fun a b => f (a, b)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α × β → σ}
(hf : Computable f)


theorem curry_eq (g : A ⊗ Y ⟶ X) : curry g = (ihom.coev A).app Y ≫ (ihom A).map g

(g : CategoryTheory.MonoidalCategory.tensorObj A Y ⟶ X)

CategoryTheory.MonoidalClosed.curry g =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.ihom.coev A).app Y) ((CategoryTheory.ihom A).map g)


theorem nat_casesOn_right {f : α → ℕ} {g : α → σ} {h : α → ℕ →. σ} (hf : Computable f)
    (hg : Computable g) (hh : Partrec₂ h) : Partrec fun a => (f a).casesOn (some (g a)) (h a)

{α : Type u_1}
{σ : Type u_4}
[Primcodable α]
[Primcodable σ]
{f : α → ℕ}
{g : α → σ}
{h : α → ℕ →. σ}
(hf : Computable f)
(hg : Computable g)
(hh : Partrec₂ h)

Partrec fun a => Nat.casesOn (f a) (Part.some (g a)) (h a)


@[to_additive (attr := simp)]
theorem coe_mk' : (mk' N : G → G ⧸ N) = mk

{G : Type u}
[AddGroup G]
(N : AddSubgroup G)
[nN : N.Normal]

⇑(QuotientAddGroup.mk' N) = QuotientAddGroup.mk


@[ext]
theorem SlashInvariantForm.ext {f g : SlashInvariantForm Γ k} (h : ∀ x, f x = g x) : f = g

{Γ : outParam (Subgroup SL(2, ℤ))}
{k : outParam ℤ}
{f g : SlashInvariantForm Γ k}
(h : ∀ (x : ℍ), f x = g x)


@[simp]
theorem snoc_eraseLast_last {s : CompositionSeries X} (h : IsMaximal s.eraseLast.last s.last) :
    s.eraseLast.snoc s.last h = s

(h : JordanHolderLattice.IsMaximal (RelSeries.eraseLast s).last (RelSeries.last s))

(RelSeries.eraseLast s).snoc (RelSeries.last s) h = s


@[simp]
theorem apply_ne_zero_iff [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) (i j : V) :
    ¬A i j = 0 ↔ A i j = 1

{V : Type u_1}
{α : Type u_2}
{A : Matrix V V α}
[MulZeroOneClass α]
[Nontrivial α]
(h : A.IsAdjMatrix)
(i j : V)


/-- We say that a collection of functions form a smooth partition of unity on a set `s` if

* all functions are infinitely smooth and nonnegative;
* the family `fun i ↦ support (f i)` is locally finite;
* for all `x ∈ s` the sum `∑ᶠ i, f i x` equals one;
* for all `x`, the sum `∑ᶠ i, f i x` is less than or equal to one. -/
structure SmoothPartitionOfUnity (s : Set M := univ) where
  /-- The family of functions forming the partition of unity. -/
  toFun : ι → C^∞⟮I, M; 𝓘(ℝ), ℝ⟯
  /-- Around each point, there are only finitely many nonzero functions in the family. -/
  locallyFinite' : LocallyFinite fun i => support (toFun i)
  /-- All the functions in the partition of unity are nonnegative. -/
  nonneg' : ∀ i x, 0 ≤ toFun i x
  /-- The functions in the partition of unity add up to `1` at any point of `s`. -/
  sum_eq_one' : ∀ x ∈ s, ∑ᶠ i, toFun i x = 1
  /-- The functions in the partition of unity add up to at most `1` everywhere. -/
  sum_le_one' : ∀ x, ∑ᶠ i, toFun i x ≤ 1

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : optParam (Set M) Set.univ}
(self : SmoothPartitionOfUnity ι I M s)
(x : M)


/-- A bilinear map into `Fin n.succ → M₃` can be built out of a map into `M₃` and a map into
`Fin n → M₃` -/
@[simps]
def LinearMap.vecCons₂ {n} (f : M →ₗ[R] M₂ →ₗ[R] M₃) (g : M →ₗ[R] M₂ →ₗ[R] Fin n → M₃) :
    M →ₗ[R] M₂ →ₗ[R] Fin n.succ → M₃

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R M₂]
[Module R M₃]
{n : ℕ}
(f : M →ₗ[R] M₂ →ₗ[R] M₃)
(g : M →ₗ[R] M₂ →ₗ[R] Fin n → M₃)
(m : M)


@[simp, refl] protected theorem Perm.refl : ∀ l : List α, l ~ l


theorem toAlgHom_toLinearMap (f : A →ₐc[R] B) :
    ((f : A →ₐ[R] B) : A →ₗ[R] B) = f

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(f : A →ₐc[R] B)


lemma normalClosure_def'' : normalClosure F K L = ⨆ f : L ≃ₐ[F] L, K.map f

{F : Type u_1}
{L : Type u_3}
[Field F]
[Field L]
[Algebra F L]
(K : IntermediateField F L)
[Normal F L]

normalClosure F (↥K) L = ⨆ f, IntermediateField.map (↑f) K


theorem card_bind (Q : ∀ i ∈ P.parts, Finpartition i) :
    (P.bind Q).parts.card = ∑ A ∈ P.parts.attach, (Q _ A.2).parts.card

(Q : (i : α) → i ∈ P.parts → Finpartition i)

(P.bind Q).parts.card = ∑ A ∈ P.parts.attach, (Q ↑A ⋯).parts.card


theorem toOrderHom_eq_coe (f : α →𝒄 β) : f.1 = f

{α : Type u}
{β : Type v}
[OmegaCompletePartialOrder α]
[OmegaCompletePartialOrder β]
(f : α →𝒄 β)


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

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


@[simp] theorem coe_top : (↑(⊤ : L) : α) = ⊤

{α : Type u_1}
[CompleteLattice α]
{L : CompleteSublattice α}


/-- The definitional equality between `p`-ary heterogeneous functions into `τ`
  and function from `vecHead p` to `(vecTail p)`-ary heterogeneous functions into `τ`. -/
@[simps!]
def fromTypes_succ_equiv {n} (p : Fin (n + 1) → Type u) (τ : Type u) :
    FromTypes p τ ≃ (vecHead p → FromTypes (vecTail p) τ)

{n : ℕ}
(p : Fin (n + 1) → Type u)
(τ : Type u)
(a : Function.FromTypes p τ)

(Function.fromTypes_succ_equiv p τ) a = a


@[simp]
theorem Term.realize_le [LE M] [L.OrderedStructure M] {t₁ t₂ : L.Term (α ⊕ (Fin n))} {v : α → M}
    {xs : Fin n → M} :
    (t₁.le t₂).Realize v xs ↔ t₁.realize (Sum.elim v xs) ≤ t₂.realize (Sum.elim v xs)

{L : FirstOrder.Language}
{α : Type w}
{M : Type w'}
{n : ℕ}
[L.IsOrdered]
[L.Structure M]
[LE M]
[L.OrderedStructure M]
{t₁ t₂ : L.Term (α ⊕ Fin n)}
{v : α → M}
{xs : Fin n → M}

(t₁.le t₂).Realize v xs ↔
  FirstOrder.Language.Term.realize (Sum.elim v xs) t₁ ≤ FirstOrder.Language.Term.realize (Sum.elim v xs) t₂


theorem neg_iff : z < 0 ↔ re z < 0 ∧ im z = 0

z < 0 ↔ RCLike.re z < 0 ∧ RCLike.im z = 0


@[to_additive]
lemma mul_not_mem_of_orderOf_eq_two {x y : G} (hx : orderOf x = 2)
    (hy : orderOf y = 2) (hxy : x ≠ y) : x * y ∉ ({x, y, 1} : Set G)

{G : Type u}
[AddGroup G]
{x y : G}
(hx : addOrderOf x = 2)
(hy : addOrderOf y = 2)
(hxy : x ≠ y)


theorem generateFrom_iUnion_isOpen (f : ι → TopologicalSpace α) :
    generateFrom (⋃ i, { s | IsOpen[f i] s }) = ⨅ i, f i

{α : Type u}
{ι : Sort v}
(f : ι → TopologicalSpace α)

TopologicalSpace.generateFrom (⋃ i, {s | IsOpen s}) = ⨅ i, f i