theorem map₂_inf_subset_right : map₂ m f (g₁ ⊓ g₂) ≤ map₂ m f g₁ ⊓ map₂ m f g₂

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

Filter.map₂ m f (g₁ ⊓ g₂) ≤ Filter.map₂ m f g₁ ⊓ Filter.map₂ m f g₂


@[simp]
theorem reflect_neg (f : R[X]) (N : ℕ) : reflect N (-f) = -reflect N f

{R : Type u_1}
[Ring R]
(f : Polynomial R)
(N : ℕ)

Polynomial.reflect N (-f) = -Polynomial.reflect N f


theorem integrable_zero : Integrable (0 : α →ₘ[μ] β)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]


@[to_additive]
theorem div_le_comm : a / b ≤ c ↔ a / c ≤ b

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


theorem prod_norm_eq_sup (f : WithLp ∞ (α × β)) : ‖f‖ = ‖f.fst‖ ⊔ ‖f.snd‖

{α : Type u_2}
{β : Type u_3}
[Norm α]
[Norm β]
(f : WithLp ⊤ (α × β))


protected theorem Periodic.nsmul_eq [AddMonoid α] (h : Periodic f c) (n : ℕ) : f (n • c) = f 0

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[AddMonoid α]
(h : Function.Periodic f c)
(n : ℕ)


@[simp]
theorem top_rpow_of_neg {y : ℝ} (h : y < 0) : (⊤ : ℝ≥0∞) ^ y = 0


theorem toMultiset_strictMono : StrictMono (@toMultiset ι)


theorem generate_eq_generate_inter (s : Set (Set α)) :
    generate s = generate (sInter '' { t | Set.Finite t ∧ t ⊆ s })

Filter.generate s = Filter.generate (Set.sInter '' {t | t.Finite ∧ t ⊆ s})


/-- Ring homomorphisms preserve additive inverse. -/
protected theorem map_neg [NonAssocRing α] [NonAssocRing β] (f : α →+* β) (x : α) : f (-x) = -f x

{α : Type u_2}
{β : Type u_3}
[NonAssocRing α]
[NonAssocRing β]
(f : α →+* β)
(x : α)


theorem count_factors_eq_find_of_dvd_pow [DecidableEq (Associates α)] {a p : Associates α}
    (hp : Irreducible p) [∀ n : ℕ, Decidable (a ∣ p ^ n)] {n : ℕ} (h : a ∣ p ^ n) :
    @Nat.find (fun n => a ∣ p ^ n) _ ⟨n, h⟩ = p.count a.factors

[(p : Associates α) → Decidable (Irreducible p)]


theorem bliminf_eq : bliminf u f p = sSup { a | ∀ᶠ x in f, p x → a ≤ u x }

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
{f : Filter β}
{u : β → α}
{p : β → Prop}

Filter.bliminf u f p = sSup {a | ∀ᶠ (x : β) in f, p x → a ≤ u x}


@[simp] theorem exists_false : ¬(∃ _a : α, False)


theorem base_smul_def (h : H) (w : NormalWord d) :
    base φ h • w = { w with head := h * w.head }

{d : Monoid.PushoutI.NormalWord.Transversal φ}

(Monoid.PushoutI.base φ) h • w = { toWord := w.toWord, head := h * w.head, normalized := ⋯ }


@[simp]
theorem map_functorial_obj (F : C ⥤ D) {X Y : C} (f : X ⟶ Y) : map F.obj f = F.map f

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


theorem Icc_subset_Ico_iff (h₁ : a₁ ≤ b₁) : Icc a₁ b₁ ⊆ Ico a₂ b₂ ↔ a₂ ≤ a₁ ∧ b₁ < b₂

{α : Type u_1}
[Preorder α]
{a₁ a₂ b₁ b₂ : α}
(h₁ : a₁ ≤ b₁)

Set.Icc a₁ b₁ ⊆ Set.Ico a₂ b₂ ↔ a₂ ≤ a₁ ∧ b₁ < b₂


theorem zeroLocus_mul (I J : Ideal R) :
    zeroLocus ((I * J : Ideal R) : Set R) = zeroLocus I ∪ zeroLocus J

{R : Type u}
[CommSemiring R]
(I J : Ideal R)

PrimeSpectrum.zeroLocus ↑(I * J) = PrimeSpectrum.zeroLocus ↑I ∪ PrimeSpectrum.zeroLocus ↑J


theorem measurable_from_quotient {s : Setoid α} {f : Quotient s → β} :
    Measurable f ↔ Measurable (f ∘ Quotient.mk'')

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{s : Setoid α}
{f : Quotient s → β}


@[to_additive (attr := simp)]
theorem div_div_cancel (a b : G) : a / (a / b) = b

{G : Type u_3}
[AddCommGroup G]
(a b : G)


@[to_additive (attr := simp)]
theorem inv_apply (μ : Measure G) (s : Set G) : μ.inv s = μ s⁻¹

{G : Type u_2}
[MeasurableSpace G]
[InvolutiveInv G]
[MeasurableInv G]
(μ : MeasureTheory.Measure G)
(s : Set G)


theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
    H.map f ≤ H' ↔ H ≤ H'.comap f

{V : Type u}
{W : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G →g G')
(H : G.Subgraph)
(H' : G'.Subgraph)

SimpleGraph.Subgraph.map f H ≤ H' ↔ H ≤ SimpleGraph.Subgraph.comap f H'


protected theorem neg_add_le_of_le_add {a b c : Int} (h : a ≤ b + c) : -b + a ≤ c


@[to_additive]
theorem isPeriodicPt_mul_iff_pow_eq_one (x : G) : IsPeriodicPt (x * ·) n 1 ↔ x ^ n = 1

{G : Type u_1}
[Monoid G]
{n : ℕ}
(x : G)

Function.IsPeriodicPt (fun x_1 => x * x_1) n 1 ↔ x ^ n = 1


@[simp]
theorem symmDiff_top' : a ∆ ⊤ = ￢a

{α : Type u_2}
[CoheytingAlgebra α]
(a : α)


theorem interedges_biUnion_right (s : Finset α) (t : Finset ι) (f : ι → Finset β) :
    interedges r s (t.biUnion f) = t.biUnion fun b ↦ interedges r s (f b)

{ι : Type u_2}
{α : Type u_4}
{β : Type u_5}
(r : α → β → Prop)
[(a : α) → DecidablePred (r a)]
[DecidableEq α]
[DecidableEq β]
(s : Finset α)
(t : Finset ι)
(f : ι → Finset β)

Rel.interedges r s (t.biUnion f) = t.biUnion fun b => Rel.interedges r s (f b)


@[simp]
theorem isBounded_closure_iff : IsBounded (closure s) ↔ IsBounded s

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

Bornology.IsBounded (closure s) ↔ Bornology.IsBounded s


@[simp]
theorem mem_toSubsemiring {s : Subring R} {x : R} : x ∈ s.toSubsemiring ↔ x ∈ s

{R : Type u}
[Ring R]
{s : Subring R}
{x : R}


@[to_additive (attr := simp, norm_cast)]
theorem unop_natCast [NatCast α] (n : ℕ) : unop (n : αᵐᵒᵖ) = n


/-- `Sum.inl` as a relation embedding into `Sum.LiftRel r s`. -/
@[simps]
def sumLiftRelInl (r : α → α → Prop) (s : β → β → Prop) : r ↪r Sum.LiftRel r s

{α : Type u_1}
{β : Type u_2}
(r : α → α → Prop)
(s : β → β → Prop)
(val : α)

(RelEmbedding.sumLiftRelInl r s) val = Sum.inl val


/-- If `f` is a continuous monotone map `ℝ → ℝ`, `f (x + 1) = f x + 1`, then there exists `x`
such that `f x = x + τ f`. -/
theorem exists_eq_add_translationNumber (hf : Continuous f) : ∃ x, f x = x + τ f

(f : CircleDeg1Lift)
(hf : Continuous ⇑f)


@[simp]
theorem mem_iff_mem {x : α} {z : Sym2 α} : Sym2.Mem x z ↔ x ∈ z


@[simp]
theorem toFinset_subset : s.toFinset ⊆ t.toFinset ↔ s ⊆ t

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


theorem mapL_opNorm : ‖mapL f‖ ≤ ∏ i, ‖f i‖

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

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

‖PiTensorProduct.mapL f‖ ≤ ∏ i : ι, ‖f i‖


lemma extend_d_to_eq_zero (i' j' : ι') (j : ι) (hj : e.f j = j') (hj' : ¬ c.Rel (c.prev j) j) :
    (K.extend e).d i' j' = 0


theorem csSup_le_iff' {s : Set α} (hs : BddAbove s) {a : α} : sSup s ≤ a ↔ ∀ x ∈ s, x ≤ a

{α : Type u_1}
[ConditionallyCompleteLinearOrderBot α]
{s : Set α}
(hs : BddAbove s)
{a : α}


/-- Right-composition gives a functor `(D ⥤ E) ⥤ ((C ⥤ D) ⥤ (C ⥤ E))`.

`(whiskeringRight.obj H).obj F` is `F ⋙ H`, and
`(whiskeringRight.obj H).map α` is `whiskerRight α H`.
-/
@[simps]
def whiskeringRight : (D ⥤ E) ⥤ (C ⥤ D) ⥤ C ⥤ E

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

((CategoryTheory.whiskeringRight C D E).obj H).obj F = F.comp H


@[simp]
theorem clog_ofNat (b : ℕ) (n : ℕ) [n.AtLeastTwo] :
    clog b (no_index (OfNat.ofNat n : R)) = Nat.clog b (OfNat.ofNat n)

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
(b n : ℕ)
[n.AtLeastTwo]

Int.clog b (OfNat.ofNat n) = ↑(Nat.clog b (OfNat.ofNat n))


theorem count_le_cardinal (n : ℕ) : (count p n : Cardinal) ≤ Cardinal.mk { k | p k }

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

↑(Nat.count p n) ≤ Cardinal.mk ↑{k | p k}


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

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


theorem isInt_not_isCoprime : {x y nx ny : ℤ} →
    IsInt x nx → IsInt y ny → ¬ IsCoprime nx ny → ¬ IsCoprime x y

Mathlib.Meta.NormNum.IsInt x nx → Mathlib.Meta.NormNum.IsInt y ny → ¬IsCoprime nx ny → ¬IsCoprime x y


@[to_additive]
theorem prod_univ_two' [CommMonoid β] (f : α → β) (a b : α) :
    ∏ i, f (![a, b] i) = f a * f b

{α : Type u_1}
{β : Type u_2}
[CommMonoid β]
(f : α → β)
(a b : α)

∏ i : Fin (Nat.succ 0).succ, f (![a, b] i) = f a * f b


theorem IsCycle.isConj (hσ : IsCycle σ) (hτ : IsCycle τ) (h : σ.support.card = τ.support.card) :
    IsConj σ τ

{α : Type u_2}
[Fintype α]
[DecidableEq α]
{σ τ : Equiv.Perm α}
(hσ : σ.IsCycle)
(hτ : τ.IsCycle)
(h : σ.support.card = τ.support.card)


@[to_additive]
theorem index_ker (f : G →* G') : f.ker.index = Nat.card (Set.range f)

{G : Type u_1}
{G' : Type u_2}
[AddGroup G]
[AddGroup G']
(f : G →+ G')


theorem C_mul_dvd (ha : a ≠ 0) : C a * p ∣ q ↔ p ∣ q

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


theorem diam_Icc {a b : ℝ} (h : a ≤ b) : Metric.diam (Icc a b) = b - a


@[simp]
theorem map_id (s : WSeq α) : map id s = s


theorem lhopital_zero_left_on_Ioo (hff' : ∀ x ∈ Ioo a b, HasDerivAt f (f' x) x)
    (hgg' : ∀ x ∈ Ioo a b, HasDerivAt g (g' x) x) (hg' : ∀ x ∈ Ioo a b, g' x ≠ 0)
    (hfb : Tendsto f (𝓝[<] b) (𝓝 0)) (hgb : Tendsto g (𝓝[<] b) (𝓝 0))
    (hdiv : Tendsto (fun x => f' x / g' x) (𝓝[<] b) l) :
  Tendsto (fun x => f x / g x) (𝓝[<] b) l

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

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

(hdiv : Filter.Tendsto (fun x => f' x / g' x) (𝓝[<] b) l)

Filter.Tendsto (fun x => f x / g x) (𝓝[<] b) l


theorem nonempty_cauchyFilter_iff : Nonempty (CauchyFilter α) ↔ Nonempty α


@[deprecated DifferentiableAt.sub_iff_left (since := "2024-07-11")]
theorem differentiableAt_sub_const_iff (c : F) :
    DifferentiableAt 𝕜 (fun y => f y - c) x ↔ DifferentiableAt 𝕜 f x

{𝕜 : 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}
(c : F)


/-- A linear order is reflexive, transitive, antisymmetric and total relation `≤`.
We assume that every linear ordered type has decidable `(≤)`, `(<)`, and `(=)`. -/
class LinearOrder (α : Type u) extends PartialOrder α, Min α, Max α, Ord α :=
  /-- A linear order is total. -/
  le_total (a b : α) : a ≤ b ∨ b ≤ a
  /-- In a linearly ordered type, we assume the order relations are all decidable. -/
  decidableLE : DecidableRel (· ≤ · : α → α → Prop)
  /-- In a linearly ordered type, we assume the order relations are all decidable. -/
  decidableEq : DecidableEq α := @decidableEqOfDecidableLE _ _ decidableLE
  /-- In a linearly ordered type, we assume the order relations are all decidable. -/
  decidableLT : DecidableRel (· < · : α → α → Prop) :=
    @decidableLTOfDecidableLE _ _ decidableLE
  min := fun a b => if a ≤ b then a else b
  max := fun a b => if a ≤ b then b else a
  /-- The minimum function is equivalent to the one you get from `minOfLe`. -/
  min_def : ∀ a b, min a b = if a ≤ b then a else b := by intros; rfl
  /-- The minimum function is equivalent to the one you get from `maxOfLe`. -/
  max_def : ∀ a b, max a b = if a ≤ b then b else a := by intros; rfl
  compare a b := compareOfLessAndEq a b
  /-- Comparison via `compare` is equal to the canonical comparison given decidable `<` and `=`. -/
  compare_eq_compareOfLessAndEq : ∀ a b, compare a b = compareOfLessAndEq a b := by
    compareOfLessAndEq_rfl

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


@[mono]
theorem toAddSubmonoid_mono : Monotone (toAddSubmonoid : Subsemiring R → AddSubmonoid R)


theorem ext_iff {inst₁ inst₂ : NonUnitalNonAssocCommSemiring R} :
    inst₁ = inst₂ ↔
      (local_hAdd[R, inst₁] = local_hAdd[R, inst₂]) ∧
      (local_hMul[R, inst₁] = local_hMul[R, inst₂])

inst₁ = inst₂ ↔ HAdd.hAdd = HAdd.hAdd ∧ HMul.hMul = HMul.hMul


@[simp]
theorem mapDomain_zero {f : α → β} : mapDomain f (0 : α →₀ M) = (0 : β →₀ M)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddCommMonoid M]
{f : α → β}


/-- Evaluating a polynomial with integer coefficients at a rational number and clearing
denominators, yields a number greater than or equal to one.  The target can be any
`LinearOrderedField K`.
The assumption on `K` could be weakened to `LinearOrderedCommRing` assuming that the
image of the denominator is invertible in `K`. -/
theorem one_le_pow_mul_abs_eval_div {K : Type*} [LinearOrderedField K] {f : ℤ[X]} {a b : ℤ}
    (b0 : 0 < b) (fab : eval ((a : K) / b) (f.map (algebraMap ℤ K)) ≠ 0) :
    (1 : K) ≤ (b : K) ^ f.natDegree * |eval ((a : K) / b) (f.map (algebraMap ℤ K))|

(fab : Polynomial.eval (↑a / ↑b) (Polynomial.map (algebraMap ℤ K) f) ≠ 0)

1 ≤ ↑b ^ f.natDegree * |Polynomial.eval (↑a / ↑b) (Polynomial.map (algebraMap ℤ K) f)|


/-- The homotopy cofiber of a morphism of homological complexes,
also known as the mapping cone. -/
@[simps]
noncomputable def homotopyCofiber : HomologicalComplex C c

(HomologicalComplex.homotopyCofiber φ).X i = HomologicalComplex.homotopyCofiber.X φ i


theorem Set.EqOn.eventuallyEq_of_mem {α β} {s : Set α} {l : Filter α} {f g : α → β} (h : EqOn f g s)
    (hl : s ∈ l) : f =ᶠ[l] g

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{l : Filter α}
{f g : α → β}
(h : Set.EqOn f g s)
(hl : s ∈ l)


theorem AECover.integrable_of_lintegral_nnnorm_tendsto [l.NeBot] [l.IsCountablyGenerated]
    {φ : ι → Set α} (hφ : AECover μ l φ) {f : α → E} (I : ℝ) (hfm : AEStronglyMeasurable f μ)
    (htendsto : Tendsto (fun i => ∫⁻ x in φ i, ‖f x‖₊ ∂μ) l (𝓝 <| ENNReal.ofReal I)) :
    Integrable f μ

(hfm : MeasureTheory.AEStronglyMeasurable f μ)

(htendsto : Filter.Tendsto (fun i => ∫⁻ (x : α) in φ i, ↑‖f x‖₊ ∂μ) l (𝓝 (ENNReal.ofReal I)))


@[simp] theorem elem_eq_mem [BEq α] [LawfulBEq α] (a : α) (as : List α) :
    elem a as = decide (a ∈ as)

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


private theorem tendsto_zero_of_norm_tendsto_zero : Tendsto (fun i => F.eval (ncs i)) atTop (𝓝 0)

(hnorm : Filter.Tendsto (fun i => ‖Polynomial.eval (↑ncs i) F‖) Filter.atTop (𝓝 0))

Filter.Tendsto (fun i => Polynomial.eval (↑ncs i) F) Filter.atTop (𝓝 0)


@[to_additive]
theorem mulSupport_mulSingle_disjoint {b' : B} (hb : b ≠ 1) (hb' : b' ≠ 1) {i j : A} :
    Disjoint (mulSupport (mulSingle i b)) (mulSupport (mulSingle j b')) ↔ i ≠ j

{A : Type u_1}
{B : Type u_2}
[DecidableEq A]
[Zero B]
{b b' : B}
(hb : b ≠ 0)
(hb' : b' ≠ 0)
{i j : A}

Disjoint (Function.support (Pi.single i b)) (Function.support (Pi.single j b')) ↔ i ≠ j


theorem expMapCircle_sub_two_pi (x : ℝ) : expMapCircle (x - 2 * π) = expMapCircle x


/-- If the composition of two continuous functions `g ∘ f` is proper and `f` is surjective,
then `g` is proper. -/
lemma isProperMap_of_comp_of_surj (hf : Continuous f)
    (hg : Continuous g) (hgf : IsProperMap (g ∘ f)) (f_surj : f.Surjective) : IsProperMap g

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X → Y}
{g : Y → Z}
(hf : Continuous f)
(hg : Continuous g)
(hgf : IsProperMap (g ∘ f))
(f_surj : Function.Surjective f)


@[simp] -- Porting note: add norm_cast; we leave it out for now to reproduce mathlib3 behavior.
theorem coe_zero : (↑(0 : ConvexBody V) : Set V) = 0

{V : Type u_1}
[TopologicalSpace V]
[AddCommGroup V]
[Module ℝ V]


@[simp]
theorem withTop_comp (f : LatticeHom β γ) (g : LatticeHom α β) :
    (f.comp g).withTop = f.withTop.comp g.withTop

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


@[to_additive]
theorem smul_pi_subset [∀ i, SMul K (R i)] (r : K) (s : Set ι) (t : ∀ i, Set (R i)) :
    r • pi s t ⊆ pi s (r • t)

{K : Type u_1}
{ι : Type u_2}
{R : ι → Type u_3}
[(i : ι) → SMul K (R i)]
(r : K)
(s : Set ι)
(t : (i : ι) → Set (R i))


theorem mem_coLindelof : s ∈ coLindelof X ↔ ∃ t, IsLindelof t ∧ tᶜ ⊆ s

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

s ∈ Filter.coLindelof X ↔ ∃ t, IsLindelof t ∧ tᶜ ⊆ s


theorem Nodup.le_dedup_iff_le {s t : Multiset α} (hno : s.Nodup) : s ≤ t.dedup ↔ s ≤ t

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


@[simp] lemma inr_sup (b₁ b₂ : β) : (inrₗ (b₁ ⊔ b₂) : α ⊕ β) = inrₗ b₁ ⊔ inrₗ b₂

{α : Type u_1}
{β : Type u_2}
[SemilatticeSup α]
[SemilatticeSup β]
(b₁ b₂ : β)

Sum.inrₗ (b₁ ⊔ b₂) = Sum.inrₗ b₁ ⊔ Sum.inrₗ b₂


@[simp]
theorem decide_ite (u : Prop) [du : Decidable u] (p q : Prop)
      [dpq : Decidable (ite u p q)] [dp : Decidable p] [dq : Decidable q] :
    decide (ite u p q) = ite u (decide p) (decide q)

(u : Prop)
[du : Decidable u]
(p q : Prop)
[dpq : Decidable (if u then p else q)]
[dp : Decidable p]
[dq : Decidable q]

decide (if u then p else q) = if u then decide p else decide q


theorem GradedMonoid.list_prod_ofFn_eq_dProd {n : ℕ} (f : Fin n → GradedMonoid A) :
    (List.ofFn f).prod =
      GradedMonoid.mk _ ((List.finRange n).dProd (fun i => (f i).1) fun i => (f i).2)

{ι : Type u_1}
{A : ι → Type u_3}
[AddMonoid ι]
[GradedMonoid.GMonoid A]
{n : ℕ}
(f : Fin n → GradedMonoid A)

(List.ofFn f).prod =
  GradedMonoid.mk ((List.finRange n).dProdIndex fun i => (f i).fst)
    ((List.finRange n).dProd (fun i => (f i).fst) fun i => (f i).snd)


theorem EventuallyLE.countable_bUnion {ι : Type*} {S : Set ι} (hS : S.Countable)
    {s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) :
    ⋃ i ∈ S, s i ‹_› ≤ᶠ[l] ⋃ i ∈ S, t i ‹_›

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

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


/-- There is no surjection from `α : Type u` into `Type (max u v)`. This theorem
  demonstrates why `Type : Type` would be inconsistent in Lean. -/
theorem not_surjective_Type {α : Type u} (f : α → Type max u v) : ¬Surjective f


@[simp]
theorem cpow_nat_inv_pow (x : ℂ) {n : ℕ} (hn : n ≠ 0) : (x ^ (n⁻¹ : ℂ)) ^ n = x


@[simp]
theorem AList.toFinmap_entries (s : AList β) : ⟦s⟧.entries = s.entries

{α : Type u}
{β : α → Type v}
(s : AList β)


/-- If a preadditive category has all kernels, then it also has all equalizers. -/
theorem hasEqualizers_of_hasKernels [HasKernels C] : HasEqualizers C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Limits.HasKernels C]


@[simp]
theorem subset_union_left {s t : Set α} : s ⊆ s ∪ t


/-- A version of `UniformContinuous.inf_dom_left` for binary functions -/
theorem uniformContinuous_inf_dom_left₂ {α β γ} {f : α → β → γ} {ua1 ua2 : UniformSpace α}
    {ub1 ub2 : UniformSpace β} {uc1 : UniformSpace γ}
    (h : by haveI := ua1; haveI := ub1; exact UniformContinuous fun p : α × β => f p.1 p.2) : by
      haveI := ua1 ⊓ ua2; haveI := ub1 ⊓ ub2
      exact UniformContinuous fun p : α × β => f p.1 p.2

{f : α → β → γ}

(h : UniformContinuous fun p => f p.1 p.2)


theorem continuousOn_extChartAt (x : M) : ContinuousOn (extChartAt I x) (extChartAt I x).source

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(I : ModelWithCorners 𝕜 E H)
[ChartedSpace H M]
(x : M)

ContinuousOn (↑(extChartAt I x)) (extChartAt I x).source


@[simp] theorem val_last (n : Nat) : last n = n


protected theorem FiberBundle.extChartAt_target (x : TotalSpace F E) :
    (extChartAt (IB.prod 𝓘(𝕜, F)) x).target =
      ((extChartAt IB x.proj).target ∩
        (extChartAt IB x.proj).symm ⁻¹' (trivializationAt F E x.proj).baseSet) ×ˢ univ

[TopologicalSpace (Bundle.TotalSpace F E)]

(extChartAt (IB.prod 𝓘(𝕜, F)) x).target =
  ((extChartAt IB x.proj).target ∩ ↑(extChartAt IB x.proj).symm ⁻¹' (trivializationAt F E x.proj).baseSet) ×ˢ Set.univ


@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith [CommMonoid α] (x y : Vector α n) :
    x.toList.prod * y.toList.prod = (Vector.zipWith (· * ·) x y).toList.prod

{α : Type u_1}
{n : ℕ}
[AddCommMonoid α]
(x y : Mathlib.Vector α n)

x.toList.sum + y.toList.sum = (Mathlib.Vector.zipWith (fun x x_1 => x + x_1) x y).toList.sum


theorem mul_eval (l₁ l₂ : LinearCombo) (v : Coeffs) (w : l₁.coeffs.isZero ∨ l₂.coeffs.isZero) :
    (mul l₁ l₂).eval v = l₁.eval v * l₂.eval v

(l₁.mul l₂).eval v = l₁.eval v * l₂.eval v


@[to_additive]
theorem tendsto_inv_nhdsWithin_Ici_inv {a : H} : Tendsto Inv.inv (𝓝[≥] a⁻¹) (𝓝[≤] a)

{H : Type x}
[TopologicalSpace H]
[OrderedAddCommGroup H]
[ContinuousNeg H]
{a : H}

Filter.Tendsto Neg.neg (𝓝[≥] (-a)) (𝓝[≤] a)


@[simp] lemma supClosure_infClosure (s : Set α) : supClosure (infClosure s) = latticeClosure s

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


/-- The `ComplexShape` appropriate for cohomology, so `d : X i ⟶ X j` only when `j = i + 1`.
-/
@[simps!]
def up (α : Type*) [AddRightCancelSemigroup α] [One α] : ComplexShape α

(α : Type u_2)
[AddRightCancelSemigroup α]
[One α]
(i j : α)

(ComplexShape.up α).Rel i j = (i + 1 = j)


@[to_additive]
theorem mul_mk'_one_eq_mk' (x) (y : S) : f.toMap x * f.mk' 1 y = f.mk' x y

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


theorem inl_le_inr [LE α] [LE β] (a : α) (b : β) : toLex (inl a) ≤ toLex (inr b)

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


@[elementwise]
theorem w : res F U ≫ leftRes F U = res F U ≫ rightRes F U

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasProducts C]
{X : TopCat}
(F : TopCat.Presheaf C X)
{ι : Type v'}
(U : ι → TopologicalSpace.Opens ↑X)

TopCat.Presheaf.SheafConditionEqualizerProducts.res F U ≫ TopCat.Presheaf.SheafConditionEqualizerProducts.leftRes F U =
  TopCat.Presheaf.SheafConditionEqualizerProducts.res F U ≫ TopCat.Presheaf.SheafConditionEqualizerProducts.rightRes F U


theorem RemoveNone.mem_fiber (a : Option α) (f : Perm α) :
    f ∈ RemoveNone.fiber a ↔
      ∃ F : Perm (Option α), F ∈ derangements (Option α) ∧ F none = a ∧ removeNone F = f

{α : Type u_1}
[DecidableEq α]
(a : Option α)
(f : Equiv.Perm α)

f ∈ derangements.Equiv.RemoveNone.fiber a ↔ ∃ F ∈ derangements (Option α), F none = a ∧ Equiv.removeNone F = f


theorem isIrreducible_iff_singleton [T2Space X] {S : Set X} : IsIrreducible S ↔ ∃ x, S = {x}

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
{S : Set X}


@[to_additive]
lemma map_stabilizer_le (f : G →* H) (s : Set G) :
    (stabilizer G s).map f ≤ stabilizer H (f '' s)

{G : Type u_1}
{H : Type u_2}
[Group G]
[Group H]
(f : G →* H)
(s : Set G)

Subgroup.map f (MulAction.stabilizer G s) ≤ MulAction.stabilizer H (⇑f '' s)


lemma densityProcess_antitone_kernel_right {ν' : Kernel α γ}
    (hνν' : ν ≤ ν') (hκν : fst κ ≤ ν) (n : ℕ) (a : α) (x : γ) (s : Set β) :
    densityProcess κ ν' n a x s ≤ densityProcess κ ν n a x s

{κ : ProbabilityTheory.Kernel α (γ × β)}

κ.densityProcess ν' n a x s ≤ κ.densityProcess ν n a x s


theorem card_eq_sum_card_image [DecidableEq β] (f : α → β) (s : Finset α) :
    s.card = ∑ a ∈ s.image f, (s.filter fun x => f x = a).card

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

s.card = ∑ a ∈ Finset.image f s, (Finset.filter (fun x => f x = a) s).card


theorem hasDerivAt_arcsin {x : ℝ} (h₁ : x ≠ -1) (h₂ : x ≠ 1) :
    HasDerivAt arcsin (1 / √(1 - x ^ 2)) x

HasDerivAt Real.arcsin (1 / √(1 - x ^ 2)) x


theorem Periodic.const_inv_smul₀ [AddCommMonoid α] [DivisionSemiring γ] [Module γ α]
    (h : Periodic f c) (a : γ) : Periodic (fun x => f (a⁻¹ • x)) (a • c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{c : α}
[AddCommMonoid α]
[DivisionSemiring γ]
[Module γ α]
(h : Function.Periodic f c)
(a : γ)

Function.Periodic (fun x => f (a⁻¹ • x)) (a • c)


theorem exists_mulVec_eq_zero_iff' {A : Type*} (K : Type*) [DecidableEq n] [CommRing A]
    [Nontrivial A] [Field K] [Algebra A K] [IsFractionRing A K] {M : Matrix n n A} :
    (∃ v ≠ 0, M *ᵥ v = 0) ↔ M.det = 0

{n : Type u_1}
[Fintype n]
{A : Type u_4}
(K : Type u_5)
[DecidableEq n]
[CommRing A]
[Nontrivial A]
[Field K]
[Algebra A K]
[IsFractionRing A K]
{M : Matrix n n A}

(∃ v, v ≠ 0 ∧ M.mulVec v = 0) ↔ M.det = 0


@[gcongr]
protected theorem sub (h₁ : a ≡ b [ZMOD n]) (h₂ : c ≡ d [ZMOD n]) : a - c ≡ b - d [ZMOD n]

{n a b c d : ℤ}
(h₁ : a ≡ b [ZMOD n])
(h₂ : c ≡ d [ZMOD n])


theorem mapDomain.addMonoidHom_comp_mapRange [AddCommMonoid N] (f : α → β) (g : M →+ N) :
    (mapDomain.addMonoidHom f).comp (mapRange.addMonoidHom g) =
      (mapRange.addMonoidHom g).comp (mapDomain.addMonoidHom f)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
{N : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
(f : α → β)
(g : M →+ N)

(Finsupp.mapDomain.addMonoidHom f).comp (Finsupp.mapRange.addMonoidHom g) =
  (Finsupp.mapRange.addMonoidHom g).comp (Finsupp.mapDomain.addMonoidHom f)


@[to_additive (attr := simp)]
theorem _root_.Subgroup.ker_subtype (H : Subgroup G) : H.subtype.ker = ⊥

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


@[simp] lemma comp_sup_comp (a b : α) : comp a ⊔ comp b = comp (a ⊓ b)

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

Booleanisation.comp a ⊔ Booleanisation.comp b = Booleanisation.comp (a ⊓ b)


@[to_additive]
theorem elim_div_div [Div γ] : Sum.elim (a / a') (b / b') = Sum.elim a b / Sum.elim a' b'

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(a a' : α → γ)
(b b' : β → γ)
[Div γ]


/-- Given a measure `μ`, signed measures `s` and `t`, and a function `f` such that `t` is
mutually singular with respect to `μ` and `s = t + μ.withDensityᵥ f`, we have
`f = rnDeriv s μ`, i.e. `f` is the Radon-Nikodym derivative of `s` and `μ`. -/
theorem eq_rnDeriv (t : SignedMeasure α) (f : α → ℝ) (hfi : Integrable f μ)
    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    f =ᵐ[μ] s.rnDeriv μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : MeasureTheory.SignedMeasure α}
(t : MeasureTheory.SignedMeasure α)
(f : α → ℝ)
(hfi : MeasureTheory.Integrable f μ)
(htμ : t ⟂ᵥ μ.toENNRealVectorMeasure)
(hadd : s = t + μ.withDensityᵥ f)


theorem perm_split : ∀ {l l₁ l₂ : List α}, split l = (l₁, l₂) → l ~ l₁ ++ l₂


lemma basis_iff_basis_closure_of_subset (hIX : I ⊆ X) (hX : X ⊆ M.E := by aesop_mat) :
    M.Basis I X ↔ M.Basis I (M.closure X)

{α : Type u_2}
{M : Matroid α}
{X I : Set α}
(hIX : I ⊆ X)
(hX : X ⊆ M.E := by aesop_mat)


@[simp]
theorem empty_orElse (c) : (empty α <|> c) = c

(HOrElse.hOrElse (Computation.empty α) fun x => c) = c


theorem inner_self_nonneg {x : F} : 0 ≤ re ⟪x, x⟫

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


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

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


@[simp]
theorem neLocus_eq_empty {f g : α →₀ N} : f.neLocus g = ∅ ↔ f = g

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
{f g : α →₀ N}


@[simp, norm_cast]
lemma ofENat_le_ofENat {m n : ℕ∞} : (m : Cardinal) ≤ n ↔ m ≤ n

↑m ≤ ↑n ↔ m ≤ n


theorem mem_closure_iff_exists_term {x : M} :
    x ∈ closure L s ↔ ∃ t : L.Term s, t.realize ((↑) : s → M) = x

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

x ∈ (FirstOrder.Language.Substructure.closure L).toFun s ↔ ∃ t, FirstOrder.Language.Term.realize Subtype.val t = x


theorem _root_.AlgEquiv.map_det [Algebra R S] {T : Type z} [CommRing T] [Algebra R T]
    (f : S ≃ₐ[R] T) (M : Matrix n n S) : f M.det = Matrix.det (f.mapMatrix M)

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{S : Type w}
[CommRing S]
[Algebra R S]
{T : Type z}
[CommRing T]
[Algebra R T]
(f : S ≃ₐ[R] T)
(M : Matrix n n S)


/-- For an outer regular measure, the measure of a set is the infimum of the measures of open sets
containing it. -/
theorem _root_.Set.measure_eq_iInf_isOpen (A : Set α) (μ : Measure α) [OuterRegular μ] :
    μ A = ⨅ (U : Set α) (_ : A ⊆ U) (_ : IsOpen U), μ U

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
(A : Set α)
(μ : MeasureTheory.Measure α)
[μ.OuterRegular]

μ A = ⨅ U, ⨅ (_ : A ⊆ U), ⨅ (_ : IsOpen U), μ U


/-- The Euler integral for the `Γ` function converges for positive real `s`. -/
theorem GammaIntegral_convergent {s : ℝ} (h : 0 < s) :
    IntegrableOn (fun x : ℝ => exp (-x) * x ^ (s - 1)) (Ioi 0)

MeasureTheory.IntegrableOn (fun x => rexp (-x) * x ^ (s - 1)) (Set.Ioi 0) MeasureTheory.volume


theorem selfZPow_of_nonneg {n : ℤ} (hn : 0 ≤ n) : selfZPow x B n = algebraMap R B x ^ n.natAbs

{R : Type u_1}
[CommRing R]
(x : R)
(B : Type u_2)
[CommRing B]
[Algebra R B]
[IsLocalization.Away x B]
{n : ℤ}
(hn : 0 ≤ n)

selfZPow x B n = (algebraMap R B) x ^ n.natAbs


@[simp]
theorem zpow_lt_iff_lt (hx : 1 < a) : a ^ m < a ^ n ↔ m < n

{α : Type u_1}
[LinearOrderedSemifield α]
{a : α}
{m n : ℤ}
(hx : 1 < a)


theorem toFinset_eq_of_perm (l l' : List α) (h : l ~ l') : l.toFinset = l'.toFinset

{α : Type u_1}
[DecidableEq α]
(l l' : List α)
(h : l.Perm l')


@[simp]
theorem lt_min'_iff : x < s.min' H ↔ ∀ y ∈ s, x < y

{α : Type u_2}
[LinearOrder α]
(s : Finset α)
(H : s.Nonempty)
{x : α}


@[simp]
lemma preimage_coe_Ioo (x y : ℝ) : Real.toEReal ⁻¹' Ioo x y = Ioo x y

Real.toEReal ⁻¹' Set.Ioo ↑x ↑y = Set.Ioo x y


@[simp]
theorem coe_mk (x y : ℤ) (prop : x ^ 2 - d * y ^ 2 = 1) : (↑(mk x y prop) : ℤ√d) = ⟨x, y⟩

↑(Pell.Solution₁.mk x y prop) = { re := x, im := y }


theorem image_interior (h : X ≃ₜ Y) (s : Set X) : h '' interior s = interior (h '' s)

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


theorem mem_sup : x ∈ p ⊔ p' ↔ ∃ y ∈ p, ∃ z ∈ p', y + z = x

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{x : M}
{p p' : Submodule R M}


theorem coe_def (s : NonemptyInterval α) : (s : Set α) = Set.Icc s.toProd.1 s.toProd.2

{α : Type u_1}
[PartialOrder α]
(s : NonemptyInterval α)


/-- If we're analytic at a point, we're analytic in a nonempty ball -/
theorem AnalyticAt.exists_ball_analyticOn {f : E → F} {x : E} (h : AnalyticAt 𝕜 f x) :
    ∃ r : ℝ, 0 < r ∧ AnalyticOn 𝕜 f (Metric.ball x r)

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

∃ r, 0 < r ∧ AnalyticOn 𝕜 f (Metric.ball x r)


theorem nthHomSeq_mul (r s : R) :
    nthHomSeq f_compat (r * s) ≈ nthHomSeq f_compat r * nthHomSeq f_compat s

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

PadicInt.nthHomSeq f_compat (r * s) ≈ PadicInt.nthHomSeq f_compat r * PadicInt.nthHomSeq f_compat s


lemma trace_blockDiagonal' [DecidableEq p] {m : p → Type*} [∀ i, Fintype (m i)]
    (M : ∀ i, Matrix (m i) (m i) R) :
    trace (blockDiagonal' M) = ∑ i, trace (M i)

{p : Type u_4}
{R : Type u_6}
[Fintype p]
[AddCommMonoid R]
[DecidableEq p]
{m : p → Type u_8}
[(i : p) → Fintype (m i)]
(M : (i : p) → Matrix (m i) (m i) R)

(Matrix.blockDiagonal' M).trace = ∑ i : p, (M i).trace


theorem liftPropWithinAt_indep_chart_target_aux2 (g : H → M') {x : H} {s : Set H}
    (hf : f ∈ G'.maximalAtlas M') (xf : g x ∈ f.source) (hf' : f' ∈ G'.maximalAtlas M')
    (xf' : g x ∈ f'.source) (hgs : ContinuousWithinAt g s x) : P (f ∘ g) s x ↔ P (f' ∘ g) s x

(hf : f ∈ StructureGroupoid.maximalAtlas M' G')

(hf' : f' ∈ StructureGroupoid.maximalAtlas M' G')


@[simp]
theorem braiding_naturality_right (X : ModuleCat R) {Y Z : ModuleCat R} (f : Y ⟶ Z) :
    X ◁ f ≫ (braiding X Z).hom = (braiding X Y).hom ≫ f ▷ X

{R : Type u}
[CommRing R]
(X : ModuleCat R)
{Y Z : ModuleCat R}
(f : Y ⟶ Z)

X ◁ f ≫ (X.braiding Z).hom = (X.braiding Y).hom ≫ f ▷ X


/-- `BEqCmp cmp` asserts that `cmp x y = .eq` and `x == y` coincide. -/
class BEqCmp [BEq α] (cmp : α → α → Ordering) : Prop where
  /-- `cmp x y = .eq` holds iff `x == y` is true. -/
  cmp_iff_beq : cmp x y = .eq ↔ x == y

{α : Type u_1}
[BEq α]
{cmp : α → α → Ordering}
[self : Batteries.BEqCmp cmp]
{x y : α}


theorem zip_map_right (f : β → γ) (l₁ : List α) (l₂ : List β) :
    zip l₁ (l₂.map f) = (zip l₁ l₂).map (Prod.map id f)

{β : Type u_1}
{γ : Type u_2}
{α : Type u_3}
(f : β → γ)
(l₁ : List α)
(l₂ : List β)

l₁.zip (List.map f l₂) = List.map (Prod.map id f) (l₁.zip l₂)


theorem powersetCard_sup [DecidableEq α] (u : Finset α) (n : ℕ) (hn : n < u.card) :
    (powersetCard n.succ u).sup id = u

{α : Type u_1}
[DecidableEq α]
(u : Finset α)
(n : ℕ)
(hn : n < u.card)

(Finset.powersetCard n.succ u).sup id = u


theorem compl_image_coe (s : Set X) : ((↑) '' s : Set (OnePoint X))ᶜ = (↑) '' sᶜ ∪ {∞}

(OnePoint.some '' s)ᶜ = OnePoint.some '' sᶜ ∪ {OnePoint.infty}


@[simp]
lemma reverse_iInf {ι : Sort*} (l : ι → Language α) : (⨅ i, l i).reverse = ⨅ i, (l i).reverse

{α : Type u_1}
{ι : Sort u_4}
(l : ι → Language α)


theorem finSuccEquiv'_below {i : Fin (n + 1)} {m : Fin n} (h : Fin.castSucc m < i) :
    (finSuccEquiv' i) (Fin.castSucc m) = m

{n : ℕ}
{i : Fin (n + 1)}
{m : Fin n}
(h : m.castSucc < i)


@[to_additive]
theorem isLUB_inv' : IsLUB s⁻¹ a⁻¹ ↔ IsGLB s a

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

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


theorem chainHeight_insert_of_forall_lt (a : α) (ha : ∀ b ∈ s, b < a) :
    (insert a s).chainHeight = s.chainHeight + 1

{α : Type u_1}
{s : Set α}
[Preorder α]
(a : α)
(ha : ∀ b ∈ s, b < a)


/-- An antitone map sends a least element of a set to a greatest element of its image. -/
theorem map_isLeast : IsLeast s a → IsGreatest (f '' s) (f a)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : Antitone f)
{a : α}
{s : Set α}


/-- Local homeomorphism between a real (semi)normed space and the unit ball.
See also `Homeomorph.unitBall`. -/
@[simps (config := .lemmasOnly)]
def PartialHomeomorph.univUnitBall : PartialHomeomorph E E

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
(y : E)

↑PartialHomeomorph.univUnitBall.symm y = (√(1 - ‖y‖ ^ 2))⁻¹ • y


theorem coe_to_submodule_mk (p : Submodule R L) (h) :
    (({ p with lie_mem' := h } : LieSubalgebra R L) : Submodule R L) = p

(h : ∀ {x y : L}, x ∈ p.carrier → y ∈ p.carrier → ⁅x, y⁆ ∈ p.carrier)

{ toSubmodule := p, lie_mem' := h }.toSubmodule = p


(K : Type u_1)
[Field K]
[NumberField K]


@[simp]
theorem logb_eq_zero : logb b x = 0 ↔ b = 0 ∨ b = 1 ∨ b = -1 ∨ x = 0 ∨ x = 1 ∨ x = -1

Real.logb b x = 0 ↔ b = 0 ∨ b = 1 ∨ b = -1 ∨ x = 0 ∨ x = 1 ∨ x = -1


lemma card_singleton_prod (a : α) (t : Set β) : Nat.card ({a} ×ˢ t) = Nat.card t

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


lemma exact_map_iff_of_faithful [S.HasHomology]
    (F : C ⥤ D) [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] [F.Faithful] :
    (S.map F).Exact ↔ S.Exact


/-- If `e : S₁ ≅ S₂` is an isomorphism of short complexes and `h₁ : HomologyData S₁`,
this is the homology data for `S₂` deduced from the isomorphism. -/
@[simps!]
noncomputable def ofIso (e : S₁ ≅ S₂) (h : HomologyData S₁)

(CategoryTheory.ShortComplex.HomologyData.ofIso e h).iso = h.iso


@[to_additive (attr := simp, norm_cast)]
lemma op_ratCast [RatCast α] (q : ℚ) : op (q : α) = q


@[simp, norm_cast]
theorem cast_multiset_sum (s : Multiset ℚ) : (↑s.sum : α) = (s.map (↑)).sum

{α : Type u_2}
[DivisionRing α]
[CharZero α]
(s : Multiset ℚ)


theorem IsAdjointPair.mul {f g f' g' : Module.End R M} (h : IsAdjointPair B B f g)
    (h' : IsAdjointPair B B f' g') : IsAdjointPair B B (f * f') (g' * g)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
{f g f' g' : Module.End R M}
(h : B.IsAdjointPair B f g)
(h' : B.IsAdjointPair B f' g')


theorem HasLineDerivWithinAt.mono_of_mem
    (h : HasLineDerivWithinAt 𝕜 f f' t x v) (hst : t ∈ 𝓝[s] x) :
    HasLineDerivWithinAt 𝕜 f f' s x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : E → F}
{f' : F}
{s t : Set E}
{x v : E}
(h : HasLineDerivWithinAt 𝕜 f f' t x v)
(hst : t ∈ 𝓝[s] x)


/-- Triangles with triangle morphisms form a category.
-/
@[simps]
instance triangleCategory : Category (Triangle C)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.HasShift C ℤ]

∀ {X Y Z : CategoryTheory.Pretriangulated.Triangle C} (f : X ⟶ Y) (g : Y ⟶ Z),
  f ≫ g = CategoryTheory.Pretriangulated.TriangleMorphism.comp f g


/-- The degree of `cyclotomic n` is `totient n`. -/
theorem degree_cyclotomic (n : ℕ) (R : Type*) [Ring R] [Nontrivial R] :
    (cyclotomic n R).degree = Nat.totient n

(n : ℕ)
(R : Type u_1)
[Ring R]
[Nontrivial R]

(Polynomial.cyclotomic n R).degree = ↑n.totient


theorem noncommFold_cons (s : Multiset α) (a : α) (h h') (x : α) :
    noncommFold op (a ::ₘ s) h x = op a (noncommFold op s h' x)

(op : α → α → α)

(h : {x | x ∈ a ::ₘ s}.Pairwise fun x y => op x y = op y x)

(h' : {x | x ∈ s}.Pairwise fun x y => op x y = op y x)

Multiset.noncommFold op (a ::ₘ s) h x = op a (Multiset.noncommFold op s h' x)


@[simp]
theorem symm_apply_apply (e : M ≃ₗ⁅R,L⁆ N) : ∀ x, e.symm (e x) = x

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[LieRingModule L M]
[LieRingModule L N]
(e : M ≃ₗ⁅R,L⁆ N)
(x : M)


theorem natDegree_quadratic_le : natDegree (C a * X ^ 2 + C b * X + C c) ≤ 2

(Polynomial.C a * Polynomial.X ^ 2 + Polynomial.C b * Polynomial.X + Polynomial.C c).natDegree ≤ 2


theorem toMeasureOfLEZero_toSignedMeasure (hs : s ≤[Set.univ] 0) :
    (s.toMeasureOfLEZero Set.univ MeasurableSet.univ hs).toSignedMeasure = -s

(hs : MeasureTheory.VectorMeasure.restrict s Set.univ ≤ MeasureTheory.VectorMeasure.restrict 0 Set.univ)

(s.toMeasureOfLEZero Set.univ ⋯ hs).toSignedMeasure = -s


theorem domDomCongr_perm [Fintype ι] [DecidableEq ι] (σ : Equiv.Perm ι) :
    g.domDomCongr σ = Equiv.Perm.sign σ • g

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N' : Type u_6}
[AddCommGroup N']
[Module R N']
{ι : Type u_7}
(g : M [⋀^ι]→ₗ[R] N')
[Fintype ι]
[DecidableEq ι]
(σ : Equiv.Perm ι)

AlternatingMap.domDomCongr σ g = Equiv.Perm.sign σ • g


@[simp] lemma infs_self : s ⊼ s = s ↔ InfClosed s

{α : Type u_2}
[SemilatticeInf α]
{s : Set α}


theorem roots_expand_image_frobenius_subset [DecidableEq R] :
    (expand R p f).roots.toFinset.image (frobenius R p) ⊆ f.roots.toFinset

{R : Type u_1}
[CommRing R]
[IsDomain R]
(p : ℕ)
[ExpChar R p]
(f : R[X])
[DecidableEq R]

Finset.image (⇑(frobenius R p)) ((Polynomial.expand R p) f).roots.toFinset ⊆ f.roots.toFinset


@[to_additive]
theorem prod_filter_ne_one (s : Finset α) [∀ x, Decidable (f x ≠ 1)] :
    ∏ x ∈ s.filter fun x => f x ≠ 1, f x = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
{f : α → β}
[AddCommMonoid β]
(s : Finset α)
[(x : α) → Decidable (f x ≠ 0)]

∑ x ∈ Finset.filter (fun x => f x ≠ 0) s, f x = ∑ x ∈ s, f x


@[simp, norm_cast]
theorem val_smul_of_tower (s : S) (x : p) : ((s • x : p) : M) = s • (x : M)

{S : Type u'}
{R : Type u}
{M : Type v}
[Monoid R]
[MulAction R M]
[SMul S R]
[SMul S M]
[IsScalarTower S R M]
(p : SubMulAction R M)
(s : S)
(x : ↥p)


@[simp]
theorem map_zero (f : L₁ →ₗ⁅R⁆ L₂) : f 0 = 0

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


theorem BddBelow.dual (h : BddBelow s) : BddAbove (ofDual ⁻¹' s)

{α : Type u}
[Preorder α]
{s : Set α}
(h : BddBelow s)


theorem cons_rev {α n} (a : α) (f : Fin n → α) (i : Fin <| n + 1) :
    cons (α := fun _ => α) a f i.rev = snoc (α := fun _ => α) (f ∘ Fin.rev : Fin _ → α) a i

{α : Type u_1}
{n : ℕ}
(a : α)
(f : Fin n → α)
(i : Fin (n + 1))

Fin.cons a f i.rev = Fin.snoc (f ∘ Fin.rev) a i


@[simp] theorem ForInStep.bind_done [Monad m] (a : α) (f : α → m (ForInStep α)) :
    (ForInStep.done a).bind (m := m) f = pure (.done a)

{m : Type u_1 → Type u_2}
{α : Type u_1}
[Monad m]
(a : α)
(f : α → m (ForInStep α))

(ForInStep.done a).bind f = pure (ForInStep.done a)


@[simp]
theorem self_trans_symm (h : M ≃ₘ^n⟮I, J⟯ N) : h.trans h.symm = Diffeomorph.refl I M n

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


lemma condIndep_iff_condIndepSets (m' m₁ m₂ : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω}
    [StandardBorelSpace Ω] [Nonempty Ω] (hm' : m' ≤ mΩ) (μ : Measure Ω ) [IsFiniteMeasure μ] :
    CondIndep m' m₁ m₂ hm' μ
      ↔ CondIndepSets m' hm' {s | MeasurableSet[m₁] s} {s | MeasurableSet[m₂] s} μ

{Ω : Type u_1}
(m' m₁ m₂ : MeasurableSpace Ω)
{mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
(hm' : m' ≤ mΩ)
(μ : MeasureTheory.Measure Ω)
[MeasureTheory.IsFiniteMeasure μ]

ProbabilityTheory.CondIndep m' m₁ m₂ hm' μ ↔
  ProbabilityTheory.CondIndepSets m' hm' {s | MeasurableSet s} {s | MeasurableSet s} μ


theorem polarCoord_source_ae_eq_univ : polarCoord.source =ᵐ[volume] univ


theorem IsBigOWith.congr_right (h : IsBigOWith c l f g₁) (hg : ∀ x, g₁ x = g₂ x) :
    IsBigOWith c l f g₂

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


lemma ofENat_toENat_le (a : Cardinal) : ↑(toENat a) ≤ a


theorem map_surjective_of_surjective : Function.Surjective (map f)

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
{f : F}
(hf : Function.Surjective ⇑f)


/-- A subring `t` includes `closure s` if and only if it includes `s`. -/
@[simp]
theorem closure_le {s : Set R} {t : Subring R} : closure s ≤ t ↔ s ⊆ t

{R : Type u}
[Ring R]
{s : Set R}
{t : Subring R}


protected theorem pos_of_lt_add_left : n < k + n → 0 < k


/-- A family of seminorms is separating iff it induces a T₁ topology. -/
theorem WithSeminorms.separating_iff_T1 (hp : WithSeminorms p) :
    (∀ x, x ≠ 0 → ∃ i, p i x ≠ 0) ↔ T1Space E

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
[TopologicalSpace E]
{p : SeminormFamily 𝕜 E ι}
(hp : WithSeminorms p)

(∀ (x : E), x ≠ 0 → ∃ i, (p i) x ≠ 0) ↔ T1Space E


/-- The Monge point lies in the affine span. -/
theorem mongePoint_mem_affineSpan {n : ℕ} (s : Simplex ℝ P n) :
    s.mongePoint ∈ affineSpan ℝ (Set.range s.points)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P n)


protected theorem Periodic.neg_eq [AddGroup α] (h : Periodic f c) : f (-c) = f 0

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


theorem ofMul_image_powers_eq_multiples_ofMul [Monoid M] {x : M} :
    Additive.ofMul '' (Submonoid.powers x : Set M) = AddSubmonoid.multiples (Additive.ofMul x)

⇑Additive.ofMul '' ↑(Submonoid.powers x) = ↑(AddSubmonoid.multiples (Additive.ofMul x))


@[ext]
theorem limit_ext' (F : J ⥤ Type v) (x y : limit F) (w : ∀ j, limit.π F j x = limit.π F j y) :
    x = y

(w : ∀ (j : J), CategoryTheory.Limits.limit.π F j x = CategoryTheory.Limits.limit.π F j y)


theorem condIndep_iSup_of_directed_le {m : ι → MeasurableSpace Ω}
    (h_indep : ∀ i, CondIndep m' (m i) m₁ hm' μ)
    (h_le : ∀ i, m i ≤ mΩ) (h_le' : m₁ ≤ mΩ) (hm : Directed (· ≤ ·) m) :
    CondIndep m' (⨆ i, m i) m₁ hm' μ

(h_indep : ∀ (i : ι), ProbabilityTheory.CondIndep m' (m i) m₁ hm' μ)

(hm : Directed (fun x x_1 => x ≤ x_1) m)

ProbabilityTheory.CondIndep m' (⨆ i, m i) m₁ hm' μ


theorem tensorObj_counit (A B : Comon_ C) : (A ⊗ B).counit = (A.counit ⊗ B.counit) ≫ (λ_ _).hom

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

(A ⊗ B).counit = (A.counit ⊗ B.counit) ≫ (λ_ (𝟙_ C)).hom


/-- The exponential map in `𝕂 = ℝ` or `𝕂 = ℂ` has derivative `exp 𝕂 x` at any point `x`. -/
theorem hasDerivAt_exp {x : 𝕂} : HasDerivAt (exp 𝕂) (exp 𝕂 x) x

HasDerivAt (NormedSpace.exp 𝕂) (NormedSpace.exp 𝕂 x) x


/-- An antitone function between (conditionally) complete linear ordered spaces sends a
`Filter.limsInf` to the `Filter.limsup` of the image if the function is continuous at the `limsInf`
(and the filter is bounded from below and frequently bounded from above). -/
theorem Antitone.map_limsInf_of_continuousAt {F : Filter R} [NeBot F] {f : R → S}
    (f_decr : Antitone f) (f_cont : ContinuousAt f F.limsInf)
    (cobdd : F.IsCobounded (· ≥ ·) := by isBoundedDefault)
    (bdd_below : F.IsBounded (· ≥ ·) := by isBoundedDefault) : f F.limsInf = F.limsup f

(cobdd : Filter.IsCobounded (fun x x_1 => x ≥ x_1) F := by isBoundedDefault)

(bdd_below : Filter.IsBounded (fun x x_1 => x ≥ x_1) F := by isBoundedDefault)


theorem smul_def [SMul R' α] {S : Subsemiring R'} (g : S) (m : α) : g • m = (g : R') • m

{R' : Type u_1}
{α : Type u_2}
[NonAssocSemiring R']
[SMul R' α]
{S : Subsemiring R'}
(g : ↥S)
(m : α)


theorem eq_of_forall_dvd' (h : ∀ c, c ∣ a ↔ c ∣ b) : a = b

{α : Type u_1}
[CancelCommMonoidWithZero α]
{a b : α}
[Subsingleton αˣ]
(h : ∀ (c : α), c ∣ a ↔ c ∣ b)


protected theorem HasFDerivWithinAt.insert (h : HasFDerivWithinAt g g' s x) :
    HasFDerivWithinAt g g' (insert x s) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{g : E → F}
{g' : E →L[𝕜] F}
{x : E}
{s : Set E}
(h : HasFDerivWithinAt g g' s x)


theorem vcomp_app (α : NatTrans F G) (β : NatTrans G H) (X : C) :
    (vcomp α β).app X = α.app X ≫ β.app X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G H : CategoryTheory.Functor C D}
(α : CategoryTheory.NatTrans F G)
(β : CategoryTheory.NatTrans G H)
(X : C)

(α.vcomp β).app X = CategoryTheory.CategoryStruct.comp (α.app X) (β.app X)


theorem Submodule.rank_le_one_iff_isPrincipal (W : Submodule K V) [Module.Free K W] :
    Module.rank K W ≤ 1 ↔ W.IsPrincipal

{K : Type u}
{V : Type v}
[Ring K]
[StrongRankCondition K]
[AddCommGroup V]
[Module K V]
(W : Submodule K V)
[Module.Free K ↥W]


/-- Two n-simplices among cospherical points in n-space have the same
circumsphere. -/
theorem circumsphere_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional ℝ V]
    (hd : finrank ℝ V = n) (hc : Cospherical ps) {sx₁ sx₂ : Simplex ℝ P n}
    (hsx₁ : Set.range sx₁.points ⊆ ps) (hsx₂ : Set.range sx₂.points ⊆ ps) :
    sx₁.circumsphere = sx₂.circumsphere

(hd : FiniteDimensional.finrank ℝ V = n)


@[simp]
theorem constFormalMultilinearSeries_apply [NontriviallyNormedField 𝕜] [NormedAddCommGroup E]
    [NormedAddCommGroup F] [NormedSpace 𝕜 E] [NormedSpace 𝕜 F] {c : F} {n : ℕ} (hn : n ≠ 0) :
    constFormalMultilinearSeries 𝕜 E c n = 0

{𝕜 : Type u}
{E : Type v}
{F : Type w}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
{c : F}
{n : ℕ}
(hn : n ≠ 0)


theorem neg_lf_iff {x y : PGame} : -y ⧏ x ↔ -x ⧏ y


@[simp]
theorem length_copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
    (p.copy hu hv).length = p.length

{V : Type u}
{G : SimpleGraph V}
{u v u' v' : V}
(p : G.Walk u v)
(hu : u = u')
(hv : v = v')


@[simp]
theorem ofFintype_apply (a : α) : ofFintype f h a = f a

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


theorem pos_of_mem_rowLens (μ : YoungDiagram) (x : ℕ) (hx : x ∈ μ.rowLens) : 0 < x


theorem subset_inter {s₁ s₂ u : Finset α} : s₁ ⊆ s₂ → s₁ ⊆ u → s₁ ⊆ s₂ ∩ u

{α : Type u_1}
[DecidableEq α]
{s₁ s₂ u : Finset α}

s₁ ⊆ s₂ → s₁ ⊆ u → s₁ ⊆ s₂ ∩ u


@[to_additive (attr := simp)]
theorem pure_mul : pure a * g = g.map (a * ·)

{α : Type u_2}
[Add α]
{g : Filter α}
{a : α}

pure a + g = Filter.map (fun x => a + x) g


lemma mem_of_iso [ClosedUnderIsomorphisms P] {X Y : C} (e : X ≅ Y) (hX : P X) : P Y


@[to_additive]
theorem le_comap_of_map_le {T : Submonoid N} {f : F} : S.map f ≤ T → S ≤ T.comap f

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(S : Submonoid M)
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{T : Submonoid N}
{f : F}

Submonoid.map f S ≤ T → S ≤ Submonoid.comap f T


theorem sized_union : (A ∪ B).Sized r ↔ A.Sized r ∧ B.Sized r

{α : Type u_1}
{A B : Set (Finset α)}
{r : ℕ}

Set.Sized r (A ∪ B) ↔ Set.Sized r A ∧ Set.Sized r B


theorem sq_mul_squarefree (n : ℕ) : ∃ a b : ℕ, b ^ 2 * a = n ∧ Squarefree a


lemma IsLUB.exists_of_not_isSuccLimit (hf : IsLUB (Set.range f) x) (hx : ¬ IsSuccLimit x) :
    ∃ i, f i = x

{ι : Type u_1}
{α : Type u_2}
[ConditionallyCompleteLinearOrderBot α]
{f : ι → α}
{x : α}
(hf : IsLUB (Set.range f) x)
(hx : ¬Order.IsSuccLimit x)


@[simp, norm_cast]
theorem toBialgHom_inj {e₁ e₂ : A ≃ₐc[R] B} : (↑e₁ : A →ₐc[R] B) = e₂ ↔ e₁ = e₂

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
{e₁ e₂ : A ≃ₐc[R] B}

↑e₁ = ↑e₂ ↔ e₁ = e₂


lemma card_conjClasses_odd (hn : Odd n) :
    Nat.card (ConjClasses (DihedralGroup n)) = (n + 3) / 2


theorem evenOdd_mul_le (i j : ZMod 2) : evenOdd Q i * evenOdd Q j ≤ evenOdd Q (i + j)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(i j : ZMod 2)

CliffordAlgebra.evenOdd Q i * CliffordAlgebra.evenOdd Q j ≤ CliffordAlgebra.evenOdd Q (i + j)


theorem to_sup_of_normal_left' {H K : Subgroup G} (hH : IsPGroup p H) (hK : IsPGroup p K)
    (hHK : K ≤ H.normalizer) : IsPGroup p (H ⊔ K : Subgroup G)

{p : ℕ}
{G : Type u_1}
[Group G]
{H K : Subgroup G}
(hH : IsPGroup p ↥H)
(hK : IsPGroup p ↥K)
(hHK : K ≤ H.normalizer)


@[simp]
theorem cos_add_pi (θ : Angle) : cos (θ + π) = -cos θ


@[simp]
theorem toLinearEquiv_trans (e' : E₂ ≃ₛₗᵢ[σ₂₃] E₃) :
    (e.trans e').toLinearEquiv = e.toLinearEquiv.trans e'.toLinearEquiv

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

(e.trans e').toLinearEquiv = e.trans e'.toLinearEquiv


/-- `Solution'` is a tuple given by a solution to `a ^ 3 + b ^ 3 = u * c ^ 3`,
where `a`, `b`, `c` and `u` are as in `FermatLastTheoremForThreeGen`.
See `Solution` for the actual structure on which we will do the descent. -/
structure Solution' where
  a : 𝓞 K
  b : 𝓞 K
  c : 𝓞 K
  u : (𝓞 K)ˣ
  ha : ¬ λ ∣ a
  hb : ¬ λ ∣ b
  hc : c ≠ 0
  coprime : IsCoprime a b
  hcdvd : λ ∣ c
  H : a ^ 3 + b ^ 3 = u * c ^ 3

(self : FermatLastTheoremForThreeGen.Solution' hζ)

self.a ^ 3 + self.b ^ 3 = ↑self.u * self.c ^ 3


/-- The composition of `C^n` functions on domains is `C^n`. -/
theorem ContMDiffOn.comp {t : Set M'} {g : M' → M''} (hg : ContMDiffOn I' I'' n g t)
    (hf : ContMDiffOn I I' n f s) (st : s ⊆ f ⁻¹' t) : ContMDiffOn I I'' n (g ∘ f) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{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'}
{s : Set M}
{n : ℕ∞}
{t : Set M'}
{g : M' → M''}
(hg : ContMDiffOn I' I'' n g t)
(hf : ContMDiffOn I I' n f s)
(st : s ⊆ f ⁻¹' t)


/-- Equivalence of categories is reflexive. -/
@[refl, simps]
def refl : C ≌ C

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

CategoryTheory.Equivalence.refl.functor = CategoryTheory.Functor.id C


@[simp]
theorem smul_mul [Fintype n] [Monoid R] [DistribMulAction R α] [IsScalarTower R α α] (a : R)
    (M : Matrix m n α) (N : Matrix n l α) : (a • M) * N = a • (M * N)

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{R : Type u_7}
{α : Type v}
[AddCommMonoid α]
[Mul α]
[Fintype n]
[Monoid R]
[DistribMulAction R α]
[IsScalarTower R α α]
(a : R)
(M : Matrix m n α)
(N : Matrix n l α)


theorem quotientMap_mk : QuotientMap (mk : X → SeparationQuotient X)


lemma exists_egirth_eq_length :
    (∃ (a : α) (w : G.Walk a a), w.IsCycle ∧ G.egirth = w.length) ↔ ¬ G.IsAcyclic

(∃ a w, w.IsCycle ∧ G.egirth = ↑w.length) ↔ ¬G.IsAcyclic


theorem eLpNormEssSup_const (c : F) (hμ : μ ≠ 0) :
    eLpNormEssSup (fun _ : α => c) μ = (‖c‖₊ : ℝ≥0∞)

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
(c : F)
(hμ : μ ≠ 0)

MeasureTheory.eLpNormEssSup (fun x => c) μ = ↑‖c‖₊


theorem unitsModPrincipalUnitsEquivResidueFieldUnits_comp_quotientGroup_mk_apply
    (x : A.unitGroup) :
    A.unitsModPrincipalUnitsEquivResidueFieldUnits.toMonoidHom (QuotientGroup.mk x) =
      A.unitGroupToResidueFieldUnits x

{K : Type u}
[Field K]
(A : ValuationSubring K)
(x : ↥A.unitGroup)

A.unitsModPrincipalUnitsEquivResidueFieldUnits.toMonoidHom ↑x = A.unitGroupToResidueFieldUnits x


/-- The homeomorphism `homeomorphUnitSphereProd E` sends an additive Haar measure `μ`
to the product of `μ.toSphere` and `MeasureTheory.Measure.volumeIoiPow (dim E - 1)`,
where `dim E = FiniteDimensional.finrank ℝ E` is the dimension of `E`. -/
theorem measurePreserving_homeomorphUnitSphereProd :
    MeasurePreserving (homeomorphUnitSphereProd E) (μ.comap (↑))
      (μ.toSphere.prod (volumeIoiPow (dim E - 1)))

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]

MeasureTheory.MeasurePreserving (⇑(homeomorphUnitSphereProd E)) (MeasureTheory.Measure.comap Subtype.val μ)
  (μ.toSphere.prod (MeasureTheory.Measure.volumeIoiPow (dim E - 1)))


/-- We say that a type has `MeasurableInf` if `(c ⊓ ·)` and `(· ⊓ c)` are measurable functions.
For a typeclass assuming measurability of `uncurry (· ⊓ ·)` see `MeasurableInf₂`. -/
class MeasurableInf (M : Type*) [MeasurableSpace M] [Inf M] : Prop where
  measurable_const_inf : ∀ c : M, Measurable (c ⊓ ·)
  measurable_inf_const : ∀ c : M, Measurable (· ⊓ c)

{M : Type u_1}
[MeasurableSpace M]
[Inf M]
[self : MeasurableInf M]
(c : M)


/-- Closed seminorm-balls at the origin are absorbent. -/
protected theorem absorbent_closedBall_zero (hr : 0 < r) : Absorbent 𝕜 (closedBall p (0 : E) r)

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : Seminorm 𝕜 E)
{r : ℝ}
(hr : 0 < r)


theorem vec_iff {m n f} : @Vec m n f ↔ Primrec f

{f : Mathlib.Vector ℕ m → Mathlib.Vector ℕ n}


/-- Any invertible matrix rescales Lebesgue measure through the absolute value of its
determinant. -/
theorem map_matrix_volume_pi_eq_smul_volume_pi [DecidableEq ι] {M : Matrix ι ι ℝ} (hM : det M ≠ 0) :
    Measure.map (toLin' M) volume = ENNReal.ofReal (abs (det M)⁻¹) • volume

{ι : Type u_1}
[Fintype ι]
[DecidableEq ι]
{M : Matrix ι ι ℝ}
(hM : M.det ≠ 0)

MeasureTheory.Measure.map (⇑(Matrix.toLin' M)) MeasureTheory.volume = ENNReal.ofReal |M.det⁻¹| • MeasureTheory.volume


/-- If a set has zero measure in a neighborhood of each of its points, then it has zero measure
in a second-countable space. -/
theorem measure_null_of_locally_null [TopologicalSpace α] [SecondCountableTopology α]
    (s : Set α) (hs : ∀ x ∈ s, ∃ u ∈ 𝓝[s] x, μ u = 0) : μ s = 0

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
[TopologicalSpace α]
[SecondCountableTopology α]
(s : Set α)
(hs : ∀ x ∈ s, ∃ u ∈ 𝓝[s] x, μ u = 0)


@[to_additive (attr := simp, nolint simpComm)]
theorem unop_eq_one_iff [One α] (a : αᵐᵒᵖ) : a.unop = 1 ↔ a = 1


/-- A function `f` is an absolute value if it is nonnegative, zero only at 0, additive, and
multiplicative.

See also the type `AbsoluteValue` which represents a bundled version of absolute values.
-/
class IsAbsoluteValue {S} [OrderedSemiring S] {R} [Semiring R] (f : R → S) : Prop where
  /-- The absolute value is nonnegative -/
  abv_nonneg' : ∀ x, 0 ≤ f x
  /-- The absolute value is positive definitive -/
  abv_eq_zero' : ∀ {x}, f x = 0 ↔ x = 0
  /-- The absolute value satisfies the triangle inequality -/
  abv_add' : ∀ x y, f (x + y) ≤ f x + f y
  /-- The absolute value is multiplicative -/
  abv_mul' : ∀ x y, f (x * y) = f x * f y

{S : Type u_5}
[OrderedSemiring S]
{R : Type u_6}
[Semiring R]
{f : R → S}
[self : IsAbsoluteValue f]
(x y : R)


/-- Banach fixed-point theorem, contraction mapping theorem, `EMetricSpace` version.
A contracting map on a complete metric space has a fixed point.
We include more conclusions in this theorem to avoid proving them again later.

The main API for this theorem are the functions `efixedPoint` and `fixedPoint`,
and lemmas about these functions. -/
theorem exists_fixedPoint (hf : ContractingWith K f) (x : α) (hx : edist x (f x) ≠ ∞) :
    ∃ y, IsFixedPt f y ∧ Tendsto (fun n ↦ f^[n] x) atTop (𝓝 y) ∧
      ∀ n : ℕ, edist (f^[n] x) y ≤ edist x (f x) * (K : ℝ≥0∞) ^ n / (1 - K)

{α : Type u_1}
[EMetricSpace α]
[cs : CompleteSpace α]
{K : ℝ≥0}
{f : α → α}
(hf : ContractingWith K f)
(x : α)
(hx : edist x (f x) ≠ ⊤)

∃ y,
  Function.IsFixedPt f y ∧
    Filter.Tendsto (fun n => f^[n] x) Filter.atTop (𝓝 y) ∧
      ∀ (n : ℕ), edist (f^[n] x) y ≤ edist x (f x) * ↑K ^ n / (1 - ↑K)


theorem Kernel.integral_integral_sub ⦃f g : β × γ → E⦄ (hf : Integrable f ((κ ⊗ₖ η) a))
    (hg : Integrable g ((κ ⊗ₖ η) a)) :
    ∫ x, ∫ y, f (x, y) - g (x, y) ∂η (a, x) ∂κ a =
      ∫ x, ∫ y, f (x, y) ∂η (a, x) ∂κ a - ∫ x, ∫ y, g (x, y) ∂η (a, x) ∂κ a

{η : ProbabilityTheory.Kernel (α × β) γ}

⦃f g : β × γ → E⦄

(hf : MeasureTheory.Integrable f ((κ ⊗ₖ η) a))

(hg : MeasureTheory.Integrable g ((κ ⊗ₖ η) a))

∫ (x : β), ∫ (y : γ), f (x, y) - g (x, y) ∂η (a, x) ∂κ a =
  ∫ (x : β), ∫ (y : γ), f (x, y) ∂η (a, x) ∂κ a - ∫ (x : β), ∫ (y : γ), g (x, y) ∂η (a, x) ∂κ a


protected theorem le_of_add_le_add_left [LE α] [ContravariantClass α α (· + ·) (· ≤ ·)] (ha : a ≠ ⊤)
    (h : a + b ≤ a + c) : b ≤ c

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


/-- A point equals its orthogonal projection if and only if it lies in the subspace. -/
theorem orthogonalProjection_eq_self_iff {v : E} : (orthogonalProjection K v : E) = v ↔ v ∈ K

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[HasOrthogonalProjection K]
{v : E}

↑((orthogonalProjection K) v) = v ↔ v ∈ K


protected theorem norm_nonneg (x : E K) :
    0 ≤ mixedEmbedding.norm x

(x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ))


theorem tendsto_inf {f : α → β} {x : Filter α} {y₁ y₂ : Filter β} :
    Tendsto f x (y₁ ⊓ y₂) ↔ Tendsto f x y₁ ∧ Tendsto f x y₂

{α : Type u}
{β : Type v}
{f : α → β}
{x : Filter α}
{y₁ y₂ : Filter β}

Filter.Tendsto f x (y₁ ⊓ y₂) ↔ Filter.Tendsto f x y₁ ∧ Filter.Tendsto f x y₂


@[simp] lemma addRight_zero : Equiv.addRight (0 : α) = 1


@[reassoc (attr := simp)]
lemma Qiso_inv_hom_id {X Y : C} (s : X ⟶ Y) (hs : W s) :
    Qinv s hs  ≫ (Q W).map s = 𝟙 _

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[W.HasLeftCalculusOfFractions]
{X Y : C}
(s : X ⟶ Y)
(hs : W s)

CategoryTheory.CategoryStruct.comp (CategoryTheory.MorphismProperty.LeftFraction.Localization.Qinv s hs)
    ((CategoryTheory.MorphismProperty.LeftFraction.Localization.Q W).map s) =
  CategoryTheory.CategoryStruct.id ((CategoryTheory.MorphismProperty.LeftFraction.Localization.Q W).obj Y)


/-- If `j` is terminal in the index category, then the map `colimit.ι F j` is an isomorphism.
-/
theorem isIso_ι_of_isTerminal {j : J} (I : IsTerminal j) (F : J ⥤ C) [HasColimit F] :
    IsIso (colimit.ι F j)

(I : CategoryTheory.Limits.IsTerminal j)

CategoryTheory.IsIso (CategoryTheory.Limits.colimit.ι F j)


@[instance]
theorem atTop_neBot [Nonempty α] [SemilatticeSup α] : NeBot (atTop : Filter α)

{α : Type u_3}
[Nonempty α]
[SemilatticeSup α]


/-- Let `f` be a function continuous on a convex (or, equivalently, connected) subset `D`
of the real line. If `f` is differentiable on the interior of `D` and `C < f'`, then
`f` grows faster than `C * x` on `D`, i.e., `C * (y - x) < f y - f x` whenever `x, y ∈ D`,
`x < y`. -/
theorem Convex.mul_sub_lt_image_sub_of_lt_deriv {D : Set ℝ} (hD : Convex ℝ D) {f : ℝ → ℝ}
    (hf : ContinuousOn f D) (hf' : DifferentiableOn ℝ f (interior D)) {C}
    (hf'_gt : ∀ x ∈ interior D, C < deriv f x) :
    ∀ᵉ (x ∈ D) (y ∈ D), x < y → C * (y - x) < f y - f x

x ∈ D → ∀ y ∈ D, x < y → C * (y - x) < f y - f x


@[simp] lemma toLowerSet_specializes_toLowerSet {a b : α} :
  toLowerSet a ⤳ toLowerSet b ↔ a ≤ b

Topology.WithLowerSet.toLowerSet a ⤳ Topology.WithLowerSet.toLowerSet b ↔ a ≤ b


/-- The function `ContinuousLinearEquiv.inverse` can be written in terms of `Ring.inverse` for the
ring of self-maps of the domain. -/
theorem to_ring_inverse (e : M ≃L[R] M₂) (f : M →L[R] M₂) :
    inverse f = Ring.inverse ((e.symm : M₂ →L[R] M).comp f) ∘L e.symm

{R : Type u_1}
{M : Type u_2}
{M₂ : Type u_3}
[TopologicalSpace M]
[TopologicalSpace M₂]
[Ring R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M₂]
[Module R M₂]
(e : M ≃L[R] M₂)
(f : M →L[R] M₂)

f.inverse = (Ring.inverse ((↑e.symm).comp f)).comp ↑e.symm


/-- If `circulant v` is symmetric, `∀ i j : I, v (- i) = v i`. -/
theorem circulant_isSymm_apply [AddGroup n] {v : n → α} (h : (circulant v).IsSymm) (i : n) :
    v (-i) = v i

{α : Type u_1}
{n : Type u_4}
[AddGroup n]
{v : n → α}
(h : (Matrix.circulant v).IsSymm)
(i : n)


theorem preimage_invFun_of_not_mem [n : Nonempty α] {f : α → β} (hf : Injective f) {s : Set α}
    (h : Classical.choice n ∉ s) : invFun f ⁻¹' s = f '' s

{α : Type u_1}
{β : Type u_2}
[n : Nonempty α]
{f : α → β}
(hf : Function.Injective f)
{s : Set α}
(h : Classical.choice n ∉ s)


@[to_additive]
theorem IsUnit.Submonoid.coe_inv [Monoid M] (x : IsUnit.submonoid M) :
    ↑x⁻¹ = (↑x.prop.unit⁻¹ : M)

{M : Type u_1}
[AddMonoid M]
(x : ↥(IsAddUnit.addSubmonoid M))


/-- An alternative way to prove that `μ` is right invariant under multiplication. -/
@[to_additive " An alternative way to prove that `μ` is right invariant under addition. "]
theorem forall_measure_preimage_mul_right_iff (μ : Measure G) :
    (∀ (g : G) (A : Set G), MeasurableSet A → μ ((fun h => h * g) ⁻¹' A) = μ A) ↔
      IsMulRightInvariant μ

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

(∀ (g : G) (A : Set G), MeasurableSet A → μ ((fun h => h * g) ⁻¹' A) = μ A) ↔ μ.IsMulRightInvariant


protected theorem Tendsto.pow {f : Filter α} {m : α → ℝ≥0∞} {a : ℝ≥0∞} {n : ℕ}
    (hm : Tendsto m f (𝓝 a)) : Tendsto (fun x => m x ^ n) f (𝓝 (a ^ n))

{α : Type u_1}
{f : Filter α}
{m : α → ℝ≥0∞}
{a : ℝ≥0∞}
{n : ℕ}
(hm : Filter.Tendsto m f (𝓝 a))

Filter.Tendsto (fun x => m x ^ n) f (𝓝 (a ^ n))


theorem leftUnitor_naturality {X₁ X₂ : C} (f : X₁ ⟶ X₂) :
    tensorHom ℬ (𝟙 𝒯.cone.pt) f ≫ (BinaryFan.leftUnitor 𝒯.isLimit (ℬ 𝒯.cone.pt X₂).isLimit).hom =
      (BinaryFan.leftUnitor 𝒯.isLimit (ℬ 𝒯.cone.pt X₁).isLimit).hom ≫ f

(𝒯 : CategoryTheory.Limits.LimitCone (CategoryTheory.Functor.empty C))

(ℬ : (X Y : C) → CategoryTheory.Limits.LimitCone (CategoryTheory.Limits.pair X Y))

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ (CategoryTheory.CategoryStruct.id 𝒯.cone.pt) f)
    (CategoryTheory.Limits.BinaryFan.leftUnitor 𝒯.isLimit (ℬ 𝒯.cone.pt X₂).isLimit).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.BinaryFan.leftUnitor 𝒯.isLimit (ℬ 𝒯.cone.pt X₁).isLimit).hom
    f


theorem get?_len_le (a : Array α) (i : Nat) (h : a.size ≤ i) : a[i]? = none

{α : Type u_1}
(a : Array α)
(i : Nat)
(h : a.size ≤ i)


theorem equiv_iff [HasEquiv α] {p : α → Prop} {s t : Subtype p} : s ≈ t ↔ (s : α) ≈ (t : α)

{α : Sort u_1}
[HasEquiv α]
{p : α → Prop}
{s t : Subtype p}

s ≈ t ↔ ↑s ≈ ↑t


/-- Linear equivalence between linear maps `M₂ →ₗ[R] M₃`
and one-multilinear maps `MultilinearMap R (fun _ : ι ↦ M₂) M₃`. -/
@[simps (config := { simpRhs := true })]
def ofSubsingletonₗ [Subsingleton ι] (i : ι) :
    (M₂ →ₗ[R] M₃) ≃ₗ[S] MultilinearMap R (fun _ : ι ↦ M₂) M₃

(R : Type uR)
(S : Type uS)
{ι : Type uι}
(M₂ : Type v₂)
(M₃ : Type v₃)
[Semiring R]
[AddCommMonoid M₂]
[Module R M₂]
[Semiring S]
[AddCommMonoid M₃]
[Module S M₃]
[Module R M₃]
[SMulCommClass R S M₃]
[Subsingleton ι]
(i : ι)

∀ (a : M₂ →ₗ[R] M₃), (MultilinearMap.ofSubsingletonₗ R S M₂ M₃ i) a = (MultilinearMap.ofSubsingleton R M₂ M₃ i) a


/-- `x ↦ fderiv 𝕜 (f x) (g x)` is continuous. -/
theorem Continuous.fderiv {f : E → F → G} {g : E → F} {n : ℕ∞}
    (hf : ContDiff 𝕜 n <| Function.uncurry f) (hg : Continuous g) (hn : 1 ≤ n) :
    Continuous fun x => fderiv 𝕜 (f x) (g x)

(hf : ContDiff 𝕜 n (Function.uncurry f))


theorem T25Space.of_injective_continuous [TopologicalSpace Y] [T25Space Y] {f : X → Y}
    (hinj : Injective f) (hcont : Continuous f) : T25Space X

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T25Space Y]
{f : X → Y}
(hinj : Function.Injective f)
(hcont : Continuous f)


private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x

(x : A × ↥(CliffordAlgebra.even.lift.S f))

((CliffordAlgebra.even.lift.fFold f) m) (((CliffordAlgebra.even.lift.fFold f) m) x) = Q m • x


theorem aroots_def (p : T[X]) (S) [CommRing S] [IsDomain S] [Algebra T S] :
    p.aroots S = (p.map (algebraMap T S)).roots

{T : Type w}
[CommRing T]
(p : Polynomial T)
(S : Type u_1)
[CommRing S]
[IsDomain S]
[Algebra T S]

p.aroots S = (Polynomial.map (algebraMap T S) p).roots


protected theorem edist_dist (f g : Lp E p μ) : edist f g = .ofReal (dist f g)

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
(f g : ↥(MeasureTheory.Lp E p μ))


@[simp]
theorem spanSingleton_le_iff_mem {x : P} {I : FractionalIdeal S P} :
    spanSingleton S x ≤ I ↔ x ∈ I

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
[loc : IsLocalization S P]
{x : P}
{I : FractionalIdeal S P}

FractionalIdeal.spanSingleton S x ≤ I ↔ x ∈ I


@[norm_cast]
theorem coe_rpow_of_nonneg (x : ℝ≥0) {y : ℝ} (h : 0 ≤ y) : (x : ℝ≥0∞) ^ y = (x ^ y : ℝ≥0)


theorem convexHull_convexHull_union_right (s t : Set E) :
    convexHull 𝕜 (s ∪ convexHull 𝕜 t) = convexHull 𝕜 (s ∪ t)

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

(convexHull 𝕜) (s ∪ (convexHull 𝕜) t) = (convexHull 𝕜) (s ∪ t)


lemma bounded' (hf : IsCauSeq abv f) (x : α) : ∃ r > x, ∀ i, abv (f i) < r

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{f : ℕ → β}
(hf : IsCauSeq abv f)
(x : α)


theorem Perm.append_left {t₁ t₂ : List α} : ∀ l : List α, t₁ ~ t₂ → l ++ t₁ ~ l ++ t₂

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


theorem choose_spec {α : Sort u} {p : α → Prop} (h : ∃ x, p x) : p (choose h)


/-- A real Lipschitz function into a finite dimensional real vector space is differentiable
almost everywhere. For the general Rademacher theorem assuming
that the source space is finite dimensional, see `LipschitzWith.ae_differentiableAt`. -/
theorem LipschitzWith.ae_differentiableAt_real {C : ℝ≥0} {f : ℝ → V} (h : LipschitzWith C f) :
    ∀ᵐ x, DifferentiableAt ℝ f x

{V : Type u_3}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[FiniteDimensional ℝ V]
{C : ℝ≥0}
{f : ℝ → V}
(h : LipschitzWith C f)


@[gcongr] lemma smoothNumbers_mono {N M : ℕ} (hNM : N ≤ M) : N.smoothNumbers ⊆ M.smoothNumbers


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the left side and `g` on the right side. -/
@[simps!]
def fromArrowArrowFunctor : Arrow (Arrow C) ⥤ Square C

(f : CategoryTheory.Arrow (CategoryTheory.Arrow C))

(CategoryTheory.Square.fromArrowArrowFunctor.obj f).f₁₂ = f.hom.left


/-- Turn a limit of `F.leftOp : Jᵒᵖ ⥤ C` into a colimit of `F : J ⥤ Cᵒᵖ`. -/
@[simps]
def isColimitCoconeOfConeLeftOp (F : J ⥤ Cᵒᵖ) {c : Cone F.leftOp} (hc : IsLimit c) :
    IsColimit (coconeOfConeLeftOp c)

{c : CategoryTheory.Limits.Cone F.leftOp}

(CategoryTheory.Limits.isColimitCoconeOfConeLeftOp F hc).desc s =
  (hc.lift (CategoryTheory.Limits.coneLeftOpOfCocone s)).op


theorem map_nhds {f : X → α} :
    map f (𝓝 x) = ⨅ s ∈ { s : Set X | x ∈ s ∧ IsOpen s }, 𝓟 (f '' s)

{X : Type u}
{α : Type u_1}
{x : X}
[TopologicalSpace X]
{f : X → α}

Filter.map f (𝓝 x) = ⨅ s ∈ {s | x ∈ s ∧ IsOpen s}, 𝓟 (f '' s)


@[simp] theorem endofunctorMonoidalCategory_associator_hom_app (F G H : C ⥤ C) (X : C) :
  (α_ F G H).hom.app X = 𝟙 _

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(F G H : CategoryTheory.Functor C C)
(X : C)

(CategoryTheory.MonoidalCategory.associator F G H).hom.app X =
  CategoryTheory.CategoryStruct.id
    ((CategoryTheory.MonoidalCategory.tensorObj (CategoryTheory.MonoidalCategory.tensorObj F G) H).obj X)


/-- `fst` is the functor `(X, Y) ↦ X`. -/
@[simps]
def fst : C × D ⥤ C

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

∀ {X Y : C × D} (f : X ⟶ Y), (CategoryTheory.Prod.fst C D).map f = f.1


/-- Internal: Not intended to be used outside this local construction. -/
theorem PNat.isUnit_natCast [h : Fact (∀ I : Ideal R, I ≠ ⊤ → CharZero (R ⧸ I))]
    (n : ℕ+) : IsUnit (n : R)

[h : Fact (∀ (I : Ideal R), I ≠ ⊤ → CharZero (R ⧸ I))]


@[simp] theorem length_dropLast : ∀ (xs : List α), xs.dropLast.length = xs.length - 1


@[to_additive ThreeAPFree.prod]
theorem ThreeGPFree.prod {t : Set β} (hs : ThreeGPFree s) (ht : ThreeGPFree t) :
    ThreeGPFree (s ×ˢ t)

{α : Type u_2}
{β : Type u_3}
[Monoid α]
[Monoid β]
{s : Set α}
{t : Set β}
(hs : ThreeGPFree s)
(ht : ThreeGPFree t)


theorem mk'_add (x y : B) (hx : IsIntegral R x) (hy : IsIntegral R y) :
    mk' A (x + y) (hx.add hy) = mk' A x hx + mk' A y hy

{R : Type u_1}
(A : Type u_2)
{B : Type u_3}
[CommRing R]
[CommRing A]
[CommRing B]
[Algebra R B]
[Algebra A B]
[IsIntegralClosure A R B]
(x y : B)
(hx : IsIntegral R x)
(hy : IsIntegral R y)

IsIntegralClosure.mk' A (x + y) ⋯ = IsIntegralClosure.mk' A x hx + IsIntegralClosure.mk' A y hy


/-- A connected order is one satisfying the condition `a < c → a < b ∨ b < c`.
  This is recognizable as an intuitionistic substitute for `a ≤ b ∨ b ≤ a` on
  the constructive reals, and is also known as negative transitivity,
  since the contrapositive asserts transitivity of the relation `¬ a < b`.  -/
class IsOrderConnected (α : Type u) (lt : α → α → Prop) : Prop where
  /-- A connected order is one satisfying the condition `a < c → a < b ∨ b < c`. -/
  conn : ∀ a b c, lt a c → lt a b ∨ lt b c

{α : Type u}
{lt : α → α → Prop}
[self : IsOrderConnected α lt]
(a b c : α)


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

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

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


@[to_additive (attr := simp)]
theorem homQuotientZPowOfHom_comp :
    homQuotientZPowOfHom (f.comp g) n =
      (homQuotientZPowOfHom f n).comp (homQuotientZPowOfHom g n)

{A B : Type u}
[CommGroup A]
[CommGroup B]
(f : A →* B)
(g : B →* A)
(n : ℤ)

QuotientGroup.homQuotientZPowOfHom (f.comp g) n =
  (QuotientGroup.homQuotientZPowOfHom f n).comp (QuotientGroup.homQuotientZPowOfHom g n)


@[simp]
theorem subset_insert (x : α) (s : Set α) : s ⊆ insert x s


theorem MDifferentiableWithinAt.congr_of_eventuallyEq (h : MDifferentiableWithinAt I I' f s x)
    (h₁ : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : MDifferentiableWithinAt I I' f₁ s x


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

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

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


lemma exact_iff_of_epi_of_isIso_of_mono (φ : S₁ ⟶ S₂) [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] :
    S₁.Exact ↔ S₂.Exact


theorem log_surjective : Function.Surjective log


theorem integral_sin_pow_odd :
    (∫ x in (0)..π, sin x ^ (2 * n + 1)) = 2 * ∏ i ∈ range n, (2 * (i : ℝ) + 2) / (2 * i + 3)

∫ (x : ℝ) in 0 ..π, Real.sin x ^ (2 * n + 1) = 2 * ∏ i ∈ Finset.range n, (2 * ↑i + 2) / (2 * ↑i + 3)


theorem ae_map_le (h : QuasiMeasurePreserving f μa μb) : ae (μa.map f) ≤ ae μb

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

MeasureTheory.ae (MeasureTheory.Measure.map f μa) ≤ MeasureTheory.ae μb


nonrec theorem basis_toMatrix_basisFun_mul [Fintype ι]
    {𝕜} [SeminormedCommRing 𝕜] (b : Basis ι 𝕜 (PiLp p fun _ : ι => 𝕜))
    (A : Matrix ι ι 𝕜) :
    b.toMatrix (PiLp.basisFun _ _ _) * A =
      Matrix.of fun i j => b.repr ((WithLp.equiv _ _).symm (Aᵀ j)) i

(p : ℝ≥0∞)
{ι : Type u_2}
[Fintype ι]
{𝕜 : Type u_5}
[SeminormedCommRing 𝕜]
(b : Basis ι 𝕜 (PiLp p fun x => 𝕜))
(A : Matrix ι ι 𝕜)

b.toMatrix ⇑(PiLp.basisFun p 𝕜 ι) * A =
  Matrix.of fun i j => (b.repr ((WithLp.equiv p ((i : ι) → (fun x => 𝕜) i)).symm (A.transpose j))) i


theorem iff : HasLift sq ↔ Nonempty sq.LiftStruct

{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)


/-- The canonical `RightHomologyData` of a short complex `S` in an abelian category, for
which the `H` field is `Abelian.image (kernel.ι S.g ≫ cokernel.π S.f)`. -/
@[simps]
noncomputable def ofAbelian : S.RightHomologyData

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

(CategoryTheory.ShortComplex.RightHomologyData.ofAbelian S).Q = CategoryTheory.Limits.cokernel S.f


/-- Product over a sigma type equals the product of fiberwise products. For rewriting
in the reverse direction, use `Finset.prod_sigma'`.  -/
@[to_additive "Sum over a sigma type equals the sum of fiberwise sums. For rewriting
in the reverse direction, use `Finset.sum_sigma'`"]
theorem prod_sigma {σ : α → Type*} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : Sigma σ → β) :
    ∏ x ∈ s.sigma t, f x = ∏ a ∈ s, ∏ s ∈ t a, f ⟨a, s⟩

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
{σ : α → Type u_6}
(s : Finset α)
(t : (a : α) → Finset (σ a))
(f : Sigma σ → β)


theorem lintegral_mono_nnreal {f g : α → ℝ≥0} (h : f ≤ g) : ∫⁻ a, f a ∂μ ≤ ∫⁻ a, g a ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → ℝ≥0}
(h : f ≤ g)

∫⁻ (a : α), ↑(f a) ∂μ ≤ ∫⁻ (a : α), ↑(g a) ∂μ


/-- The Grothendieck construction applied to a functor to `Type`
(thought of as a functor to `Cat` by realising a type as a discrete category)
is the same as the 'category of elements' construction.
-/
-- See porting note on grothendieckTypeToCatInverse.
-- We just want to turn off grothendieckTypeToCat_inverse_map_fiber_down_down,
-- so have to list the complement here for `@[simps]`.
@[simps! functor_obj_fst functor_obj_snd functor_map_coe inverse_obj_base inverse_obj_fiber_as
  inverse_map_base unitIso_hom_app_base unitIso_hom_app_fiber unitIso_inv_app_base
  unitIso_inv_app_fiber counitIso_hom_app_coe counitIso_inv_app_coe]
def grothendieckTypeToCat : Grothendieck (G ⋙ typeToCat) ≌ G.Elements

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(G : CategoryTheory.Functor C (Type w))
(X : G.Elements)

((CategoryTheory.Grothendieck.grothendieckTypeToCat G).inverse.obj X).fiber.as = X.snd


theorem utf8Len_le_of_sublist : ∀ {cs₁ cs₂}, cs₁ <+ cs₂ → utf8Len cs₁ ≤ utf8Len cs₂

cs₁.Sublist cs₂ → String.utf8Len cs₁ ≤ String.utf8Len cs₂


@[ext]
lemma hom_ext {A B : PointedGaloisObject F} {f g : A ⟶ B} (h : f.val = g.val) : f = g

{F : CategoryTheory.Functor C FintypeCat}

{A B : CategoryTheory.PreGaloisCategory.PointedGaloisObject F}


@[to_additive]
theorem IsLowerSet.div_right (hs : IsLowerSet s) : IsLowerSet (s / t)

{α : Type u_1}
[OrderedCommGroup α]
{s t : Set α}
(hs : IsLowerSet s)


/-- If `C` is cofiltered, then `F : C ⥤ D` is initial if and only if `CostructuredArrow F d` is
    cofiltered for all `d : D`. -/
theorem Functor.initial_iff_isCofiltered_costructuredArrow [IsCofilteredOrEmpty C] :
    Initial F ↔ ∀ d, IsCofiltered (CostructuredArrow F d)

{C : Type v₁}
[CategoryTheory.Category.{v₁, v₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₂} D]
(F : CategoryTheory.Functor C D)
[CategoryTheory.IsCofilteredOrEmpty C]

F.Initial ↔ ∀ (d : D), CategoryTheory.IsCofiltered (CategoryTheory.CostructuredArrow F d)


@[simp]
lemma biUnion_subset_iff_forall_subset {α β : Type*} [DecidableEq β] {s : Finset α}
    {t : Finset β} {f : α → Finset β} : s.biUnion f ⊆ t ↔ ∀ x ∈ s, f x ⊆ t

{α : Type u_4}
{β : Type u_5}
[DecidableEq β]
{s : Finset α}
{t : Finset β}
{f : α → Finset β}


/-- Postcomposition of a continuous linear map with a linear isometry preserves
the operator norm. -/
theorem norm_toContinuousLinearMap_comp [RingHomIsometric σ₁₂] (f : F →ₛₗᵢ[σ₂₃] G)
    {g : E →SL[σ₁₂] F} : ‖f.toContinuousLinearMap.comp g‖ = ‖g‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{𝕜₃ : Type u_3}
{E : Type u_4}
{F : Type u_6}
{G : Type u_8}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedAddCommGroup G]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NontriviallyNormedField 𝕜₃]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[NormedSpace 𝕜₃ G]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{σ₂₃ : 𝕜₂ →+* 𝕜₃}
{σ₁₃ : 𝕜 →+* 𝕜₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
[RingHomIsometric σ₁₂]
(f : F →ₛₗᵢ[σ₂₃] G)
{g : E →SL[σ₁₂] F}


/-- The main proof of the lower bound part of the Akra-Bazzi theorem. The factor
`1 + ε n` does not change the asymptotic order, but is needed for the induction step to go
through. -/
lemma smoothingFn_mul_asympBound_isBigO_T :
    (fun (n : ℕ) => (1 + ε n) * asympBound g a b n) =O[atTop] T

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)

(fun n => (1 + AkraBazziRecurrence.smoothingFn ↑n) * AkraBazziRecurrence.asympBound g a b n) =O[Filter.atTop] T


@[simp]
theorem id_eq_id : Coalgebra.Hom.id V = 𝟙 V

(V : CategoryTheory.Endofunctor.Coalgebra F)

CategoryTheory.Endofunctor.Coalgebra.Hom.id V = CategoryTheory.CategoryStruct.id V


@[simp]
protected theorem det [Fintype n] (t : TransvectionStruct n R) : det t.toMatrix = 1

{n : Type u_1}
{R : Type u₂}
[DecidableEq n]
[CommRing R]
[Fintype n]
(t : Matrix.TransvectionStruct n R)


/-- `MulMemClass S M` says `S` is a type of sets `s : Set M` that are closed under `(*)` -/
class MulMemClass (S : Type*) (M : Type*) [Mul M] [SetLike S M] : Prop where
  /-- A substructure satisfying `MulMemClass` is closed under multiplication. -/
  mul_mem : ∀ {s : S} {a b : M}, a ∈ s → b ∈ s → a * b ∈ s

{S : Type u_4}
{M : Type u_5}
[Mul M]
[SetLike S M]
[self : MulMemClass S M]
{s : S}
{a b : M}


theorem map_comap (μ : Measure β) : (comap f μ).map f = μ.restrict (range f)

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
{m1 : MeasurableSpace β}
{f : α → β}
(hf : MeasurableEmbedding f)
(μ : MeasureTheory.Measure β)

MeasureTheory.Measure.map f (MeasureTheory.Measure.comap f μ) = μ.restrict (Set.range f)


theorem toDFinsupp_injective : Injective (toDFinsupp : Multiset α → Π₀ _a, ℕ)


theorem IsExtrFilter.neg (hf : IsExtrFilter f l a) : IsExtrFilter (fun x => -f x) l a

{α : Type u}
{β : Type v}
[OrderedAddCommGroup β]
{f : α → β}
{a : α}
{l : Filter α}
(hf : IsExtrFilter f l a)


theorem restrict_sUnion_congr {S : Set (Set α)} (hc : S.Countable) :
    μ.restrict (⋃₀ S) = ν.restrict (⋃₀ S) ↔ ∀ s ∈ S, μ.restrict s = ν.restrict s

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{S : Set (Set α)}
(hc : S.Countable)


lemma isOpenMap_eval (i : ι) : IsOpenMap (Function.eval i : (∀ i, π i) → π i)

{ι : Type u_1}
{π : ι → Type u_2}
[(i : ι) → TopologicalSpace (π i)]
(i : ι)


/-- An order is strongly atomic if every nontrivial interval `[a, b]`
contains an element covering `a`. -/
@[mk_iff]
class IsStronglyAtomic (α : Type*) [Preorder α] : Prop where
  exists_covBy_le_of_lt : ∀ (a b : α), a < b → ∃ x, a ⋖ x ∧ x ≤ b

{α : Type u_5}
[Preorder α]
[self : IsStronglyAtomic α]
(a b : α)


lemma mem_sumLexLift :
    c ∈ sumLexLift f₁ f₂ g₁ g₂ a b ↔
      (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f₁ a₁ b₁) ∨
        (∃ a₁ b₂ c₁, a = inl a₁ ∧ b = inr b₂ ∧ c = inl c₁ ∧ c₁ ∈ g₁ a₁ b₂) ∨
          (∃ a₁ b₂ c₂, a = inl a₁ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ g₂ a₁ b₂) ∨
            ∃ a₂ b₂ c₂, a = inr a₂ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ f₂ a₂ b₂

{α₁ : Type u_1}
{α₂ : Type u_2}
{β₁ : Type u_3}
{β₂ : Type u_4}
{γ₁ : Type u_5}
{γ₂ : Type u_6}
{f₁ : α₁ → β₁ → Finset γ₁}
{f₂ : α₂ → β₂ → Finset γ₂}
{g₁ : α₁ → β₂ → Finset γ₁}
{g₂ : α₁ → β₂ → Finset γ₂}
{a : α₁ ⊕ α₂}
{b : β₁ ⊕ β₂}
{c : γ₁ ⊕ γ₂}

c ∈ Finset.sumLexLift f₁ f₂ g₁ g₂ a b ↔
  (∃ a₁ b₁ c₁, a = Sum.inl a₁ ∧ b = Sum.inl b₁ ∧ c = Sum.inl c₁ ∧ c₁ ∈ f₁ a₁ b₁) ∨
    (∃ a₁ b₂ c₁, a = Sum.inl a₁ ∧ b = Sum.inr b₂ ∧ c = Sum.inl c₁ ∧ c₁ ∈ g₁ a₁ b₂) ∨
      (∃ a₁ b₂ c₂, a = Sum.inl a₁ ∧ b = Sum.inr b₂ ∧ c = Sum.inr c₂ ∧ c₂ ∈ g₂ a₁ b₂) ∨
        ∃ a₂ b₂ c₂, a = Sum.inr a₂ ∧ b = Sum.inr b₂ ∧ c = Sum.inr c₂ ∧ c₂ ∈ f₂ a₂ b₂


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

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

(X : CategoryTheory.Pretriangulated.Triangle C)

(CategoryTheory.Pretriangulated.rotCompInvRot.inv.app X).hom₂ = 𝟙 X.obj₂


@[simp]
theorem polar_iUnion {ι} {s : ι → Set E} : B.polar (⋃ i, s i) = ⋂ i, B.polar (s i)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NormedCommRing 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
(B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜)
{ι : Sort u_4}
{s : ι → Set E}


theorem wittStructureRat_existsUnique (Φ : MvPolynomial idx ℚ) :
    ∃! φ : ℕ → MvPolynomial (idx × ℕ) ℚ,
      ∀ n : ℕ, bind₁ φ (W_ ℚ n) = bind₁ (fun i => rename (Prod.mk i) (W_ ℚ n)) Φ

(p : ℕ)
{idx : Type u_2}
[hp : Fact (Nat.Prime p)]
(Φ : MvPolynomial idx ℚ)

∃! φ,
  ∀ (n : ℕ),
    (MvPolynomial.bind₁ φ) (W_ ℚ n) = (MvPolynomial.bind₁ fun i => (MvPolynomial.rename (Prod.mk i)) (W_ ℚ n)) Φ


@[simp]
theorem count_not_add_count (l : List Bool) (b : Bool) : count (!b) l + count b l = length l

List.count (!b) l + List.count b l = l.length


lemma killingForm_eq :
    killingForm R I = (killingForm R L).restrict I

(R : Type u_1)
(L : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[Module.Free R L]
[Module.Finite R L]
(I : LieIdeal R L)
[IsDomain R]
[IsPrincipalIdealRing R]

killingForm R ↥↑I = (killingForm R L).restrict (lieIdealSubalgebra R L I).toSubmodule


@[to_additive]
theorem forall_mk {C : α ⧸ s → Prop} : (∀ x : α ⧸ s, C x) ↔ ∀ x : α, C x

{α : Type u_1}
[Group α]
{s : Subgroup α}
{C : α ⧸ s → Prop}


/-- The functor which sends `S : SnakeInput C` to its zeroth line `S.L₀`. -/
@[simps]
def functorL₀ : SnakeInput C ⥤ ShortComplex C

(S : CategoryTheory.ShortComplex.SnakeInput C)

CategoryTheory.ShortComplex.SnakeInput.functorL₀.obj S = S.L₀


theorem natCast_ne_top (n : ℕ) : (n : EReal) ≠ ⊤


protected theorem coe_add (x y : S) : (↑(x + y) : A) = ↑x + ↑y

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
{S : NonUnitalSubalgebra R A}
(x y : ↥S)


theorem mk'_num_den (x : K) : mk' K (num A x) (den A x) = x

(A : Type u_4)
[CommRing A]
[IsDomain A]
[UniqueFactorizationMonoid A]
{K : Type u_5}
[Field K]
[Algebra A K]
[IsFractionRing A K]
(x : K)

IsLocalization.mk' K (IsFractionRing.num A x) (IsFractionRing.den A x) = x


@[simp]
theorem iSupLift_comp_inclusion {i : ι} (h : K i ≤ T) :
    (iSupLift K dir f hf T hT).comp (inclusion h) = f i

{dir : Directed (fun x x_1 => x ≤ x_1) K}

{hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (NonUnitalStarSubalgebra.inclusion h)}

(NonUnitalStarSubalgebra.iSupLift K dir f hf T hT).comp (NonUnitalStarSubalgebra.inclusion h) = f i


theorem mono_bliminf' (h : ∀ᶠ x in f, p x → u x ≤ v x) : bliminf u f p ≤ bliminf v f p

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : Filter β}
{p : β → Prop}
{u v : β → α}
(h : ∀ᶠ (x : β) in f, p x → u x ≤ v x)

Filter.bliminf u f p ≤ Filter.bliminf v f p


protected theorem nhds [CompleteSpace E] (e : E ≃L[𝕜] F) :
    range ((↑) : (E ≃L[𝕜] F) → E →L[𝕜] F) ∈ 𝓝 (e : E →L[𝕜] F)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace E]
(e : E ≃L[𝕜] F)

Set.range ContinuousLinearEquiv.toContinuousLinearMap ∈ 𝓝 ↑e


private theorem HD_optimalGHDist_le (g : Cb X Y) (hg : g ∈ candidatesB X Y) :
    HD (optimalGHDist X Y) ≤ HD g

(hg : g ∈ GromovHausdorff.candidatesB X Y)

GromovHausdorff.HD (GromovHausdorff.optimalGHDist X Y) ≤ GromovHausdorff.HD g


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

[∀ (X : Cᵒᵖ),
    Small.{v, max u₂ v}
      ↑((F ⋙ PresheafOfModules.evaluation R X) ⋙ CategoryTheory.forget (ModuleCat ↑(R.obj X))).sections]

(PresheafOfModules.limitBundledCore F).map f =
  CategoryTheory.Limits.limMap (CategoryTheory.whiskerLeft F (PresheafOfModules.restriction R f)) ≫
    (CategoryTheory.preservesLimitIso (ModuleCat.restrictScalars (R.map f)) (F ⋙ PresheafOfModules.evaluation R Y)).inv


theorem prod_coe_symm (e : PartialEquiv α β) (e' : PartialEquiv γ δ) :
    ((e.prod e').symm : β × δ → α × γ) = fun p => (e.symm p.1, e'.symm p.2)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(e : PartialEquiv α β)
(e' : PartialEquiv γ δ)

↑(e.prod e').symm = fun p => (↑e.symm p.1, ↑e'.symm p.2)


/-- The inclusion map of the Moore complex in the alternating face map complex,
as a natural transformation -/
@[simps]
def inclusionOfMooreComplex : normalizedMooreComplex A ⟶ alternatingFaceMapComplex A

(A : Type u_2)
[CategoryTheory.Category.{u_3, u_2} A]
[CategoryTheory.Abelian A]
(X : CategoryTheory.SimplicialObject A)

(AlgebraicTopology.inclusionOfMooreComplex A).app X = AlgebraicTopology.inclusionOfMooreComplexMap X


protected theorem id : LeftOrdContinuous (id : α → α)


@[fun_prop]
theorem DifferentiableOn.star (h : DifferentiableOn 𝕜 f s) :
    DifferentiableOn 𝕜 (fun y => star (f y)) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[StarRing 𝕜]
[TrivialStar 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[StarAddMonoid F]
[NormedSpace 𝕜 F]
[StarModule 𝕜 F]
[ContinuousStar F]
{f : E → F}
{s : Set E}
(h : DifferentiableOn 𝕜 f s)


lemma iSup_partitionFiltration_eq_generateFrom_range (ht : ∀ n, MeasurableSet (t n)) :
    ⨆ n, partitionFiltration ht n = generateFrom (Set.range t)

{α : Type u_1}
[m : MeasurableSpace α]
{t : ℕ → Set α}
(ht : ∀ (n : ℕ), MeasurableSet (t n))

⨆ n, ↑(ProbabilityTheory.partitionFiltration ht) n = MeasurableSpace.generateFrom (Set.range t)


theorem addVal_apply {x : HahnSeries Γ R} :
    addVal Γ R x = x.orderTop

{Γ : Type u_1}
{R : Type u_2}
[LinearOrderedCancelAddCommMonoid Γ]
[Ring R]
[IsDomain R]
{x : HahnSeries Γ R}


theorem nodup_append_comm {l₁ l₂ : List α} : Nodup (l₁ ++ l₂) ↔ Nodup (l₂ ++ l₁)


/-- If `(s : S)` is in the image of `f`, then `C s` lifts. -/
theorem C'_mem_lifts {f : R →+* S} {s : S} (h : s ∈ Set.range f) : C s ∈ lifts f

{R : Type u}
[Semiring R]
{S : Type v}
[Semiring S]
{f : R →+* S}
{s : S}
(h : s ∈ Set.range ⇑f)


@[to_additive]
theorem centralizer_univ : centralizer Set.univ = center G

AddSubgroup.centralizer Set.univ = AddSubgroup.center G


@[simp] lemma coe_toTopHom (f : InfTopHom α β) : ⇑f.toTopHom = f

{α : Type u_3}
{β : Type u_4}
[Inf α]
[Top α]
[Inf β]
[Top β]
(f : InfTopHom α β)


theorem indepSet_empty_left [IsProbabilityMeasure μ] (s : Set Ω) : IndepSet ∅ s μ

{Ω : Type u_1}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsProbabilityMeasure μ]
(s : Set Ω)


@[to_additive]
theorem inv_some [Inv α] (a : α) : (some a)⁻¹ = some a⁻¹


lemma tendsto_diracProba_iff_tendsto [CompletelyRegularSpace X] {x : X} (L : Filter X) :
    Tendsto diracProba L (𝓝 (diracProba x)) ↔ Tendsto id L (𝓝 x)

{X : Type u_1}
[MeasurableSpace X]
[TopologicalSpace X]
[OpensMeasurableSpace X]
[CompletelyRegularSpace X]
{x : X}
(L : Filter X)

Filter.Tendsto MeasureTheory.diracProba L (𝓝 (MeasureTheory.diracProba x)) ↔ Filter.Tendsto id L (𝓝 x)


theorem mul_nat (h : LiouvilleWith p x) (hn : n ≠ 0) : LiouvilleWith p (x * n)

{p x : ℝ}
{n : ℕ}
(h : LiouvilleWith p x)
(hn : n ≠ 0)


@[to_additive] lemma exists_mem_ne_one_of_prod_ne_one (h : l.prod ≠ 1) :
    ∃ x ∈ l, x ≠ (1 : M)

{M : Type u_4}
[AddMonoid M]
{l : List M}
(h : l.sum ≠ 0)


@[simp]
theorem aleph'_lt {o₁ o₂ : Ordinal} : aleph' o₁ < aleph' o₂ ↔ o₁ < o₂

Cardinal.aleph' o₁ < Cardinal.aleph' o₂ ↔ o₁ < o₂


@[simp]
theorem cons_vecAlt1 (h : m + 1 + 1 = n + 1 + (n + 1)) (x y : α) (u : Fin m → α) :
    vecAlt1 h (vecCons x (vecCons y u)) = vecCons y (vecAlt1 (by omega) u)

Matrix.vecAlt1 h (Matrix.vecCons x (Matrix.vecCons y u)) = Matrix.vecCons y (Matrix.vecAlt1 ⋯ u)


/-- Given a continuous function `f`, and a proof `h : P f`, we can define a `HomotopyWith f f P` by
`F (t, x) = f x`
-/
@[simps!]
def refl (f : C(X, Y)) (hf : P f) : HomotopyWith f f P

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{P : C(X, Y) → Prop}
(f : C(X, Y))
(hf : P f)
(x : ↑I × X)

(ContinuousMap.HomotopyWith.refl f hf) x = f x.2


@[simp]
theorem mk_sub [∀ i, AddGroup (β i)] {s : Finset ι} {x y : ∀ i : (↑s : Set ι), β i.1} :
    mk s (x - y) = mk s x - mk s y

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → AddGroup (β i)]
{s : Finset ι}
{x y : (i : ↑↑s) → β ↑i}

DFinsupp.mk s (x - y) = DFinsupp.mk s x - DFinsupp.mk s y


protected theorem antitone [Subsingleton α] (f : α → β) : Antitone f

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


@[simp] lemma isSublattice_univ : IsSublattice (Set.univ : Set α)


theorem roots_expand_pow :
    (expand R (p ^ n) f).roots = p ^ n • f.roots.map (iterateFrobeniusEquiv R p n).symm

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

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


/-- In a category with pullbacks, a morphism `f : X ⟶ Y` induces a functor `Over Y ⥤ Over X`,
by pulling back a morphism along `f`. -/
@[simps! (config := { simpRhs := true}) obj_left obj_hom map_left]
def pullback {X Y : C} (f : X ⟶ Y) : Over Y ⥤ Over X

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasPullbacks C]
{X Y : C}
(f : X ⟶ Y)
(g : CategoryTheory.Over Y)

((CategoryTheory.Over.pullback f).obj g).hom = CategoryTheory.Limits.pullback.snd g.hom f


lemma _root_.Monotone.image_uIcc_subset (hf : Monotone f) : f '' uIcc a b ⊆ uIcc (f a) (f b)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Lattice β]
{f : α → β}
{a b : α}
(hf : Monotone f)

f '' Set.uIcc a b ⊆ Set.uIcc (f a) (f b)


theorem span_gramSchmidt_Iio (f : ι → E) (c : ι) :
    span 𝕜 (gramSchmidt 𝕜 f '' Set.Iio c) = span 𝕜 (f '' Set.Iio c)

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_3}
[LinearOrder ι]
[LocallyFiniteOrderBot ι]
[IsWellOrder ι fun x x_1 => x < x_1]
(f : ι → E)
(c : ι)

Submodule.span 𝕜 (gramSchmidt 𝕜 f '' Set.Iio c) = Submodule.span 𝕜 (f '' Set.Iio c)


/-- Transform a `QuaternionAlgebra.Basis` through an `AlgHom`. -/
@[simps i j k]
def compHom (F : A →ₐ[R] B) : Basis B c₁ c₂

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommRing R]
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
{c₁ c₂ : R}
(q : QuaternionAlgebra.Basis A c₁ c₂)
(F : A →ₐ[R] B)


/-- `χ₄` takes values in `{0, 1, -1}` -/
theorem isQuadratic_χ₄ : χ₄.IsQuadratic


@[norm_cast]
theorem dvd_to_nat {m n : PosNum} : (m : ℕ) ∣ n ↔ m ∣ n

↑m ∣ ↑n ↔ m ∣ n


@[to_additive]
theorem diff_inv : (diff ϕ S T)⁻¹ = diff ϕ T S

{G : Type u_1}
[Group G]
{H : Subgroup G}
{A : Type u_2}
[CommGroup A]
(ϕ : ↥H →* A)
(S T : ↑(Subgroup.leftTransversals ↑H))
[H.FiniteIndex]

(Subgroup.leftTransversals.diff ϕ S T)⁻¹ = Subgroup.leftTransversals.diff ϕ T S


protected theorem congr_equiv {p : SeminormFamily 𝕜 E ι} [t : TopologicalSpace E]
    (hp : WithSeminorms p) (e : ι' ≃ ι) : WithSeminorms (p ∘ e)

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
{ι' : Type u_9}
[Nonempty ι]
[Nonempty ι']
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : SeminormFamily 𝕜 E ι}
[t : TopologicalSpace E]
(hp : WithSeminorms p)
(e : ι' ≃ ι)


theorem Summable.tendsto_atTop_of_pos [LinearOrderedField α] [TopologicalSpace α] [OrderTopology α]
    {f : ℕ → α} (hf : Summable f⁻¹) (hf' : ∀ n, 0 < f n) : Tendsto f atTop atTop

{α : Type u_3}
[LinearOrderedField α]
[TopologicalSpace α]
[OrderTopology α]
{f : ℕ → α}
(hf : Summable f⁻¹)
(hf' : ∀ (n : ℕ), 0 < f n)

Filter.Tendsto f Filter.atTop Filter.atTop


@[simp]
theorem image_closedBall (x : E) (r : ℝ) : e '' Metric.closedBall x r = Metric.closedBall (e x) r

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

⇑e '' Metric.closedBall x r = Metric.closedBall (e x) r


lemma top_ringCon : (⊤ : TwoSidedIdeal R).ringCon = ⊤

(R : Type u_1)
[NonUnitalNonAssocRing R]


@[simp] theorem isPrefixOf_cons_nil [BEq α] : isPrefixOf (a::as) ([] : List α) = false

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


theorem transitive_transGen : Transitive (TransGen r)


theorem isCoprime_div_gcd_div_gcd (hq : q ≠ 0) :
    IsCoprime (p / GCDMonoid.gcd p q) (q / GCDMonoid.gcd p q)

{R : Type u_1}
[EuclideanDomain R]
[GCDMonoid R]
{p q : R}
(hq : q ≠ 0)


@[to_additive (attr := simp)]
theorem coprodAssoc_apply_inl_inr (x : N) : coprodAssoc M N P (inl (inr x)) = inr (inl x)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[Monoid M]
[Monoid N]
[Monoid P]
(x : N)

(Monoid.MulEquiv.coprodAssoc M N P) (Monoid.Coprod.inl (Monoid.Coprod.inr x)) = Monoid.Coprod.inr (Monoid.Coprod.inl x)


@[simp]
theorem to_comma_map_right {X Y} (f : X ⟶ Y) : ((toStructuredArrow F).map f).right = f.val

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : CategoryTheory.Functor C (Type w))
{X Y : F.Elements}
(f : X ⟶ Y)

((CategoryTheory.CategoryOfElements.toStructuredArrow F).map f).right = ↑f


theorem convexHull_min : s ⊆ t → Convex 𝕜 t → convexHull 𝕜 s ⊆ t

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{s t : Set E}

s ⊆ t → Convex 𝕜 t → (convexHull 𝕜) s ⊆ t


@[simp]
theorem range_list_getD (d : α) : (range fun n : Nat => l[n]?.getD d) = insert d { x | x ∈ l }

(Set.range fun n => l[n]?.getD d) = insert d {x | x ∈ l}


theorem left : Primrec₂ fun (a : α) (_ : β) => a

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


theorem norm_real (c : ℝ) :
    mixedEmbedding.norm ((fun _ ↦ c, fun _ ↦ c) : (E K)) = |c| ^ finrank ℚ K

{K : Type u_1}
[Field K]
[NumberField K]
(c : ℝ)

NumberField.mixedEmbedding.norm (fun x => c, fun x => ↑c) = |c| ^ FiniteDimensional.finrank ℚ K


lemma nonsingular_of_equiv {P Q : Fin 3 → R} (h : P ≈ Q) : W'.Nonsingular P ↔ W'.Nonsingular Q

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P Q : Fin 3 → R}
(h : P ≈ Q)


/-- Unicity of `lift`: a map that agrees on `R` and `h.root` agrees with `lift` everywhere. -/
theorem eq_lift (h : IsAdjoinRoot S f) (g : S →+* T) (hmap : ∀ a, g (algebraMap R S a) = i a)
    (hroot : g h.root = x) : g = h.lift i x hx

(hmap : ∀ (a : R), g ((algebraMap R S) a) = i a)


theorem hasBasis_nhds_of_ne_zero {x : Γ₀} (h : x ≠ 0) :
    HasBasis (𝓝 x) (fun _ : Unit => True) fun _ => {x}

{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
{x : Γ₀}
(h : x ≠ 0)

(𝓝 x).HasBasis (fun x => True) fun x_1 => {x}


theorem Ici_def (a : α) : { x | a ≤ x } = Ici a


/-- The predicate corresponding to a base set of the filter defined by an
`IntegrationParams`. It says that

* if `l.bHenstock`, then `π` is a Henstock prepartition, i.e. each tag belongs to the corresponding
  closed box;
* `π` is subordinate to `r`;
* if `l.bDistortion`, then the distortion of each box in `π` is less than or equal to `c`;
* if `l.bDistortion`, then there exists a prepartition `π'` with distortion `≤ c` that covers
  exactly `I \ π.iUnion`.

The last condition is automatically verified for partitions, and is used in the proof of the
Sacks-Henstock inequality to compare two prepartitions covering the same part of the box.

It is also automatically satisfied for any `c > 1`, see TODO section of the module docstring for
details. -/
structure MemBaseSet (l : IntegrationParams) (I : Box ι) (c : ℝ≥0) (r : (ι → ℝ) → Ioi (0 : ℝ))
    (π : TaggedPrepartition I) : Prop where
  protected isSubordinate : π.IsSubordinate r
  protected isHenstock : l.bHenstock → π.IsHenstock
  protected distortion_le : l.bDistortion → π.distortion ≤ c
  protected exists_compl : l.bDistortion → ∃ π' : Prepartition I,
    π'.iUnion = ↑I \ π.iUnion ∧ π'.distortion ≤ c

{ι : Type u_1}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{I : BoxIntegral.Box ι}
{c : ℝ≥0}
{r : (ι → ℝ) → ↑(Set.Ioi 0)}
{π : BoxIntegral.TaggedPrepartition I}
(self : l.MemBaseSet I c r π)


lemma homMk_eq_of_leftFractionRel {X Y : C} (z₁ z₂ : W.LeftFraction X Y)
    (h : LeftFractionRel z₁ z₂) :
    homMk z₁ = homMk z₂

(h : CategoryTheory.MorphismProperty.LeftFractionRel z₁ z₂)

CategoryTheory.MorphismProperty.LeftFraction.Localization.homMk z₁ =
  CategoryTheory.MorphismProperty.LeftFraction.Localization.homMk z₂


@[simp]
theorem coeFn_smul (a : S) (Q : QuadraticMap R M N) : ⇑(a • Q) = a • ⇑Q

{S : Type u_1}
{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
[Monoid S]
[DistribMulAction S N]
[SMulCommClass S R N]
(a : S)
(Q : QuadraticMap R M N)