Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
goals
listlengths
0
224
goals_before
listlengths
0
220
import Mathlib.SetTheory.Cardinal.Finite #align_import data.set.ncard from "leanprover-community/mathlib"@"74c2af38a828107941029b03839882c5c6f87a04" namespace Set variable {Ξ± Ξ² : Type*} {s t : Set Ξ±} noncomputable def encard (s : Set Ξ±) : β„•βˆž := PartENat.withTopEquiv (PartENat.card s) @[simp] theorem encard_univ_coe (s : Set Ξ±) : encard (univ : Set s) = encard s := by rw [encard, encard, PartENat.card_congr (Equiv.Set.univ ↑s)] theorem encard_univ (Ξ± : Type*) : encard (univ : Set Ξ±) = PartENat.withTopEquiv (PartENat.card Ξ±) := by rw [encard, PartENat.card_congr (Equiv.Set.univ Ξ±)] theorem Finite.encard_eq_coe_toFinset_card (h : s.Finite) : s.encard = h.toFinset.card := by have := h.fintype rw [encard, PartENat.card_eq_coe_fintype_card, PartENat.withTopEquiv_natCast, toFinite_toFinset, toFinset_card] theorem encard_eq_coe_toFinset_card (s : Set Ξ±) [Fintype s] : encard s = s.toFinset.card := by have h := toFinite s rw [h.encard_eq_coe_toFinset_card, toFinite_toFinset] theorem encard_coe_eq_coe_finsetCard (s : Finset Ξ±) : encard (s : Set Ξ±) = s.card := by rw [Finite.encard_eq_coe_toFinset_card (Finset.finite_toSet s)]; simp theorem Infinite.encard_eq {s : Set Ξ±} (h : s.Infinite) : s.encard = ⊀ := by have := h.to_subtype rw [encard, ← PartENat.withTopEquiv.symm.injective.eq_iff, Equiv.symm_apply_apply, PartENat.withTopEquiv_symm_top, PartENat.card_eq_top_of_infinite] @[simp] theorem encard_eq_zero : s.encard = 0 ↔ s = βˆ… := by rw [encard, ← PartENat.withTopEquiv.symm.injective.eq_iff, Equiv.symm_apply_apply, PartENat.withTopEquiv_symm_zero, PartENat.card_eq_zero_iff_empty, isEmpty_subtype, eq_empty_iff_forall_not_mem] @[simp] theorem encard_empty : (βˆ… : Set Ξ±).encard = 0 := by rw [encard_eq_zero] theorem nonempty_of_encard_ne_zero (h : s.encard β‰  0) : s.Nonempty := by rwa [nonempty_iff_ne_empty, Ne, ← encard_eq_zero] theorem encard_ne_zero : s.encard β‰  0 ↔ s.Nonempty := by rw [ne_eq, encard_eq_zero, nonempty_iff_ne_empty] @[simp] theorem encard_pos : 0 < s.encard ↔ s.Nonempty := by rw [pos_iff_ne_zero, encard_ne_zero] @[simp] theorem encard_singleton (e : Ξ±) : ({e} : Set Ξ±).encard = 1 := by rw [encard, ← PartENat.withTopEquiv.symm.injective.eq_iff, Equiv.symm_apply_apply, PartENat.card_eq_coe_fintype_card, Fintype.card_ofSubsingleton, Nat.cast_one]; rfl theorem encard_union_eq (h : Disjoint s t) : (s βˆͺ t).encard = s.encard + t.encard := by classical have e := (Equiv.Set.union (by rwa [subset_empty_iff, ← disjoint_iff_inter_eq_empty])).symm simp [encard, ← PartENat.card_congr e, PartENat.card_sum, PartENat.withTopEquiv] theorem encard_insert_of_not_mem {a : Ξ±} (has : a βˆ‰ s) : (insert a s).encard = s.encard + 1 := by rw [← union_singleton, encard_union_eq (by simpa), encard_singleton] theorem Finite.encard_lt_top (h : s.Finite) : s.encard < ⊀ := by refine h.induction_on (by simp) ?_ rintro a t hat _ ht' rw [encard_insert_of_not_mem hat] exact lt_tsub_iff_right.1 ht' theorem Finite.encard_eq_coe (h : s.Finite) : s.encard = ENat.toNat s.encard := (ENat.coe_toNat h.encard_lt_top.ne).symm theorem Finite.exists_encard_eq_coe (h : s.Finite) : βˆƒ (n : β„•), s.encard = n := ⟨_, h.encard_eq_coe⟩ @[simp] theorem encard_lt_top_iff : s.encard < ⊀ ↔ s.Finite := ⟨fun h ↦ by_contra fun h' ↦ h.ne (Infinite.encard_eq h'), Finite.encard_lt_top⟩ @[simp] theorem encard_eq_top_iff : s.encard = ⊀ ↔ s.Infinite := by rw [← not_iff_not, ← Ne, ← lt_top_iff_ne_top, encard_lt_top_iff, not_infinite] theorem encard_ne_top_iff : s.encard β‰  ⊀ ↔ s.Finite := by simp
Mathlib/Data/Set/Card.lean
140
141
theorem finite_of_encard_le_coe {k : β„•} (h : s.encard ≀ k) : s.Finite := by
rw [← encard_lt_top_iff]; exact h.trans_lt (WithTop.coe_lt_top _)
[ " univ.encard = s.encard", " univ.encard = PartENat.withTopEquiv (PartENat.card Ξ±)", " s.encard = ↑h.toFinset.card", " s.encard = ↑s.toFinset.card", " (↑s).encard = ↑s.card", " ↑⋯.toFinset.card = ↑s.card", " s.encard = ⊀", " s.encard = 0 ↔ s = βˆ…", " βˆ….encard = 0", " s.Nonempty", " s.encard β‰  0 ↔...
[ " univ.encard = s.encard", " univ.encard = PartENat.withTopEquiv (PartENat.card Ξ±)", " s.encard = ↑h.toFinset.card", " s.encard = ↑s.toFinset.card", " (↑s).encard = ↑s.card", " ↑⋯.toFinset.card = ↑s.card", " s.encard = ⊀", " s.encard = 0 ↔ s = βˆ…", " βˆ….encard = 0", " s.Nonempty", " s.encard β‰  0 ↔...
import Mathlib.Topology.Homeomorph import Mathlib.Topology.StoneCech #align_import topology.extremally_disconnected from "leanprover-community/mathlib"@"7e281deff072232a3c5b3e90034bd65dde396312" noncomputable section open scoped Classical open Function Set universe u section variable (X : Type u) [TopologicalSpace X] class ExtremallyDisconnected : Prop where open_closure : βˆ€ U : Set X, IsOpen U β†’ IsOpen (closure U) #align extremally_disconnected ExtremallyDisconnected section def CompactT2.Projective : Prop := βˆ€ {Y Z : Type u} [TopologicalSpace Y] [TopologicalSpace Z], βˆ€ [CompactSpace Y] [T2Space Y] [CompactSpace Z] [T2Space Z], βˆ€ {f : X β†’ Z} {g : Y β†’ Z} (_ : Continuous f) (_ : Continuous g) (_ : Surjective g), βˆƒ h : X β†’ Y, Continuous h ∧ g ∘ h = f #align compact_t2.projective CompactT2.Projective variable {X}
Mathlib/Topology/ExtremallyDisconnected.lean
83
92
theorem StoneCech.projective [DiscreteTopology X] : CompactT2.Projective (StoneCech X) := by
intro Y Z _tsY _tsZ _csY _t2Y _csZ _csZ f g hf hg g_sur let s : Z β†’ Y := fun z => Classical.choose <| g_sur z have hs : g ∘ s = id := funext fun z => Classical.choose_spec (g_sur z) let t := s ∘ f ∘ stoneCechUnit have ht : Continuous t := continuous_of_discreteTopology let h : StoneCech X β†’ Y := stoneCechExtend ht have hh : Continuous h := continuous_stoneCechExtend ht refine ⟨h, hh, denseRange_stoneCechUnit.equalizer (hg.comp hh) hf ?_⟩ rw [comp.assoc, stoneCechExtend_extends ht, ← comp.assoc, hs, id_comp]
[ " CompactT2.Projective (StoneCech X)", " βˆƒ h, Continuous h ∧ g ∘ h = f", " (g ∘ h) ∘ stoneCechUnit = f ∘ stoneCechUnit" ]
[]
import Mathlib.MeasureTheory.Measure.FiniteMeasure import Mathlib.MeasureTheory.Integral.Average #align_import measure_theory.measure.probability_measure from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" noncomputable section open MeasureTheory open Set open Filter open BoundedContinuousFunction open scoped Topology ENNReal NNReal BoundedContinuousFunction namespace MeasureTheory section ProbabilityMeasure def ProbabilityMeasure (Ξ© : Type*) [MeasurableSpace Ξ©] : Type _ := { ΞΌ : Measure Ξ© // IsProbabilityMeasure ΞΌ } #align measure_theory.probability_measure MeasureTheory.ProbabilityMeasure namespace ProbabilityMeasure variable {Ξ© : Type*} [MeasurableSpace Ξ©] instance [Inhabited Ξ©] : Inhabited (ProbabilityMeasure Ξ©) := ⟨⟨Measure.dirac default, Measure.dirac.isProbabilityMeasure⟩⟩ -- Porting note: as with other subtype synonyms (e.g., `ℝβ‰₯0`), we need a new function for the -- coercion instead of relying on `Subtype.val`. @[coe] def toMeasure : ProbabilityMeasure Ξ© β†’ Measure Ξ© := Subtype.val instance : Coe (ProbabilityMeasure Ξ©) (MeasureTheory.Measure Ξ©) where coe := toMeasure instance (ΞΌ : ProbabilityMeasure Ξ©) : IsProbabilityMeasure (ΞΌ : Measure Ξ©) := ΞΌ.prop @[simp, norm_cast] lemma coe_mk (ΞΌ : Measure Ξ©) (hΞΌ) : toMeasure ⟨μ, hμ⟩ = ΞΌ := rfl @[simp] theorem val_eq_to_measure (Ξ½ : ProbabilityMeasure Ξ©) : Ξ½.val = (Ξ½ : Measure Ξ©) := rfl #align measure_theory.probability_measure.val_eq_to_measure MeasureTheory.ProbabilityMeasure.val_eq_to_measure theorem toMeasure_injective : Function.Injective ((↑) : ProbabilityMeasure Ξ© β†’ Measure Ξ©) := Subtype.coe_injective #align measure_theory.probability_measure.coe_injective MeasureTheory.ProbabilityMeasure.toMeasure_injective instance instFunLike : FunLike (ProbabilityMeasure Ξ©) (Set Ξ©) ℝβ‰₯0 where coe ΞΌ s := ((ΞΌ : Measure Ξ©) s).toNNReal coe_injective' ΞΌ Ξ½ h := toMeasure_injective $ Measure.ext fun s _ ↦ by simpa [ENNReal.toNNReal_eq_toNNReal_iff, measure_ne_top] using congr_fun h s lemma coeFn_def (ΞΌ : ProbabilityMeasure Ξ©) : ΞΌ = fun s ↦ ((ΞΌ : Measure Ξ©) s).toNNReal := rfl #align measure_theory.probability_measure.coe_fn_eq_to_nnreal_coe_fn_to_measure MeasureTheory.ProbabilityMeasure.coeFn_def lemma coeFn_mk (ΞΌ : Measure Ξ©) (hΞΌ) : DFunLike.coe (F := ProbabilityMeasure Ξ©) ⟨μ, hμ⟩ = fun s ↦ (ΞΌ s).toNNReal := rfl @[simp, norm_cast] lemma mk_apply (ΞΌ : Measure Ξ©) (hΞΌ) (s : Set Ξ©) : DFunLike.coe (F := ProbabilityMeasure Ξ©) ⟨μ, hμ⟩ s = (ΞΌ s).toNNReal := rfl @[simp, norm_cast] theorem coeFn_univ (Ξ½ : ProbabilityMeasure Ξ©) : Ξ½ univ = 1 := congr_arg ENNReal.toNNReal Ξ½.prop.measure_univ #align measure_theory.probability_measure.coe_fn_univ MeasureTheory.ProbabilityMeasure.coeFn_univ theorem coeFn_univ_ne_zero (Ξ½ : ProbabilityMeasure Ξ©) : Ξ½ univ β‰  0 := by simp only [coeFn_univ, Ne, one_ne_zero, not_false_iff] #align measure_theory.probability_measure.coe_fn_univ_ne_zero MeasureTheory.ProbabilityMeasure.coeFn_univ_ne_zero def toFiniteMeasure (ΞΌ : ProbabilityMeasure Ξ©) : FiniteMeasure Ξ© := ⟨μ, inferInstance⟩ #align measure_theory.probability_measure.to_finite_measure MeasureTheory.ProbabilityMeasure.toFiniteMeasure @[simp] lemma coeFn_toFiniteMeasure (ΞΌ : ProbabilityMeasure Ξ©) : ⇑μ.toFiniteMeasure = ΞΌ := rfl lemma toFiniteMeasure_apply (ΞΌ : ProbabilityMeasure Ξ©) (s : Set Ξ©) : ΞΌ.toFiniteMeasure s = ΞΌ s := rfl @[simp] theorem toMeasure_comp_toFiniteMeasure_eq_toMeasure (Ξ½ : ProbabilityMeasure Ξ©) : (Ξ½.toFiniteMeasure : Measure Ξ©) = (Ξ½ : Measure Ξ©) := rfl #align measure_theory.probability_measure.coe_comp_to_finite_measure_eq_coe MeasureTheory.ProbabilityMeasure.toMeasure_comp_toFiniteMeasure_eq_toMeasure @[simp] theorem coeFn_comp_toFiniteMeasure_eq_coeFn (Ξ½ : ProbabilityMeasure Ξ©) : (Ξ½.toFiniteMeasure : Set Ξ© β†’ ℝβ‰₯0) = (Ξ½ : Set Ξ© β†’ ℝβ‰₯0) := rfl #align measure_theory.probability_measure.coe_fn_comp_to_finite_measure_eq_coe_fn MeasureTheory.ProbabilityMeasure.coeFn_comp_toFiniteMeasure_eq_coeFn @[simp] theorem toFiniteMeasure_apply_eq_apply (Ξ½ : ProbabilityMeasure Ξ©) (s : Set Ξ©) : Ξ½.toFiniteMeasure s = Ξ½ s := rfl @[simp] theorem ennreal_coeFn_eq_coeFn_toMeasure (Ξ½ : ProbabilityMeasure Ξ©) (s : Set Ξ©) : (Ξ½ s : ℝβ‰₯0∞) = (Ξ½ : Measure Ξ©) s := by rw [← coeFn_comp_toFiniteMeasure_eq_coeFn, FiniteMeasure.ennreal_coeFn_eq_coeFn_toMeasure, toMeasure_comp_toFiniteMeasure_eq_toMeasure] #align measure_theory.probability_measure.ennreal_coe_fn_eq_coe_fn_to_measure MeasureTheory.ProbabilityMeasure.ennreal_coeFn_eq_coeFn_toMeasure
Mathlib/MeasureTheory/Measure/ProbabilityMeasure.lean
199
201
theorem apply_mono (ΞΌ : ProbabilityMeasure Ξ©) {s₁ sβ‚‚ : Set Ξ©} (h : s₁ βŠ† sβ‚‚) : ΞΌ s₁ ≀ ΞΌ sβ‚‚ := by
rw [← coeFn_comp_toFiniteMeasure_eq_coeFn] exact MeasureTheory.FiniteMeasure.apply_mono _ h
[ " ↑μ s = ↑ν s", " Ξ½ univ β‰  0", " ↑(Ξ½ s) = ↑ν s", " ΞΌ s₁ ≀ ΞΌ sβ‚‚", " ΞΌ.toFiniteMeasure s₁ ≀ ΞΌ.toFiniteMeasure sβ‚‚" ]
[ " ↑μ s = ↑ν s", " Ξ½ univ β‰  0", " ↑(Ξ½ s) = ↑ν s" ]
import Mathlib.SetTheory.Game.Short #align_import set_theory.game.state from "leanprover-community/mathlib"@"b134b2f5cf6dd25d4bbfd3c498b6e36c11a17225" universe u namespace SetTheory namespace PGame class State (S : Type u) where turnBound : S β†’ β„• l : S β†’ Finset S r : S β†’ Finset S left_bound : βˆ€ {s t : S}, t ∈ l s β†’ turnBound t < turnBound s right_bound : βˆ€ {s t : S}, t ∈ r s β†’ turnBound t < turnBound s #align pgame.state SetTheory.PGame.State open State variable {S : Type u} [State S] theorem turnBound_ne_zero_of_left_move {s t : S} (m : t ∈ l s) : turnBound s β‰  0 := by intro h have t := left_bound m rw [h] at t exact Nat.not_succ_le_zero _ t #align pgame.turn_bound_ne_zero_of_left_move SetTheory.PGame.turnBound_ne_zero_of_left_move
Mathlib/SetTheory/Game/State.lean
57
61
theorem turnBound_ne_zero_of_right_move {s t : S} (m : t ∈ r s) : turnBound s β‰  0 := by
intro h have t := right_bound m rw [h] at t exact Nat.not_succ_le_zero _ t
[ " turnBound s β‰  0", " False" ]
[ " turnBound s β‰  0", " False" ]
import Mathlib.Topology.Algebra.GroupWithZero import Mathlib.Topology.Order.OrderClosed #align_import topology.algebra.with_zero_topology from "leanprover-community/mathlib"@"3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064" open Topology Filter TopologicalSpace Filter Set Function namespace WithZeroTopology variable {Ξ± Ξ“β‚€ : Type*} [LinearOrderedCommGroupWithZero Ξ“β‚€] {Ξ³ γ₁ Ξ³β‚‚ : Ξ“β‚€} {l : Filter Ξ±} {f : Ξ± β†’ Ξ“β‚€} scoped instance (priority := 100) topologicalSpace : TopologicalSpace Ξ“β‚€ := nhdsAdjoint 0 <| β¨… Ξ³ β‰  0, π“Ÿ (Iio Ξ³) #align with_zero_topology.topological_space WithZeroTopology.topologicalSpace theorem nhds_eq_update : (𝓝 : Ξ“β‚€ β†’ Filter Ξ“β‚€) = update pure 0 (β¨… Ξ³ β‰  0, π“Ÿ (Iio Ξ³)) := by rw [nhds_nhdsAdjoint, sup_of_le_right] exact le_iInfβ‚‚ fun Ξ³ hΞ³ ↦ le_principal_iff.2 <| zero_lt_iff.2 hΞ³ #align with_zero_topology.nhds_eq_update WithZeroTopology.nhds_eq_update theorem nhds_zero : 𝓝 (0 : Ξ“β‚€) = β¨… Ξ³ β‰  0, π“Ÿ (Iio Ξ³) := by rw [nhds_eq_update, update_same] #align with_zero_topology.nhds_zero WithZeroTopology.nhds_zero theorem hasBasis_nhds_zero : (𝓝 (0 : Ξ“β‚€)).HasBasis (fun Ξ³ : Ξ“β‚€ => Ξ³ β‰  0) Iio := by rw [nhds_zero] refine hasBasis_biInf_principal ?_ ⟨1, one_ne_zero⟩ exact directedOn_iff_directed.2 (Monotone.directed_ge fun a b hab => Iio_subset_Iio hab) #align with_zero_topology.has_basis_nhds_zero WithZeroTopology.hasBasis_nhds_zero theorem Iio_mem_nhds_zero (hΞ³ : Ξ³ β‰  0) : Iio Ξ³ ∈ 𝓝 (0 : Ξ“β‚€) := hasBasis_nhds_zero.mem_of_mem hΞ³ #align with_zero_topology.Iio_mem_nhds_zero WithZeroTopology.Iio_mem_nhds_zero theorem nhds_zero_of_units (Ξ³ : Ξ“β‚€Λ£) : Iio ↑γ ∈ 𝓝 (0 : Ξ“β‚€) := Iio_mem_nhds_zero Ξ³.ne_zero #align with_zero_topology.nhds_zero_of_units WithZeroTopology.nhds_zero_of_units theorem tendsto_zero : Tendsto f l (𝓝 (0 : Ξ“β‚€)) ↔ βˆ€ (Ξ³β‚€) (_ : Ξ³β‚€ β‰  0), βˆ€αΆ  x in l, f x < Ξ³β‚€ := by simp [nhds_zero] #align with_zero_topology.tendsto_zero WithZeroTopology.tendsto_zero @[simp] theorem nhds_of_ne_zero {Ξ³ : Ξ“β‚€} (hβ‚€ : Ξ³ β‰  0) : 𝓝 Ξ³ = pure Ξ³ := nhds_nhdsAdjoint_of_ne _ hβ‚€ #align with_zero_topology.nhds_of_ne_zero WithZeroTopology.nhds_of_ne_zero theorem nhds_coe_units (Ξ³ : Ξ“β‚€Λ£) : 𝓝 (Ξ³ : Ξ“β‚€) = pure (Ξ³ : Ξ“β‚€) := nhds_of_ne_zero Ξ³.ne_zero #align with_zero_topology.nhds_coe_units WithZeroTopology.nhds_coe_units theorem singleton_mem_nhds_of_units (Ξ³ : Ξ“β‚€Λ£) : ({↑γ} : Set Ξ“β‚€) ∈ 𝓝 (Ξ³ : Ξ“β‚€) := by simp #align with_zero_topology.singleton_mem_nhds_of_units WithZeroTopology.singleton_mem_nhds_of_units theorem singleton_mem_nhds_of_ne_zero (h : Ξ³ β‰  0) : ({Ξ³} : Set Ξ“β‚€) ∈ 𝓝 (Ξ³ : Ξ“β‚€) := by simp [h] #align with_zero_topology.singleton_mem_nhds_of_ne_zero WithZeroTopology.singleton_mem_nhds_of_ne_zero theorem hasBasis_nhds_of_ne_zero {x : Ξ“β‚€} (h : x β‰  0) : HasBasis (𝓝 x) (fun _ : Unit => True) fun _ => {x} := by rw [nhds_of_ne_zero h] exact hasBasis_pure _ #align with_zero_topology.has_basis_nhds_of_ne_zero WithZeroTopology.hasBasis_nhds_of_ne_zero theorem hasBasis_nhds_units (Ξ³ : Ξ“β‚€Λ£) : HasBasis (𝓝 (Ξ³ : Ξ“β‚€)) (fun _ : Unit => True) fun _ => {↑γ} := hasBasis_nhds_of_ne_zero Ξ³.ne_zero #align with_zero_topology.has_basis_nhds_units WithZeroTopology.hasBasis_nhds_units theorem tendsto_of_ne_zero {Ξ³ : Ξ“β‚€} (h : Ξ³ β‰  0) : Tendsto f l (𝓝 Ξ³) ↔ βˆ€αΆ  x in l, f x = Ξ³ := by rw [nhds_of_ne_zero h, tendsto_pure] #align with_zero_topology.tendsto_of_ne_zero WithZeroTopology.tendsto_of_ne_zero theorem tendsto_units {Ξ³β‚€ : Ξ“β‚€Λ£} : Tendsto f l (𝓝 (Ξ³β‚€ : Ξ“β‚€)) ↔ βˆ€αΆ  x in l, f x = Ξ³β‚€ := tendsto_of_ne_zero Ξ³β‚€.ne_zero #align with_zero_topology.tendsto_units WithZeroTopology.tendsto_units theorem Iio_mem_nhds (h : γ₁ < Ξ³β‚‚) : Iio Ξ³β‚‚ ∈ 𝓝 γ₁ := by rcases eq_or_ne γ₁ 0 with (rfl | hβ‚€) <;> simp [*, h.ne', Iio_mem_nhds_zero] #align with_zero_topology.Iio_mem_nhds WithZeroTopology.Iio_mem_nhds
Mathlib/Topology/Algebra/WithZeroTopology.lean
136
139
theorem isOpen_iff {s : Set Ξ“β‚€} : IsOpen s ↔ (0 : Ξ“β‚€) βˆ‰ s ∨ βˆƒ Ξ³, Ξ³ β‰  0 ∧ Iio Ξ³ βŠ† s := by
rw [isOpen_iff_mem_nhds, ← and_forall_ne (0 : Ξ“β‚€)] simp (config := { contextual := true }) [nhds_of_ne_zero, imp_iff_not_or, hasBasis_nhds_zero.mem_iff]
[ " 𝓝 = update pure 0 (β¨… Ξ³, β¨… (_ : Ξ³ β‰  0), π“Ÿ (Iio Ξ³))", " pure 0 ≀ β¨… Ξ³, β¨… (_ : Ξ³ β‰  0), π“Ÿ (Iio Ξ³)", " 𝓝 0 = β¨… Ξ³, β¨… (_ : Ξ³ β‰  0), π“Ÿ (Iio Ξ³)", " (𝓝 0).HasBasis (fun Ξ³ => Ξ³ β‰  0) Iio", " (β¨… Ξ³, β¨… (_ : Ξ³ β‰  0), π“Ÿ (Iio Ξ³)).HasBasis (fun Ξ³ => Ξ³ β‰  0) Iio", " DirectedOn ((fun Ξ³ => Iio Ξ³) ⁻¹'o fun x x_1 => x β‰₯ x_1...
[ " 𝓝 = update pure 0 (β¨… Ξ³, β¨… (_ : Ξ³ β‰  0), π“Ÿ (Iio Ξ³))", " pure 0 ≀ β¨… Ξ³, β¨… (_ : Ξ³ β‰  0), π“Ÿ (Iio Ξ³)", " 𝓝 0 = β¨… Ξ³, β¨… (_ : Ξ³ β‰  0), π“Ÿ (Iio Ξ³)", " (𝓝 0).HasBasis (fun Ξ³ => Ξ³ β‰  0) Iio", " (β¨… Ξ³, β¨… (_ : Ξ³ β‰  0), π“Ÿ (Iio Ξ³)).HasBasis (fun Ξ³ => Ξ³ β‰  0) Iio", " DirectedOn ((fun Ξ³ => Iio Ξ³) ⁻¹'o fun x x_1 => x β‰₯ x_1...
import Mathlib.AlgebraicTopology.DoldKan.Faces import Mathlib.CategoryTheory.Idempotents.Basic #align_import algebraic_topology.dold_kan.projections from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504" open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Preadditive CategoryTheory.SimplicialObject Opposite CategoryTheory.Idempotents open Simplicial DoldKan noncomputable section namespace AlgebraicTopology namespace DoldKan variable {C : Type*} [Category C] [Preadditive C] {X : SimplicialObject C} noncomputable def P : β„• β†’ (K[X] ⟢ K[X]) | 0 => πŸ™ _ | q + 1 => P q ≫ (πŸ™ _ + HΟƒ q) set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P AlgebraicTopology.DoldKan.P -- Porting note: `P_zero` and `P_succ` have been added to ease the port, because -- `unfold P` would sometimes unfold to a `match` rather than the induction formula lemma P_zero : (P 0 : K[X] ⟢ K[X]) = πŸ™ _ := rfl lemma P_succ (q : β„•) : (P (q+1) : K[X] ⟢ K[X]) = P q ≫ (πŸ™ _ + HΟƒ q) := rfl @[simp]
Mathlib/AlgebraicTopology/DoldKan/Projections.lean
61
65
theorem P_f_0_eq (q : β„•) : ((P q).f 0 : X _[0] ⟢ X _[0]) = πŸ™ _ := by
induction' q with q hq · rfl · simp only [P_succ, HomologicalComplex.add_f_apply, HomologicalComplex.comp_f, HomologicalComplex.id_f, id_comp, hq, Hσ_eq_zero, add_zero]
[ " (P q).f 0 = πŸ™ (K[X].X 0)", " (P 0).f 0 = πŸ™ (K[X].X 0)", " (P (q + 1)).f 0 = πŸ™ (K[X].X 0)" ]
[]
import Mathlib.Algebra.Module.BigOperators import Mathlib.Data.Fintype.BigOperators import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace import Mathlib.LinearAlgebra.Finsupp import Mathlib.Tactic.FinCases #align_import linear_algebra.affine_space.combination from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" noncomputable section open Affine namespace Finset theorem univ_fin2 : (univ : Finset (Fin 2)) = {0, 1} := by ext x fin_cases x <;> simp #align finset.univ_fin2 Finset.univ_fin2 variable {k : Type*} {V : Type*} {P : Type*} [Ring k] [AddCommGroup V] [Module k V] variable [S : AffineSpace V P] variable {ΞΉ : Type*} (s : Finset ΞΉ) variable {ΞΉβ‚‚ : Type*} (sβ‚‚ : Finset ΞΉβ‚‚) def weightedVSubOfPoint (p : ΞΉ β†’ P) (b : P) : (ΞΉ β†’ k) β†’β‚—[k] V := βˆ‘ i ∈ s, (LinearMap.proj i : (ΞΉ β†’ k) β†’β‚—[k] k).smulRight (p i -α΅₯ b) #align finset.weighted_vsub_of_point Finset.weightedVSubOfPoint @[simp] theorem weightedVSubOfPoint_apply (w : ΞΉ β†’ k) (p : ΞΉ β†’ P) (b : P) : s.weightedVSubOfPoint p b w = βˆ‘ i ∈ s, w i β€’ (p i -α΅₯ b) := by simp [weightedVSubOfPoint, LinearMap.sum_apply] #align finset.weighted_vsub_of_point_apply Finset.weightedVSubOfPoint_apply @[simp (high)] theorem weightedVSubOfPoint_apply_const (w : ΞΉ β†’ k) (p : P) (b : P) : s.weightedVSubOfPoint (fun _ => p) b w = (βˆ‘ i ∈ s, w i) β€’ (p -α΅₯ b) := by rw [weightedVSubOfPoint_apply, sum_smul] #align finset.weighted_vsub_of_point_apply_const Finset.weightedVSubOfPoint_apply_const theorem weightedVSubOfPoint_congr {w₁ wβ‚‚ : ΞΉ β†’ k} (hw : βˆ€ i ∈ s, w₁ i = wβ‚‚ i) {p₁ pβ‚‚ : ΞΉ β†’ P} (hp : βˆ€ i ∈ s, p₁ i = pβ‚‚ i) (b : P) : s.weightedVSubOfPoint p₁ b w₁ = s.weightedVSubOfPoint pβ‚‚ b wβ‚‚ := by simp_rw [weightedVSubOfPoint_apply] refine sum_congr rfl fun i hi => ?_ rw [hw i hi, hp i hi] #align finset.weighted_vsub_of_point_congr Finset.weightedVSubOfPoint_congr
Mathlib/LinearAlgebra/AffineSpace/Combination.lean
96
104
theorem weightedVSubOfPoint_eq_of_weights_eq (p : ΞΉ β†’ P) (j : ΞΉ) (w₁ wβ‚‚ : ΞΉ β†’ k) (hw : βˆ€ i, i β‰  j β†’ w₁ i = wβ‚‚ i) : s.weightedVSubOfPoint p (p j) w₁ = s.weightedVSubOfPoint p (p j) wβ‚‚ := by
simp only [Finset.weightedVSubOfPoint_apply] congr ext i rcases eq_or_ne i j with h | h Β· simp [h] Β· simp [hw i h]
[ " univ = {0, 1}", " x ∈ univ ↔ x ∈ {0, 1}", " ⟨0, β‹―βŸ© ∈ univ ↔ ⟨0, β‹―βŸ© ∈ {0, 1}", " ⟨1, β‹―βŸ© ∈ univ ↔ ⟨1, β‹―βŸ© ∈ {0, 1}", " (s.weightedVSubOfPoint p b) w = βˆ‘ i ∈ s, w i β€’ (p i -α΅₯ b)", " (s.weightedVSubOfPoint (fun x => p) b) w = (βˆ‘ i ∈ s, w i) β€’ (p -α΅₯ b)", " (s.weightedVSubOfPoint p₁ b) w₁ = (s.weightedVSubOf...
[ " univ = {0, 1}", " x ∈ univ ↔ x ∈ {0, 1}", " ⟨0, β‹―βŸ© ∈ univ ↔ ⟨0, β‹―βŸ© ∈ {0, 1}", " ⟨1, β‹―βŸ© ∈ univ ↔ ⟨1, β‹―βŸ© ∈ {0, 1}", " (s.weightedVSubOfPoint p b) w = βˆ‘ i ∈ s, w i β€’ (p i -α΅₯ b)", " (s.weightedVSubOfPoint (fun x => p) b) w = (βˆ‘ i ∈ s, w i) β€’ (p -α΅₯ b)", " (s.weightedVSubOfPoint p₁ b) w₁ = (s.weightedVSubOf...
import Batteries.Data.UInt @[ext] theorem Char.ext : {a b : Char} β†’ a.val = b.val β†’ a = b | ⟨_,_⟩, ⟨_,_⟩, rfl => rfl theorem Char.ext_iff {x y : Char} : x = y ↔ x.val = y.val := ⟨congrArg _, Char.ext⟩ theorem Char.le_antisymm_iff {x y : Char} : x = y ↔ x ≀ y ∧ y ≀ x := Char.ext_iff.trans UInt32.le_antisymm_iff theorem Char.le_antisymm {x y : Char} (h1 : x ≀ y) (h2 : y ≀ x) : x = y := Char.le_antisymm_iff.2 ⟨h1, h2⟩ instance : Batteries.LawfulOrd Char := .compareOfLessAndEq (fun _ => Nat.lt_irrefl _) Nat.lt_trans Nat.not_lt Char.le_antisymm namespace String private theorem csize_eq (c) : csize c = 1 ∨ csize c = 2 ∨ csize c = 3 ∨ csize c = 4 := by simp only [csize, Char.utf8Size] repeat (first | split | (solve | simp (config := {decide := true})))
.lake/packages/batteries/Batteries/Data/Char.lean
30
31
theorem csize_pos (c) : 0 < csize c := by
rcases csize_eq c with _|_|_|_ <;> simp_all (config := {decide := true})
[]
[]
import Mathlib.Data.ENNReal.Inv #align_import data.real.ennreal from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520" open Set NNReal ENNReal namespace ENNReal section iInf variable {ΞΉ : Sort*} {f g : ΞΉ β†’ ℝβ‰₯0∞} variable {a b c d : ℝβ‰₯0∞} {r p q : ℝβ‰₯0} theorem toNNReal_iInf (hf : βˆ€ i, f i β‰  ∞) : (iInf f).toNNReal = β¨… i, (f i).toNNReal := by cases isEmpty_or_nonempty ΞΉ Β· rw [iInf_of_empty, top_toNNReal, NNReal.iInf_empty] Β· lift f to ΞΉ β†’ ℝβ‰₯0 using hf simp_rw [← coe_iInf, toNNReal_coe] #align ennreal.to_nnreal_infi ENNReal.toNNReal_iInf theorem toNNReal_sInf (s : Set ℝβ‰₯0∞) (hs : βˆ€ r ∈ s, r β‰  ∞) : (sInf s).toNNReal = sInf (ENNReal.toNNReal '' s) := by have hf : βˆ€ i, ((↑) : s β†’ ℝβ‰₯0∞) i β‰  ∞ := fun ⟨r, rs⟩ => hs r rs -- Porting note: `← sInf_image'` had to be replaced by `← image_eq_range` as the lemmas are used -- in a different order. simpa only [← sInf_range, ← image_eq_range, Subtype.range_coe_subtype] using (toNNReal_iInf hf) #align ennreal.to_nnreal_Inf ENNReal.toNNReal_sInf theorem toNNReal_iSup (hf : βˆ€ i, f i β‰  ∞) : (iSup f).toNNReal = ⨆ i, (f i).toNNReal := by lift f to ΞΉ β†’ ℝβ‰₯0 using hf simp_rw [toNNReal_coe] by_cases h : BddAbove (range f) Β· rw [← coe_iSup h, toNNReal_coe] Β· rw [NNReal.iSup_of_not_bddAbove h, iSup_coe_eq_top.2 h, top_toNNReal] #align ennreal.to_nnreal_supr ENNReal.toNNReal_iSup theorem toNNReal_sSup (s : Set ℝβ‰₯0∞) (hs : βˆ€ r ∈ s, r β‰  ∞) : (sSup s).toNNReal = sSup (ENNReal.toNNReal '' s) := by have hf : βˆ€ i, ((↑) : s β†’ ℝβ‰₯0∞) i β‰  ∞ := fun ⟨r, rs⟩ => hs r rs -- Porting note: `← sSup_image'` had to be replaced by `← image_eq_range` as the lemmas are used -- in a different order. simpa only [← sSup_range, ← image_eq_range, Subtype.range_coe_subtype] using (toNNReal_iSup hf) #align ennreal.to_nnreal_Sup ENNReal.toNNReal_sSup theorem toReal_iInf (hf : βˆ€ i, f i β‰  ∞) : (iInf f).toReal = β¨… i, (f i).toReal := by simp only [ENNReal.toReal, toNNReal_iInf hf, NNReal.coe_iInf] #align ennreal.to_real_infi ENNReal.toReal_iInf theorem toReal_sInf (s : Set ℝβ‰₯0∞) (hf : βˆ€ r ∈ s, r β‰  ∞) : (sInf s).toReal = sInf (ENNReal.toReal '' s) := by simp only [ENNReal.toReal, toNNReal_sInf s hf, NNReal.coe_sInf, Set.image_image] #align ennreal.to_real_Inf ENNReal.toReal_sInf theorem toReal_iSup (hf : βˆ€ i, f i β‰  ∞) : (iSup f).toReal = ⨆ i, (f i).toReal := by simp only [ENNReal.toReal, toNNReal_iSup hf, NNReal.coe_iSup] #align ennreal.to_real_supr ENNReal.toReal_iSup theorem toReal_sSup (s : Set ℝβ‰₯0∞) (hf : βˆ€ r ∈ s, r β‰  ∞) : (sSup s).toReal = sSup (ENNReal.toReal '' s) := by simp only [ENNReal.toReal, toNNReal_sSup s hf, NNReal.coe_sSup, Set.image_image] #align ennreal.to_real_Sup ENNReal.toReal_sSup theorem iInf_add : iInf f + a = β¨… i, f i + a := le_antisymm (le_iInf fun _ => add_le_add (iInf_le _ _) <| le_rfl) (tsub_le_iff_right.1 <| le_iInf fun _ => tsub_le_iff_right.2 <| iInf_le _ _) #align ennreal.infi_add ENNReal.iInf_add theorem iSup_sub : (⨆ i, f i) - a = ⨆ i, f i - a := le_antisymm (tsub_le_iff_right.2 <| iSup_le fun i => tsub_le_iff_right.1 <| le_iSup (f Β· - a) i) (iSup_le fun _ => tsub_le_tsub (le_iSup _ _) (le_refl a)) #align ennreal.supr_sub ENNReal.iSup_sub theorem sub_iInf : (a - β¨… i, f i) = ⨆ i, a - f i := by refine eq_of_forall_ge_iff fun c => ?_ rw [tsub_le_iff_right, add_comm, iInf_add] simp [tsub_le_iff_right, sub_eq_add_neg, add_comm] #align ennreal.sub_infi ENNReal.sub_iInf theorem sInf_add {s : Set ℝβ‰₯0∞} : sInf s + a = β¨… b ∈ s, b + a := by simp [sInf_eq_iInf, iInf_add] #align ennreal.Inf_add ENNReal.sInf_add
Mathlib/Data/ENNReal/Real.lean
609
610
theorem add_iInf {a : ℝβ‰₯0∞} : a + iInf f = β¨… b, a + f b := by
rw [add_comm, iInf_add]; simp [add_comm]
[ " (iInf f).toNNReal = β¨… i, (f i).toNNReal", " (β¨… i, ↑(f i)).toNNReal = β¨… i, ((fun i => ↑(f i)) i).toNNReal", " (sInf s).toNNReal = sInf (ENNReal.toNNReal '' s)", " (iSup f).toNNReal = ⨆ i, (f i).toNNReal", " (⨆ i, ↑(f i)).toNNReal = ⨆ i, ((fun i => ↑(f i)) i).toNNReal", " (⨆ i, ↑(f i)).toNNReal = ⨆ i, f i...
[ " (iInf f).toNNReal = β¨… i, (f i).toNNReal", " (β¨… i, ↑(f i)).toNNReal = β¨… i, ((fun i => ↑(f i)) i).toNNReal", " (sInf s).toNNReal = sInf (ENNReal.toNNReal '' s)", " (iSup f).toNNReal = ⨆ i, (f i).toNNReal", " (⨆ i, ↑(f i)).toNNReal = ⨆ i, ((fun i => ↑(f i)) i).toNNReal", " (⨆ i, ↑(f i)).toNNReal = ⨆ i, f i...
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def
Mathlib/Analysis/Convex/Gauge.lean
66
68
theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by
congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _
[ " gauge s x = sInf {r | r ∈ Ioi 0 ∧ r⁻¹ β€’ x ∈ s}", " 0 < r ∧ x ∈ r β€’ s ↔ r ∈ Ioi 0 ∧ r⁻¹ β€’ x ∈ s" ]
[]
import Mathlib.Algebra.Group.Fin import Mathlib.Algebra.NeZero import Mathlib.Data.Nat.ModEq import Mathlib.Data.Fintype.Card #align_import data.zmod.defs from "leanprover-community/mathlib"@"3a2b5524a138b5d0b818b858b516d4ac8a484b03" def ZMod : β„• β†’ Type | 0 => β„€ | n + 1 => Fin (n + 1) #align zmod ZMod instance ZMod.decidableEq : βˆ€ n : β„•, DecidableEq (ZMod n) | 0 => inferInstanceAs (DecidableEq β„€) | n + 1 => inferInstanceAs (DecidableEq (Fin (n + 1))) #align zmod.decidable_eq ZMod.decidableEq instance ZMod.repr : βˆ€ n : β„•, Repr (ZMod n) | 0 => by dsimp [ZMod]; infer_instance | n + 1 => by dsimp [ZMod]; infer_instance #align zmod.has_repr ZMod.repr namespace ZMod instance instUnique : Unique (ZMod 1) := Fin.uniqueFinOne instance fintype : βˆ€ (n : β„•) [NeZero n], Fintype (ZMod n) | 0, h => (h.ne rfl).elim | n + 1, _ => Fin.fintype (n + 1) #align zmod.fintype ZMod.fintype instance infinite : Infinite (ZMod 0) := Int.infinite #align zmod.infinite ZMod.infinite @[simp]
Mathlib/Data/ZMod/Defs.lean
124
127
theorem card (n : β„•) [Fintype (ZMod n)] : Fintype.card (ZMod n) = n := by
cases n with | zero => exact (not_finite (ZMod 0)).elim | succ n => convert Fintype.card_fin (n + 1) using 2
[ " Repr (ZMod 0)", " Repr β„€", " Repr (ZMod (n + 1))", " Repr (Fin (n + 1))", " Fintype.card (ZMod n) = n", " Fintype.card (ZMod 0) = 0", " Fintype.card (ZMod (n + 1)) = n + 1" ]
[ " Repr (ZMod 0)", " Repr β„€", " Repr (ZMod (n + 1))", " Repr (Fin (n + 1))" ]
import Mathlib.Algebra.Ring.Prod import Mathlib.GroupTheory.OrderOfElement import Mathlib.Tactic.FinCases #align_import data.zmod.basic from "leanprover-community/mathlib"@"74ad1c88c77e799d2fea62801d1dbbd698cff1b7" assert_not_exists Submodule open Function namespace ZMod instance charZero : CharZero (ZMod 0) := inferInstanceAs (CharZero β„€) def val : βˆ€ {n : β„•}, ZMod n β†’ β„• | 0 => Int.natAbs | n + 1 => ((↑) : Fin (n + 1) β†’ β„•) #align zmod.val ZMod.val theorem val_lt {n : β„•} [NeZero n] (a : ZMod n) : a.val < n := by cases n Β· cases NeZero.ne 0 rfl exact Fin.is_lt a #align zmod.val_lt ZMod.val_lt theorem val_le {n : β„•} [NeZero n] (a : ZMod n) : a.val ≀ n := a.val_lt.le #align zmod.val_le ZMod.val_le @[simp] theorem val_zero : βˆ€ {n}, (0 : ZMod n).val = 0 | 0 => rfl | _ + 1 => rfl #align zmod.val_zero ZMod.val_zero @[simp] theorem val_one' : (1 : ZMod 0).val = 1 := rfl #align zmod.val_one' ZMod.val_one' @[simp] theorem val_neg' {n : ZMod 0} : (-n).val = n.val := Int.natAbs_neg n #align zmod.val_neg' ZMod.val_neg' @[simp] theorem val_mul' {m n : ZMod 0} : (m * n).val = m.val * n.val := Int.natAbs_mul m n #align zmod.val_mul' ZMod.val_mul' @[simp] theorem val_natCast {n : β„•} (a : β„•) : (a : ZMod n).val = a % n := by cases n Β· rw [Nat.mod_zero] exact Int.natAbs_ofNat a Β· apply Fin.val_natCast #align zmod.val_nat_cast ZMod.val_natCast @[deprecated (since := "2024-04-17")] alias val_nat_cast := val_natCast theorem val_unit' {n : ZMod 0} : IsUnit n ↔ n.val = 1 := by simp only [val] rw [Int.isUnit_iff, Int.natAbs_eq_iff, Nat.cast_one] lemma eq_one_of_isUnit_natCast {n : β„•} (h : IsUnit (n : ZMod 0)) : n = 1 := by rw [← Nat.mod_zero n, ← val_natCast, val_unit'.mp h] theorem val_natCast_of_lt {n a : β„•} (h : a < n) : (a : ZMod n).val = a := by rwa [val_natCast, Nat.mod_eq_of_lt] @[deprecated (since := "2024-04-17")] alias val_nat_cast_of_lt := val_natCast_of_lt instance charP (n : β„•) : CharP (ZMod n) n where cast_eq_zero_iff' := by intro k cases' n with n Β· simp [zero_dvd_iff, Int.natCast_eq_zero, Nat.zero_eq] Β· exact Fin.natCast_eq_zero @[simp] theorem addOrderOf_one (n : β„•) : addOrderOf (1 : ZMod n) = n := CharP.eq _ (CharP.addOrderOf_one _) (ZMod.charP n) #align zmod.add_order_of_one ZMod.addOrderOf_one @[simp] theorem addOrderOf_coe (a : β„•) {n : β„•} (n0 : n β‰  0) : addOrderOf (a : ZMod n) = n / n.gcd a := by cases' a with a Β· simp only [Nat.zero_eq, Nat.cast_zero, addOrderOf_zero, Nat.gcd_zero_right, Nat.pos_of_ne_zero n0, Nat.div_self] rw [← Nat.smul_one_eq_cast, addOrderOf_nsmul' _ a.succ_ne_zero, ZMod.addOrderOf_one] #align zmod.add_order_of_coe ZMod.addOrderOf_coe @[simp] theorem addOrderOf_coe' {a : β„•} (n : β„•) (a0 : a β‰  0) : addOrderOf (a : ZMod n) = n / n.gcd a := by rw [← Nat.smul_one_eq_cast, addOrderOf_nsmul' _ a0, ZMod.addOrderOf_one] #align zmod.add_order_of_coe' ZMod.addOrderOf_coe' theorem ringChar_zmod_n (n : β„•) : ringChar (ZMod n) = n := by rw [ringChar.eq_iff] exact ZMod.charP n #align zmod.ring_char_zmod_n ZMod.ringChar_zmod_n -- @[simp] -- Porting note (#10618): simp can prove this theorem natCast_self (n : β„•) : (n : ZMod n) = 0 := CharP.cast_eq_zero (ZMod n) n #align zmod.nat_cast_self ZMod.natCast_self @[deprecated (since := "2024-04-17")] alias nat_cast_self := natCast_self @[simp] theorem natCast_self' (n : β„•) : (n + 1 : ZMod (n + 1)) = 0 := by rw [← Nat.cast_add_one, natCast_self (n + 1)] #align zmod.nat_cast_self' ZMod.natCast_self' @[deprecated (since := "2024-04-17")] alias nat_cast_self' := natCast_self' section UniversalProperty variable {n : β„•} {R : Type*} section variable [AddGroupWithOne R] def cast : βˆ€ {n : β„•}, ZMod n β†’ R | 0 => Int.cast | _ + 1 => fun i => i.val #align zmod.cast ZMod.cast @[simp] theorem cast_zero : (cast (0 : ZMod n) : R) = 0 := by delta ZMod.cast cases n Β· exact Int.cast_zero Β· simp #align zmod.cast_zero ZMod.cast_zero
Mathlib/Data/ZMod/Basic.lean
183
186
theorem cast_eq_val [NeZero n] (a : ZMod n) : (cast a : R) = a.val := by
cases n Β· cases NeZero.ne 0 rfl rfl
[ " a.val < n", " a.val < 0", " a.val < n✝ + 1", " (↑a).val = a % n", " (↑a).val = a % 0", " (↑a).val = a", " (↑a).val = a % (n✝ + 1)", " IsUnit n ↔ n.val = 1", " IsUnit n ↔ Int.natAbs n = 1", " n = 1", " βˆ€ (x : β„•), ↑x = 0 ↔ n ∣ x", " ↑k = 0 ↔ n ∣ k", " ↑k = 0 ↔ 0 ∣ k", " ↑k = 0 ↔ n + 1 ∣ k"...
[ " a.val < n", " a.val < 0", " a.val < n✝ + 1", " (↑a).val = a % n", " (↑a).val = a % 0", " (↑a).val = a", " (↑a).val = a % (n✝ + 1)", " IsUnit n ↔ n.val = 1", " IsUnit n ↔ Int.natAbs n = 1", " n = 1", " βˆ€ (x : β„•), ↑x = 0 ↔ n ∣ x", " ↑k = 0 ↔ n ∣ k", " ↑k = 0 ↔ 0 ∣ k", " ↑k = 0 ↔ n + 1 ∣ k"...
import Mathlib.Algebra.Group.Units import Mathlib.Algebra.GroupWithZero.Basic import Mathlib.Logic.Equiv.Defs import Mathlib.Tactic.Contrapose import Mathlib.Tactic.Nontriviality import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.group_with_zero.units.basic from "leanprover-community/mathlib"@"df5e9937a06fdd349fc60106f54b84d47b1434f0" -- Guard against import creep assert_not_exists Multiplicative assert_not_exists DenselyOrdered variable {Ξ± Mβ‚€ Gβ‚€ Mβ‚€' Gβ‚€' F F' : Type*} variable [MonoidWithZero Mβ‚€] @[simp] theorem isUnit_zero_iff : IsUnit (0 : Mβ‚€) ↔ (0 : Mβ‚€) = 1 := ⟨fun ⟨⟨_, a, (a0 : 0 * a = 1), _⟩, rfl⟩ => by rwa [zero_mul] at a0, fun h => @isUnit_of_subsingleton _ _ (subsingleton_of_zero_eq_one h) 0⟩ #align is_unit_zero_iff isUnit_zero_iff -- Porting note: removed `simp` tag because `simpNF` says it's redundant theorem not_isUnit_zero [Nontrivial Mβ‚€] : Β¬IsUnit (0 : Mβ‚€) := mt isUnit_zero_iff.1 zero_ne_one #align not_is_unit_zero not_isUnit_zero namespace Ring open scoped Classical noncomputable def inverse : Mβ‚€ β†’ Mβ‚€ := fun x => if h : IsUnit x then ((h.unit⁻¹ : Mβ‚€Λ£) : Mβ‚€) else 0 #align ring.inverse Ring.inverse @[simp] theorem inverse_unit (u : Mβ‚€Λ£) : inverse (u : Mβ‚€) = (u⁻¹ : Mβ‚€Λ£) := by rw [inverse, dif_pos u.isUnit, IsUnit.unit_of_val_units] #align ring.inverse_unit Ring.inverse_unit @[simp] theorem inverse_non_unit (x : Mβ‚€) (h : Β¬IsUnit x) : inverse x = 0 := dif_neg h #align ring.inverse_non_unit Ring.inverse_non_unit theorem mul_inverse_cancel (x : Mβ‚€) (h : IsUnit x) : x * inverse x = 1 := by rcases h with ⟨u, rfl⟩ rw [inverse_unit, Units.mul_inv] #align ring.mul_inverse_cancel Ring.mul_inverse_cancel theorem inverse_mul_cancel (x : Mβ‚€) (h : IsUnit x) : inverse x * x = 1 := by rcases h with ⟨u, rfl⟩ rw [inverse_unit, Units.inv_mul] #align ring.inverse_mul_cancel Ring.inverse_mul_cancel
Mathlib/Algebra/GroupWithZero/Units/Basic.lean
118
119
theorem mul_inverse_cancel_right (x y : Mβ‚€) (h : IsUnit x) : y * x * inverse x = y := by
rw [mul_assoc, mul_inverse_cancel x h, mul_one]
[ " 0 = 1", " inverse ↑u = ↑u⁻¹", " x * inverse x = 1", " ↑u * inverse ↑u = 1", " inverse x * x = 1", " inverse ↑u * ↑u = 1", " y * x * inverse x = y" ]
[ " 0 = 1", " inverse ↑u = ↑u⁻¹", " x * inverse x = 1", " ↑u * inverse ↑u = 1", " inverse x * x = 1", " inverse ↑u * ↑u = 1" ]
import Mathlib.CategoryTheory.Limits.Shapes.CommSq import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial import Mathlib.CategoryTheory.Limits.Shapes.Types import Mathlib.Topology.Category.TopCat.Limits.Pullbacks import Mathlib.CategoryTheory.Limits.FunctorCategory import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts import Mathlib.CategoryTheory.Limits.VanKampen #align_import category_theory.extensive from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1" open CategoryTheory.Limits namespace CategoryTheory universe v' u' v u v'' u'' variable {J : Type v'} [Category.{u'} J] {C : Type u} [Category.{v} C] variable {D : Type u''} [Category.{v''} D] section Extensive variable {X Y : C} class HasPullbacksOfInclusions (C : Type u) [Category.{v} C] [HasBinaryCoproducts C] : Prop where [hasPullbackInl : βˆ€ {X Y Z : C} (f : Z ⟢ X β¨Ώ Y), HasPullback coprod.inl f] attribute [instance] HasPullbacksOfInclusions.hasPullbackInl class PreservesPullbacksOfInclusions {C : Type*} [Category C] {D : Type*} [Category D] (F : C β₯€ D) [HasBinaryCoproducts C] where [preservesPullbackInl : βˆ€ {X Y Z : C} (f : Z ⟢ X β¨Ώ Y), PreservesLimit (cospan coprod.inl f) F] attribute [instance] PreservesPullbacksOfInclusions.preservesPullbackInl class FinitaryPreExtensive (C : Type u) [Category.{v} C] : Prop where [hasFiniteCoproducts : HasFiniteCoproducts C] [hasPullbacksOfInclusions : HasPullbacksOfInclusions C] universal' : βˆ€ {X Y : C} (c : BinaryCofan X Y), IsColimit c β†’ IsUniversalColimit c attribute [instance] FinitaryPreExtensive.hasFiniteCoproducts attribute [instance] FinitaryPreExtensive.hasPullbacksOfInclusions class FinitaryExtensive (C : Type u) [Category.{v} C] : Prop where [hasFiniteCoproducts : HasFiniteCoproducts C] [hasPullbacksOfInclusions : HasPullbacksOfInclusions C] van_kampen' : βˆ€ {X Y : C} (c : BinaryCofan X Y), IsColimit c β†’ IsVanKampenColimit c #align category_theory.finitary_extensive CategoryTheory.FinitaryExtensive attribute [instance] FinitaryExtensive.hasFiniteCoproducts attribute [instance] FinitaryExtensive.hasPullbacksOfInclusions
Mathlib/CategoryTheory/Extensive.lean
102
112
theorem FinitaryExtensive.vanKampen [FinitaryExtensive C] {F : Discrete WalkingPair β₯€ C} (c : Cocone F) (hc : IsColimit c) : IsVanKampenColimit c := by
let X := F.obj ⟨WalkingPair.left⟩ let Y := F.obj ⟨WalkingPair.right⟩ have : F = pair X Y := by apply Functor.hext · rintro ⟨⟨⟩⟩ <;> rfl · rintro ⟨⟨⟩⟩ ⟨j⟩ ⟨⟨rfl : _ = j⟩⟩ <;> simp clear_value X Y subst this exact FinitaryExtensive.van_kampen' c hc
[ " IsVanKampenColimit c", " F = pair X Y", " βˆ€ (X_1 : Discrete WalkingPair), F.obj X_1 = (pair X Y).obj X_1", " F.obj { as := WalkingPair.left } = (pair X Y).obj { as := WalkingPair.left }", " F.obj { as := WalkingPair.right } = (pair X Y).obj { as := WalkingPair.right }", " βˆ€ (X_1 Y_1 : Discrete WalkingPa...
[]
import Mathlib.Analysis.Analytic.Composition #align_import analysis.analytic.inverse from "leanprover-community/mathlib"@"284fdd2962e67d2932fa3a79ce19fcf92d38e228" open scoped Classical Topology open Finset Filter namespace FormalMultilinearSeries variable {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] noncomputable def leftInv (p : FormalMultilinearSeries π•œ E F) (i : E ≃L[π•œ] F) : FormalMultilinearSeries π•œ F E | 0 => 0 | 1 => (continuousMultilinearCurryFin1 π•œ F E).symm i.symm | n + 2 => -βˆ‘ c : { c : Composition (n + 2) // c.length < n + 2 }, (leftInv p i (c : Composition (n + 2)).length).compAlongComposition (p.compContinuousLinearMap i.symm) c #align formal_multilinear_series.left_inv FormalMultilinearSeries.leftInv @[simp] theorem leftInv_coeff_zero (p : FormalMultilinearSeries π•œ E F) (i : E ≃L[π•œ] F) : p.leftInv i 0 = 0 := by rw [leftInv] #align formal_multilinear_series.left_inv_coeff_zero FormalMultilinearSeries.leftInv_coeff_zero @[simp] theorem leftInv_coeff_one (p : FormalMultilinearSeries π•œ E F) (i : E ≃L[π•œ] F) : p.leftInv i 1 = (continuousMultilinearCurryFin1 π•œ F E).symm i.symm := by rw [leftInv] #align formal_multilinear_series.left_inv_coeff_one FormalMultilinearSeries.leftInv_coeff_one theorem leftInv_removeZero (p : FormalMultilinearSeries π•œ E F) (i : E ≃L[π•œ] F) : p.removeZero.leftInv i = p.leftInv i := by ext1 n induction' n using Nat.strongRec' with n IH match n with | 0 => simp -- if one replaces `simp` with `refl`, the proof times out in the kernel. | 1 => simp -- TODO: why? | n + 2 => simp only [leftInv, neg_inj] refine Finset.sum_congr rfl fun c cuniv => ?_ rcases c with ⟨c, hc⟩ ext v dsimp simp [IH _ hc] #align formal_multilinear_series.left_inv_remove_zero FormalMultilinearSeries.leftInv_removeZero
Mathlib/Analysis/Analytic/Inverse.lean
97
148
theorem leftInv_comp (p : FormalMultilinearSeries π•œ E F) (i : E ≃L[π•œ] F) (h : p 1 = (continuousMultilinearCurryFin1 π•œ E F).symm i) : (leftInv p i).comp p = id π•œ E := by
ext (n v) match n with | 0 => simp only [leftInv_coeff_zero, ContinuousMultilinearMap.zero_apply, id_apply_ne_one, Ne, not_false_iff, zero_ne_one, comp_coeff_zero'] | 1 => simp only [leftInv_coeff_one, comp_coeff_one, h, id_apply_one, ContinuousLinearEquiv.coe_apply, ContinuousLinearEquiv.symm_apply_apply, continuousMultilinearCurryFin1_symm_apply] | n + 2 => have A : (Finset.univ : Finset (Composition (n + 2))) = {c | Composition.length c < n + 2}.toFinset βˆͺ {Composition.ones (n + 2)} := by refine Subset.antisymm (fun c _ => ?_) (subset_univ _) by_cases h : c.length < n + 2 Β· simp [h, Set.mem_toFinset (s := {c | Composition.length c < n + 2})] Β· simp [Composition.eq_ones_iff_le_length.2 (not_lt.1 h)] have B : Disjoint ({c | Composition.length c < n + 2} : Set (Composition (n + 2))).toFinset {Composition.ones (n + 2)} := by simp [Set.mem_toFinset (s := {c | Composition.length c < n + 2})] have C : ((p.leftInv i (Composition.ones (n + 2)).length) fun j : Fin (Composition.ones n.succ.succ).length => p 1 fun _ => v ((Fin.castLE (Composition.length_le _)) j)) = p.leftInv i (n + 2) fun j : Fin (n + 2) => p 1 fun _ => v j := by apply FormalMultilinearSeries.congr _ (Composition.ones_length _) fun j hj1 hj2 => ?_ exact FormalMultilinearSeries.congr _ rfl fun k _ _ => by congr have D : (p.leftInv i (n + 2) fun j : Fin (n + 2) => p 1 fun _ => v j) = -βˆ‘ c ∈ {c : Composition (n + 2) | c.length < n + 2}.toFinset, (p.leftInv i c.length) (p.applyComposition c v) := by simp only [leftInv, ContinuousMultilinearMap.neg_apply, neg_inj, ContinuousMultilinearMap.sum_apply] convert (sum_toFinset_eq_subtype (fun c : Composition (n + 2) => c.length < n + 2) (fun c : Composition (n + 2) => (ContinuousMultilinearMap.compAlongComposition (p.compContinuousLinearMap (i.symm : F β†’L[π•œ] E)) c (p.leftInv i c.length)) fun j : Fin (n + 2) => p 1 fun _ : Fin 1 => v j)).symm.trans _ simp only [compContinuousLinearMap_applyComposition, ContinuousMultilinearMap.compAlongComposition_apply] congr ext c congr ext k simp [h, Function.comp] simp [FormalMultilinearSeries.comp, show n + 2 β‰  1 by omega, A, Finset.sum_union B, applyComposition_ones, C, D, -Set.toFinset_setOf]
[ " p.leftInv i 0 = 0", " p.leftInv i 1 = (continuousMultilinearCurryFin1 π•œ F E).symm ↑i.symm", " p.removeZero.leftInv i = p.leftInv i", " p.removeZero.leftInv i n = p.leftInv i n", " p.removeZero.leftInv i 0 = p.leftInv i 0", " p.removeZero.leftInv i 1 = p.leftInv i 1", " p.removeZero.leftInv i (n + 2) ...
[ " p.leftInv i 0 = 0", " p.leftInv i 1 = (continuousMultilinearCurryFin1 π•œ F E).symm ↑i.symm", " p.removeZero.leftInv i = p.leftInv i", " p.removeZero.leftInv i n = p.leftInv i n", " p.removeZero.leftInv i 0 = p.leftInv i 0", " p.removeZero.leftInv i 1 = p.leftInv i 1", " p.removeZero.leftInv i (n + 2) ...
import Mathlib.Analysis.SpecialFunctions.Pow.Real import Mathlib.Data.Int.Log #align_import analysis.special_functions.log.base from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690" open Set Filter Function open Topology noncomputable section namespace Real variable {b x y : ℝ} -- @[pp_nodot] -- Porting note: removed noncomputable def logb (b x : ℝ) : ℝ := log x / log b #align real.logb Real.logb theorem log_div_log : log x / log b = logb b x := rfl #align real.log_div_log Real.log_div_log @[simp] theorem logb_zero : logb b 0 = 0 := by simp [logb] #align real.logb_zero Real.logb_zero @[simp] theorem logb_one : logb b 1 = 0 := by simp [logb] #align real.logb_one Real.logb_one @[simp] lemma logb_self_eq_one (hb : 1 < b) : logb b b = 1 := div_self (log_pos hb).ne' lemma logb_self_eq_one_iff : logb b b = 1 ↔ b β‰  0 ∧ b β‰  1 ∧ b β‰  -1 := Iff.trans ⟨fun h h' => by simp [logb, h'] at h, div_self⟩ log_ne_zero @[simp] theorem logb_abs (x : ℝ) : logb b |x| = logb b x := by rw [logb, logb, log_abs] #align real.logb_abs Real.logb_abs @[simp] theorem logb_neg_eq_logb (x : ℝ) : logb b (-x) = logb b x := by rw [← logb_abs x, ← logb_abs (-x), abs_neg] #align real.logb_neg_eq_logb Real.logb_neg_eq_logb theorem logb_mul (hx : x β‰  0) (hy : y β‰  0) : logb b (x * y) = logb b x + logb b y := by simp_rw [logb, log_mul hx hy, add_div] #align real.logb_mul Real.logb_mul theorem logb_div (hx : x β‰  0) (hy : y β‰  0) : logb b (x / y) = logb b x - logb b y := by simp_rw [logb, log_div hx hy, sub_div] #align real.logb_div Real.logb_div @[simp] theorem logb_inv (x : ℝ) : logb b x⁻¹ = -logb b x := by simp [logb, neg_div] #align real.logb_inv Real.logb_inv theorem inv_logb (a b : ℝ) : (logb a b)⁻¹ = logb b a := by simp_rw [logb, inv_div] #align real.inv_logb Real.inv_logb theorem inv_logb_mul_base {a b : ℝ} (h₁ : a β‰  0) (hβ‚‚ : b β‰  0) (c : ℝ) : (logb (a * b) c)⁻¹ = (logb a c)⁻¹ + (logb b c)⁻¹ := by simp_rw [inv_logb]; exact logb_mul h₁ hβ‚‚ #align real.inv_logb_mul_base Real.inv_logb_mul_base theorem inv_logb_div_base {a b : ℝ} (h₁ : a β‰  0) (hβ‚‚ : b β‰  0) (c : ℝ) : (logb (a / b) c)⁻¹ = (logb a c)⁻¹ - (logb b c)⁻¹ := by simp_rw [inv_logb]; exact logb_div h₁ hβ‚‚ #align real.inv_logb_div_base Real.inv_logb_div_base theorem logb_mul_base {a b : ℝ} (h₁ : a β‰  0) (hβ‚‚ : b β‰  0) (c : ℝ) : logb (a * b) c = ((logb a c)⁻¹ + (logb b c)⁻¹)⁻¹ := by rw [← inv_logb_mul_base h₁ hβ‚‚ c, inv_inv] #align real.logb_mul_base Real.logb_mul_base theorem logb_div_base {a b : ℝ} (h₁ : a β‰  0) (hβ‚‚ : b β‰  0) (c : ℝ) : logb (a / b) c = ((logb a c)⁻¹ - (logb b c)⁻¹)⁻¹ := by rw [← inv_logb_div_base h₁ hβ‚‚ c, inv_inv] #align real.logb_div_base Real.logb_div_base theorem mul_logb {a b c : ℝ} (h₁ : b β‰  0) (hβ‚‚ : b β‰  1) (h₃ : b β‰  -1) : logb a b * logb b c = logb a c := by unfold logb rw [mul_comm, div_mul_div_cancel _ (log_ne_zero.mpr ⟨h₁, hβ‚‚, hβ‚ƒβŸ©)] #align real.mul_logb Real.mul_logb theorem div_logb {a b c : ℝ} (h₁ : c β‰  0) (hβ‚‚ : c β‰  1) (h₃ : c β‰  -1) : logb a c / logb b c = logb a b := div_div_div_cancel_left' _ _ <| log_ne_zero.mpr ⟨h₁, hβ‚‚, hβ‚ƒβŸ© #align real.div_logb Real.div_logb theorem logb_rpow_eq_mul_logb_of_pos (hx : 0 < x) : logb b (x ^ y) = y * logb b x := by rw [logb, log_rpow hx, logb, mul_div_assoc]
Mathlib/Analysis/SpecialFunctions/Log/Base.lean
119
120
theorem logb_pow {k : β„•} (hx : 0 < x) : logb b (x ^ k) = k * logb b x := by
rw [← rpow_natCast, logb_rpow_eq_mul_logb_of_pos hx]
[ " b.logb 0 = 0", " b.logb 1 = 0", " False", " b.logb |x| = b.logb x", " b.logb (-x) = b.logb x", " b.logb (x * y) = b.logb x + b.logb y", " b.logb (x / y) = b.logb x - b.logb y", " b.logb x⁻¹ = -b.logb x", " (a.logb b)⁻¹ = b.logb a", " ((a * b).logb c)⁻¹ = (a.logb c)⁻¹ + (b.logb c)⁻¹", " c.logb ...
[ " b.logb 0 = 0", " b.logb 1 = 0", " False", " b.logb |x| = b.logb x", " b.logb (-x) = b.logb x", " b.logb (x * y) = b.logb x + b.logb y", " b.logb (x / y) = b.logb x - b.logb y", " b.logb x⁻¹ = -b.logb x", " (a.logb b)⁻¹ = b.logb a", " ((a * b).logb c)⁻¹ = (a.logb c)⁻¹ + (b.logb c)⁻¹", " c.logb ...
import Mathlib.Data.Set.Image import Mathlib.Data.SProd #align_import data.set.prod from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4" open Function namespace Set section Prod variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {s s₁ sβ‚‚ : Set Ξ±} {t t₁ tβ‚‚ : Set Ξ²} {a : Ξ±} {b : Ξ²} theorem Subsingleton.prod (hs : s.Subsingleton) (ht : t.Subsingleton) : (s Γ—Λ’ t).Subsingleton := fun _x hx _y hy ↦ Prod.ext (hs hx.1 hy.1) (ht hx.2 hy.2) noncomputable instance decidableMemProd [DecidablePred (Β· ∈ s)] [DecidablePred (Β· ∈ t)] : DecidablePred (Β· ∈ s Γ—Λ’ t) := fun _ => And.decidable #align set.decidable_mem_prod Set.decidableMemProd @[gcongr] theorem prod_mono (hs : s₁ βŠ† sβ‚‚) (ht : t₁ βŠ† tβ‚‚) : s₁ Γ—Λ’ t₁ βŠ† sβ‚‚ Γ—Λ’ tβ‚‚ := fun _ ⟨h₁, hβ‚‚βŸ© => ⟨hs h₁, ht hβ‚‚βŸ© #align set.prod_mono Set.prod_mono @[gcongr] theorem prod_mono_left (hs : s₁ βŠ† sβ‚‚) : s₁ Γ—Λ’ t βŠ† sβ‚‚ Γ—Λ’ t := prod_mono hs Subset.rfl #align set.prod_mono_left Set.prod_mono_left @[gcongr] theorem prod_mono_right (ht : t₁ βŠ† tβ‚‚) : s Γ—Λ’ t₁ βŠ† s Γ—Λ’ tβ‚‚ := prod_mono Subset.rfl ht #align set.prod_mono_right Set.prod_mono_right @[simp] theorem prod_self_subset_prod_self : s₁ Γ—Λ’ s₁ βŠ† sβ‚‚ Γ—Λ’ sβ‚‚ ↔ s₁ βŠ† sβ‚‚ := ⟨fun h _ hx => (h (mk_mem_prod hx hx)).1, fun h _ hx => ⟨h hx.1, h hx.2⟩⟩ #align set.prod_self_subset_prod_self Set.prod_self_subset_prod_self @[simp] theorem prod_self_ssubset_prod_self : s₁ Γ—Λ’ s₁ βŠ‚ sβ‚‚ Γ—Λ’ sβ‚‚ ↔ s₁ βŠ‚ sβ‚‚ := and_congr prod_self_subset_prod_self <| not_congr prod_self_subset_prod_self #align set.prod_self_ssubset_prod_self Set.prod_self_ssubset_prod_self theorem prod_subset_iff {P : Set (Ξ± Γ— Ξ²)} : s Γ—Λ’ t βŠ† P ↔ βˆ€ x ∈ s, βˆ€ y ∈ t, (x, y) ∈ P := ⟨fun h _ hx _ hy => h (mk_mem_prod hx hy), fun h ⟨_, _⟩ hp => h _ hp.1 _ hp.2⟩ #align set.prod_subset_iff Set.prod_subset_iff theorem forall_prod_set {p : Ξ± Γ— Ξ² β†’ Prop} : (βˆ€ x ∈ s Γ—Λ’ t, p x) ↔ βˆ€ x ∈ s, βˆ€ y ∈ t, p (x, y) := prod_subset_iff #align set.forall_prod_set Set.forall_prod_set theorem exists_prod_set {p : Ξ± Γ— Ξ² β†’ Prop} : (βˆƒ x ∈ s Γ—Λ’ t, p x) ↔ βˆƒ x ∈ s, βˆƒ y ∈ t, p (x, y) := by simp [and_assoc] #align set.exists_prod_set Set.exists_prod_set @[simp] theorem prod_empty : s Γ—Λ’ (βˆ… : Set Ξ²) = βˆ… := by ext exact and_false_iff _ #align set.prod_empty Set.prod_empty @[simp] theorem empty_prod : (βˆ… : Set Ξ±) Γ—Λ’ t = βˆ… := by ext exact false_and_iff _ #align set.empty_prod Set.empty_prod @[simp, mfld_simps] theorem univ_prod_univ : @univ Ξ± Γ—Λ’ @univ Ξ² = univ := by ext exact true_and_iff _ #align set.univ_prod_univ Set.univ_prod_univ theorem univ_prod {t : Set Ξ²} : (univ : Set Ξ±) Γ—Λ’ t = Prod.snd ⁻¹' t := by simp [prod_eq] #align set.univ_prod Set.univ_prod theorem prod_univ {s : Set Ξ±} : s Γ—Λ’ (univ : Set Ξ²) = Prod.fst ⁻¹' s := by simp [prod_eq] #align set.prod_univ Set.prod_univ @[simp] lemma prod_eq_univ [Nonempty Ξ±] [Nonempty Ξ²] : s Γ—Λ’ t = univ ↔ s = univ ∧ t = univ := by simp [eq_univ_iff_forall, forall_and] @[simp] theorem singleton_prod : ({a} : Set Ξ±) Γ—Λ’ t = Prod.mk a '' t := by ext ⟨x, y⟩ simp [and_left_comm, eq_comm] #align set.singleton_prod Set.singleton_prod @[simp] theorem prod_singleton : s Γ—Λ’ ({b} : Set Ξ²) = (fun a => (a, b)) '' s := by ext ⟨x, y⟩ simp [and_left_comm, eq_comm] #align set.prod_singleton Set.prod_singleton theorem singleton_prod_singleton : ({a} : Set Ξ±) Γ—Λ’ ({b} : Set Ξ²) = {(a, b)} := by simp #align set.singleton_prod_singleton Set.singleton_prod_singleton @[simp] theorem union_prod : (s₁ βˆͺ sβ‚‚) Γ—Λ’ t = s₁ Γ—Λ’ t βˆͺ sβ‚‚ Γ—Λ’ t := by ext ⟨x, y⟩ simp [or_and_right] #align set.union_prod Set.union_prod @[simp] theorem prod_union : s Γ—Λ’ (t₁ βˆͺ tβ‚‚) = s Γ—Λ’ t₁ βˆͺ s Γ—Λ’ tβ‚‚ := by ext ⟨x, y⟩ simp [and_or_left] #align set.prod_union Set.prod_union
Mathlib/Data/Set/Prod.lean
137
139
theorem inter_prod : (s₁ ∩ sβ‚‚) Γ—Λ’ t = s₁ Γ—Λ’ t ∩ sβ‚‚ Γ—Λ’ t := by
ext ⟨x, y⟩ simp only [← and_and_right, mem_inter_iff, mem_prod]
[ " (βˆƒ x ∈ s Γ—Λ’ t, p x) ↔ βˆƒ x ∈ s, βˆƒ y ∈ t, p (x, y)", " s Γ—Λ’ βˆ… = βˆ…", " x✝ ∈ s Γ—Λ’ βˆ… ↔ x✝ ∈ βˆ…", " βˆ… Γ—Λ’ t = βˆ…", " x✝ ∈ βˆ… Γ—Λ’ t ↔ x✝ ∈ βˆ…", " univ Γ—Λ’ univ = univ", " x✝ ∈ univ Γ—Λ’ univ ↔ x✝ ∈ univ", " univ Γ—Λ’ t = Prod.snd ⁻¹' t", " s Γ—Λ’ univ = Prod.fst ⁻¹' s", " s Γ—Λ’ t = univ ↔ s = univ ∧ t = univ", " {...
[ " (βˆƒ x ∈ s Γ—Λ’ t, p x) ↔ βˆƒ x ∈ s, βˆƒ y ∈ t, p (x, y)", " s Γ—Λ’ βˆ… = βˆ…", " x✝ ∈ s Γ—Λ’ βˆ… ↔ x✝ ∈ βˆ…", " βˆ… Γ—Λ’ t = βˆ…", " x✝ ∈ βˆ… Γ—Λ’ t ↔ x✝ ∈ βˆ…", " univ Γ—Λ’ univ = univ", " x✝ ∈ univ Γ—Λ’ univ ↔ x✝ ∈ univ", " univ Γ—Λ’ t = Prod.snd ⁻¹' t", " s Γ—Λ’ univ = Prod.fst ⁻¹' s", " s Γ—Λ’ t = univ ↔ s = univ ∧ t = univ", " {...
import Mathlib.NumberTheory.ModularForms.SlashInvariantForms import Mathlib.NumberTheory.ModularForms.CongruenceSubgroups noncomputable section open ModularForm UpperHalfPlane Matrix namespace SlashInvariantForm theorem vAdd_width_periodic (N : β„•) (k n : β„€) (f : SlashInvariantForm (Gamma N) k) (z : ℍ) : f (((N * n) : ℝ) +α΅₯ z) = f z := by norm_cast rw [← modular_T_zpow_smul z (N * n)] have Hn := (ModularGroup_T_pow_mem_Gamma N (N * n) (by simp)) simp only [zpow_natCast, Int.natAbs_ofNat] at Hn convert (SlashInvariantForm.slash_action_eqn' k (Gamma N) f ⟨((ModularGroup.T ^ (N * n))), Hn⟩ z) unfold SpecialLinearGroup.coeToGL simp only [Fin.isValue, ModularGroup.coe_T_zpow (N * n), of_apply, cons_val', cons_val_zero, empty_val', cons_val_fin_one, cons_val_one, head_fin_const, Int.cast_zero, zero_mul, head_cons, Int.cast_one, zero_add, one_zpow, one_mul]
Mathlib/NumberTheory/ModularForms/Identities.lean
34
37
theorem T_zpow_width_invariant (N : β„•) (k n : β„€) (f : SlashInvariantForm (Gamma N) k) (z : ℍ) : f (((ModularGroup.T ^ (N * n))) β€’ z) = f z := by
rw [modular_T_zpow_smul z (N * n)] simpa only [Int.cast_mul, Int.cast_natCast] using vAdd_width_periodic N k n f z
[ " f (↑N * ↑n +α΅₯ z) = f z", " f (↑(↑N * n) +α΅₯ z) = f z", " f (ModularGroup.T ^ (↑N * n) β€’ z) = f z", " ↑N ∣ ↑N * n", " f z = (↑(β†‘β†‘β†‘βŸ¨ModularGroup.T ^ (↑N * n), Hn⟩ 1 0) * ↑z + ↑(β†‘β†‘β†‘βŸ¨ModularGroup.T ^ (↑N * n), Hn⟩ 1 1)) ^ k * f z", " f z =\n (↑(↑{ val := β†‘β†‘βŸ¨ModularGroup.T ^ (↑N * n), Hn⟩, inv := ↑(β†‘βŸ¨Modul...
[ " f (↑N * ↑n +α΅₯ z) = f z", " f (↑(↑N * n) +α΅₯ z) = f z", " f (ModularGroup.T ^ (↑N * n) β€’ z) = f z", " ↑N ∣ ↑N * n", " f z = (↑(β†‘β†‘β†‘βŸ¨ModularGroup.T ^ (↑N * n), Hn⟩ 1 0) * ↑z + ↑(β†‘β†‘β†‘βŸ¨ModularGroup.T ^ (↑N * n), Hn⟩ 1 1)) ^ k * f z", " f z =\n (↑(↑{ val := β†‘β†‘βŸ¨ModularGroup.T ^ (↑N * n), Hn⟩, inv := ↑(β†‘βŸ¨Modul...
import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" noncomputable section open RCLike Real Filter open scoped Classical Topology section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [RCLike π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean
Mathlib/Analysis/InnerProductSpace/Calculus.lean
333
337
theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by
rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl
[ " DifferentiableWithinAt π•œ f t y ↔ βˆ€ (i : ΞΉ), DifferentiableWithinAt π•œ (fun x => f x i) t y", " (βˆ€ (i : ΞΉ), DifferentiableWithinAt π•œ (fun x => (⇑(EuclideanSpace.equiv ΞΉ π•œ) ∘ f) x i) t y) ↔\n βˆ€ (i : ΞΉ), DifferentiableWithinAt π•œ (fun x => f x i) t y", " DifferentiableAt π•œ f y ↔ βˆ€ (i : ΞΉ), DifferentiableA...
[ " DifferentiableWithinAt π•œ f t y ↔ βˆ€ (i : ΞΉ), DifferentiableWithinAt π•œ (fun x => f x i) t y", " (βˆ€ (i : ΞΉ), DifferentiableWithinAt π•œ (fun x => (⇑(EuclideanSpace.equiv ΞΉ π•œ) ∘ f) x i) t y) ↔\n βˆ€ (i : ΞΉ), DifferentiableWithinAt π•œ (fun x => f x i) t y", " DifferentiableAt π•œ f y ↔ βˆ€ (i : ΞΉ), DifferentiableA...
import Mathlib.Algebra.Module.Submodule.Basic import Mathlib.Topology.Algebra.Monoid import Mathlib.Analysis.Asymptotics.Asymptotics import Mathlib.Algebra.Algebra.Pi #align_import order.filter.zero_and_bounded_at_filter from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" namespace Filter variable {π•œ Ξ± Ξ² : Type*} open Topology def ZeroAtFilter [Zero Ξ²] [TopologicalSpace Ξ²] (l : Filter Ξ±) (f : Ξ± β†’ Ξ²) : Prop := Filter.Tendsto f l (𝓝 0) #align filter.zero_at_filter Filter.ZeroAtFilter theorem zero_zeroAtFilter [Zero Ξ²] [TopologicalSpace Ξ²] (l : Filter Ξ±) : ZeroAtFilter l (0 : Ξ± β†’ Ξ²) := tendsto_const_nhds #align filter.zero_zero_at_filter Filter.zero_zeroAtFilter nonrec theorem ZeroAtFilter.add [TopologicalSpace Ξ²] [AddZeroClass Ξ²] [ContinuousAdd Ξ²] {l : Filter Ξ±} {f g : Ξ± β†’ Ξ²} (hf : ZeroAtFilter l f) (hg : ZeroAtFilter l g) : ZeroAtFilter l (f + g) := by simpa using hf.add hg #align filter.zero_at_filter.add Filter.ZeroAtFilter.add nonrec theorem ZeroAtFilter.neg [TopologicalSpace Ξ²] [AddGroup Ξ²] [ContinuousNeg Ξ²] {l : Filter Ξ±} {f : Ξ± β†’ Ξ²} (hf : ZeroAtFilter l f) : ZeroAtFilter l (-f) := by simpa using hf.neg #align filter.zero_at_filter.neg Filter.ZeroAtFilter.neg theorem ZeroAtFilter.smul [TopologicalSpace Ξ²] [Zero π•œ] [Zero Ξ²] [SMulWithZero π•œ Ξ²] [ContinuousConstSMul π•œ Ξ²] {l : Filter Ξ±} {f : Ξ± β†’ Ξ²} (c : π•œ) (hf : ZeroAtFilter l f) : ZeroAtFilter l (c β€’ f) := by simpa using hf.const_smul c #align filter.zero_at_filter.smul Filter.ZeroAtFilter.smul variable (π•œ) in def zeroAtFilterSubmodule [TopologicalSpace Ξ²] [Semiring π•œ] [AddCommMonoid Ξ²] [Module π•œ Ξ²] [ContinuousAdd Ξ²] [ContinuousConstSMul π•œ Ξ²] (l : Filter Ξ±) : Submodule π•œ (Ξ± β†’ Ξ²) where carrier := ZeroAtFilter l zero_mem' := zero_zeroAtFilter l add_mem' ha hb := ha.add hb smul_mem' c _ hf := hf.smul c #align filter.zero_at_filter_submodule Filter.zeroAtFilterSubmodule def zeroAtFilterAddSubmonoid [TopologicalSpace Ξ²] [AddZeroClass Ξ²] [ContinuousAdd Ξ²] (l : Filter Ξ±) : AddSubmonoid (Ξ± β†’ Ξ²) where carrier := ZeroAtFilter l add_mem' ha hb := ha.add hb zero_mem' := zero_zeroAtFilter l #align filter.zero_at_filter_add_submonoid Filter.zeroAtFilterAddSubmonoid def BoundedAtFilter [Norm Ξ²] (l : Filter Ξ±) (f : Ξ± β†’ Ξ²) : Prop := Asymptotics.IsBigO l f (1 : Ξ± β†’ ℝ) #align filter.bounded_at_filter Filter.BoundedAtFilter
Mathlib/Order/Filter/ZeroAndBoundedAtFilter.lean
84
87
theorem ZeroAtFilter.boundedAtFilter [NormedAddCommGroup Ξ²] {l : Filter Ξ±} {f : Ξ± β†’ Ξ²} (hf : ZeroAtFilter l f) : BoundedAtFilter l f := by
rw [ZeroAtFilter, ← Asymptotics.isLittleO_const_iff (one_ne_zero' ℝ)] at hf exact hf.isBigO
[ " l.ZeroAtFilter (f + g)", " l.ZeroAtFilter (-f)", " l.ZeroAtFilter (c β€’ f)", " l.BoundedAtFilter f" ]
[ " l.ZeroAtFilter (f + g)", " l.ZeroAtFilter (-f)", " l.ZeroAtFilter (c β€’ f)" ]
import Mathlib.ModelTheory.Syntax import Mathlib.ModelTheory.Semantics import Mathlib.ModelTheory.Algebra.Ring.Basic import Mathlib.Algebra.Field.MinimalAxioms variable {K : Type*} namespace FirstOrder namespace Field open Language Ring Structure BoundedFormula inductive FieldAxiom : Type | addAssoc : FieldAxiom | zeroAdd : FieldAxiom | addLeftNeg : FieldAxiom | mulAssoc : FieldAxiom | mulComm : FieldAxiom | oneMul : FieldAxiom | existsInv : FieldAxiom | leftDistrib : FieldAxiom | existsPairNE : FieldAxiom @[simp] def FieldAxiom.toSentence : FieldAxiom β†’ Language.ring.Sentence | .addAssoc => βˆ€' βˆ€' βˆ€' (((&0 + &1) + &2) =' (&0 + (&1 + &2))) | .zeroAdd => βˆ€' (((0 : Language.ring.Term _) + &0) =' &0) | .addLeftNeg => βˆ€' βˆ€' ((-&0 + &0) =' 0) | .mulAssoc => βˆ€' βˆ€' βˆ€' (((&0 * &1) * &2) =' (&0 * (&1 * &2))) | .mulComm => βˆ€' βˆ€' ((&0 * &1) =' (&1 * &0)) | .oneMul => βˆ€' (((1 : Language.ring.Term _) * &0) =' &0) | .existsInv => βˆ€' (∼(&0 =' 0) ⟹ βˆƒ' ((&0 * &1) =' 1)) | .leftDistrib => βˆ€' βˆ€' βˆ€' ((&0 * (&1 + &2)) =' ((&0 * &1) + (&0 * &2))) | .existsPairNE => βˆƒ' βˆƒ' (∼(&0 =' &1)) @[simp] def FieldAxiom.toProp (K : Type*) [Add K] [Mul K] [Neg K] [Zero K] [One K] : FieldAxiom β†’ Prop | .addAssoc => βˆ€ x y z : K, (x + y) + z = x + (y + z) | .zeroAdd => βˆ€ x : K, 0 + x = x | .addLeftNeg => βˆ€ x : K, -x + x = 0 | .mulAssoc => βˆ€ x y z : K, (x * y) * z = x * (y * z) | .mulComm => βˆ€ x y : K, x * y = y * x | .oneMul => βˆ€ x : K, 1 * x = x | .existsInv => βˆ€ x : K, x β‰  0 β†’ βˆƒ y, x * y = 1 | .leftDistrib => βˆ€ x y z : K, x * (y + z) = x * y + x * z | .existsPairNE => βˆƒ x y : K, x β‰  y def _root_.FirstOrder.Language.Theory.field : Language.ring.Theory := Set.range FieldAxiom.toSentence
Mathlib/ModelTheory/Algebra/Field/Basic.lean
81
86
theorem FieldAxiom.realize_toSentence_iff_toProp {K : Type*} [Add K] [Mul K] [Neg K] [Zero K] [One K] [CompatibleRing K] (ax : FieldAxiom) : (K ⊨ (ax.toSentence : Sentence Language.ring)) ↔ ax.toProp K := by
cases ax <;> simp [Sentence.Realize, Formula.Realize, Fin.snoc]
[ " K ⊨ ax.toSentence ↔ toProp K ax", " K ⊨ addAssoc.toSentence ↔ toProp K addAssoc", " K ⊨ zeroAdd.toSentence ↔ toProp K zeroAdd", " K ⊨ addLeftNeg.toSentence ↔ toProp K addLeftNeg", " K ⊨ mulAssoc.toSentence ↔ toProp K mulAssoc", " K ⊨ mulComm.toSentence ↔ toProp K mulComm", " K ⊨ oneMul.toSentence ↔ to...
[]
import Mathlib.Topology.Order.Basic #align_import topology.algebra.order.monotone_convergence from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514" open Filter Set Function open scoped Classical open Filter Topology variable {Ξ± Ξ² : Type*} class SupConvergenceClass (Ξ± : Type*) [Preorder Ξ±] [TopologicalSpace Ξ±] : Prop where tendsto_coe_atTop_isLUB : βˆ€ (a : Ξ±) (s : Set Ξ±), IsLUB s a β†’ Tendsto (CoeTC.coe : s β†’ Ξ±) atTop (𝓝 a) #align Sup_convergence_class SupConvergenceClass class InfConvergenceClass (Ξ± : Type*) [Preorder Ξ±] [TopologicalSpace Ξ±] : Prop where tendsto_coe_atBot_isGLB : βˆ€ (a : Ξ±) (s : Set Ξ±), IsGLB s a β†’ Tendsto (CoeTC.coe : s β†’ Ξ±) atBot (𝓝 a) #align Inf_convergence_class InfConvergenceClass instance OrderDual.supConvergenceClass [Preorder Ξ±] [TopologicalSpace Ξ±] [InfConvergenceClass Ξ±] : SupConvergenceClass Ξ±α΅’α΅ˆ := βŸ¨β€ΉInfConvergenceClass Ξ±β€Ί.1⟩ #align order_dual.Sup_convergence_class OrderDual.supConvergenceClass instance OrderDual.infConvergenceClass [Preorder Ξ±] [TopologicalSpace Ξ±] [SupConvergenceClass Ξ±] : InfConvergenceClass Ξ±α΅’α΅ˆ := βŸ¨β€ΉSupConvergenceClass Ξ±β€Ί.1⟩ #align order_dual.Inf_convergence_class OrderDual.infConvergenceClass -- see Note [lower instance priority] instance (priority := 100) LinearOrder.supConvergenceClass [TopologicalSpace Ξ±] [LinearOrder Ξ±] [OrderTopology Ξ±] : SupConvergenceClass Ξ± := by refine ⟨fun a s ha => tendsto_order.2 ⟨fun b hb => ?_, fun b hb => ?_⟩⟩ Β· rcases ha.exists_between hb with ⟨c, hcs, bc, bca⟩ lift c to s using hcs exact (eventually_ge_atTop c).mono fun x hx => bc.trans_le hx Β· exact eventually_of_forall fun x => (ha.1 x.2).trans_lt hb #align linear_order.Sup_convergence_class LinearOrder.supConvergenceClass -- see Note [lower instance priority] instance (priority := 100) LinearOrder.infConvergenceClass [TopologicalSpace Ξ±] [LinearOrder Ξ±] [OrderTopology Ξ±] : InfConvergenceClass Ξ± := show InfConvergenceClass Ξ±α΅’α΅ˆα΅’α΅ˆ from OrderDual.infConvergenceClass #align linear_order.Inf_convergence_class LinearOrder.infConvergenceClass section variable {ΞΉ : Type*} [Preorder ΞΉ] [TopologicalSpace Ξ±] section IsLUB variable [Preorder Ξ±] [SupConvergenceClass Ξ±] {f : ΞΉ β†’ Ξ±} {a : Ξ±}
Mathlib/Topology/Order/MonotoneConvergence.lean
96
100
theorem tendsto_atTop_isLUB (h_mono : Monotone f) (ha : IsLUB (Set.range f) a) : Tendsto f atTop (𝓝 a) := by
suffices Tendsto (rangeFactorization f) atTop atTop from (SupConvergenceClass.tendsto_coe_atTop_isLUB _ _ ha).comp this exact h_mono.rangeFactorization.tendsto_atTop_atTop fun b => b.2.imp fun a ha => ha.ge
[ " SupConvergenceClass Ξ±", " βˆ€αΆ  (b_1 : ↑s) in atTop, b < CoeTC.coe b_1", " βˆ€αΆ  (b_1 : ↑s) in atTop, CoeTC.coe b_1 < b", " Tendsto f atTop (𝓝 a)", " Tendsto (rangeFactorization f) atTop atTop" ]
[ " SupConvergenceClass Ξ±", " βˆ€αΆ  (b_1 : ↑s) in atTop, b < CoeTC.coe b_1", " βˆ€αΆ  (b_1 : ↑s) in atTop, CoeTC.coe b_1 < b" ]
import Mathlib.CategoryTheory.Subobject.MonoOver import Mathlib.CategoryTheory.Skeletal import Mathlib.CategoryTheory.ConcreteCategory.Basic import Mathlib.Tactic.ApplyFun import Mathlib.Tactic.CategoryTheory.Elementwise #align_import category_theory.subobject.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe v₁ vβ‚‚ u₁ uβ‚‚ noncomputable section namespace CategoryTheory open CategoryTheory CategoryTheory.Category CategoryTheory.Limits variable {C : Type u₁} [Category.{v₁} C] {X Y Z : C} variable {D : Type uβ‚‚} [Category.{vβ‚‚} D] def Subobject (X : C) := ThinSkeleton (MonoOver X) #align category_theory.subobject CategoryTheory.Subobject instance (X : C) : PartialOrder (Subobject X) := by dsimp only [Subobject] infer_instance namespace Subobject -- Porting note: made it a def rather than an abbreviation -- because Lean would make it too transparent def mk {X A : C} (f : A ⟢ X) [Mono f] : Subobject X := (toThinSkeleton _).obj (MonoOver.mk' f) #align category_theory.subobject.mk CategoryTheory.Subobject.mk section attribute [local ext] CategoryTheory.Comma protected theorem ind {X : C} (p : Subobject X β†’ Prop) (h : βˆ€ ⦃A : C⦄ (f : A ⟢ X) [Mono f], p (Subobject.mk f)) (P : Subobject X) : p P := by apply Quotient.inductionOn' intro a exact h a.arrow #align category_theory.subobject.ind CategoryTheory.Subobject.ind protected theorem indβ‚‚ {X : C} (p : Subobject X β†’ Subobject X β†’ Prop) (h : βˆ€ ⦃A B : C⦄ (f : A ⟢ X) (g : B ⟢ X) [Mono f] [Mono g], p (Subobject.mk f) (Subobject.mk g)) (P Q : Subobject X) : p P Q := by apply Quotient.inductionOnβ‚‚' intro a b exact h a.arrow b.arrow #align category_theory.subobject.indβ‚‚ CategoryTheory.Subobject.indβ‚‚ end protected def lift {Ξ± : Sort*} {X : C} (F : βˆ€ ⦃A : C⦄ (f : A ⟢ X) [Mono f], Ξ±) (h : βˆ€ ⦃A B : C⦄ (f : A ⟢ X) (g : B ⟢ X) [Mono f] [Mono g] (i : A β‰… B), i.hom ≫ g = f β†’ F f = F g) : Subobject X β†’ Ξ± := fun P => Quotient.liftOn' P (fun m => F m.arrow) fun m n ⟨i⟩ => h m.arrow n.arrow ((MonoOver.forget X β‹™ Over.forget X).mapIso i) (Over.w i.hom) #align category_theory.subobject.lift CategoryTheory.Subobject.lift @[simp] protected theorem lift_mk {Ξ± : Sort*} {X : C} (F : βˆ€ ⦃A : C⦄ (f : A ⟢ X) [Mono f], Ξ±) {h A} (f : A ⟢ X) [Mono f] : Subobject.lift F h (Subobject.mk f) = F f := rfl #align category_theory.subobject.lift_mk CategoryTheory.Subobject.lift_mk noncomputable def equivMonoOver (X : C) : Subobject X β‰Œ MonoOver X := ThinSkeleton.equivalence _ #align category_theory.subobject.equiv_mono_over CategoryTheory.Subobject.equivMonoOver noncomputable def representative {X : C} : Subobject X β₯€ MonoOver X := (equivMonoOver X).functor #align category_theory.subobject.representative CategoryTheory.Subobject.representative noncomputable def representativeIso {X : C} (A : MonoOver X) : representative.obj ((toThinSkeleton _).obj A) β‰… A := (equivMonoOver X).counitIso.app A #align category_theory.subobject.representative_iso CategoryTheory.Subobject.representativeIso noncomputable def underlying {X : C} : Subobject X β₯€ C := representative β‹™ MonoOver.forget _ β‹™ Over.forget _ #align category_theory.subobject.underlying CategoryTheory.Subobject.underlying instance : CoeOut (Subobject X) C where coe Y := underlying.obj Y -- Porting note: removed as it has become a syntactic tautology -- @[simp] -- theorem underlying_as_coe {X : C} (P : Subobject X) : underlying.obj P = P := -- rfl -- #align category_theory.subobject.underlying_as_coe CategoryTheory.Subobject.underlying_as_coe noncomputable def underlyingIso {X Y : C} (f : X ⟢ Y) [Mono f] : (Subobject.mk f : C) β‰… X := (MonoOver.forget _ β‹™ Over.forget _).mapIso (representativeIso (MonoOver.mk' f)) #align category_theory.subobject.underlying_iso CategoryTheory.Subobject.underlyingIso noncomputable def arrow {X : C} (Y : Subobject X) : (Y : C) ⟢ X := (representative.obj Y).obj.hom #align category_theory.subobject.arrow CategoryTheory.Subobject.arrow instance arrow_mono {X : C} (Y : Subobject X) : Mono Y.arrow := (representative.obj Y).property #align category_theory.subobject.arrow_mono CategoryTheory.Subobject.arrow_mono @[simp]
Mathlib/CategoryTheory/Subobject/Basic.lean
210
213
theorem arrow_congr {A : C} (X Y : Subobject A) (h : X = Y) : eqToHom (congr_arg (fun X : Subobject A => (X : C)) h) ≫ Y.arrow = X.arrow := by
induction h simp
[ " PartialOrder (Subobject X)", " PartialOrder (ThinSkeleton (MonoOver X))", " p P", " βˆ€ (a : MonoOver X), p (Quotient.mk'' a)", " p (Quotient.mk'' a)", " p P Q", " βˆ€ (a₁ aβ‚‚ : MonoOver X), p (Quotient.mk'' a₁) (Quotient.mk'' aβ‚‚)", " p (Quotient.mk'' a) (Quotient.mk'' b)", " eqToHom β‹― ≫ Y.arrow = X.ar...
[ " PartialOrder (Subobject X)", " PartialOrder (ThinSkeleton (MonoOver X))", " p P", " βˆ€ (a : MonoOver X), p (Quotient.mk'' a)", " p (Quotient.mk'' a)", " p P Q", " βˆ€ (a₁ aβ‚‚ : MonoOver X), p (Quotient.mk'' a₁) (Quotient.mk'' aβ‚‚)", " p (Quotient.mk'' a) (Quotient.mk'' b)" ]
import Mathlib.Algebra.Order.Hom.Monoid import Mathlib.SetTheory.Game.Ordinal #align_import set_theory.surreal.basic from "leanprover-community/mathlib"@"8900d545017cd21961daa2a1734bb658ef52c618" universe u namespace SetTheory open scoped PGame namespace PGame def Numeric : PGame β†’ Prop | ⟨_, _, L, R⟩ => (βˆ€ i j, L i < R j) ∧ (βˆ€ i, Numeric (L i)) ∧ βˆ€ j, Numeric (R j) #align pgame.numeric SetTheory.PGame.Numeric
Mathlib/SetTheory/Surreal/Basic.lean
71
75
theorem numeric_def {x : PGame} : Numeric x ↔ (βˆ€ i j, x.moveLeft i < x.moveRight j) ∧ (βˆ€ i, Numeric (x.moveLeft i)) ∧ βˆ€ j, Numeric (x.moveRight j) := by
cases x; rfl
[ " x.Numeric ↔\n (βˆ€ (i : x.LeftMoves) (j : x.RightMoves), x.moveLeft i < x.moveRight j) ∧\n (βˆ€ (i : x.LeftMoves), (x.moveLeft i).Numeric) ∧ βˆ€ (j : x.RightMoves), (x.moveRight j).Numeric", " (mk α✝ β✝ a✝¹ a✝).Numeric ↔\n (βˆ€ (i : (mk α✝ β✝ a✝¹ a✝).LeftMoves) (j : (mk α✝ β✝ a✝¹ a✝).RightMoves),\n (m...
[]
import Mathlib.Data.Int.Range import Mathlib.Data.ZMod.Basic import Mathlib.NumberTheory.MulChar.Basic #align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" namespace ZMod section QuadCharModP @[simps] def Ο‡β‚„ : MulChar (ZMod 4) β„€ where toFun := (![0, 1, 0, -1] : ZMod 4 β†’ β„€) map_one' := rfl map_mul' := by decide map_nonunit' := by decide #align zmod.Ο‡β‚„ ZMod.Ο‡β‚„ theorem isQuadratic_Ο‡β‚„ : Ο‡β‚„.IsQuadratic := by intro a -- Porting note (#11043): was `decide!` fin_cases a all_goals decide #align zmod.is_quadratic_Ο‡β‚„ ZMod.isQuadratic_Ο‡β‚„ theorem Ο‡β‚„_nat_mod_four (n : β„•) : Ο‡β‚„ n = Ο‡β‚„ (n % 4 : β„•) := by rw [← ZMod.natCast_mod n 4] #align zmod.Ο‡β‚„_nat_mod_four ZMod.Ο‡β‚„_nat_mod_four theorem Ο‡β‚„_int_mod_four (n : β„€) : Ο‡β‚„ n = Ο‡β‚„ (n % 4 : β„€) := by rw [← ZMod.intCast_mod n 4] norm_cast #align zmod.Ο‡β‚„_int_mod_four ZMod.Ο‡β‚„_int_mod_four theorem Ο‡β‚„_int_eq_if_mod_four (n : β„€) : Ο‡β‚„ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := by have help : βˆ€ m : β„€, 0 ≀ m β†’ m < 4 β†’ Ο‡β‚„ m = if m % 2 = 0 then 0 else if m = 1 then 1 else -1 := by decide rw [← Int.emod_emod_of_dvd n (by decide : (2 : β„€) ∣ 4), ← ZMod.intCast_mod n 4] exact help (n % 4) (Int.emod_nonneg n (by norm_num)) (Int.emod_lt n (by norm_num)) #align zmod.Ο‡β‚„_int_eq_if_mod_four ZMod.Ο‡β‚„_int_eq_if_mod_four theorem Ο‡β‚„_nat_eq_if_mod_four (n : β„•) : Ο‡β‚„ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := mod_cast Ο‡β‚„_int_eq_if_mod_four n #align zmod.Ο‡β‚„_nat_eq_if_mod_four ZMod.Ο‡β‚„_nat_eq_if_mod_four theorem Ο‡β‚„_eq_neg_one_pow {n : β„•} (hn : n % 2 = 1) : Ο‡β‚„ n = (-1) ^ (n / 2) := by rw [Ο‡β‚„_nat_eq_if_mod_four] simp only [hn, Nat.one_ne_zero, if_false] conv_rhs => -- Porting note: was `nth_rw` arg 2; rw [← Nat.div_add_mod n 4] enter [1, 1, 1]; rw [(by norm_num : 4 = 2 * 2)] rw [mul_assoc, add_comm, Nat.add_mul_div_left _ _ (by norm_num : 0 < 2), pow_add, pow_mul, neg_one_sq, one_pow, mul_one] have help : βˆ€ m : β„•, m < 4 β†’ m % 2 = 1 β†’ ite (m = 1) (1 : β„€) (-1) = (-1) ^ (m / 2) := by decide exact help (n % 4) (Nat.mod_lt n (by norm_num)) ((Nat.mod_mod_of_dvd n (by decide : 2 ∣ 4)).trans hn) #align zmod.Ο‡β‚„_eq_neg_one_pow ZMod.Ο‡β‚„_eq_neg_one_pow theorem Ο‡β‚„_nat_one_mod_four {n : β„•} (hn : n % 4 = 1) : Ο‡β‚„ n = 1 := by rw [Ο‡β‚„_nat_mod_four, hn] rfl #align zmod.Ο‡β‚„_nat_one_mod_four ZMod.Ο‡β‚„_nat_one_mod_four theorem Ο‡β‚„_nat_three_mod_four {n : β„•} (hn : n % 4 = 3) : Ο‡β‚„ n = -1 := by rw [Ο‡β‚„_nat_mod_four, hn] rfl #align zmod.Ο‡β‚„_nat_three_mod_four ZMod.Ο‡β‚„_nat_three_mod_four theorem Ο‡β‚„_int_one_mod_four {n : β„€} (hn : n % 4 = 1) : Ο‡β‚„ n = 1 := by rw [Ο‡β‚„_int_mod_four, hn] rfl #align zmod.Ο‡β‚„_int_one_mod_four ZMod.Ο‡β‚„_int_one_mod_four theorem Ο‡β‚„_int_three_mod_four {n : β„€} (hn : n % 4 = 3) : Ο‡β‚„ n = -1 := by rw [Ο‡β‚„_int_mod_four, hn] rfl #align zmod.Ο‡β‚„_int_three_mod_four ZMod.Ο‡β‚„_int_three_mod_four theorem neg_one_pow_div_two_of_one_mod_four {n : β„•} (hn : n % 4 = 1) : (-1 : β„€) ^ (n / 2) = 1 := by rw [← Ο‡β‚„_eq_neg_one_pow (Nat.odd_of_mod_four_eq_one hn), ← natCast_mod, hn] rfl #align zmod.neg_one_pow_div_two_of_one_mod_four ZMod.neg_one_pow_div_two_of_one_mod_four theorem neg_one_pow_div_two_of_three_mod_four {n : β„•} (hn : n % 4 = 3) : (-1 : β„€) ^ (n / 2) = -1 := by rw [← Ο‡β‚„_eq_neg_one_pow (Nat.odd_of_mod_four_eq_three hn), ← natCast_mod, hn] rfl #align zmod.neg_one_pow_div_two_of_three_mod_four ZMod.neg_one_pow_div_two_of_three_mod_four @[simps] def Ο‡β‚ˆ : MulChar (ZMod 8) β„€ where toFun := (![0, 1, 0, -1, 0, -1, 0, 1] : ZMod 8 β†’ β„€) map_one' := rfl map_mul' := by decide map_nonunit' := by decide #align zmod.Ο‡β‚ˆ ZMod.Ο‡β‚ˆ
Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean
142
146
theorem isQuadratic_Ο‡β‚ˆ : Ο‡β‚ˆ.IsQuadratic := by
intro a -- Porting note: was `decide!` fin_cases a all_goals decide
[ " βˆ€ (x y : ZMod 4),\n { toFun := ![0, 1, 0, -1], map_one' := β‹― }.toFun (x * y) =\n { toFun := ![0, 1, 0, -1], map_one' := β‹― }.toFun x * { toFun := ![0, 1, 0, -1], map_one' := β‹― }.toFun y", " βˆ€ (a : ZMod 4), Β¬IsUnit a β†’ (↑{ toFun := ![0, 1, 0, -1], map_one' := β‹―, map_mul' := β‹― }).toFun a = 0", " Ο‡β‚„.IsQua...
[ " βˆ€ (x y : ZMod 4),\n { toFun := ![0, 1, 0, -1], map_one' := β‹― }.toFun (x * y) =\n { toFun := ![0, 1, 0, -1], map_one' := β‹― }.toFun x * { toFun := ![0, 1, 0, -1], map_one' := β‹― }.toFun y", " βˆ€ (a : ZMod 4), Β¬IsUnit a β†’ (↑{ toFun := ![0, 1, 0, -1], map_one' := β‹―, map_mul' := β‹― }).toFun a = 0", " Ο‡β‚„.IsQua...
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset import Mathlib.Algebra.Group.Submonoid.Membership import Mathlib.Algebra.Module.LinearMap.Basic import Mathlib.Data.Finset.Preimage import Mathlib.Data.Set.Finite import Mathlib.GroupTheory.GroupAction.BigOperators #align_import data.dfinsupp.basic from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1" universe u u₁ uβ‚‚ v v₁ vβ‚‚ v₃ w x y l variable {ΞΉ : Type u} {Ξ³ : Type w} {Ξ² : ΞΉ β†’ Type v} {β₁ : ΞΉ β†’ Type v₁} {Ξ²β‚‚ : ΞΉ β†’ Type vβ‚‚} variable (Ξ²) structure DFinsupp [βˆ€ i, Zero (Ξ² i)] : Type max u v where mk' :: toFun : βˆ€ i, Ξ² i support' : Trunc { s : Multiset ΞΉ // βˆ€ i, i ∈ s ∨ toFun i = 0 } #align dfinsupp DFinsupp variable {Ξ²} notation3 "Ξ β‚€ "(...)", "r:(scoped f => DFinsupp f) => r namespace DFinsupp section Basic variable [βˆ€ i, Zero (Ξ² i)] [βˆ€ i, Zero (β₁ i)] [βˆ€ i, Zero (Ξ²β‚‚ i)] instance instDFunLike : DFunLike (Ξ β‚€ i, Ξ² i) ΞΉ Ξ² := ⟨fun f => f.toFun, fun ⟨f₁, sβ‚βŸ© ⟨fβ‚‚, sβ‚βŸ© ↦ fun (h : f₁ = fβ‚‚) ↦ by subst h congr apply Subsingleton.elim ⟩ #align dfinsupp.fun_like DFinsupp.instDFunLike instance : CoeFun (Ξ β‚€ i, Ξ² i) fun _ => βˆ€ i, Ξ² i := inferInstance @[simp] theorem toFun_eq_coe (f : Ξ β‚€ i, Ξ² i) : f.toFun = f := rfl #align dfinsupp.to_fun_eq_coe DFinsupp.toFun_eq_coe @[ext] theorem ext {f g : Ξ β‚€ i, Ξ² i} (h : βˆ€ i, f i = g i) : f = g := DFunLike.ext _ _ h #align dfinsupp.ext DFinsupp.ext #align dfinsupp.ext_iff DFunLike.ext_iff #align dfinsupp.coe_fn_injective DFunLike.coe_injective lemma ne_iff {f g : Ξ β‚€ i, Ξ² i} : f β‰  g ↔ βˆƒ i, f i β‰  g i := DFunLike.ne_iff instance : Zero (Ξ β‚€ i, Ξ² i) := ⟨⟨0, Trunc.mk <| βŸ¨βˆ…, fun _ => Or.inr rfl⟩⟩⟩ instance : Inhabited (Ξ β‚€ i, Ξ² i) := ⟨0⟩ @[simp, norm_cast] lemma coe_mk' (f : βˆ€ i, Ξ² i) (s) : ⇑(⟨f, s⟩ : Ξ β‚€ i, Ξ² i) = f := rfl #align dfinsupp.coe_mk' DFinsupp.coe_mk' @[simp, norm_cast] lemma coe_zero : ⇑(0 : Ξ β‚€ i, Ξ² i) = 0 := rfl #align dfinsupp.coe_zero DFinsupp.coe_zero theorem zero_apply (i : ΞΉ) : (0 : Ξ β‚€ i, Ξ² i) i = 0 := rfl #align dfinsupp.zero_apply DFinsupp.zero_apply def mapRange (f : βˆ€ i, β₁ i β†’ Ξ²β‚‚ i) (hf : βˆ€ i, f i 0 = 0) (x : Ξ β‚€ i, β₁ i) : Ξ β‚€ i, Ξ²β‚‚ i := ⟨fun i => f i (x i), x.support'.map fun s => ⟨s.1, fun i => (s.2 i).imp_right fun h : x i = 0 => by rw [← hf i, ← h]⟩⟩ #align dfinsupp.map_range DFinsupp.mapRange @[simp] theorem mapRange_apply (f : βˆ€ i, β₁ i β†’ Ξ²β‚‚ i) (hf : βˆ€ i, f i 0 = 0) (g : Ξ β‚€ i, β₁ i) (i : ΞΉ) : mapRange f hf g i = f i (g i) := rfl #align dfinsupp.map_range_apply DFinsupp.mapRange_apply @[simp]
Mathlib/Data/DFinsupp/Basic.lean
144
147
theorem mapRange_id (h : βˆ€ i, id (0 : β₁ i) = 0 := fun i => rfl) (g : Ξ β‚€ i : ΞΉ, β₁ i) : mapRange (fun i => (id : β₁ i β†’ β₁ i)) h g = g := by
ext rfl
[ " { toFun := f₁, support' := sβ‚βœ } = { toFun := fβ‚‚, support' := s₁ }", " { toFun := f₁, support' := sβ‚βœ } = { toFun := f₁, support' := s₁ }", " sβ‚βœ = s₁", " (fun i => f i (x i)) i = 0", " mapRange (fun i => id) h g = g", " (mapRange (fun i => id) h g) i✝ = g i✝" ]
[ " { toFun := f₁, support' := sβ‚βœ } = { toFun := fβ‚‚, support' := s₁ }", " { toFun := f₁, support' := sβ‚βœ } = { toFun := f₁, support' := s₁ }", " sβ‚βœ = s₁", " (fun i => f i (x i)) i = 0" ]
import Mathlib.CategoryTheory.Abelian.Basic #align_import category_theory.idempotents.basic from "leanprover-community/mathlib"@"3a061790136d13594ec10c7c90d202335ac5d854" open CategoryTheory open CategoryTheory.Category open CategoryTheory.Limits open CategoryTheory.Preadditive open Opposite namespace CategoryTheory variable (C : Type*) [Category C] class IsIdempotentComplete : Prop where idempotents_split : βˆ€ (X : C) (p : X ⟢ X), p ≫ p = p β†’ βˆƒ (Y : C) (i : Y ⟢ X) (e : X ⟢ Y), i ≫ e = πŸ™ Y ∧ e ≫ i = p #align category_theory.is_idempotent_complete CategoryTheory.IsIdempotentComplete namespace Idempotents theorem isIdempotentComplete_iff_hasEqualizer_of_id_and_idempotent : IsIdempotentComplete C ↔ βˆ€ (X : C) (p : X ⟢ X), p ≫ p = p β†’ HasEqualizer (πŸ™ X) p := by constructor Β· intro intro X p hp rcases IsIdempotentComplete.idempotents_split X p hp with ⟨Y, i, e, ⟨h₁, hβ‚‚βŸ©βŸ© exact ⟨Nonempty.intro { cone := Fork.ofΞΉ i (show i ≫ πŸ™ X = i ≫ p by rw [comp_id, ← hβ‚‚, ← assoc, h₁, id_comp]) isLimit := by apply Fork.IsLimit.mk' intro s refine ⟨s.ΞΉ ≫ e, ?_⟩ constructor Β· erw [assoc, hβ‚‚, ← Limits.Fork.condition s, comp_id] Β· intro m hm rw [Fork.ΞΉ_ofΞΉ] at hm rw [← hm] simp only [← hm, assoc, h₁] exact (comp_id m).symm }⟩ Β· intro h refine ⟨?_⟩ intro X p hp haveI : HasEqualizer (πŸ™ X) p := h X p hp refine ⟨equalizer (πŸ™ X) p, equalizer.ΞΉ (πŸ™ X) p, equalizer.lift p (show p ≫ πŸ™ X = p ≫ p by rw [hp, comp_id]), ?_, equalizer.lift_ΞΉ _ _⟩ ext simp only [assoc, limit.lift_Ο€, Eq.ndrec, id_eq, eq_mpr_eq_cast, Fork.ofΞΉ_pt, Fork.ofΞΉ_Ο€_app, id_comp] rw [← equalizer.condition, comp_id] #align category_theory.idempotents.is_idempotent_complete_iff_has_equalizer_of_id_and_idempotent CategoryTheory.Idempotents.isIdempotentComplete_iff_hasEqualizer_of_id_and_idempotent variable {C} theorem idem_of_id_sub_idem [Preadditive C] {X : C} (p : X ⟢ X) (hp : p ≫ p = p) : (πŸ™ _ - p) ≫ (πŸ™ _ - p) = πŸ™ _ - p := by simp only [comp_sub, sub_comp, id_comp, comp_id, hp, sub_self, sub_zero] #align category_theory.idempotents.idem_of_id_sub_idem CategoryTheory.Idempotents.idem_of_id_sub_idem variable (C) theorem isIdempotentComplete_iff_idempotents_have_kernels [Preadditive C] : IsIdempotentComplete C ↔ βˆ€ (X : C) (p : X ⟢ X), p ≫ p = p β†’ HasKernel p := by rw [isIdempotentComplete_iff_hasEqualizer_of_id_and_idempotent] constructor Β· intro h X p hp haveI : HasEqualizer (πŸ™ X) (πŸ™ X - p) := h X (πŸ™ _ - p) (idem_of_id_sub_idem p hp) convert hasKernel_of_hasEqualizer (πŸ™ X) (πŸ™ X - p) rw [sub_sub_cancel] Β· intro h X p hp haveI : HasKernel (πŸ™ _ - p) := h X (πŸ™ _ - p) (idem_of_id_sub_idem p hp) apply Preadditive.hasEqualizer_of_hasKernel #align category_theory.idempotents.is_idempotent_complete_iff_idempotents_have_kernels CategoryTheory.Idempotents.isIdempotentComplete_iff_idempotents_have_kernels instance (priority := 100) isIdempotentComplete_of_abelian (D : Type*) [Category D] [Abelian D] : IsIdempotentComplete D := by rw [isIdempotentComplete_iff_idempotents_have_kernels] intros infer_instance #align category_theory.idempotents.is_idempotent_complete_of_abelian CategoryTheory.Idempotents.isIdempotentComplete_of_abelian variable {C} theorem split_imp_of_iso {X X' : C} (Ο† : X β‰… X') (p : X ⟢ X) (p' : X' ⟢ X') (hpp' : p ≫ Ο†.hom = Ο†.hom ≫ p') (h : βˆƒ (Y : C) (i : Y ⟢ X) (e : X ⟢ Y), i ≫ e = πŸ™ Y ∧ e ≫ i = p) : βˆƒ (Y' : C) (i' : Y' ⟢ X') (e' : X' ⟢ Y'), i' ≫ e' = πŸ™ Y' ∧ e' ≫ i' = p' := by rcases h with ⟨Y, i, e, ⟨h₁, hβ‚‚βŸ©βŸ© use Y, i ≫ Ο†.hom, Ο†.inv ≫ e constructor Β· slice_lhs 2 3 => rw [Ο†.hom_inv_id] rw [id_comp, h₁] Β· slice_lhs 2 3 => rw [hβ‚‚] rw [hpp', ← assoc, Ο†.inv_hom_id, id_comp] #align category_theory.idempotents.split_imp_of_iso CategoryTheory.Idempotents.split_imp_of_iso
Mathlib/CategoryTheory/Idempotents/Basic.lean
143
154
theorem split_iff_of_iso {X X' : C} (Ο† : X β‰… X') (p : X ⟢ X) (p' : X' ⟢ X') (hpp' : p ≫ Ο†.hom = Ο†.hom ≫ p') : (βˆƒ (Y : C) (i : Y ⟢ X) (e : X ⟢ Y), i ≫ e = πŸ™ Y ∧ e ≫ i = p) ↔ βˆƒ (Y' : C) (i' : Y' ⟢ X') (e' : X' ⟢ Y'), i' ≫ e' = πŸ™ Y' ∧ e' ≫ i' = p' := by
constructor Β· exact split_imp_of_iso Ο† p p' hpp' Β· apply split_imp_of_iso Ο†.symm p' p rw [← comp_id p, ← Ο†.hom_inv_id] slice_rhs 2 3 => rw [hpp'] slice_rhs 1 2 => erw [Ο†.inv_hom_id] simp only [id_comp] rfl
[ " IsIdempotentComplete C ↔ βˆ€ (X : C) (p : X ⟢ X), p ≫ p = p β†’ HasEqualizer (πŸ™ X) p", " IsIdempotentComplete C β†’ βˆ€ (X : C) (p : X ⟢ X), p ≫ p = p β†’ HasEqualizer (πŸ™ X) p", " βˆ€ (X : C) (p : X ⟢ X), p ≫ p = p β†’ HasEqualizer (πŸ™ X) p", " HasEqualizer (πŸ™ X) p", " i ≫ πŸ™ X = i ≫ p", " IsLimit (Fork.ofΞΉ i β‹―)",...
[ " IsIdempotentComplete C ↔ βˆ€ (X : C) (p : X ⟢ X), p ≫ p = p β†’ HasEqualizer (πŸ™ X) p", " IsIdempotentComplete C β†’ βˆ€ (X : C) (p : X ⟢ X), p ≫ p = p β†’ HasEqualizer (πŸ™ X) p", " βˆ€ (X : C) (p : X ⟢ X), p ≫ p = p β†’ HasEqualizer (πŸ™ X) p", " HasEqualizer (πŸ™ X) p", " i ≫ πŸ™ X = i ≫ p", " IsLimit (Fork.ofΞΉ i β‹―)",...
import Mathlib.Data.Finset.Fold import Mathlib.Algebra.GCDMonoid.Multiset #align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" #align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d" variable {ΞΉ Ξ± Ξ² Ξ³ : Type*} namespace Finset open Multiset variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±] section gcd def gcd (s : Finset Ξ²) (f : Ξ² β†’ Ξ±) : Ξ± := s.fold GCDMonoid.gcd 0 f #align finset.gcd Finset.gcd variable {s s₁ sβ‚‚ : Finset Ξ²} {f : Ξ² β†’ Ξ±} theorem gcd_def : s.gcd f = (s.1.map f).gcd := rfl #align finset.gcd_def Finset.gcd_def @[simp] theorem gcd_empty : (βˆ… : Finset Ξ²).gcd f = 0 := fold_empty #align finset.gcd_empty Finset.gcd_empty theorem dvd_gcd_iff {a : Ξ±} : a ∣ s.gcd f ↔ βˆ€ b ∈ s, a ∣ f b := by apply Iff.trans Multiset.dvd_gcd simp only [Multiset.mem_map, and_imp, exists_imp] exact ⟨fun k b hb ↦ k _ _ hb rfl, fun k a' b hb h ↦ h β–Έ k _ hb⟩ #align finset.dvd_gcd_iff Finset.dvd_gcd_iff theorem gcd_dvd {b : Ξ²} (hb : b ∈ s) : s.gcd f ∣ f b := dvd_gcd_iff.1 dvd_rfl _ hb #align finset.gcd_dvd Finset.gcd_dvd theorem dvd_gcd {a : Ξ±} : (βˆ€ b ∈ s, a ∣ f b) β†’ a ∣ s.gcd f := dvd_gcd_iff.2 #align finset.dvd_gcd Finset.dvd_gcd @[simp] theorem gcd_insert [DecidableEq Ξ²] {b : Ξ²} : (insert b s : Finset Ξ²).gcd f = GCDMonoid.gcd (f b) (s.gcd f) := by by_cases h : b ∈ s Β· rw [insert_eq_of_mem h, (gcd_eq_right_iff (f b) (s.gcd f) (Multiset.normalize_gcd (s.1.map f))).2 (gcd_dvd h)] apply fold_insert h #align finset.gcd_insert Finset.gcd_insert @[simp] theorem gcd_singleton {b : Ξ²} : ({b} : Finset Ξ²).gcd f = normalize (f b) := Multiset.gcd_singleton #align finset.gcd_singleton Finset.gcd_singleton -- Porting note: Priority changed for `simpNF` @[simp 1100]
Mathlib/Algebra/GCDMonoid/Finset.lean
181
181
theorem normalize_gcd : normalize (s.gcd f) = s.gcd f := by
simp [gcd_def]
[ " a ∣ s.gcd f ↔ βˆ€ b ∈ s, a ∣ f b", " (βˆ€ b ∈ Multiset.map f s.val, a ∣ b) ↔ βˆ€ b ∈ s, a ∣ f b", " (βˆ€ (b : Ξ±), βˆ€ x ∈ s.val, f x = b β†’ a ∣ b) ↔ βˆ€ b ∈ s, a ∣ f b", " (insert b s).gcd f = GCDMonoid.gcd (f b) (s.gcd f)", " normalize (s.gcd f) = s.gcd f" ]
[ " a ∣ s.gcd f ↔ βˆ€ b ∈ s, a ∣ f b", " (βˆ€ b ∈ Multiset.map f s.val, a ∣ b) ↔ βˆ€ b ∈ s, a ∣ f b", " (βˆ€ (b : Ξ±), βˆ€ x ∈ s.val, f x = b β†’ a ∣ b) ↔ βˆ€ b ∈ s, a ∣ f b", " (insert b s).gcd f = GCDMonoid.gcd (f b) (s.gcd f)" ]
import Mathlib.Topology.Compactness.Compact open Set Filter Topology TopologicalSpace Classical variable {X : Type*} {Y : Type*} {ΞΉ : Type*} variable [TopologicalSpace X] [TopologicalSpace Y] {s t : Set X} instance [WeaklyLocallyCompactSpace X] [WeaklyLocallyCompactSpace Y] : WeaklyLocallyCompactSpace (X Γ— Y) where exists_compact_mem_nhds x := let ⟨s₁, hc₁, hβ‚βŸ© := exists_compact_mem_nhds x.1 let ⟨sβ‚‚, hcβ‚‚, hβ‚‚βŸ© := exists_compact_mem_nhds x.2 ⟨s₁ Γ—Λ’ sβ‚‚, hc₁.prod hcβ‚‚, prod_mem_nhds h₁ hβ‚‚βŸ© instance {ΞΉ : Type*} [Finite ΞΉ] {X : ΞΉ β†’ Type*} [(i : ΞΉ) β†’ TopologicalSpace (X i)] [(i : ΞΉ) β†’ WeaklyLocallyCompactSpace (X i)] : WeaklyLocallyCompactSpace ((i : ΞΉ) β†’ X i) where exists_compact_mem_nhds := fun f ↦ by choose s hsc hs using fun i ↦ exists_compact_mem_nhds (f i) exact ⟨pi univ s, isCompact_univ_pi hsc, set_pi_mem_nhds univ.toFinite fun i _ ↦ hs i⟩ instance (priority := 100) [CompactSpace X] : WeaklyLocallyCompactSpace X where exists_compact_mem_nhds _ := ⟨univ, isCompact_univ, univ_mem⟩
Mathlib/Topology/Compactness/LocallyCompact.lean
40
45
theorem exists_compact_superset [WeaklyLocallyCompactSpace X] {K : Set X} (hK : IsCompact K) : βˆƒ K', IsCompact K' ∧ K βŠ† interior K' := by
choose s hc hmem using fun x : X ↦ exists_compact_mem_nhds x rcases hK.elim_nhds_subcover _ fun x _ ↦ interior_mem_nhds.2 (hmem x) with ⟨I, -, hIK⟩ refine βŸ¨β‹ƒ x ∈ I, s x, I.isCompact_biUnion fun _ _ ↦ hc _, hIK.trans ?_⟩ exact iUnionβ‚‚_subset fun x hx ↦ interior_mono <| subset_iUnionβ‚‚ (s := fun x _ ↦ s x) x hx
[ " βˆƒ s, IsCompact s ∧ s ∈ 𝓝 f", " βˆƒ K', IsCompact K' ∧ K βŠ† interior K'", " ⋃ x ∈ I, interior (s x) βŠ† interior (⋃ x ∈ I, s x)" ]
[ " βˆƒ s, IsCompact s ∧ s ∈ 𝓝 f" ]
import Mathlib.Data.Matrix.Basic import Mathlib.Data.PEquiv #align_import data.matrix.pequiv from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" namespace PEquiv open Matrix universe u v variable {k l m n : Type*} variable {Ξ± : Type v} open Matrix def toMatrix [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m ≃. n) : Matrix m n Ξ± := of fun i j => if j ∈ f i then (1 : Ξ±) else 0 #align pequiv.to_matrix PEquiv.toMatrix -- TODO: set as an equation lemma for `toMatrix`, see mathlib4#3024 @[simp] theorem toMatrix_apply [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m ≃. n) (i j) : toMatrix f i j = if j ∈ f i then (1 : Ξ±) else 0 := rfl #align pequiv.to_matrix_apply PEquiv.toMatrix_apply theorem mul_matrix_apply [Fintype m] [DecidableEq m] [Semiring Ξ±] (f : l ≃. m) (M : Matrix m n Ξ±) (i j) : (f.toMatrix * M :) i j = Option.casesOn (f i) 0 fun fi => M fi j := by dsimp [toMatrix, Matrix.mul_apply] cases' h : f i with fi Β· simp [h] Β· rw [Finset.sum_eq_single fi] <;> simp (config := { contextual := true }) [h, eq_comm] #align pequiv.mul_matrix_apply PEquiv.mul_matrix_apply theorem toMatrix_symm [DecidableEq m] [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m ≃. n) : (f.symm.toMatrix : Matrix n m Ξ±) = f.toMatrixα΅€ := by ext simp only [transpose, mem_iff_mem f, toMatrix_apply] congr #align pequiv.to_matrix_symm PEquiv.toMatrix_symm @[simp] theorem toMatrix_refl [DecidableEq n] [Zero Ξ±] [One Ξ±] : ((PEquiv.refl n).toMatrix : Matrix n n Ξ±) = 1 := by ext simp [toMatrix_apply, one_apply] #align pequiv.to_matrix_refl PEquiv.toMatrix_refl theorem matrix_mul_apply [Fintype m] [Semiring Ξ±] [DecidableEq n] (M : Matrix l m Ξ±) (f : m ≃. n) (i j) : (M * f.toMatrix :) i j = Option.casesOn (f.symm j) 0 fun fj => M i fj := by dsimp [toMatrix, Matrix.mul_apply] cases' h : f.symm j with fj Β· simp [h, ← f.eq_some_iff] Β· rw [Finset.sum_eq_single fj] Β· simp [h, ← f.eq_some_iff] Β· rintro b - n simp [h, ← f.eq_some_iff, n.symm] Β· simp #align pequiv.matrix_mul_apply PEquiv.matrix_mul_apply theorem toPEquiv_mul_matrix [Fintype m] [DecidableEq m] [Semiring Ξ±] (f : m ≃ m) (M : Matrix m n Ξ±) : f.toPEquiv.toMatrix * M = M.submatrix f id := by ext i j rw [mul_matrix_apply, Equiv.toPEquiv_apply, submatrix_apply, id] #align pequiv.to_pequiv_mul_matrix PEquiv.toPEquiv_mul_matrix theorem mul_toPEquiv_toMatrix {m n Ξ± : Type*} [Fintype n] [DecidableEq n] [Semiring Ξ±] (f : n ≃ n) (M : Matrix m n Ξ±) : M * f.toPEquiv.toMatrix = M.submatrix id f.symm := Matrix.ext fun i j => by rw [PEquiv.matrix_mul_apply, ← Equiv.toPEquiv_symm, Equiv.toPEquiv_apply, Matrix.submatrix_apply, id] #align pequiv.mul_to_pequiv_to_matrix PEquiv.mul_toPEquiv_toMatrix theorem toMatrix_trans [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring Ξ±] (f : l ≃. m) (g : m ≃. n) : ((f.trans g).toMatrix : Matrix l n Ξ±) = f.toMatrix * g.toMatrix := by ext i j rw [mul_matrix_apply] dsimp [toMatrix, PEquiv.trans] cases f i <;> simp #align pequiv.to_matrix_trans PEquiv.toMatrix_trans @[simp] theorem toMatrix_bot [DecidableEq n] [Zero Ξ±] [One Ξ±] : ((βŠ₯ : PEquiv m n).toMatrix : Matrix m n Ξ±) = 0 := rfl #align pequiv.to_matrix_bot PEquiv.toMatrix_bot theorem toMatrix_injective [DecidableEq n] [MonoidWithZero Ξ±] [Nontrivial Ξ±] : Function.Injective (@toMatrix m n Ξ± _ _ _) := by classical intro f g refine not_imp_not.1 ?_ simp only [Matrix.ext_iff.symm, toMatrix_apply, PEquiv.ext_iff, not_forall, exists_imp] intro i hi use i cases' hf : f i with fi Β· cases' hg : g i with gi -- Porting note: was `cc` Β· rw [hf, hg] at hi exact (hi rfl).elim Β· use gi simp Β· use fi simp [hf.symm, Ne.symm hi] #align pequiv.to_matrix_injective PEquiv.toMatrix_injective
Mathlib/Data/Matrix/PEquiv.lean
142
148
theorem toMatrix_swap [DecidableEq n] [Ring Ξ±] (i j : n) : (Equiv.swap i j).toPEquiv.toMatrix = (1 : Matrix n n Ξ±) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix + (single j i).toMatrix := by
ext dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply] split_ifs <;> simp_all
[ " (f.toMatrix * M) i j = Option.casesOn (f i) 0 fun fi => M fi j", " βˆ‘ j_1 : m, (if j_1 ∈ f i then 1 else 0) * M j_1 j = Option.rec 0 (fun val => M val j) (f i)", " βˆ‘ j_1 : m, (if j_1 ∈ none then 1 else 0) * M j_1 j = Option.rec 0 (fun val => M val j) none", " βˆ‘ j_1 : m, (if j_1 ∈ some fi then 1 else 0) * M j...
[ " (f.toMatrix * M) i j = Option.casesOn (f i) 0 fun fi => M fi j", " βˆ‘ j_1 : m, (if j_1 ∈ f i then 1 else 0) * M j_1 j = Option.rec 0 (fun val => M val j) (f i)", " βˆ‘ j_1 : m, (if j_1 ∈ none then 1 else 0) * M j_1 j = Option.rec 0 (fun val => M val j) none", " βˆ‘ j_1 : m, (if j_1 ∈ some fi then 1 else 0) * M j...
import Mathlib.Data.List.Join #align_import data.list.permutation from "leanprover-community/mathlib"@"dd71334db81d0bd444af1ee339a29298bef40734" -- Make sure we don't import algebra assert_not_exists Monoid open Nat variable {Ξ± Ξ² : Type*} namespace List theorem permutationsAux2_fst (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) : βˆ€ (ys : List Ξ±) (f : List Ξ± β†’ Ξ²), (permutationsAux2 t ts r ys f).1 = ys ++ ts | [], f => rfl | y :: ys, f => by simp [permutationsAux2, permutationsAux2_fst t _ _ ys] #align list.permutations_aux2_fst List.permutationsAux2_fst @[simp] theorem permutationsAux2_snd_nil (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) (f : List Ξ± β†’ Ξ²) : (permutationsAux2 t ts r [] f).2 = r := rfl #align list.permutations_aux2_snd_nil List.permutationsAux2_snd_nil @[simp] theorem permutationsAux2_snd_cons (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) (y : Ξ±) (ys : List Ξ±) (f : List Ξ± β†’ Ξ²) : (permutationsAux2 t ts r (y :: ys) f).2 = f (t :: y :: ys ++ ts) :: (permutationsAux2 t ts r ys fun x : List Ξ± => f (y :: x)).2 := by simp [permutationsAux2, permutationsAux2_fst t _ _ ys] #align list.permutations_aux2_snd_cons List.permutationsAux2_snd_cons theorem permutationsAux2_append (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) (ys : List Ξ±) (f : List Ξ± β†’ Ξ²) : (permutationsAux2 t ts nil ys f).2 ++ r = (permutationsAux2 t ts r ys f).2 := by induction ys generalizing f <;> simp [*] #align list.permutations_aux2_append List.permutationsAux2_append theorem permutationsAux2_comp_append {t : Ξ±} {ts ys : List Ξ±} {r : List Ξ²} (f : List Ξ± β†’ Ξ²) : ((permutationsAux2 t [] r ys) fun x => f (x ++ ts)).2 = (permutationsAux2 t ts r ys f).2 := by induction' ys with ys_hd _ ys_ih generalizing f Β· simp Β· simp [ys_ih fun xs => f (ys_hd :: xs)] #align list.permutations_aux2_comp_append List.permutationsAux2_comp_append theorem map_permutationsAux2' {Ξ±' Ξ²'} (g : Ξ± β†’ Ξ±') (g' : Ξ² β†’ Ξ²') (t : Ξ±) (ts ys : List Ξ±) (r : List Ξ²) (f : List Ξ± β†’ Ξ²) (f' : List Ξ±' β†’ Ξ²') (H : βˆ€ a, g' (f a) = f' (map g a)) : map g' (permutationsAux2 t ts r ys f).2 = (permutationsAux2 (g t) (map g ts) (map g' r) (map g ys) f').2 := by induction' ys with ys_hd _ ys_ih generalizing f f' Β· simp Β· simp only [map, permutationsAux2_snd_cons, cons_append, cons.injEq] rw [ys_ih, permutationsAux2_fst] Β· refine ⟨?_, rfl⟩ simp only [← map_cons, ← map_append]; apply H Β· intro a; apply H #align list.map_permutations_aux2' List.map_permutationsAux2' theorem map_permutationsAux2 (t : Ξ±) (ts : List Ξ±) (ys : List Ξ±) (f : List Ξ± β†’ Ξ²) : (permutationsAux2 t ts [] ys id).2.map f = (permutationsAux2 t ts [] ys f).2 := by rw [map_permutationsAux2' id, map_id, map_id] Β· rfl simp #align list.map_permutations_aux2 List.map_permutationsAux2 theorem permutationsAux2_snd_eq (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) (ys : List Ξ±) (f : List Ξ± β†’ Ξ²) : (permutationsAux2 t ts r ys f).2 = ((permutationsAux2 t [] [] ys id).2.map fun x => f (x ++ ts)) ++ r := by rw [← permutationsAux2_append, map_permutationsAux2, permutationsAux2_comp_append] #align list.permutations_aux2_snd_eq List.permutationsAux2_snd_eq theorem map_map_permutationsAux2 {Ξ±'} (g : Ξ± β†’ Ξ±') (t : Ξ±) (ts ys : List Ξ±) : map (map g) (permutationsAux2 t ts [] ys id).2 = (permutationsAux2 (g t) (map g ts) [] (map g ys) id).2 := map_permutationsAux2' _ _ _ _ _ _ _ _ fun _ => rfl #align list.map_map_permutations_aux2 List.map_map_permutationsAux2 theorem map_map_permutations'Aux (f : Ξ± β†’ Ξ²) (t : Ξ±) (ts : List Ξ±) : map (map f) (permutations'Aux t ts) = permutations'Aux (f t) (map f ts) := by induction' ts with a ts ih Β· rfl Β· simp only [permutations'Aux, map_cons, map_map, ← ih, cons.injEq, true_and, Function.comp_def] #align list.map_map_permutations'_aux List.map_map_permutations'Aux theorem permutations'Aux_eq_permutationsAux2 (t : Ξ±) (ts : List Ξ±) : permutations'Aux t ts = (permutationsAux2 t [] [ts ++ [t]] ts id).2 := by induction' ts with a ts ih; Β· rfl simp only [permutations'Aux, ih, cons_append, permutationsAux2_snd_cons, append_nil, id_eq, cons.injEq, true_and] simp (config := { singlePass := true }) only [← permutationsAux2_append] simp [map_permutationsAux2] #align list.permutations'_aux_eq_permutations_aux2 List.permutations'Aux_eq_permutationsAux2
Mathlib/Data/List/Permutation.lean
149
164
theorem mem_permutationsAux2 {t : Ξ±} {ts : List Ξ±} {ys : List Ξ±} {l l' : List Ξ±} : l' ∈ (permutationsAux2 t ts [] ys (l ++ Β·)).2 ↔ βˆƒ l₁ lβ‚‚, lβ‚‚ β‰  [] ∧ ys = l₁ ++ lβ‚‚ ∧ l' = l ++ l₁ ++ t :: lβ‚‚ ++ ts := by
induction' ys with y ys ih generalizing l Β· simp (config := { contextual := true }) rw [permutationsAux2_snd_cons, show (fun x : List Ξ± => l ++ y :: x) = (l ++ [y] ++ Β·) by funext _; simp, mem_cons, ih] constructor Β· rintro (rfl | ⟨l₁, lβ‚‚, l0, rfl, rfl⟩) Β· exact ⟨[], y :: ys, by simp⟩ Β· exact ⟨y :: l₁, lβ‚‚, l0, by simp⟩ Β· rintro ⟨_ | ⟨y', lβ‚βŸ©, lβ‚‚, l0, ye, rfl⟩ Β· simp [ye] Β· simp only [cons_append] at ye rcases ye with ⟨rfl, rfl⟩ exact Or.inr ⟨l₁, lβ‚‚, l0, by simp⟩
[ " (permutationsAux2 t ts r (y :: ys) f).1 = y :: ys ++ ts", " (permutationsAux2 t ts r (y :: ys) f).2 = f (t :: y :: ys ++ ts) :: (permutationsAux2 t ts r ys fun x => f (y :: x)).2", " (permutationsAux2 t ts [] ys f).2 ++ r = (permutationsAux2 t ts r ys f).2", " (permutationsAux2 t ts [] [] f).2 ++ r = (permu...
[ " (permutationsAux2 t ts r (y :: ys) f).1 = y :: ys ++ ts", " (permutationsAux2 t ts r (y :: ys) f).2 = f (t :: y :: ys ++ ts) :: (permutationsAux2 t ts r ys fun x => f (y :: x)).2", " (permutationsAux2 t ts [] ys f).2 ++ r = (permutationsAux2 t ts r ys f).2", " (permutationsAux2 t ts [] [] f).2 ++ r = (permu...
import Mathlib.Init.Function import Mathlib.Logic.Function.Basic #align_import data.sigma.basic from "leanprover-community/mathlib"@"a148d797a1094ab554ad4183a4ad6f130358ef64" open Function section Sigma variable {Ξ± α₁ Ξ±β‚‚ : Type*} {Ξ² : Ξ± β†’ Type*} {β₁ : α₁ β†’ Type*} {Ξ²β‚‚ : Ξ±β‚‚ β†’ Type*} namespace Sigma instance instInhabitedSigma [Inhabited Ξ±] [Inhabited (Ξ² default)] : Inhabited (Sigma Ξ²) := ⟨⟨default, default⟩⟩ instance instDecidableEqSigma [h₁ : DecidableEq Ξ±] [hβ‚‚ : βˆ€ a, DecidableEq (Ξ² a)] : DecidableEq (Sigma Ξ²) | ⟨a₁, bβ‚βŸ©, ⟨aβ‚‚, bβ‚‚βŸ© => match a₁, b₁, aβ‚‚, bβ‚‚, h₁ a₁ aβ‚‚ with | _, b₁, _, bβ‚‚, isTrue (Eq.refl _) => match b₁, bβ‚‚, hβ‚‚ _ b₁ bβ‚‚ with | _, _, isTrue (Eq.refl _) => isTrue rfl | _, _, isFalse n => isFalse fun h ↦ Sigma.noConfusion h fun _ eβ‚‚ ↦ n <| eq_of_heq eβ‚‚ | _, _, _, _, isFalse n => isFalse fun h ↦ Sigma.noConfusion h fun e₁ _ ↦ n e₁ -- sometimes the built-in injectivity support does not work @[simp] -- @[nolint simpNF] theorem mk.inj_iff {a₁ aβ‚‚ : Ξ±} {b₁ : Ξ² a₁} {bβ‚‚ : Ξ² aβ‚‚} : Sigma.mk a₁ b₁ = ⟨aβ‚‚, bβ‚‚βŸ© ↔ a₁ = aβ‚‚ ∧ HEq b₁ bβ‚‚ := ⟨fun h ↦ by cases h; simp, fun ⟨h₁, hβ‚‚βŸ© ↦ by subst h₁; rw [eq_of_heq hβ‚‚]⟩ #align sigma.mk.inj_iff Sigma.mk.inj_iff @[simp] theorem eta : βˆ€ x : Ξ£a, Ξ² a, Sigma.mk x.1 x.2 = x | ⟨_, _⟩ => rfl #align sigma.eta Sigma.eta #align sigma.ext Sigma.ext
Mathlib/Data/Sigma/Basic.lean
70
71
theorem ext_iff {xβ‚€ x₁ : Sigma Ξ²} : xβ‚€ = x₁ ↔ xβ‚€.1 = x₁.1 ∧ HEq xβ‚€.2 x₁.2 := by
cases xβ‚€; cases x₁; exact Sigma.mk.inj_iff
[ " a₁ = aβ‚‚ ∧ HEq b₁ bβ‚‚", " a₁ = a₁ ∧ HEq b₁ b₁", " ⟨a₁, bβ‚βŸ© = ⟨aβ‚‚, bβ‚‚βŸ©", " ⟨a₁, bβ‚βŸ© = ⟨a₁, bβ‚‚βŸ©", " xβ‚€ = x₁ ↔ xβ‚€.fst = x₁.fst ∧ HEq xβ‚€.snd x₁.snd", " ⟨fst✝, snd✝⟩ = x₁ ↔ ⟨fst✝, snd✝⟩.fst = x₁.fst ∧ HEq ⟨fst✝, snd✝⟩.snd x₁.snd", " ⟨fst✝¹, snd✝¹⟩ = ⟨fst✝, snd✝⟩ ↔ ⟨fst✝¹, snd✝¹⟩.fst = ⟨fst✝, snd✝⟩.fst ∧ HEq ...
[ " a₁ = aβ‚‚ ∧ HEq b₁ bβ‚‚", " a₁ = a₁ ∧ HEq b₁ b₁", " ⟨a₁, bβ‚βŸ© = ⟨aβ‚‚, bβ‚‚βŸ©", " ⟨a₁, bβ‚βŸ© = ⟨a₁, bβ‚‚βŸ©" ]
import Mathlib.Analysis.SpecialFunctions.Pow.Complex import Qq #align_import analysis.special_functions.pow.real from "leanprover-community/mathlib"@"4fa54b337f7d52805480306db1b1439c741848c8" noncomputable section open scoped Classical open Real ComplexConjugate open Finset Set namespace Real variable {x y z : ℝ} noncomputable def rpow (x y : ℝ) := ((x : β„‚) ^ (y : β„‚)).re #align real.rpow Real.rpow noncomputable instance : Pow ℝ ℝ := ⟨rpow⟩ @[simp] theorem rpow_eq_pow (x y : ℝ) : rpow x y = x ^ y := rfl #align real.rpow_eq_pow Real.rpow_eq_pow theorem rpow_def (x y : ℝ) : x ^ y = ((x : β„‚) ^ (y : β„‚)).re := rfl #align real.rpow_def Real.rpow_def theorem rpow_def_of_nonneg {x : ℝ} (hx : 0 ≀ x) (y : ℝ) : x ^ y = if x = 0 then if y = 0 then 1 else 0 else exp (log x * y) := by simp only [rpow_def, Complex.cpow_def]; split_ifs <;> simp_all [(Complex.ofReal_log hx).symm, -Complex.ofReal_mul, -RCLike.ofReal_mul, (Complex.ofReal_mul _ _).symm, Complex.exp_ofReal_re, Complex.ofReal_eq_zero] #align real.rpow_def_of_nonneg Real.rpow_def_of_nonneg theorem rpow_def_of_pos {x : ℝ} (hx : 0 < x) (y : ℝ) : x ^ y = exp (log x * y) := by rw [rpow_def_of_nonneg (le_of_lt hx), if_neg (ne_of_gt hx)] #align real.rpow_def_of_pos Real.rpow_def_of_pos theorem exp_mul (x y : ℝ) : exp (x * y) = exp x ^ y := by rw [rpow_def_of_pos (exp_pos _), log_exp] #align real.exp_mul Real.exp_mul @[simp, norm_cast] theorem rpow_intCast (x : ℝ) (n : β„€) : x ^ (n : ℝ) = x ^ n := by simp only [rpow_def, ← Complex.ofReal_zpow, Complex.cpow_intCast, Complex.ofReal_intCast, Complex.ofReal_re] #align real.rpow_int_cast Real.rpow_intCast @[deprecated (since := "2024-04-17")] alias rpow_int_cast := rpow_intCast @[simp, norm_cast] theorem rpow_natCast (x : ℝ) (n : β„•) : x ^ (n : ℝ) = x ^ n := by simpa using rpow_intCast x n #align real.rpow_nat_cast Real.rpow_natCast @[deprecated (since := "2024-04-17")] alias rpow_nat_cast := rpow_natCast @[simp] theorem exp_one_rpow (x : ℝ) : exp 1 ^ x = exp x := by rw [← exp_mul, one_mul] #align real.exp_one_rpow Real.exp_one_rpow @[simp] lemma exp_one_pow (n : β„•) : exp 1 ^ n = exp n := by rw [← rpow_natCast, exp_one_rpow] theorem rpow_eq_zero_iff_of_nonneg (hx : 0 ≀ x) : x ^ y = 0 ↔ x = 0 ∧ y β‰  0 := by simp only [rpow_def_of_nonneg hx] split_ifs <;> simp [*, exp_ne_zero] #align real.rpow_eq_zero_iff_of_nonneg Real.rpow_eq_zero_iff_of_nonneg @[simp] lemma rpow_eq_zero (hx : 0 ≀ x) (hy : y β‰  0) : x ^ y = 0 ↔ x = 0 := by simp [rpow_eq_zero_iff_of_nonneg, *] @[simp] lemma rpow_ne_zero (hx : 0 ≀ x) (hy : y β‰  0) : x ^ y β‰  0 ↔ x β‰  0 := Real.rpow_eq_zero hx hy |>.not open Real theorem rpow_def_of_neg {x : ℝ} (hx : x < 0) (y : ℝ) : x ^ y = exp (log x * y) * cos (y * Ο€) := by rw [rpow_def, Complex.cpow_def, if_neg] Β· have : Complex.log x * y = ↑(log (-x) * y) + ↑(y * Ο€) * Complex.I := by simp only [Complex.log, abs_of_neg hx, Complex.arg_ofReal_of_neg hx, Complex.abs_ofReal, Complex.ofReal_mul] ring rw [this, Complex.exp_add_mul_I, ← Complex.ofReal_exp, ← Complex.ofReal_cos, ← Complex.ofReal_sin, mul_add, ← Complex.ofReal_mul, ← mul_assoc, ← Complex.ofReal_mul, Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.I_re, Complex.ofReal_im, Real.log_neg_eq_log] ring Β· rw [Complex.ofReal_eq_zero] exact ne_of_lt hx #align real.rpow_def_of_neg Real.rpow_def_of_neg
Mathlib/Analysis/SpecialFunctions/Pow/Real.lean
115
117
theorem rpow_def_of_nonpos {x : ℝ} (hx : x ≀ 0) (y : ℝ) : x ^ y = if x = 0 then if y = 0 then 1 else 0 else exp (log x * y) * cos (y * Ο€) := by
split_ifs with h <;> simp [rpow_def, *]; exact rpow_def_of_neg (lt_of_le_of_ne hx h) _
[ " x ^ y = if x = 0 then if y = 0 then 1 else 0 else rexp (x.log * y)", " (if ↑x = 0 then if ↑y = 0 then 1 else 0 else ((↑x).log * ↑y).exp).re =\n if x = 0 then if y = 0 then 1 else 0 else rexp (x.log * y)", " Complex.re 1 = 1", " Complex.re 1 = 0", " Complex.re 1 = rexp (x.log * y)", " Complex.re 0 = 1...
[ " x ^ y = if x = 0 then if y = 0 then 1 else 0 else rexp (x.log * y)", " (if ↑x = 0 then if ↑y = 0 then 1 else 0 else ((↑x).log * ↑y).exp).re =\n if x = 0 then if y = 0 then 1 else 0 else rexp (x.log * y)", " Complex.re 1 = 1", " Complex.re 1 = 0", " Complex.re 1 = rexp (x.log * y)", " Complex.re 0 = 1...
import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar import Mathlib.MeasureTheory.Integral.SetIntegral #align_import measure_theory.measure.haar.normed_space from "leanprover-community/mathlib"@"b84aee748341da06a6d78491367e2c0e9f15e8a5" noncomputable section open scoped NNReal ENNReal Pointwise Topology open Inv Set Function MeasureTheory.Measure Filter open FiniteDimensional namespace MeasureTheory namespace Measure example {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [Nontrivial E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] (ΞΌ : Measure E) [IsAddHaarMeasure ΞΌ] : NoAtoms ΞΌ := by infer_instance variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] (ΞΌ : Measure E) [IsAddHaarMeasure ΞΌ] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] variable {s : Set E} theorem integral_comp_smul (f : E β†’ F) (R : ℝ) : ∫ x, f (R β€’ x) βˆ‚ΞΌ = |(R ^ finrank ℝ E)⁻¹| β€’ ∫ x, f x βˆ‚ΞΌ := by by_cases hF : CompleteSpace F; swap Β· simp [integral, hF] rcases eq_or_ne R 0 with (rfl | hR) Β· simp only [zero_smul, integral_const] rcases Nat.eq_zero_or_pos (finrank ℝ E) with (hE | hE) Β· have : Subsingleton E := finrank_zero_iff.1 hE have : f = fun _ => f 0 := by ext x; rw [Subsingleton.elim x 0] conv_rhs => rw [this] simp only [hE, pow_zero, inv_one, abs_one, one_smul, integral_const] Β· have : Nontrivial E := finrank_pos_iff.1 hE simp only [zero_pow hE.ne', measure_univ_of_isAddLeftInvariant, ENNReal.top_toReal, zero_smul, inv_zero, abs_zero] Β· calc (∫ x, f (R β€’ x) βˆ‚ΞΌ) = ∫ y, f y βˆ‚Measure.map (fun x => R β€’ x) ΞΌ := (integral_map_equiv (Homeomorph.smul (isUnit_iff_ne_zero.2 hR).unit).toMeasurableEquiv f).symm _ = |(R ^ finrank ℝ E)⁻¹| β€’ ∫ x, f x βˆ‚ΞΌ := by simp only [map_addHaar_smul ΞΌ hR, integral_smul_measure, ENNReal.toReal_ofReal, abs_nonneg] #align measure_theory.measure.integral_comp_smul MeasureTheory.Measure.integral_comp_smul theorem integral_comp_smul_of_nonneg (f : E β†’ F) (R : ℝ) {hR : 0 ≀ R} : ∫ x, f (R β€’ x) βˆ‚ΞΌ = (R ^ finrank ℝ E)⁻¹ β€’ ∫ x, f x βˆ‚ΞΌ := by rw [integral_comp_smul ΞΌ f R, abs_of_nonneg (inv_nonneg.2 (pow_nonneg hR _))] #align measure_theory.measure.integral_comp_smul_of_nonneg MeasureTheory.Measure.integral_comp_smul_of_nonneg theorem integral_comp_inv_smul (f : E β†’ F) (R : ℝ) : ∫ x, f (R⁻¹ β€’ x) βˆ‚ΞΌ = |R ^ finrank ℝ E| β€’ ∫ x, f x βˆ‚ΞΌ := by rw [integral_comp_smul ΞΌ f R⁻¹, inv_pow, inv_inv] #align measure_theory.measure.integral_comp_inv_smul MeasureTheory.Measure.integral_comp_inv_smul
Mathlib/MeasureTheory/Measure/Haar/NormedSpace.lean
105
107
theorem integral_comp_inv_smul_of_nonneg (f : E β†’ F) {R : ℝ} (hR : 0 ≀ R) : ∫ x, f (R⁻¹ β€’ x) βˆ‚ΞΌ = R ^ finrank ℝ E β€’ ∫ x, f x βˆ‚ΞΌ := by
rw [integral_comp_inv_smul ΞΌ f R, abs_of_nonneg (pow_nonneg hR _)]
[ " NoAtoms ΞΌ", " ∫ (x : E), f (R β€’ x) βˆ‚ΞΌ = |(R ^ finrank ℝ E)⁻¹| β€’ ∫ (x : E), f x βˆ‚ΞΌ", " ∫ (x : E), f (0 β€’ x) βˆ‚ΞΌ = |(0 ^ finrank ℝ E)⁻¹| β€’ ∫ (x : E), f x βˆ‚ΞΌ", " (ΞΌ univ).toReal β€’ f 0 = |(0 ^ finrank ℝ E)⁻¹| β€’ ∫ (x : E), f x βˆ‚ΞΌ", " f = fun x => f 0", " f x = f 0", "E : Type u_1\ninst✝⁷ : NormedAddCommGrou...
[ " NoAtoms ΞΌ", " ∫ (x : E), f (R β€’ x) βˆ‚ΞΌ = |(R ^ finrank ℝ E)⁻¹| β€’ ∫ (x : E), f x βˆ‚ΞΌ", " ∫ (x : E), f (0 β€’ x) βˆ‚ΞΌ = |(0 ^ finrank ℝ E)⁻¹| β€’ ∫ (x : E), f x βˆ‚ΞΌ", " (ΞΌ univ).toReal β€’ f 0 = |(0 ^ finrank ℝ E)⁻¹| β€’ ∫ (x : E), f x βˆ‚ΞΌ", " f = fun x => f 0", " f x = f 0", "E : Type u_1\ninst✝⁷ : NormedAddCommGrou...
import Mathlib.CategoryTheory.Adjunction.FullyFaithful import Mathlib.CategoryTheory.Adjunction.Limits import Mathlib.CategoryTheory.Limits.Shapes.CommSq import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial import Mathlib.CategoryTheory.Limits.FunctorCategory import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts #align_import category_theory.extensive from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1" open CategoryTheory.Limits namespace CategoryTheory universe v' u' v u variable {J : Type v'} [Category.{u'} J] {C : Type u} [Category.{v} C] variable {K : Type*} [Category K] {D : Type*} [Category D] section NatTrans def NatTrans.Equifibered {F G : J β₯€ C} (Ξ± : F ⟢ G) : Prop := βˆ€ ⦃i j : J⦄ (f : i ⟢ j), IsPullback (F.map f) (Ξ±.app i) (Ξ±.app j) (G.map f) #align category_theory.nat_trans.equifibered CategoryTheory.NatTrans.Equifibered theorem NatTrans.equifibered_of_isIso {F G : J β₯€ C} (Ξ± : F ⟢ G) [IsIso Ξ±] : Equifibered Ξ± := fun _ _ f => IsPullback.of_vert_isIso ⟨NatTrans.naturality _ f⟩ #align category_theory.nat_trans.equifibered_of_is_iso CategoryTheory.NatTrans.equifibered_of_isIso theorem NatTrans.Equifibered.comp {F G H : J β₯€ C} {Ξ± : F ⟢ G} {Ξ² : G ⟢ H} (hΞ± : Equifibered Ξ±) (hΞ² : Equifibered Ξ²) : Equifibered (Ξ± ≫ Ξ²) := fun _ _ f => (hΞ± f).paste_vert (hΞ² f) #align category_theory.nat_trans.equifibered.comp CategoryTheory.NatTrans.Equifibered.comp theorem NatTrans.Equifibered.whiskerRight {F G : J β₯€ C} {Ξ± : F ⟢ G} (hΞ± : Equifibered Ξ±) (H : C β₯€ D) [βˆ€ (i j : J) (f : j ⟢ i), PreservesLimit (cospan (Ξ±.app i) (G.map f)) H] : Equifibered (whiskerRight Ξ± H) := fun _ _ f => (hΞ± f).map H #align category_theory.nat_trans.equifibered.whisker_right CategoryTheory.NatTrans.Equifibered.whiskerRight theorem NatTrans.Equifibered.whiskerLeft {K : Type*} [Category K] {F G : J β₯€ C} {Ξ± : F ⟢ G} (hΞ± : Equifibered Ξ±) (H : K β₯€ J) : Equifibered (whiskerLeft H Ξ±) := fun _ _ f => hΞ± (H.map f)
Mathlib/CategoryTheory/Limits/VanKampen.lean
75
80
theorem mapPair_equifibered {F F' : Discrete WalkingPair β₯€ C} (Ξ± : F ⟢ F') : NatTrans.Equifibered Ξ± := by
rintro ⟨⟨⟩⟩ ⟨j⟩ ⟨⟨rfl : _ = j⟩⟩ all_goals dsimp; simp only [Discrete.functor_map_id] exact IsPullback.of_horiz_isIso ⟨by simp only [Category.comp_id, Category.id_comp]⟩
[ " NatTrans.Equifibered Ξ±", " IsPullback (F.map { down := { down := β‹― } }) (Ξ±.app { as := WalkingPair.right })\n (Ξ±.app { as := { as := WalkingPair.right }.as }) (F'.map { down := { down := β‹― } })", " IsPullback (F.map { down := { down := β‹― } }) (Ξ±.app { as := WalkingPair.left })\n (Ξ±.app { as := { as := W...
[]
import Mathlib.LinearAlgebra.FiniteDimensional #align_import linear_algebra.projective_space.basic from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23" variable (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] def projectivizationSetoid : Setoid { v : V // v β‰  0 } := (MulAction.orbitRel KΛ£ V).comap (↑) #align projectivization_setoid projectivizationSetoid def Projectivization := Quotient (projectivizationSetoid K V) #align projectivization Projectivization scoped[LinearAlgebra.Projectivization] notation "β„™" => Projectivization namespace Projectivization open scoped LinearAlgebra.Projectivization variable {V} def mk (v : V) (hv : v β‰  0) : β„™ K V := Quotient.mk'' ⟨v, hv⟩ #align projectivization.mk Projectivization.mk def mk' (v : { v : V // v β‰  0 }) : β„™ K V := Quotient.mk'' v #align projectivization.mk' Projectivization.mk' @[simp] theorem mk'_eq_mk (v : { v : V // v β‰  0 }) : mk' K v = mk K ↑v v.2 := rfl #align projectivization.mk'_eq_mk Projectivization.mk'_eq_mk instance [Nontrivial V] : Nonempty (β„™ K V) := let ⟨v, hv⟩ := exists_ne (0 : V) ⟨mk K v hv⟩ variable {K} protected noncomputable def rep (v : β„™ K V) : V := v.out' #align projectivization.rep Projectivization.rep theorem rep_nonzero (v : β„™ K V) : v.rep β‰  0 := v.out'.2 #align projectivization.rep_nonzero Projectivization.rep_nonzero @[simp] theorem mk_rep (v : β„™ K V) : mk K v.rep v.rep_nonzero = v := Quotient.out_eq' _ #align projectivization.mk_rep Projectivization.mk_rep open FiniteDimensional protected def submodule (v : β„™ K V) : Submodule K V := (Quotient.liftOn' v fun v => K βˆ™ (v : V)) <| by rintro ⟨a, ha⟩ ⟨b, hb⟩ ⟨x, rfl : x β€’ b = a⟩ exact Submodule.span_singleton_group_smul_eq _ x _ #align projectivization.submodule Projectivization.submodule variable (K) theorem mk_eq_mk_iff (v w : V) (hv : v β‰  0) (hw : w β‰  0) : mk K v hv = mk K w hw ↔ βˆƒ a : KΛ£, a β€’ w = v := Quotient.eq'' #align projectivization.mk_eq_mk_iff Projectivization.mk_eq_mk_iff theorem mk_eq_mk_iff' (v w : V) (hv : v β‰  0) (hw : w β‰  0) : mk K v hv = mk K w hw ↔ βˆƒ a : K, a β€’ w = v := by rw [mk_eq_mk_iff K v w hv hw] constructor Β· rintro ⟨a, ha⟩ exact ⟨a, ha⟩ Β· rintro ⟨a, ha⟩ refine ⟨Units.mk0 a fun c => hv.symm ?_, ha⟩ rwa [c, zero_smul] at ha #align projectivization.mk_eq_mk_iff' Projectivization.mk_eq_mk_iff' theorem exists_smul_eq_mk_rep (v : V) (hv : v β‰  0) : βˆƒ a : KΛ£, a β€’ v = (mk K v hv).rep := (mk_eq_mk_iff K _ _ (rep_nonzero _) hv).1 (mk_rep _) #align projectivization.exists_smul_eq_mk_rep Projectivization.exists_smul_eq_mk_rep variable {K} @[elab_as_elim] theorem ind {P : β„™ K V β†’ Prop} (h : βˆ€ (v : V) (h : v β‰  0), P (mk K v h)) : βˆ€ p, P p := Quotient.ind' <| Subtype.rec <| h #align projectivization.ind Projectivization.ind @[simp] theorem submodule_mk (v : V) (hv : v β‰  0) : (mk K v hv).submodule = K βˆ™ v := rfl #align projectivization.submodule_mk Projectivization.submodule_mk
Mathlib/LinearAlgebra/Projectivization/Basic.lean
137
139
theorem submodule_eq (v : β„™ K V) : v.submodule = K βˆ™ v.rep := by
conv_lhs => rw [← v.mk_rep] rfl
[ " βˆ€ (a b : { v // v β‰  0 }), Setoid.r a b β†’ Submodule.span K {↑a} = Submodule.span K {↑b}", " Submodule.span K {β†‘βŸ¨x β€’ b, ha⟩} = Submodule.span K {β†‘βŸ¨b, hb⟩}", " mk K v hv = mk K w hw ↔ βˆƒ a, a β€’ w = v", " (βˆƒ a, a β€’ w = v) ↔ βˆƒ a, a β€’ w = v", " (βˆƒ a, a β€’ w = v) β†’ βˆƒ a, a β€’ w = v", " βˆƒ a, a β€’ w = v", " 0 = v",...
[ " βˆ€ (a b : { v // v β‰  0 }), Setoid.r a b β†’ Submodule.span K {↑a} = Submodule.span K {↑b}", " Submodule.span K {β†‘βŸ¨x β€’ b, ha⟩} = Submodule.span K {β†‘βŸ¨b, hb⟩}", " mk K v hv = mk K w hw ↔ βˆƒ a, a β€’ w = v", " (βˆƒ a, a β€’ w = v) ↔ βˆƒ a, a β€’ w = v", " (βˆƒ a, a β€’ w = v) β†’ βˆƒ a, a β€’ w = v", " βˆƒ a, a β€’ w = v", " 0 = v" ...
import Mathlib.Algebra.Group.Submonoid.Pointwise #align_import group_theory.submonoid.inverses from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf" variable {M : Type*} namespace Submonoid @[to_additive] noncomputable instance [Monoid M] : Group (IsUnit.submonoid M) := { inferInstanceAs (Monoid (IsUnit.submonoid M)) with inv := fun x ↦ ⟨x.prop.unit⁻¹.val, x.prop.unit⁻¹.isUnit⟩ mul_left_inv := fun x ↦ Subtype.ext ((Units.val_mul x.prop.unit⁻¹ _).trans x.prop.unit.inv_val) } @[to_additive] noncomputable instance [CommMonoid M] : CommGroup (IsUnit.submonoid M) := { inferInstanceAs (Group (IsUnit.submonoid M)) with mul_comm := fun a b ↦ by convert mul_comm a b } @[to_additive] theorem IsUnit.Submonoid.coe_inv [Monoid M] (x : IsUnit.submonoid M) : ↑x⁻¹ = (↑x.prop.unit⁻¹ : M) := rfl #align submonoid.is_unit.submonoid.coe_inv Submonoid.IsUnit.Submonoid.coe_inv #align add_submonoid.is_unit.submonoid.coe_neg AddSubmonoid.IsUnit.Submonoid.coe_neg section Monoid variable [Monoid M] (S : Submonoid M) @[to_additive "`S.leftNeg` is the additive submonoid containing all the left additive inverses of `S`."] def leftInv : Submonoid M where carrier := { x : M | βˆƒ y : S, x * y = 1 } one_mem' := ⟨1, mul_one 1⟩ mul_mem' := fun {a} _b ⟨a', ha⟩ ⟨b', hb⟩ ↦ ⟨b' * a', by simp only [coe_mul, ← mul_assoc, mul_assoc a, hb, mul_one, ha]⟩ #align submonoid.left_inv Submonoid.leftInv #align add_submonoid.left_neg AddSubmonoid.leftNeg @[to_additive]
Mathlib/GroupTheory/Submonoid/Inverses.lean
73
76
theorem leftInv_leftInv_le : S.leftInv.leftInv ≀ S := by
rintro x ⟨⟨y, z, hβ‚βŸ©, hβ‚‚ : x * y = 1⟩ convert z.prop rw [← mul_one x, ← h₁, ← mul_assoc, hβ‚‚, one_mul]
[ " a * b = b * a", " a * _b * ↑(b' * a') = 1", " S.leftInv.leftInv ≀ S", " x ∈ S", " x = ↑z" ]
[ " a * b = b * a", " a * _b * ↑(b' * a') = 1" ]
import Mathlib.CategoryTheory.Idempotents.Basic import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor import Mathlib.CategoryTheory.Equivalence #align_import category_theory.idempotents.karoubi from "leanprover-community/mathlib"@"200eda15d8ff5669854ff6bcc10aaf37cb70498f" noncomputable section open CategoryTheory.Category CategoryTheory.Preadditive CategoryTheory.Limits BigOperators namespace CategoryTheory variable (C : Type*) [Category C] namespace Idempotents -- porting note (#5171): removed @[nolint has_nonempty_instance] structure Karoubi where X : C p : X ⟢ X idem : p ≫ p = p := by aesop_cat #align category_theory.idempotents.karoubi CategoryTheory.Idempotents.Karoubi namespace Karoubi variable {C} attribute [reassoc (attr := simp)] idem @[ext] theorem ext {P Q : Karoubi C} (h_X : P.X = Q.X) (h_p : P.p ≫ eqToHom h_X = eqToHom h_X ≫ Q.p) : P = Q := by cases P cases Q dsimp at h_X h_p subst h_X simpa only [mk.injEq, heq_eq_eq, true_and, eqToHom_refl, comp_id, id_comp] using h_p #align category_theory.idempotents.karoubi.ext CategoryTheory.Idempotents.Karoubi.ext @[ext] structure Hom (P Q : Karoubi C) where f : P.X ⟢ Q.X comm : f = P.p ≫ f ≫ Q.p := by aesop_cat #align category_theory.idempotents.karoubi.hom CategoryTheory.Idempotents.Karoubi.Hom instance [Preadditive C] (P Q : Karoubi C) : Inhabited (Hom P Q) := ⟨⟨0, by rw [zero_comp, comp_zero]⟩⟩ @[reassoc (attr := simp)] theorem p_comp {P Q : Karoubi C} (f : Hom P Q) : P.p ≫ f.f = f.f := by rw [f.comm, ← assoc, P.idem] #align category_theory.idempotents.karoubi.p_comp CategoryTheory.Idempotents.Karoubi.p_comp @[reassoc (attr := simp)] theorem comp_p {P Q : Karoubi C} (f : Hom P Q) : f.f ≫ Q.p = f.f := by rw [f.comm, assoc, assoc, Q.idem] #align category_theory.idempotents.karoubi.comp_p CategoryTheory.Idempotents.Karoubi.comp_p @[reassoc]
Mathlib/CategoryTheory/Idempotents/Karoubi.lean
94
94
theorem p_comm {P Q : Karoubi C} (f : Hom P Q) : P.p ≫ f.f = f.f ≫ Q.p := by
rw [p_comp, comp_p]
[ " P = Q", " { X := X✝, p := p✝, idem := idem✝ } = Q", " { X := X✝¹, p := p✝¹, idem := idem✝¹ } = { X := X✝, p := p✝, idem := idem✝ }", " { X := X✝, p := p✝¹, idem := idem✝¹ } = { X := X✝, p := p✝, idem := idem✝ }", " 0 = P.p ≫ 0 ≫ Q.p", " P.p ≫ f.f = f.f", " f.f ≫ Q.p = f.f", " P.p ≫ f.f = f.f ≫ Q.p" ...
[ " P = Q", " { X := X✝, p := p✝, idem := idem✝ } = Q", " { X := X✝¹, p := p✝¹, idem := idem✝¹ } = { X := X✝, p := p✝, idem := idem✝ }", " { X := X✝, p := p✝¹, idem := idem✝¹ } = { X := X✝, p := p✝, idem := idem✝ }", " 0 = P.p ≫ 0 ≫ Q.p", " P.p ≫ f.f = f.f", " f.f ≫ Q.p = f.f" ]
import Mathlib.LinearAlgebra.Matrix.Spectrum import Mathlib.LinearAlgebra.QuadraticForm.Basic #align_import linear_algebra.matrix.pos_def from "leanprover-community/mathlib"@"07992a1d1f7a4176c6d3f160209608be4e198566" open scoped ComplexOrder namespace Matrix variable {m n R π•œ : Type*} variable [Fintype m] [Fintype n] variable [CommRing R] [PartialOrder R] [StarRing R] [StarOrderedRing R] variable [RCLike π•œ] open scoped Matrix def PosSemidef (M : Matrix n n R) := M.IsHermitian ∧ βˆ€ x : n β†’ R, 0 ≀ dotProduct (star x) (M *α΅₯ x) #align matrix.pos_semidef Matrix.PosSemidef lemma posSemidef_diagonal_iff [DecidableEq n] {d : n β†’ R} : PosSemidef (diagonal d) ↔ (βˆ€ i : n, 0 ≀ d i) := by refine ⟨fun ⟨_, hP⟩ i ↦ by simpa using hP (Pi.single i 1), ?_⟩ refine fun hd ↦ ⟨isHermitian_diagonal_iff.2 fun i ↦ IsSelfAdjoint.of_nonneg (hd i), ?_⟩ refine fun x ↦ Finset.sum_nonneg fun i _ ↦ ?_ simpa only [mulVec_diagonal, mul_assoc] using conjugate_nonneg (hd i) _ namespace PosSemidef theorem isHermitian {M : Matrix n n R} (hM : M.PosSemidef) : M.IsHermitian := hM.1 theorem re_dotProduct_nonneg {M : Matrix n n π•œ} (hM : M.PosSemidef) (x : n β†’ π•œ) : 0 ≀ RCLike.re (dotProduct (star x) (M *α΅₯ x)) := RCLike.nonneg_iff.mp (hM.2 _) |>.1 lemma conjTranspose_mul_mul_same {A : Matrix n n R} (hA : PosSemidef A) {m : Type*} [Fintype m] (B : Matrix n m R) : PosSemidef (Bα΄΄ * A * B) := by constructor Β· exact isHermitian_conjTranspose_mul_mul B hA.1 Β· intro x simpa only [star_mulVec, dotProduct_mulVec, vecMul_vecMul] using hA.2 (B *α΅₯ x) lemma mul_mul_conjTranspose_same {A : Matrix n n R} (hA : PosSemidef A) {m : Type*} [Fintype m] (B : Matrix m n R): PosSemidef (B * A * Bα΄΄) := by simpa only [conjTranspose_conjTranspose] using hA.conjTranspose_mul_mul_same Bα΄΄
Mathlib/LinearAlgebra/Matrix/PosDef.lean
81
87
theorem submatrix {M : Matrix n n R} (hM : M.PosSemidef) (e : m β†’ n) : (M.submatrix e e).PosSemidef := by
classical rw [(by simp : M = 1 * M * 1), submatrix_mul (heβ‚‚ := Function.bijective_id), submatrix_mul (heβ‚‚ := Function.bijective_id), submatrix_id_id] simpa only [conjTranspose_submatrix, conjTranspose_one] using conjTranspose_mul_mul_same hM (Matrix.submatrix 1 id e)
[ " (diagonal d).PosSemidef ↔ βˆ€ (i : n), 0 ≀ d i", " 0 ≀ d i", " (βˆ€ (i : n), 0 ≀ d i) β†’ (diagonal d).PosSemidef", " βˆ€ (x : n β†’ R), 0 ≀ star x ⬝α΅₯ diagonal d *α΅₯ x", " 0 ≀ star x i * (diagonal d *α΅₯ x) i", " (Bα΄΄ * A * B).PosSemidef", " (Bα΄΄ * A * B).IsHermitian", " βˆ€ (x : m β†’ R), 0 ≀ star x ⬝α΅₯ (Bα΄΄ * A * B) *...
[ " (diagonal d).PosSemidef ↔ βˆ€ (i : n), 0 ≀ d i", " 0 ≀ d i", " (βˆ€ (i : n), 0 ≀ d i) β†’ (diagonal d).PosSemidef", " βˆ€ (x : n β†’ R), 0 ≀ star x ⬝α΅₯ diagonal d *α΅₯ x", " 0 ≀ star x i * (diagonal d *α΅₯ x) i", " (Bα΄΄ * A * B).PosSemidef", " (Bα΄΄ * A * B).IsHermitian", " βˆ€ (x : m β†’ R), 0 ≀ star x ⬝α΅₯ (Bα΄΄ * A * B) *...
import Mathlib.Control.EquivFunctor import Mathlib.CategoryTheory.Groupoid import Mathlib.CategoryTheory.Whiskering import Mathlib.CategoryTheory.Types #align_import category_theory.core from "leanprover-community/mathlib"@"369525b73f229ccd76a6ec0e0e0bf2be57599768" namespace CategoryTheory universe v₁ vβ‚‚ u₁ uβ‚‚ -- morphism levels before object levels. See note [CategoryTheory universes]. -- Porting note(#5171): linter not yet ported -- @[nolint has_nonempty_instance] def Core (C : Type u₁) := C #align category_theory.core CategoryTheory.Core variable {C : Type u₁} [Category.{v₁} C] instance coreCategory : Groupoid.{v₁} (Core C) where Hom (X Y : C) := X β‰… Y id (X : C) := Iso.refl X comp f g := Iso.trans f g inv {X Y} f := Iso.symm f #align category_theory.core_category CategoryTheory.coreCategory namespace Core @[simp]
Mathlib/CategoryTheory/Core.lean
52
53
theorem id_hom (X : C) : Iso.hom (coreCategory.id X) = @CategoryStruct.id C _ X := by
rfl
[ " (πŸ™ X).hom = πŸ™ X" ]
[]
import Mathlib.ModelTheory.Syntax import Mathlib.ModelTheory.Semantics import Mathlib.Algebra.Ring.Equiv variable {Ξ± : Type*} namespace FirstOrder open FirstOrder inductive ringFunc : β„• β†’ Type | add : ringFunc 2 | mul : ringFunc 2 | neg : ringFunc 1 | zero : ringFunc 0 | one : ringFunc 0 deriving DecidableEq def Language.ring : Language := { Functions := ringFunc Relations := fun _ => Empty } namespace Ring open ringFunc Language instance (n : β„•) : DecidableEq (Language.ring.Functions n) := by dsimp [Language.ring]; infer_instance instance (n : β„•) : DecidableEq (Language.ring.Relations n) := by dsimp [Language.ring]; infer_instance abbrev addFunc : Language.ring.Functions 2 := add abbrev mulFunc : Language.ring.Functions 2 := mul abbrev negFunc : Language.ring.Functions 1 := neg abbrev zeroFunc : Language.ring.Functions 0 := zero abbrev oneFunc : Language.ring.Functions 0 := one instance (Ξ± : Type*) : Zero (Language.ring.Term Ξ±) := { zero := Constants.term zeroFunc } theorem zero_def (Ξ± : Type*) : (0 : Language.ring.Term Ξ±) = Constants.term zeroFunc := rfl instance (Ξ± : Type*) : One (Language.ring.Term Ξ±) := { one := Constants.term oneFunc } theorem one_def (Ξ± : Type*) : (1 : Language.ring.Term Ξ±) = Constants.term oneFunc := rfl instance (Ξ± : Type*) : Add (Language.ring.Term Ξ±) := { add := addFunc.applyβ‚‚ } theorem add_def (Ξ± : Type*) (t₁ tβ‚‚ : Language.ring.Term Ξ±) : t₁ + tβ‚‚ = addFunc.applyβ‚‚ t₁ tβ‚‚ := rfl instance (Ξ± : Type*) : Mul (Language.ring.Term Ξ±) := { mul := mulFunc.applyβ‚‚ } theorem mul_def (Ξ± : Type*) (t₁ tβ‚‚ : Language.ring.Term Ξ±) : t₁ * tβ‚‚ = mulFunc.applyβ‚‚ t₁ tβ‚‚ := rfl instance (Ξ± : Type*) : Neg (Language.ring.Term Ξ±) := { neg := negFunc.apply₁ } theorem neg_def (Ξ± : Type*) (t : Language.ring.Term Ξ±) : -t = negFunc.apply₁ t := rfl instance : Fintype Language.ring.Symbols := ⟨⟨Multiset.ofList [Sum.inl ⟨2, .add⟩, Sum.inl ⟨2, .mul⟩, Sum.inl ⟨1, .neg⟩, Sum.inl ⟨0, .zero⟩, Sum.inl ⟨0, .one⟩], by dsimp [Language.Symbols]; decide⟩, by intro x dsimp [Language.Symbols] rcases x with ⟨_, f⟩ | ⟨_, f⟩ Β· cases f <;> decide Β· cases f ⟩ @[simp] theorem card_ring : card Language.ring = 5 := by have : Fintype.card Language.ring.Symbols = 5 := rfl simp [Language.card, this] open Language ring Structure class CompatibleRing (R : Type*) [Add R] [Mul R] [Neg R] [One R] [Zero R] extends Language.ring.Structure R where funMap_add : βˆ€ x, funMap addFunc x = x 0 + x 1 funMap_mul : βˆ€ x, funMap mulFunc x = x 0 * x 1 funMap_neg : βˆ€ x, funMap negFunc x = -x 0 funMap_zero : βˆ€ x, funMap (zeroFunc : Language.ring.Constants) x = 0 funMap_one : βˆ€ x, funMap (oneFunc : Language.ring.Constants) x = 1 open CompatibleRing attribute [simp] funMap_add funMap_mul funMap_neg funMap_zero funMap_one section variable {R : Type*} [Add R] [Mul R] [Neg R] [One R] [Zero R] [CompatibleRing R] @[simp] theorem realize_add (x y : ring.Term Ξ±) (v : Ξ± β†’ R) : Term.realize v (x + y) = Term.realize v x + Term.realize v y := by simp [add_def, funMap_add] @[simp] theorem realize_mul (x y : ring.Term Ξ±) (v : Ξ± β†’ R) : Term.realize v (x * y) = Term.realize v x * Term.realize v y := by simp [mul_def, funMap_mul] @[simp] theorem realize_neg (x : ring.Term Ξ±) (v : Ξ± β†’ R) : Term.realize v (-x) = -Term.realize v x := by simp [neg_def, funMap_neg] @[simp]
Mathlib/ModelTheory/Algebra/Ring/Basic.lean
195
196
theorem realize_zero (v : Ξ± β†’ R) : Term.realize v (0 : ring.Term Ξ±) = 0 := by
simp [zero_def, funMap_zero, constantMap]
[ " DecidableEq (ring.Functions n)", " DecidableEq (ringFunc n)", " DecidableEq (ring.Relations n)", " DecidableEq Empty", " (↑[Sum.inl ⟨2, add⟩, Sum.inl ⟨2, mul⟩, Sum.inl ⟨1, neg⟩, Sum.inl ⟨0, zero⟩, Sum.inl ⟨0, one⟩]).Nodup", " βˆ€ (x : ring.Symbols),\n x ∈\n { val := ↑[Sum.inl ⟨2, add⟩, Sum.inl ⟨2,...
[ " DecidableEq (ring.Functions n)", " DecidableEq (ringFunc n)", " DecidableEq (ring.Relations n)", " DecidableEq Empty", " (↑[Sum.inl ⟨2, add⟩, Sum.inl ⟨2, mul⟩, Sum.inl ⟨1, neg⟩, Sum.inl ⟨0, zero⟩, Sum.inl ⟨0, one⟩]).Nodup", " βˆ€ (x : ring.Symbols),\n x ∈\n { val := ↑[Sum.inl ⟨2, add⟩, Sum.inl ⟨2,...
import Mathlib.Analysis.Calculus.FDeriv.Add import Mathlib.Analysis.Calculus.FDeriv.Equiv import Mathlib.Analysis.Calculus.FDeriv.Prod import Mathlib.Analysis.Calculus.Monotone import Mathlib.Data.Set.Function import Mathlib.Algebra.Group.Basic import Mathlib.Tactic.WLOG #align_import analysis.bounded_variation from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" open scoped NNReal ENNReal Topology UniformConvergence open Set MeasureTheory Filter -- Porting note: sectioned variables because a `wlog` was broken due to extra variables in context variable {Ξ± : Type*} [LinearOrder Ξ±] {E : Type*} [PseudoEMetricSpace E] noncomputable def eVariationOn (f : Ξ± β†’ E) (s : Set Ξ±) : ℝβ‰₯0∞ := ⨆ p : β„• Γ— { u : β„• β†’ Ξ± // Monotone u ∧ βˆ€ i, u i ∈ s }, βˆ‘ i ∈ Finset.range p.1, edist (f (p.2.1 (i + 1))) (f (p.2.1 i)) #align evariation_on eVariationOn def BoundedVariationOn (f : Ξ± β†’ E) (s : Set Ξ±) := eVariationOn f s β‰  ∞ #align has_bounded_variation_on BoundedVariationOn def LocallyBoundedVariationOn (f : Ξ± β†’ E) (s : Set Ξ±) := βˆ€ a b, a ∈ s β†’ b ∈ s β†’ BoundedVariationOn f (s ∩ Icc a b) #align has_locally_bounded_variation_on LocallyBoundedVariationOn namespace eVariationOn theorem nonempty_monotone_mem {s : Set Ξ±} (hs : s.Nonempty) : Nonempty { u // Monotone u ∧ βˆ€ i : β„•, u i ∈ s } := by obtain ⟨x, hx⟩ := hs exact ⟨⟨fun _ => x, fun i j _ => le_rfl, fun _ => hx⟩⟩ #align evariation_on.nonempty_monotone_mem eVariationOn.nonempty_monotone_mem theorem eq_of_edist_zero_on {f f' : Ξ± β†’ E} {s : Set Ξ±} (h : βˆ€ ⦃x⦄, x ∈ s β†’ edist (f x) (f' x) = 0) : eVariationOn f s = eVariationOn f' s := by dsimp only [eVariationOn] congr 1 with p : 1 congr 1 with i : 1 rw [edist_congr_right (h <| p.snd.prop.2 (i + 1)), edist_congr_left (h <| p.snd.prop.2 i)] #align evariation_on.eq_of_edist_zero_on eVariationOn.eq_of_edist_zero_on theorem eq_of_eqOn {f f' : Ξ± β†’ E} {s : Set Ξ±} (h : EqOn f f' s) : eVariationOn f s = eVariationOn f' s := eq_of_edist_zero_on fun x xs => by rw [h xs, edist_self] #align evariation_on.eq_of_eq_on eVariationOn.eq_of_eqOn theorem sum_le (f : Ξ± β†’ E) {s : Set Ξ±} (n : β„•) {u : β„• β†’ Ξ±} (hu : Monotone u) (us : βˆ€ i, u i ∈ s) : (βˆ‘ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i))) ≀ eVariationOn f s := le_iSup_of_le ⟨n, u, hu, us⟩ le_rfl #align evariation_on.sum_le eVariationOn.sum_le theorem sum_le_of_monotoneOn_Icc (f : Ξ± β†’ E) {s : Set Ξ±} {m n : β„•} {u : β„• β†’ Ξ±} (hu : MonotoneOn u (Icc m n)) (us : βˆ€ i ∈ Icc m n, u i ∈ s) : (βˆ‘ i ∈ Finset.Ico m n, edist (f (u (i + 1))) (f (u i))) ≀ eVariationOn f s := by rcases le_total n m with hnm | hmn Β· simp [Finset.Ico_eq_empty_of_le hnm] let Ο€ := projIcc m n hmn let v i := u (Ο€ i) calc βˆ‘ i ∈ Finset.Ico m n, edist (f (u (i + 1))) (f (u i)) = βˆ‘ i ∈ Finset.Ico m n, edist (f (v (i + 1))) (f (v i)) := Finset.sum_congr rfl fun i hi ↦ by rw [Finset.mem_Ico] at hi simp only [v, Ο€, projIcc_of_mem hmn ⟨hi.1, hi.2.le⟩, projIcc_of_mem hmn ⟨hi.1.trans i.le_succ, hi.2⟩] _ ≀ βˆ‘ i ∈ Finset.range n, edist (f (v (i + 1))) (f (v i)) := Finset.sum_mono_set _ (Nat.Iio_eq_range β–Έ Finset.Ico_subset_Iio_self) _ ≀ eVariationOn f s := sum_le _ _ (fun i j h ↦ hu (Ο€ i).2 (Ο€ j).2 (monotone_projIcc hmn h)) fun i ↦ us _ (Ο€ i).2 #align evariation_on.sum_le_of_monotone_on_Icc eVariationOn.sum_le_of_monotoneOn_Icc
Mathlib/Analysis/BoundedVariation.lean
127
130
theorem sum_le_of_monotoneOn_Iic (f : Ξ± β†’ E) {s : Set Ξ±} {n : β„•} {u : β„• β†’ Ξ±} (hu : MonotoneOn u (Iic n)) (us : βˆ€ i ≀ n, u i ∈ s) : (βˆ‘ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i))) ≀ eVariationOn f s := by
simpa using sum_le_of_monotoneOn_Icc f (m := 0) (hu.mono Icc_subset_Iic_self) fun i hi ↦ us i hi.2
[ " Nonempty { u // Monotone u ∧ βˆ€ (i : β„•), u i ∈ s }", " eVariationOn f s = eVariationOn f' s", " ⨆ p, βˆ‘ i ∈ Finset.range p.1, edist (f (↑p.2 (i + 1))) (f (↑p.2 i)) =\n ⨆ p, βˆ‘ i ∈ Finset.range p.1, edist (f' (↑p.2 (i + 1))) (f' (↑p.2 i))", " βˆ‘ i ∈ Finset.range p.1, edist (f (↑p.2 (i + 1))) (f (↑p.2 i)) =\n ...
[ " Nonempty { u // Monotone u ∧ βˆ€ (i : β„•), u i ∈ s }", " eVariationOn f s = eVariationOn f' s", " ⨆ p, βˆ‘ i ∈ Finset.range p.1, edist (f (↑p.2 (i + 1))) (f (↑p.2 i)) =\n ⨆ p, βˆ‘ i ∈ Finset.range p.1, edist (f' (↑p.2 (i + 1))) (f' (↑p.2 i))", " βˆ‘ i ∈ Finset.range p.1, edist (f (↑p.2 (i + 1))) (f (↑p.2 i)) =\n ...
import Mathlib.Algebra.Group.Equiv.TypeTags import Mathlib.GroupTheory.FreeAbelianGroup import Mathlib.GroupTheory.FreeGroup.IsFreeGroup import Mathlib.LinearAlgebra.Dimension.StrongRankCondition #align_import group_theory.free_abelian_group_finsupp from "leanprover-community/mathlib"@"47b51515e69f59bca5cf34ef456e6000fe205a69" noncomputable section variable {X : Type*} def FreeAbelianGroup.toFinsupp : FreeAbelianGroup X β†’+ X β†’β‚€ β„€ := FreeAbelianGroup.lift fun x => Finsupp.single x (1 : β„€) #align free_abelian_group.to_finsupp FreeAbelianGroup.toFinsupp def Finsupp.toFreeAbelianGroup : (X β†’β‚€ β„€) β†’+ FreeAbelianGroup X := Finsupp.liftAddHom fun x => (smulAddHom β„€ (FreeAbelianGroup X)).flip (FreeAbelianGroup.of x) #align finsupp.to_free_abelian_group Finsupp.toFreeAbelianGroup open Finsupp FreeAbelianGroup @[simp] theorem Finsupp.toFreeAbelianGroup_comp_singleAddHom (x : X) : Finsupp.toFreeAbelianGroup.comp (Finsupp.singleAddHom x) = (smulAddHom β„€ (FreeAbelianGroup X)).flip (of x) := by ext simp only [AddMonoidHom.coe_comp, Finsupp.singleAddHom_apply, Function.comp_apply, one_smul, toFreeAbelianGroup, Finsupp.liftAddHom_apply_single] #align finsupp.to_free_abelian_group_comp_single_add_hom Finsupp.toFreeAbelianGroup_comp_singleAddHom @[simp] theorem FreeAbelianGroup.toFinsupp_comp_toFreeAbelianGroup : toFinsupp.comp toFreeAbelianGroup = AddMonoidHom.id (X β†’β‚€ β„€) := by ext x y; simp only [AddMonoidHom.id_comp] rw [AddMonoidHom.comp_assoc, Finsupp.toFreeAbelianGroup_comp_singleAddHom] simp only [toFinsupp, AddMonoidHom.coe_comp, Finsupp.singleAddHom_apply, Function.comp_apply, one_smul, lift.of, AddMonoidHom.flip_apply, smulAddHom_apply, AddMonoidHom.id_apply] #align free_abelian_group.to_finsupp_comp_to_free_abelian_group FreeAbelianGroup.toFinsupp_comp_toFreeAbelianGroup @[simp] theorem Finsupp.toFreeAbelianGroup_comp_toFinsupp : toFreeAbelianGroup.comp toFinsupp = AddMonoidHom.id (FreeAbelianGroup X) := by ext rw [toFreeAbelianGroup, toFinsupp, AddMonoidHom.comp_apply, lift.of, liftAddHom_apply_single, AddMonoidHom.flip_apply, smulAddHom_apply, one_smul, AddMonoidHom.id_apply] #align finsupp.to_free_abelian_group_comp_to_finsupp Finsupp.toFreeAbelianGroup_comp_toFinsupp @[simp] theorem Finsupp.toFreeAbelianGroup_toFinsupp {X} (x : FreeAbelianGroup X) : Finsupp.toFreeAbelianGroup (FreeAbelianGroup.toFinsupp x) = x := by rw [← AddMonoidHom.comp_apply, Finsupp.toFreeAbelianGroup_comp_toFinsupp, AddMonoidHom.id_apply] #align finsupp.to_free_abelian_group_to_finsupp Finsupp.toFreeAbelianGroup_toFinsupp namespace FreeAbelianGroup open Finsupp @[simp] theorem toFinsupp_of (x : X) : toFinsupp (of x) = Finsupp.single x 1 := by simp only [toFinsupp, lift.of] #align free_abelian_group.to_finsupp_of FreeAbelianGroup.toFinsupp_of @[simp]
Mathlib/GroupTheory/FreeAbelianGroupFinsupp.lean
87
89
theorem toFinsupp_toFreeAbelianGroup (f : X β†’β‚€ β„€) : FreeAbelianGroup.toFinsupp (Finsupp.toFreeAbelianGroup f) = f := by
rw [← AddMonoidHom.comp_apply, toFinsupp_comp_toFreeAbelianGroup, AddMonoidHom.id_apply]
[ " toFreeAbelianGroup.comp (singleAddHom x) = (smulAddHom β„€ (FreeAbelianGroup X)).flip (of x)", " (toFreeAbelianGroup.comp (singleAddHom x)) 1 = ((smulAddHom β„€ (FreeAbelianGroup X)).flip (of x)) 1", " toFinsupp.comp toFreeAbelianGroup = AddMonoidHom.id (X β†’β‚€ β„€)", " (((toFinsupp.comp toFreeAbelianGroup).comp (s...
[ " toFreeAbelianGroup.comp (singleAddHom x) = (smulAddHom β„€ (FreeAbelianGroup X)).flip (of x)", " (toFreeAbelianGroup.comp (singleAddHom x)) 1 = ((smulAddHom β„€ (FreeAbelianGroup X)).flip (of x)) 1", " toFinsupp.comp toFreeAbelianGroup = AddMonoidHom.id (X β†’β‚€ β„€)", " (((toFinsupp.comp toFreeAbelianGroup).comp (s...
import Mathlib.Topology.Constructions import Mathlib.Topology.Algebra.Monoid import Mathlib.Order.Filter.ListTraverse import Mathlib.Tactic.AdaptationNote #align_import topology.list from "leanprover-community/mathlib"@"48085f140e684306f9e7da907cd5932056d1aded" open TopologicalSpace Set Filter open Topology Filter variable {Ξ± : Type*} {Ξ² : Type*} [TopologicalSpace Ξ±] [TopologicalSpace Ξ²] instance : TopologicalSpace (List Ξ±) := TopologicalSpace.mkOfNhds (traverse nhds)
Mathlib/Topology/List.lean
28
66
theorem nhds_list (as : List Ξ±) : 𝓝 as = traverse 𝓝 as := by
refine nhds_mkOfNhds _ _ ?_ ?_ Β· intro l induction l with | nil => exact le_rfl | cons a l ih => suffices List.cons <$> pure a <*> pure l ≀ List.cons <$> 𝓝 a <*> traverse 𝓝 l by simpa only [functor_norm] using this exact Filter.seq_mono (Filter.map_mono <| pure_le_nhds a) ih Β· intro l s hs rcases (mem_traverse_iff _ _).1 hs with ⟨u, hu, hus⟩ clear as hs have : βˆƒ v : List (Set Ξ±), l.Forallβ‚‚ (fun a s => IsOpen s ∧ a ∈ s) v ∧ sequence v βŠ† s := by induction hu generalizing s with | nil => exists [] simp only [List.forallβ‚‚_nil_left_iff, exists_eq_left] exact ⟨trivial, hus⟩ -- porting note -- renamed reordered variables based on previous types | cons ht _ ih => rcases mem_nhds_iff.1 ht with ⟨u, hut, hu⟩ rcases ih _ Subset.rfl with ⟨v, hv, hvss⟩ exact ⟨u::v, List.Forallβ‚‚.cons hu hv, Subset.trans (Set.seq_mono (Set.image_subset _ hut) hvss) hus⟩ rcases this with ⟨v, hv, hvs⟩ have : sequence v ∈ traverse 𝓝 l := mem_traverse _ _ <| hv.imp fun a s ⟨hs, ha⟩ => IsOpen.mem_nhds hs ha refine mem_of_superset this fun u hu ↦ ?_ have hu := (List.mem_traverse _ _).1 hu have : List.Forallβ‚‚ (fun a s => IsOpen s ∧ a ∈ s) u v := by refine List.Forallβ‚‚.flip ?_ replace hv := hv.flip #adaptation_note /-- nightly-2024-03-16: simp was simp only [List.forallβ‚‚_and_left, flip] at hv ⊒ -/ simp only [List.forallβ‚‚_and_left, Function.flip_def] at hv ⊒ exact ⟨hv.1, hu.flip⟩ refine mem_of_superset ?_ hvs exact mem_traverse _ _ (this.imp fun a s ⟨hs, ha⟩ => IsOpen.mem_nhds hs ha)
[ " 𝓝 as = traverse 𝓝 as", " pure ≀ traverse 𝓝", " pure l ≀ traverse 𝓝 l", " pure [] ≀ traverse 𝓝 []", " pure (a :: l) ≀ traverse 𝓝 (a :: l)", " (Seq.seq (List.cons <$> pure a) fun x => pure l) ≀ Seq.seq (List.cons <$> 𝓝 a) fun x => traverse 𝓝 l", " βˆ€ (a : List Ξ±), βˆ€ s ∈ traverse 𝓝 a, βˆ€αΆ  (y : Lis...
[]
import Mathlib.Probability.Martingale.BorelCantelli import Mathlib.Probability.ConditionalExpectation import Mathlib.Probability.Independence.Basic #align_import probability.borel_cantelli from "leanprover-community/mathlib"@"2f8347015b12b0864dfaf366ec4909eb70c78740" open scoped MeasureTheory ProbabilityTheory ENNReal Topology open MeasureTheory ProbabilityTheory MeasurableSpace TopologicalSpace namespace ProbabilityTheory variable {Ξ© : Type*} {m0 : MeasurableSpace Ξ©} {ΞΌ : Measure Ξ©} [IsProbabilityMeasure ΞΌ] section BorelCantelli variable {ΞΉ Ξ² : Type*} [LinearOrder ΞΉ] [mΞ² : MeasurableSpace Ξ²] [NormedAddCommGroup Ξ²] [BorelSpace Ξ²] {f : ΞΉ β†’ Ξ© β†’ Ξ²} {i j : ΞΉ} {s : ΞΉ β†’ Set Ξ©} theorem iIndepFun.indep_comap_natural_of_lt (hf : βˆ€ i, StronglyMeasurable (f i)) (hfi : iIndepFun (fun _ => mΞ²) f ΞΌ) (hij : i < j) : Indep (MeasurableSpace.comap (f j) mΞ²) (Filtration.natural f hf i) ΞΌ := by suffices Indep (⨆ k ∈ ({j} : Set ΞΉ), MeasurableSpace.comap (f k) mΞ²) (⨆ k ∈ {k | k ≀ i}, MeasurableSpace.comap (f k) mΞ²) ΞΌ by rwa [iSup_singleton] at this exact indep_iSup_of_disjoint (fun k => (hf k).measurable.comap_le) hfi (by simpa) set_option linter.uppercaseLean3 false in #align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.iIndepFun.indep_comap_natural_of_lt theorem iIndepFun.condexp_natural_ae_eq_of_lt [SecondCountableTopology Ξ²] [CompleteSpace Ξ²] [NormedSpace ℝ Ξ²] (hf : βˆ€ i, StronglyMeasurable (f i)) (hfi : iIndepFun (fun _ => mΞ²) f ΞΌ) (hij : i < j) : ΞΌ[f j|Filtration.natural f hf i] =ᡐ[ΞΌ] fun _ => ΞΌ[f j] := condexp_indep_eq (hf j).measurable.comap_le (Filtration.le _ _) (comap_measurable <| f j).stronglyMeasurable (hfi.indep_comap_natural_of_lt hf hij) set_option linter.uppercaseLean3 false in #align probability_theory.Indep_fun.condexp_natural_ae_eq_of_lt ProbabilityTheory.iIndepFun.condexp_natural_ae_eq_of_lt theorem iIndepSet.condexp_indicator_filtrationOfSet_ae_eq (hsm : βˆ€ n, MeasurableSet (s n)) (hs : iIndepSet s ΞΌ) (hij : i < j) : ΞΌ[(s j).indicator (fun _ => 1 : Ξ© β†’ ℝ)|filtrationOfSet hsm i] =ᡐ[ΞΌ] fun _ => (ΞΌ (s j)).toReal := by rw [Filtration.filtrationOfSet_eq_natural (Ξ² := ℝ) hsm] refine (iIndepFun.condexp_natural_ae_eq_of_lt _ hs.iIndepFun_indicator hij).trans ?_ simp only [integral_indicator_const _ (hsm _), Algebra.id.smul_eq_mul, mul_one]; rfl set_option linter.uppercaseLean3 false in #align probability_theory.Indep_set.condexp_indicator_filtration_of_set_ae_eq ProbabilityTheory.iIndepSet.condexp_indicator_filtrationOfSet_ae_eq open Filter
Mathlib/Probability/BorelCantelli.lean
74
105
theorem measure_limsup_eq_one {s : β„• β†’ Set Ξ©} (hsm : βˆ€ n, MeasurableSet (s n)) (hs : iIndepSet s ΞΌ) (hs' : (βˆ‘' n, ΞΌ (s n)) = ∞) : ΞΌ (limsup s atTop) = 1 := by
rw [measure_congr (eventuallyEq_set.2 (ae_mem_limsup_atTop_iff ΞΌ <| measurableSet_filtrationOfSet' hsm) : (limsup s atTop : Set Ξ©) =ᡐ[ΞΌ] {Ο‰ | Tendsto (fun n => βˆ‘ k ∈ Finset.range n, (ΞΌ[(s (k + 1)).indicator (1 : Ξ© β†’ ℝ)|filtrationOfSet hsm k]) Ο‰) atTop atTop})] suffices {Ο‰ | Tendsto (fun n => βˆ‘ k ∈ Finset.range n, (ΞΌ[(s (k + 1)).indicator (1 : Ξ© β†’ ℝ)|filtrationOfSet hsm k]) Ο‰) atTop atTop} =ᡐ[ΞΌ] Set.univ by rw [measure_congr this, measure_univ] have : βˆ€α΅ Ο‰ βˆ‚ΞΌ, βˆ€ n, (ΞΌ[(s (n + 1)).indicator (1 : Ξ© β†’ ℝ)|filtrationOfSet hsm n]) Ο‰ = _ := ae_all_iff.2 fun n => hs.condexp_indicator_filtrationOfSet_ae_eq hsm n.lt_succ_self filter_upwards [this] with Ο‰ hΟ‰ refine eq_true (?_ : Tendsto _ _ _) simp_rw [hΟ‰] have htends : Tendsto (fun n => βˆ‘ k ∈ Finset.range n, ΞΌ (s (k + 1))) atTop (𝓝 ∞) := by rw [← ENNReal.tsum_add_one_eq_top hs' (measure_ne_top _ _)] exact ENNReal.tendsto_nat_tsum _ rw [ENNReal.tendsto_nhds_top_iff_nnreal] at htends refine tendsto_atTop_atTop_of_monotone' ?_ ?_ Β· refine monotone_nat_of_le_succ fun n => ?_ rw [← sub_nonneg, Finset.sum_range_succ_sub_sum] exact ENNReal.toReal_nonneg Β· rintro ⟨B, hB⟩ refine not_eventually.2 (frequently_of_forall fun n => ?_) (htends B.toNNReal) rw [mem_upperBounds] at hB specialize hB (βˆ‘ k ∈ Finset.range n, ΞΌ (s (k + 1))).toReal _ Β· refine ⟨n, ?_⟩ rw [ENNReal.toReal_sum] exact fun _ _ => measure_ne_top _ _ Β· rw [not_lt, ← ENNReal.toReal_le_toReal (ENNReal.sum_lt_top _).ne ENNReal.coe_ne_top] Β· exact hB.trans (by simp) Β· exact fun _ _ => measure_ne_top _ _
[ " Indep (MeasurableSpace.comap (f j) mΞ²) (↑(Filtration.natural f hf) i) ΞΌ", " Indep (⨆ k ∈ {j}, MeasurableSpace.comap (f k) mΞ²) (⨆ k ∈ {k | k ≀ i}, MeasurableSpace.comap (f k) mΞ²) ΞΌ", " Disjoint {j} {k | k ≀ i}", " ΞΌ[(s j).indicator fun x => 1|↑(filtrationOfSet hsm) i] =αΆ [ae ΞΌ] fun x => (ΞΌ (s j)).toReal", "...
[ " Indep (MeasurableSpace.comap (f j) mΞ²) (↑(Filtration.natural f hf) i) ΞΌ", " Indep (⨆ k ∈ {j}, MeasurableSpace.comap (f k) mΞ²) (⨆ k ∈ {k | k ≀ i}, MeasurableSpace.comap (f k) mΞ²) ΞΌ", " Disjoint {j} {k | k ≀ i}", " ΞΌ[(s j).indicator fun x => 1|↑(filtrationOfSet hsm) i] =αΆ [ae ΞΌ] fun x => (ΞΌ (s j)).toReal", "...
import Mathlib.Data.Set.Pairwise.Basic import Mathlib.Order.Bounds.Basic import Mathlib.Order.Directed import Mathlib.Order.Hom.Set #align_import order.antichain from "leanprover-community/mathlib"@"c227d107bbada5d0d9d20287e3282c0a7f1651a0" open Function Set section General variable {Ξ± Ξ² : Type*} {r r₁ rβ‚‚ : Ξ± β†’ Ξ± β†’ Prop} {r' : Ξ² β†’ Ξ² β†’ Prop} {s t : Set Ξ±} {a b : Ξ±} protected theorem Symmetric.compl (h : Symmetric r) : Symmetric rᢜ := fun _ _ hr hr' => hr <| h hr' #align symmetric.compl Symmetric.compl def IsAntichain (r : Ξ± β†’ Ξ± β†’ Prop) (s : Set Ξ±) : Prop := s.Pairwise rᢜ #align is_antichain IsAntichain namespace IsAntichain protected theorem subset (hs : IsAntichain r s) (h : t βŠ† s) : IsAntichain r t := hs.mono h #align is_antichain.subset IsAntichain.subset theorem mono (hs : IsAntichain r₁ s) (h : rβ‚‚ ≀ r₁) : IsAntichain rβ‚‚ s := hs.mono' <| compl_le_compl h #align is_antichain.mono IsAntichain.mono theorem mono_on (hs : IsAntichain r₁ s) (h : s.Pairwise fun ⦃a b⦄ => rβ‚‚ a b β†’ r₁ a b) : IsAntichain rβ‚‚ s := hs.imp_on <| h.imp fun _ _ h h₁ hβ‚‚ => h₁ <| h hβ‚‚ #align is_antichain.mono_on IsAntichain.mono_on protected theorem eq (hs : IsAntichain r s) {a b : Ξ±} (ha : a ∈ s) (hb : b ∈ s) (h : r a b) : a = b := Set.Pairwise.eq hs ha hb <| not_not_intro h #align is_antichain.eq IsAntichain.eq protected theorem eq' (hs : IsAntichain r s) {a b : Ξ±} (ha : a ∈ s) (hb : b ∈ s) (h : r b a) : a = b := (hs.eq hb ha h).symm #align is_antichain.eq' IsAntichain.eq' protected theorem isAntisymm (h : IsAntichain r univ) : IsAntisymm Ξ± r := ⟨fun _ _ ha _ => h.eq trivial trivial ha⟩ #align is_antichain.is_antisymm IsAntichain.isAntisymm protected theorem subsingleton [IsTrichotomous Ξ± r] (h : IsAntichain r s) : s.Subsingleton := by rintro a ha b hb obtain hab | hab | hab := trichotomous_of r a b Β· exact h.eq ha hb hab Β· exact hab Β· exact h.eq' ha hb hab #align is_antichain.subsingleton IsAntichain.subsingleton protected theorem flip (hs : IsAntichain r s) : IsAntichain (flip r) s := fun _ ha _ hb h => hs hb ha h.symm #align is_antichain.flip IsAntichain.flip theorem swap (hs : IsAntichain r s) : IsAntichain (swap r) s := hs.flip #align is_antichain.swap IsAntichain.swap theorem image (hs : IsAntichain r s) (f : Ξ± β†’ Ξ²) (h : βˆ€ ⦃a b⦄, r' (f a) (f b) β†’ r a b) : IsAntichain r' (f '' s) := by rintro _ ⟨b, hb, rfl⟩ _ ⟨c, hc, rfl⟩ hbc hr exact hs hb hc (ne_of_apply_ne _ hbc) (h hr) #align is_antichain.image IsAntichain.image theorem preimage (hs : IsAntichain r s) {f : Ξ² β†’ Ξ±} (hf : Injective f) (h : βˆ€ ⦃a b⦄, r' a b β†’ r (f a) (f b)) : IsAntichain r' (f ⁻¹' s) := fun _ hb _ hc hbc hr => hs hb hc (hf.ne hbc) <| h hr #align is_antichain.preimage IsAntichain.preimage theorem _root_.isAntichain_insert : IsAntichain r (insert a s) ↔ IsAntichain r s ∧ βˆ€ ⦃b⦄, b ∈ s β†’ a β‰  b β†’ Β¬r a b ∧ Β¬r b a := Set.pairwise_insert #align is_antichain_insert isAntichain_insert protected theorem insert (hs : IsAntichain r s) (hl : βˆ€ ⦃b⦄, b ∈ s β†’ a β‰  b β†’ Β¬r b a) (hr : βˆ€ ⦃b⦄, b ∈ s β†’ a β‰  b β†’ Β¬r a b) : IsAntichain r (insert a s) := isAntichain_insert.2 ⟨hs, fun _ hb hab => ⟨hr hb hab, hl hb hab⟩⟩ #align is_antichain.insert IsAntichain.insert theorem _root_.isAntichain_insert_of_symmetric (hr : Symmetric r) : IsAntichain r (insert a s) ↔ IsAntichain r s ∧ βˆ€ ⦃b⦄, b ∈ s β†’ a β‰  b β†’ Β¬r a b := pairwise_insert_of_symmetric hr.compl #align is_antichain_insert_of_symmetric isAntichain_insert_of_symmetric theorem insert_of_symmetric (hs : IsAntichain r s) (hr : Symmetric r) (h : βˆ€ ⦃b⦄, b ∈ s β†’ a β‰  b β†’ Β¬r a b) : IsAntichain r (insert a s) := (isAntichain_insert_of_symmetric hr).2 ⟨hs, h⟩ #align is_antichain.insert_of_symmetric IsAntichain.insert_of_symmetric
Mathlib/Order/Antichain.lean
120
124
theorem image_relEmbedding (hs : IsAntichain r s) (Ο† : r β†ͺr r') : IsAntichain r' (Ο† '' s) := by
intro b hb b' hb' h₁ hβ‚‚ rw [Set.mem_image] at hb hb' obtain ⟨⟨a, has, rfl⟩, ⟨a', has', rfl⟩⟩ := hb, hb' exact hs has has' (fun haa' => h₁ (by rw [haa'])) (Ο†.map_rel_iff.mp hβ‚‚)
[ " s.Subsingleton", " a = b", " IsAntichain r' (f '' s)", " False", " IsAntichain r' (⇑φ '' s)", " Ο† a = Ο† a'" ]
[ " s.Subsingleton", " a = b", " IsAntichain r' (f '' s)", " False" ]
import Mathlib.RingTheory.AdjoinRoot import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.Polynomial.GaussLemma #align_import field_theory.minpoly.is_integrally_closed from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" open scoped Classical Polynomial open Polynomial Set Function minpoly namespace minpoly variable {R S : Type*} [CommRing R] [CommRing S] [IsDomain R] [Algebra R S] section variable (K L : Type*) [Field K] [Algebra R K] [IsFractionRing R K] [CommRing L] [Nontrivial L] [Algebra R L] [Algebra S L] [Algebra K L] [IsScalarTower R K L] [IsScalarTower R S L] variable [IsIntegrallyClosed R] theorem isIntegrallyClosed_eq_field_fractions [IsDomain S] {s : S} (hs : IsIntegral R s) : minpoly K (algebraMap S L s) = (minpoly R s).map (algebraMap R K) := by refine (eq_of_irreducible_of_monic ?_ ?_ ?_).symm Β· exact ((monic hs).irreducible_iff_irreducible_map_fraction_map).1 (irreducible hs) Β· rw [aeval_map_algebraMap, aeval_algebraMap_apply, aeval, map_zero] Β· exact (monic hs).map _ #align minpoly.is_integrally_closed_eq_field_fractions minpoly.isIntegrallyClosed_eq_field_fractions
Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean
61
64
theorem isIntegrallyClosed_eq_field_fractions' [IsDomain S] [Algebra K S] [IsScalarTower R K S] {s : S} (hs : IsIntegral R s) : minpoly K s = (minpoly R s).map (algebraMap R K) := by
let L := FractionRing S rw [← isIntegrallyClosed_eq_field_fractions K L hs, algebraMap_eq (IsFractionRing.injective S L)]
[ " minpoly K ((algebraMap S L) s) = map (algebraMap R K) (minpoly R s)", " Irreducible (map (algebraMap R K) (minpoly R s))", " (Polynomial.aeval ((algebraMap S L) s)) (map (algebraMap R K) (minpoly R s)) = 0", " (map (algebraMap R K) (minpoly R s)).Monic", " minpoly K s = map (algebraMap R K) (minpoly R s)"...
[ " minpoly K ((algebraMap S L) s) = map (algebraMap R K) (minpoly R s)", " Irreducible (map (algebraMap R K) (minpoly R s))", " (Polynomial.aeval ((algebraMap S L) s)) (map (algebraMap R K) (minpoly R s)) = 0", " (map (algebraMap R K) (minpoly R s)).Monic" ]
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent import Mathlib.Analysis.Calculus.FDeriv.Linear import Mathlib.Analysis.Calculus.FDeriv.Comp #align_import analysis.calculus.fderiv.equiv from "leanprover-community/mathlib"@"e3fb84046afd187b710170887195d50bada934ee" open Filter Asymptotics ContinuousLinearMap Set Metric open scoped Classical open Topology NNReal Filter Asymptotics ENNReal noncomputable section section variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π•œ G] variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace π•œ G'] variable {f fβ‚€ f₁ g : E β†’ F} variable {f' fβ‚€' f₁' g' : E β†’L[π•œ] F} variable (e : E β†’L[π•œ] F) variable {x : E} variable {s t : Set E} variable {L L₁ Lβ‚‚ : Filter E} namespace ContinuousLinearEquiv variable (iso : E ≃L[π•œ] F) @[fun_prop] protected theorem hasStrictFDerivAt : HasStrictFDerivAt iso (iso : E β†’L[π•œ] F) x := iso.toContinuousLinearMap.hasStrictFDerivAt #align continuous_linear_equiv.has_strict_fderiv_at ContinuousLinearEquiv.hasStrictFDerivAt @[fun_prop] protected theorem hasFDerivWithinAt : HasFDerivWithinAt iso (iso : E β†’L[π•œ] F) s x := iso.toContinuousLinearMap.hasFDerivWithinAt #align continuous_linear_equiv.has_fderiv_within_at ContinuousLinearEquiv.hasFDerivWithinAt @[fun_prop] protected theorem hasFDerivAt : HasFDerivAt iso (iso : E β†’L[π•œ] F) x := iso.toContinuousLinearMap.hasFDerivAtFilter #align continuous_linear_equiv.has_fderiv_at ContinuousLinearEquiv.hasFDerivAt @[fun_prop] protected theorem differentiableAt : DifferentiableAt π•œ iso x := iso.hasFDerivAt.differentiableAt #align continuous_linear_equiv.differentiable_at ContinuousLinearEquiv.differentiableAt @[fun_prop] protected theorem differentiableWithinAt : DifferentiableWithinAt π•œ iso s x := iso.differentiableAt.differentiableWithinAt #align continuous_linear_equiv.differentiable_within_at ContinuousLinearEquiv.differentiableWithinAt protected theorem fderiv : fderiv π•œ iso x = iso := iso.hasFDerivAt.fderiv #align continuous_linear_equiv.fderiv ContinuousLinearEquiv.fderiv protected theorem fderivWithin (hxs : UniqueDiffWithinAt π•œ s x) : fderivWithin π•œ iso s x = iso := iso.toContinuousLinearMap.fderivWithin hxs #align continuous_linear_equiv.fderiv_within ContinuousLinearEquiv.fderivWithin @[fun_prop] protected theorem differentiable : Differentiable π•œ iso := fun _ => iso.differentiableAt #align continuous_linear_equiv.differentiable ContinuousLinearEquiv.differentiable @[fun_prop] protected theorem differentiableOn : DifferentiableOn π•œ iso s := iso.differentiable.differentiableOn #align continuous_linear_equiv.differentiable_on ContinuousLinearEquiv.differentiableOn theorem comp_differentiableWithinAt_iff {f : G β†’ E} {s : Set G} {x : G} : DifferentiableWithinAt π•œ (iso ∘ f) s x ↔ DifferentiableWithinAt π•œ f s x := by refine ⟨fun H => ?_, fun H => iso.differentiable.differentiableAt.comp_differentiableWithinAt x H⟩ have : DifferentiableWithinAt π•œ (iso.symm ∘ iso ∘ f) s x := iso.symm.differentiable.differentiableAt.comp_differentiableWithinAt x H rwa [← Function.comp.assoc iso.symm iso f, iso.symm_comp_self] at this #align continuous_linear_equiv.comp_differentiable_within_at_iff ContinuousLinearEquiv.comp_differentiableWithinAt_iff
Mathlib/Analysis/Calculus/FDeriv/Equiv.lean
104
107
theorem comp_differentiableAt_iff {f : G β†’ E} {x : G} : DifferentiableAt π•œ (iso ∘ f) x ↔ DifferentiableAt π•œ f x := by
rw [← differentiableWithinAt_univ, ← differentiableWithinAt_univ, iso.comp_differentiableWithinAt_iff]
[ " DifferentiableWithinAt π•œ (⇑iso ∘ f) s x ↔ DifferentiableWithinAt π•œ f s x", " DifferentiableWithinAt π•œ f s x", " DifferentiableAt π•œ (⇑iso ∘ f) x ↔ DifferentiableAt π•œ f x" ]
[ " DifferentiableWithinAt π•œ (⇑iso ∘ f) s x ↔ DifferentiableWithinAt π•œ f s x", " DifferentiableWithinAt π•œ f s x" ]
import Mathlib.Data.Finset.Lattice #align_import combinatorics.set_family.compression.down from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" variable {Ξ± : Type*} [DecidableEq Ξ±] {π’œ ℬ : Finset (Finset Ξ±)} {s : Finset Ξ±} {a : Ξ±} namespace Finset def nonMemberSubfamily (a : Ξ±) (π’œ : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := π’œ.filter fun s => a βˆ‰ s #align finset.non_member_subfamily Finset.nonMemberSubfamily def memberSubfamily (a : Ξ±) (π’œ : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π’œ.filter fun s => a ∈ s).image fun s => erase s a #align finset.member_subfamily Finset.memberSubfamily @[simp] theorem mem_nonMemberSubfamily : s ∈ π’œ.nonMemberSubfamily a ↔ s ∈ π’œ ∧ a βˆ‰ s := by simp [nonMemberSubfamily] #align finset.mem_non_member_subfamily Finset.mem_nonMemberSubfamily @[simp] theorem mem_memberSubfamily : s ∈ π’œ.memberSubfamily a ↔ insert a s ∈ π’œ ∧ a βˆ‰ s := by simp_rw [memberSubfamily, mem_image, mem_filter] refine ⟨?_, fun h => ⟨insert a s, ⟨h.1, by simp⟩, erase_insert h.2⟩⟩ rintro ⟨s, ⟨hs1, hs2⟩, rfl⟩ rw [insert_erase hs2] exact ⟨hs1, not_mem_erase _ _⟩ #align finset.mem_member_subfamily Finset.mem_memberSubfamily theorem nonMemberSubfamily_inter (a : Ξ±) (π’œ ℬ : Finset (Finset Ξ±)) : (π’œ ∩ ℬ).nonMemberSubfamily a = π’œ.nonMemberSubfamily a ∩ ℬ.nonMemberSubfamily a := filter_inter_distrib _ _ _ #align finset.non_member_subfamily_inter Finset.nonMemberSubfamily_inter theorem memberSubfamily_inter (a : Ξ±) (π’œ ℬ : Finset (Finset Ξ±)) : (π’œ ∩ ℬ).memberSubfamily a = π’œ.memberSubfamily a ∩ ℬ.memberSubfamily a := by unfold memberSubfamily rw [filter_inter_distrib, image_inter_of_injOn _ _ ((erase_injOn' _).mono _)] simp #align finset.member_subfamily_inter Finset.memberSubfamily_inter theorem nonMemberSubfamily_union (a : Ξ±) (π’œ ℬ : Finset (Finset Ξ±)) : (π’œ βˆͺ ℬ).nonMemberSubfamily a = π’œ.nonMemberSubfamily a βˆͺ ℬ.nonMemberSubfamily a := filter_union _ _ _ #align finset.non_member_subfamily_union Finset.nonMemberSubfamily_union
Mathlib/Combinatorics/SetFamily/Compression/Down.lean
86
88
theorem memberSubfamily_union (a : Ξ±) (π’œ ℬ : Finset (Finset Ξ±)) : (π’œ βˆͺ ℬ).memberSubfamily a = π’œ.memberSubfamily a βˆͺ ℬ.memberSubfamily a := by
simp_rw [memberSubfamily, filter_union, image_union]
[ " s ∈ nonMemberSubfamily a π’œ ↔ s ∈ π’œ ∧ a βˆ‰ s", " s ∈ memberSubfamily a π’œ ↔ insert a s ∈ π’œ ∧ a βˆ‰ s", " (βˆƒ a_1, (a_1 ∈ π’œ ∧ a ∈ a_1) ∧ a_1.erase a = s) ↔ insert a s ∈ π’œ ∧ a βˆ‰ s", " a ∈ insert a s", " (βˆƒ a_1, (a_1 ∈ π’œ ∧ a ∈ a_1) ∧ a_1.erase a = s) β†’ insert a s ∈ π’œ ∧ a βˆ‰ s", " insert a (s.erase a) ∈ π’œ...
[ " s ∈ nonMemberSubfamily a π’œ ↔ s ∈ π’œ ∧ a βˆ‰ s", " s ∈ memberSubfamily a π’œ ↔ insert a s ∈ π’œ ∧ a βˆ‰ s", " (βˆƒ a_1, (a_1 ∈ π’œ ∧ a ∈ a_1) ∧ a_1.erase a = s) ↔ insert a s ∈ π’œ ∧ a βˆ‰ s", " a ∈ insert a s", " (βˆƒ a_1, (a_1 ∈ π’œ ∧ a ∈ a_1) ∧ a_1.erase a = s) β†’ insert a s ∈ π’œ ∧ a βˆ‰ s", " insert a (s.erase a) ∈ π’œ...
import Mathlib.CategoryTheory.Category.Grpd import Mathlib.CategoryTheory.Groupoid import Mathlib.Topology.Category.TopCat.Basic import Mathlib.Topology.Homotopy.Path import Mathlib.Data.Set.Subsingleton #align_import algebraic_topology.fundamental_groupoid.basic from "leanprover-community/mathlib"@"3d7987cda72abc473c7cdbbb075170e9ac620042" open CategoryTheory universe u v variable {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] variable {xβ‚€ x₁ : X} noncomputable section open unitInterval namespace Path namespace Homotopy section def reflTransSymmAux (x : I Γ— I) : ℝ := if (x.2 : ℝ) ≀ 1 / 2 then x.1 * 2 * x.2 else x.1 * (2 - 2 * x.2) #align path.homotopy.refl_trans_symm_aux Path.Homotopy.reflTransSymmAux @[continuity] theorem continuous_reflTransSymmAux : Continuous reflTransSymmAux := by refine continuous_if_le ?_ ?_ (Continuous.continuousOn ?_) (Continuous.continuousOn ?_) ?_ Β· continuity Β· continuity Β· continuity Β· continuity intro x hx norm_num [hx, mul_assoc] #align path.homotopy.continuous_refl_trans_symm_aux Path.Homotopy.continuous_reflTransSymmAux theorem reflTransSymmAux_mem_I (x : I Γ— I) : reflTransSymmAux x ∈ I := by dsimp only [reflTransSymmAux] split_ifs Β· constructor Β· apply mul_nonneg Β· apply mul_nonneg Β· unit_interval Β· norm_num Β· unit_interval Β· rw [mul_assoc] apply mul_le_one Β· unit_interval Β· apply mul_nonneg Β· norm_num Β· unit_interval Β· linarith Β· constructor Β· apply mul_nonneg Β· unit_interval linarith [unitInterval.nonneg x.2, unitInterval.le_one x.2] Β· apply mul_le_one Β· unit_interval Β· linarith [unitInterval.nonneg x.2, unitInterval.le_one x.2] Β· linarith [unitInterval.nonneg x.2, unitInterval.le_one x.2] set_option linter.uppercaseLean3 false in #align path.homotopy.refl_trans_symm_aux_mem_I Path.Homotopy.reflTransSymmAux_mem_I def reflTransSymm (p : Path xβ‚€ x₁) : Homotopy (Path.refl xβ‚€) (p.trans p.symm) where toFun x := p ⟨reflTransSymmAux x, reflTransSymmAux_mem_I x⟩ continuous_toFun := by continuity map_zero_left := by simp [reflTransSymmAux] map_one_left x := by dsimp only [reflTransSymmAux, Path.coe_toContinuousMap, Path.trans] change _ = ite _ _ _ split_ifs with h Β· rw [Path.extend, Set.IccExtend_of_mem] Β· norm_num Β· rw [unitInterval.mul_pos_mem_iff zero_lt_two] exact ⟨unitInterval.nonneg x, h⟩ Β· rw [Path.symm, Path.extend, Set.IccExtend_of_mem] Β· simp only [Set.Icc.coe_one, one_mul, coe_mk_mk, Function.comp_apply] congr 1 ext norm_num [sub_sub_eq_add_sub] Β· rw [unitInterval.two_mul_sub_one_mem_iff] exact ⟨(not_le.1 h).le, unitInterval.le_one x⟩ prop' t x hx := by simp only [Set.mem_singleton_iff, Set.mem_insert_iff] at hx simp only [ContinuousMap.coe_mk, coe_toContinuousMap, Path.refl_apply] cases hx with | inl hx | inr hx => set_option tactic.skipAssignedInstances false in rw [hx] norm_num [reflTransSymmAux] #align path.homotopy.refl_trans_symm Path.Homotopy.reflTransSymm def reflSymmTrans (p : Path xβ‚€ x₁) : Homotopy (Path.refl x₁) (p.symm.trans p) := (reflTransSymm p.symm).cast rfl <| congr_arg _ (Path.symm_symm _) #align path.homotopy.refl_symm_trans Path.Homotopy.reflSymmTrans end section Assoc def transAssocReparamAux (t : I) : ℝ := if (t : ℝ) ≀ 1 / 4 then 2 * t else if (t : ℝ) ≀ 1 / 2 then t + 1 / 4 else 1 / 2 * (t + 1) #align path.homotopy.trans_assoc_reparam_aux Path.Homotopy.transAssocReparamAux @[continuity] theorem continuous_transAssocReparamAux : Continuous transAssocReparamAux := by refine continuous_if_le ?_ ?_ (Continuous.continuousOn ?_) (continuous_if_le ?_ ?_ (Continuous.continuousOn ?_) (Continuous.continuousOn ?_) ?_).continuousOn ?_ <;> [continuity; continuity; continuity; continuity; continuity; continuity; continuity; skip; skip] <;> Β· intro x hx set_option tactic.skipAssignedInstances false in norm_num [hx] #align path.homotopy.continuous_trans_assoc_reparam_aux Path.Homotopy.continuous_transAssocReparamAux
Mathlib/AlgebraicTopology/FundamentalGroupoid/Basic.lean
200
202
theorem transAssocReparamAux_mem_I (t : I) : transAssocReparamAux t ∈ I := by
unfold transAssocReparamAux split_ifs <;> constructor <;> linarith [unitInterval.le_one t, unitInterval.nonneg t]
[ " Continuous reflTransSymmAux", " Continuous fun x => ↑x.2", " Continuous fun x => 1 / 2", " Continuous fun x => ↑x.1 * 2 * ↑x.2", " Continuous fun x => ↑x.1 * (2 - 2 * ↑x.2)", " βˆ€ (x : ↑I Γ— ↑I), ↑x.2 = 1 / 2 β†’ ↑x.1 * 2 * ↑x.2 = ↑x.1 * (2 - 2 * ↑x.2)", " ↑x.1 * 2 * ↑x.2 = ↑x.1 * (2 - 2 * ↑x.2)", " ref...
[ " Continuous reflTransSymmAux", " Continuous fun x => ↑x.2", " Continuous fun x => 1 / 2", " Continuous fun x => ↑x.1 * 2 * ↑x.2", " Continuous fun x => ↑x.1 * (2 - 2 * ↑x.2)", " βˆ€ (x : ↑I Γ— ↑I), ↑x.2 = 1 / 2 β†’ ↑x.1 * 2 * ↑x.2 = ↑x.1 * (2 - 2 * ↑x.2)", " ↑x.1 * 2 * ↑x.2 = ↑x.1 * (2 - 2 * ↑x.2)", " ref...
import Mathlib.Order.Interval.Finset.Nat import Mathlib.Data.PNat.Defs #align_import data.pnat.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29" open Finset Function PNat namespace PNat variable (a b : β„•+) instance instLocallyFiniteOrder : LocallyFiniteOrder β„•+ := Subtype.instLocallyFiniteOrder _ theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : β„•) b).subtype fun n : β„• => 0 < n := rfl #align pnat.Icc_eq_finset_subtype PNat.Icc_eq_finset_subtype theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : β„•) b).subtype fun n : β„• => 0 < n := rfl #align pnat.Ico_eq_finset_subtype PNat.Ico_eq_finset_subtype theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : β„•) b).subtype fun n : β„• => 0 < n := rfl #align pnat.Ioc_eq_finset_subtype PNat.Ioc_eq_finset_subtype theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : β„•) b).subtype fun n : β„• => 0 < n := rfl #align pnat.Ioo_eq_finset_subtype PNat.Ioo_eq_finset_subtype theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : β„•) b).subtype fun n : β„• => 0 < n := rfl #align pnat.uIcc_eq_finset_subtype PNat.uIcc_eq_finset_subtype theorem map_subtype_embedding_Icc : (Icc a b).map (Embedding.subtype _) = Icc ↑a ↑b := Finset.map_subtype_embedding_Icc _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx #align pnat.map_subtype_embedding_Icc PNat.map_subtype_embedding_Icc theorem map_subtype_embedding_Ico : (Ico a b).map (Embedding.subtype _) = Ico ↑a ↑b := Finset.map_subtype_embedding_Ico _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx #align pnat.map_subtype_embedding_Ico PNat.map_subtype_embedding_Ico theorem map_subtype_embedding_Ioc : (Ioc a b).map (Embedding.subtype _) = Ioc ↑a ↑b := Finset.map_subtype_embedding_Ioc _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx #align pnat.map_subtype_embedding_Ioc PNat.map_subtype_embedding_Ioc theorem map_subtype_embedding_Ioo : (Ioo a b).map (Embedding.subtype _) = Ioo ↑a ↑b := Finset.map_subtype_embedding_Ioo _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx #align pnat.map_subtype_embedding_Ioo PNat.map_subtype_embedding_Ioo theorem map_subtype_embedding_uIcc : (uIcc a b).map (Embedding.subtype _) = uIcc ↑a ↑b := map_subtype_embedding_Icc _ _ #align pnat.map_subtype_embedding_uIcc PNat.map_subtype_embedding_uIcc @[simp] theorem card_Icc : (Icc a b).card = b + 1 - a := by rw [← Nat.card_Icc] -- Porting note: I had to change this to `erw` *and* provide the proof, yuck. -- https://github.com/leanprover-community/mathlib4/issues/5164 erw [← Finset.map_subtype_embedding_Icc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)] rw [card_map] #align pnat.card_Icc PNat.card_Icc @[simp] theorem card_Ico : (Ico a b).card = b - a := by rw [← Nat.card_Ico] -- Porting note: I had to change this to `erw` *and* provide the proof, yuck. -- https://github.com/leanprover-community/mathlib4/issues/5164 erw [← Finset.map_subtype_embedding_Ico _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)] rw [card_map] #align pnat.card_Ico PNat.card_Ico @[simp] theorem card_Ioc : (Ioc a b).card = b - a := by rw [← Nat.card_Ioc] -- Porting note: I had to change this to `erw` *and* provide the proof, yuck. -- https://github.com/leanprover-community/mathlib4/issues/5164 erw [← Finset.map_subtype_embedding_Ioc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)] rw [card_map] #align pnat.card_Ioc PNat.card_Ioc @[simp] theorem card_Ioo : (Ioo a b).card = b - a - 1 := by rw [← Nat.card_Ioo] -- Porting note: I had to change this to `erw` *and* provide the proof, yuck. -- https://github.com/leanprover-community/mathlib4/issues/5164 erw [← Finset.map_subtype_embedding_Ioo _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)] rw [card_map] #align pnat.card_Ioo PNat.card_Ioo @[simp] theorem card_uIcc : (uIcc a b).card = (b - a : β„€).natAbs + 1 := by rw [← Nat.card_uIcc, ← map_subtype_embedding_uIcc, card_map] #align pnat.card_uIcc PNat.card_uIcc -- Porting note: `simpNF` says `simp` can prove this theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = b + 1 - a := by rw [← card_Icc, Fintype.card_ofFinset] #align pnat.card_fintype_Icc PNat.card_fintype_Icc -- Porting note: `simpNF` says `simp` can prove this
Mathlib/Data/PNat/Interval.lean
113
114
theorem card_fintype_Ico : Fintype.card (Set.Ico a b) = b - a := by
rw [← card_Ico, Fintype.card_ofFinset]
[ " (Icc a b).card = ↑b + 1 - ↑a", " (Icc a b).card = (Icc ↑a ↑b).card", " (Icc a b).card = (map (Embedding.subtype fun n => 0 < n) (Icc a b)).card", " (Ico a b).card = ↑b - ↑a", " (Ico a b).card = (Ico ↑a ↑b).card", " (Ico a b).card = (map (Embedding.subtype fun n => 0 < n) (Ico a b)).card", " (Ioc a b)....
[ " (Icc a b).card = ↑b + 1 - ↑a", " (Icc a b).card = (Icc ↑a ↑b).card", " (Icc a b).card = (map (Embedding.subtype fun n => 0 < n) (Icc a b)).card", " (Ico a b).card = ↑b - ↑a", " (Ico a b).card = (Ico ↑a ↑b).card", " (Ico a b).card = (map (Embedding.subtype fun n => 0 < n) (Ico a b)).card", " (Ioc a b)....
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.BigOperators import Mathlib.Algebra.Polynomial.Degree.Lemmas import Mathlib.Algebra.Polynomial.Div #align_import data.polynomial.ring_division from "leanprover-community/mathlib"@"8efcf8022aac8e01df8d302dcebdbc25d6a886c8" noncomputable section open Polynomial open Finset namespace Polynomial universe u v w z variable {R : Type u} {S : Type v} {T : Type w} {a b : R} {n : β„•} section CommRing variable [CommRing R]
Mathlib/Algebra/Polynomial/RingDivision.lean
427
436
theorem le_rootMultiplicity_iff {p : R[X]} (p0 : p β‰  0) {a : R} {n : β„•} : n ≀ rootMultiplicity a p ↔ (X - C a) ^ n ∣ p := by
classical rw [rootMultiplicity_eq_nat_find_of_nonzero p0, @Nat.le_find_iff _ (_)] simp_rw [Classical.not_not] refine ⟨fun h => ?_, fun h m hm => (pow_dvd_pow _ hm).trans h⟩ cases' n with n; · rw [pow_zero] apply one_dvd; · exact h n n.lt_succ_self
[ " n ≀ rootMultiplicity a p ↔ (X - C a) ^ n ∣ p", " (βˆ€ m < n, ¬¬(X - C a) ^ (m + 1) ∣ p) ↔ (X - C a) ^ n ∣ p", " (βˆ€ m < n, (X - C a) ^ (m + 1) ∣ p) ↔ (X - C a) ^ n ∣ p", " (X - C a) ^ n ∣ p", " (X - C a) ^ 0 ∣ p", " 1 ∣ p", " (X - C a) ^ (n + 1) ∣ p" ]
[]
import Mathlib.AlgebraicGeometry.Spec import Mathlib.Algebra.Category.Ring.Constructions import Mathlib.CategoryTheory.Elementwise #align_import algebraic_geometry.Scheme from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c" -- Explicit universe annotations were used in this file to improve perfomance #12737 set_option linter.uppercaseLean3 false universe u noncomputable section open TopologicalSpace open CategoryTheory open TopCat open Opposite namespace AlgebraicGeometry structure Scheme extends LocallyRingedSpace where local_affine : βˆ€ x : toLocallyRingedSpace, βˆƒ (U : OpenNhds x) (R : CommRingCat), Nonempty (toLocallyRingedSpace.restrict U.openEmbedding β‰… Spec.toLocallyRingedSpace.obj (op R)) #align algebraic_geometry.Scheme AlgebraicGeometry.Scheme namespace Scheme -- @[nolint has_nonempty_instance] -- Porting note(#5171): linter not ported yet def Hom (X Y : Scheme) : Type* := X.toLocallyRingedSpace ⟢ Y.toLocallyRingedSpace #align algebraic_geometry.Scheme.hom AlgebraicGeometry.Scheme.Hom instance : Category Scheme := { InducedCategory.category Scheme.toLocallyRingedSpace with Hom := Hom } -- porting note (#10688): added to ease automation @[continuity] lemma Hom.continuous {X Y : Scheme} (f : X ⟢ Y) : Continuous f.1.base := f.1.base.2 protected abbrev sheaf (X : Scheme) := X.toSheafedSpace.sheaf #align algebraic_geometry.Scheme.sheaf AlgebraicGeometry.Scheme.sheaf instance : CoeSort Scheme Type* where coe X := X.carrier @[simps!] def forgetToLocallyRingedSpace : Scheme β₯€ LocallyRingedSpace := inducedFunctor _ -- deriving Full, Faithful -- Porting note: no delta derive handler, see https://github.com/leanprover-community/mathlib4/issues/5020 #align algebraic_geometry.Scheme.forget_to_LocallyRingedSpace AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace @[simps!] def fullyFaithfulForgetToLocallyRingedSpace : forgetToLocallyRingedSpace.FullyFaithful := fullyFaithfulInducedFunctor _ instance : forgetToLocallyRingedSpace.Full := InducedCategory.full _ instance : forgetToLocallyRingedSpace.Faithful := InducedCategory.faithful _ @[simps!] def forgetToTop : Scheme β₯€ TopCat := Scheme.forgetToLocallyRingedSpace β‹™ LocallyRingedSpace.forgetToTop #align algebraic_geometry.Scheme.forget_to_Top AlgebraicGeometry.Scheme.forgetToTop -- Porting note: Lean seems not able to find this coercion any more instance hasCoeToTopCat : CoeOut Scheme TopCat where coe X := X.carrier -- Porting note: added this unification hint just in case unif_hint forgetToTop_obj_eq_coe (X : Scheme) where ⊒ forgetToTop.obj X β‰Ÿ (X : TopCat) @[simp] theorem id_val_base (X : Scheme) : (πŸ™ X : _).1.base = πŸ™ _ := rfl #align algebraic_geometry.Scheme.id_val_base AlgebraicGeometry.Scheme.id_val_base @[simp] theorem id_app {X : Scheme} (U : (Opens X.carrier)α΅’α΅–) : (πŸ™ X : _).val.c.app U = X.presheaf.map (eqToHom (by induction' U with U; cases U; rfl)) := PresheafedSpace.id_c_app X.toPresheafedSpace U #align algebraic_geometry.Scheme.id_app AlgebraicGeometry.Scheme.id_app @[reassoc] theorem comp_val {X Y Z : Scheme} (f : X ⟢ Y) (g : Y ⟢ Z) : (f ≫ g).val = f.val ≫ g.val := rfl #align algebraic_geometry.Scheme.comp_val AlgebraicGeometry.Scheme.comp_val @[simp, reassoc] -- reassoc lemma does not need `simp` theorem comp_coeBase {X Y Z : Scheme} (f : X ⟢ Y) (g : Y ⟢ Z) : (f ≫ g).val.base = f.val.base ≫ g.val.base := rfl #align algebraic_geometry.Scheme.comp_coe_base AlgebraicGeometry.Scheme.comp_coeBase -- Porting note: removed elementwise attribute, as generated lemmas were trivial. @[reassoc] theorem comp_val_base {X Y Z : Scheme} (f : X ⟢ Y) (g : Y ⟢ Z) : (f ≫ g).val.base = f.val.base ≫ g.val.base := rfl #align algebraic_geometry.Scheme.comp_val_base AlgebraicGeometry.Scheme.comp_val_base theorem comp_val_base_apply {X Y Z : Scheme} (f : X ⟢ Y) (g : Y ⟢ Z) (x : X) : (f ≫ g).val.base x = g.val.base (f.val.base x) := by simp #align algebraic_geometry.Scheme.comp_val_base_apply AlgebraicGeometry.Scheme.comp_val_base_apply @[simp, reassoc] -- reassoc lemma does not need `simp` theorem comp_val_c_app {X Y Z : Scheme} (f : X ⟢ Y) (g : Y ⟢ Z) (U) : (f ≫ g).val.c.app U = g.val.c.app U ≫ f.val.c.app _ := rfl #align algebraic_geometry.Scheme.comp_val_c_app AlgebraicGeometry.Scheme.comp_val_c_app
Mathlib/AlgebraicGeometry/Scheme.lean
155
157
theorem congr_app {X Y : Scheme} {f g : X ⟢ Y} (e : f = g) (U) : f.val.c.app U = g.val.c.app U ≫ X.presheaf.map (eqToHom (by subst e; rfl)) := by
subst e; dsimp; simp
[ " U = U", " { unop := U } = { unop := U }", " { unop := { carrier := carrier✝, is_open' := is_open'✝ } } =\n { unop := { carrier := carrier✝, is_open' := is_open'✝ } }", " (f ≫ g).val.base x = g.val.base (f.val.base x)", " (Opens.map g.val.base).op.obj U = (Opens.map f.val.base).op.obj U", " (Opens.map...
[ " U = U", " { unop := U } = { unop := U }", " { unop := { carrier := carrier✝, is_open' := is_open'✝ } } =\n { unop := { carrier := carrier✝, is_open' := is_open'✝ } }", " (f ≫ g).val.base x = g.val.base (f.val.base x)" ]
import Mathlib.Algebra.Homology.Single #align_import algebra.homology.augment from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open CategoryTheory Limits HomologicalComplex universe v u variable {V : Type u} [Category.{v} V] namespace ChainComplex @[simps] def truncate [HasZeroMorphisms V] : ChainComplex V β„• β₯€ ChainComplex V β„• where obj C := { X := fun i => C.X (i + 1) d := fun i j => C.d (i + 1) (j + 1) shape := fun i j w => C.shape _ _ <| by simpa } map f := { f := fun i => f.f (i + 1) } #align chain_complex.truncate ChainComplex.truncate def truncateTo [HasZeroObject V] [HasZeroMorphisms V] (C : ChainComplex V β„•) : truncate.obj C ⟢ (singleβ‚€ V).obj (C.X 0) := (toSingleβ‚€Equiv (truncate.obj C) (C.X 0)).symm ⟨C.d 1 0, by aesop⟩ #align chain_complex.truncate_to ChainComplex.truncateTo -- PROJECT when `V` is abelian (but not generally?) -- `[βˆ€ n, Exact (C.d (n+2) (n+1)) (C.d (n+1) n)] [Epi (C.d 1 0)]` iff `QuasiIso (C.truncate_to)` variable [HasZeroMorphisms V] def augment (C : ChainComplex V β„•) {X : V} (f : C.X 0 ⟢ X) (w : C.d 1 0 ≫ f = 0) : ChainComplex V β„• where X | 0 => X | i + 1 => C.X i d | 1, 0 => f | i + 1, j + 1 => C.d i j | _, _ => 0 shape | 1, 0, h => absurd rfl h | i + 2, 0, _ => rfl | 0, _, _ => rfl | i + 1, j + 1, h => by simp only; exact C.shape i j (Nat.succ_ne_succ.1 h) d_comp_d' | _, _, 0, rfl, rfl => w | _, _, k + 1, rfl, rfl => C.d_comp_d _ _ _ #align chain_complex.augment ChainComplex.augment @[simp] theorem augment_X_zero (C : ChainComplex V β„•) {X : V} (f : C.X 0 ⟢ X) (w : C.d 1 0 ≫ f = 0) : (augment C f w).X 0 = X := rfl set_option linter.uppercaseLean3 false in #align chain_complex.augment_X_zero ChainComplex.augment_X_zero @[simp] theorem augment_X_succ (C : ChainComplex V β„•) {X : V} (f : C.X 0 ⟢ X) (w : C.d 1 0 ≫ f = 0) (i : β„•) : (augment C f w).X (i + 1) = C.X i := rfl set_option linter.uppercaseLean3 false in #align chain_complex.augment_X_succ ChainComplex.augment_X_succ @[simp] theorem augment_d_one_zero (C : ChainComplex V β„•) {X : V} (f : C.X 0 ⟢ X) (w : C.d 1 0 ≫ f = 0) : (augment C f w).d 1 0 = f := rfl #align chain_complex.augment_d_one_zero ChainComplex.augment_d_one_zero @[simp]
Mathlib/Algebra/Homology/Augment.lean
92
94
theorem augment_d_succ_succ (C : ChainComplex V β„•) {X : V} (f : C.X 0 ⟢ X) (w : C.d 1 0 ≫ f = 0) (i j : β„•) : (augment C f w).d (i + 1) (j + 1) = C.d i j := by
cases i <;> rfl
[ " Β¬(ComplexShape.down β„•).Rel (i + 1) (j + 1)", " (truncate.obj C).d 1 0 ≫ C.d 1 0 = 0", " (fun x x_1 =>\n match x, x_1 with\n | 1, 0 => f\n | i.succ, j.succ => C.d i j\n | x, x_2 => 0)\n (i + 1) (j + 1) =\n 0", " C.d i j = 0", " (C.augment f w).d (i + 1) (j + 1) = C.d i j...
[ " Β¬(ComplexShape.down β„•).Rel (i + 1) (j + 1)", " (truncate.obj C).d 1 0 ≫ C.d 1 0 = 0", " (fun x x_1 =>\n match x, x_1 with\n | 1, 0 => f\n | i.succ, j.succ => C.d i j\n | x, x_2 => 0)\n (i + 1) (j + 1) =\n 0", " C.d i j = 0" ]
import Mathlib.Data.Int.GCD import Mathlib.Tactic.NormNum namespace Tactic namespace NormNum
Mathlib/Tactic/NormNum/GCD.lean
22
28
theorem int_gcd_helper' {d : β„•} {x y : β„€} (a b : β„€) (h₁ : (d : β„€) ∣ x) (hβ‚‚ : (d : β„€) ∣ y) (h₃ : x * a + y * b = d) : Int.gcd x y = d := by
refine Nat.dvd_antisymm ?_ (Int.natCast_dvd_natCast.1 (Int.dvd_gcd h₁ hβ‚‚)) rw [← Int.natCast_dvd_natCast, ← h₃] apply dvd_add Β· exact Int.gcd_dvd_left.mul_right _ Β· exact Int.gcd_dvd_right.mul_right _
[ " x.gcd y = d", " x.gcd y ∣ d", " ↑(x.gcd y) ∣ x * a + y * b", " ↑(x.gcd y) ∣ x * a", " ↑(x.gcd y) ∣ y * b" ]
[]
import Mathlib.Algebra.EuclideanDomain.Instances import Mathlib.RingTheory.Ideal.Colon import Mathlib.RingTheory.UniqueFactorizationDomain #align_import ring_theory.principal_ideal_domain from "leanprover-community/mathlib"@"6010cf523816335f7bae7f8584cb2edaace73940" universe u v variable {R : Type u} {M : Type v} open Set Function open Submodule section variable [Ring R] [AddCommGroup M] [Module R M] instance bot_isPrincipal : (βŠ₯ : Submodule R M).IsPrincipal := ⟨⟨0, by simp⟩⟩ #align bot_is_principal bot_isPrincipal instance top_isPrincipal : (⊀ : Submodule R R).IsPrincipal := ⟨⟨1, Ideal.span_singleton_one.symm⟩⟩ #align top_is_principal top_isPrincipal variable (R) class IsBezout : Prop where isPrincipal_of_FG : βˆ€ I : Ideal R, I.FG β†’ I.IsPrincipal #align is_bezout IsBezout instance (priority := 100) IsBezout.of_isPrincipalIdealRing [IsPrincipalIdealRing R] : IsBezout R := ⟨fun I _ => IsPrincipalIdealRing.principal I⟩ #align is_bezout.of_is_principal_ideal_ring IsBezout.of_isPrincipalIdealRing instance (priority := 100) DivisionRing.isPrincipalIdealRing (K : Type u) [DivisionRing K] : IsPrincipalIdealRing K where principal S := by rcases Ideal.eq_bot_or_top S with (rfl | rfl) Β· apply bot_isPrincipal Β· apply top_isPrincipal #align division_ring.is_principal_ideal_ring DivisionRing.isPrincipalIdealRing end namespace Submodule.IsPrincipal variable [AddCommGroup M] section Ring variable [Ring R] [Module R M] noncomputable def generator (S : Submodule R M) [S.IsPrincipal] : M := Classical.choose (principal S) #align submodule.is_principal.generator Submodule.IsPrincipal.generator theorem span_singleton_generator (S : Submodule R M) [S.IsPrincipal] : span R {generator S} = S := Eq.symm (Classical.choose_spec (principal S)) #align submodule.is_principal.span_singleton_generator Submodule.IsPrincipal.span_singleton_generator @[simp] theorem _root_.Ideal.span_singleton_generator (I : Ideal R) [I.IsPrincipal] : Ideal.span ({generator I} : Set R) = I := Eq.symm (Classical.choose_spec (principal I)) #align ideal.span_singleton_generator Ideal.span_singleton_generator @[simp] theorem generator_mem (S : Submodule R M) [S.IsPrincipal] : generator S ∈ S := by conv_rhs => rw [← span_singleton_generator S] exact subset_span (mem_singleton _) #align submodule.is_principal.generator_mem Submodule.IsPrincipal.generator_mem
Mathlib/RingTheory/PrincipalIdealDomain.lean
109
111
theorem mem_iff_eq_smul_generator (S : Submodule R M) [S.IsPrincipal] {x : M} : x ∈ S ↔ βˆƒ s : R, x = s β€’ generator S := by
simp_rw [@eq_comm _ x, ← mem_span_singleton, span_singleton_generator]
[ " βŠ₯ = span R {0}", " IsPrincipal S", " IsPrincipal βŠ₯", " IsPrincipal ⊀", " generator S ∈ S", "R : Type u\nM : Type v\ninst✝³ : AddCommGroup M\ninst✝² : Ring R\ninst✝¹ : Module R M\nS : Submodule R M\ninst✝ : S.IsPrincipal\n| S", " generator S ∈ span R {generator S}", " x ∈ S ↔ βˆƒ s, x = s β€’ generator S...
[ " βŠ₯ = span R {0}", " IsPrincipal S", " IsPrincipal βŠ₯", " IsPrincipal ⊀", " generator S ∈ S", "R : Type u\nM : Type v\ninst✝³ : AddCommGroup M\ninst✝² : Ring R\ninst✝¹ : Module R M\nS : Submodule R M\ninst✝ : S.IsPrincipal\n| S", " generator S ∈ span R {generator S}" ]
import Mathlib.Probability.Kernel.Composition #align_import probability.kernel.invariance from "leanprover-community/mathlib"@"3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b" open MeasureTheory open scoped MeasureTheory ENNReal ProbabilityTheory namespace ProbabilityTheory variable {Ξ± Ξ² Ξ³ : Type*} {mΞ± : MeasurableSpace Ξ±} {mΞ² : MeasurableSpace Ξ²} {mΞ³ : MeasurableSpace Ξ³} namespace kernel @[simp] theorem bind_add (ΞΌ Ξ½ : Measure Ξ±) (ΞΊ : kernel Ξ± Ξ²) : (ΞΌ + Ξ½).bind ΞΊ = ΞΌ.bind ΞΊ + Ξ½.bind ΞΊ := by ext1 s hs rw [Measure.bind_apply hs (kernel.measurable _), lintegral_add_measure, Measure.coe_add, Pi.add_apply, Measure.bind_apply hs (kernel.measurable _), Measure.bind_apply hs (kernel.measurable _)] #align probability_theory.kernel.bind_add ProbabilityTheory.kernel.bind_add @[simp] theorem bind_smul (ΞΊ : kernel Ξ± Ξ²) (ΞΌ : Measure Ξ±) (r : ℝβ‰₯0∞) : (r β€’ ΞΌ).bind ΞΊ = r β€’ ΞΌ.bind ΞΊ := by ext1 s hs rw [Measure.bind_apply hs (kernel.measurable _), lintegral_smul_measure, Measure.coe_smul, Pi.smul_apply, Measure.bind_apply hs (kernel.measurable _), smul_eq_mul] #align probability_theory.kernel.bind_smul ProbabilityTheory.kernel.bind_smul
Mathlib/Probability/Kernel/Invariance.lean
57
60
theorem const_bind_eq_comp_const (ΞΊ : kernel Ξ± Ξ²) (ΞΌ : Measure Ξ±) : const Ξ± (ΞΌ.bind ΞΊ) = ΞΊ βˆ˜β‚– const Ξ± ΞΌ := by
ext a s hs simp_rw [comp_apply' _ _ _ hs, const_apply, Measure.bind_apply hs (kernel.measurable _)]
[ " (ΞΌ + Ξ½).bind ⇑κ = ΞΌ.bind ⇑κ + Ξ½.bind ⇑κ", " ((ΞΌ + Ξ½).bind ⇑κ) s = (ΞΌ.bind ⇑κ + Ξ½.bind ⇑κ) s", " (r β€’ ΞΌ).bind ⇑κ = r β€’ ΞΌ.bind ⇑κ", " ((r β€’ ΞΌ).bind ⇑κ) s = (r β€’ ΞΌ.bind ⇑κ) s", " const Ξ± (ΞΌ.bind ⇑κ) = ΞΊ βˆ˜β‚– const Ξ± ΞΌ", " ((const Ξ± (ΞΌ.bind ⇑κ)) a) s = ((ΞΊ βˆ˜β‚– const Ξ± ΞΌ) a) s" ]
[ " (ΞΌ + Ξ½).bind ⇑κ = ΞΌ.bind ⇑κ + Ξ½.bind ⇑κ", " ((ΞΌ + Ξ½).bind ⇑κ) s = (ΞΌ.bind ⇑κ + Ξ½.bind ⇑κ) s", " (r β€’ ΞΌ).bind ⇑κ = r β€’ ΞΌ.bind ⇑κ", " ((r β€’ ΞΌ).bind ⇑κ) s = (r β€’ ΞΌ.bind ⇑κ) s" ]
import Mathlib.MeasureTheory.Measure.Haar.Basic import Mathlib.Analysis.InnerProductSpace.PiL2 #align_import measure_theory.measure.haar.of_basis from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d" open Set TopologicalSpace MeasureTheory MeasureTheory.Measure FiniteDimensional open scoped Pointwise noncomputable section variable {ΞΉ ΞΉ' E F : Type*} section Fintype variable [Fintype ΞΉ] [Fintype ΞΉ'] section AddCommGroup variable [AddCommGroup E] [Module ℝ E] [AddCommGroup F] [Module ℝ F] def parallelepiped (v : ΞΉ β†’ E) : Set E := (fun t : ΞΉ β†’ ℝ => βˆ‘ i, t i β€’ v i) '' Icc 0 1 #align parallelepiped parallelepiped theorem mem_parallelepiped_iff (v : ΞΉ β†’ E) (x : E) : x ∈ parallelepiped v ↔ βˆƒ t ∈ Icc (0 : ΞΉ β†’ ℝ) 1, x = βˆ‘ i, t i β€’ v i := by simp [parallelepiped, eq_comm] #align mem_parallelepiped_iff mem_parallelepiped_iff
Mathlib/MeasureTheory/Measure/Haar/OfBasis.lean
57
65
theorem parallelepiped_basis_eq (b : Basis ΞΉ ℝ E) : parallelepiped b = {x | βˆ€ i, b.repr x i ∈ Set.Icc 0 1} := by
classical ext x simp_rw [mem_parallelepiped_iff, mem_setOf_eq, b.ext_elem_iff, _root_.map_sum, _root_.map_smul, Finset.sum_apply', Basis.repr_self, Finsupp.smul_single, smul_eq_mul, mul_one, Finsupp.single_apply, Finset.sum_ite_eq', Finset.mem_univ, ite_true, mem_Icc, Pi.le_def, Pi.zero_apply, Pi.one_apply, ← forall_and] aesop
[ " x ∈ parallelepiped v ↔ βˆƒ t ∈ Icc 0 1, x = βˆ‘ i : ΞΉ, t i β€’ v i", " parallelepiped ⇑b = {x | βˆ€ (i : ΞΉ), (b.repr x) i ∈ Icc 0 1}", " x ∈ parallelepiped ⇑b ↔ x ∈ {x | βˆ€ (i : ΞΉ), (b.repr x) i ∈ Icc 0 1}", " (βˆƒ t, βˆ€ (x_1 : ΞΉ), (0 ≀ t x_1 ∧ t x_1 ≀ 1) ∧ (b.repr x) x_1 = t x_1) ↔ βˆ€ (i : ΞΉ), 0 ≀ (b.repr x) i ∧ (b.rep...
[ " x ∈ parallelepiped v ↔ βˆƒ t ∈ Icc 0 1, x = βˆ‘ i : ΞΉ, t i β€’ v i" ]
import Mathlib.Algebra.BigOperators.Group.Finset import Mathlib.Data.Fintype.Card #align_import data.multiset.fintype from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d" variable {Ξ± : Type*} [DecidableEq Ξ±] {m : Multiset Ξ±} def Multiset.ToType (m : Multiset Ξ±) : Type _ := (x : Ξ±) Γ— Fin (m.count x) #align multiset.to_type Multiset.ToType instance : CoeSort (Multiset Ξ±) (Type _) := ⟨Multiset.ToType⟩ example : DecidableEq m := inferInstanceAs <| DecidableEq ((x : Ξ±) Γ— Fin (m.count x)) -- Porting note: syntactic equality #noalign multiset.coe_sort_eq @[reducible, match_pattern] def Multiset.mkToType (m : Multiset Ξ±) (x : Ξ±) (i : Fin (m.count x)) : m := ⟨x, i⟩ #align multiset.mk_to_type Multiset.mkToType instance instCoeSortMultisetType.instCoeOutToType : CoeOut m Ξ± := ⟨fun x ↦ x.1⟩ #align multiset.has_coe_to_sort.has_coe instCoeSortMultisetType.instCoeOutToTypeβ‚“ -- Porting note: syntactic equality #noalign multiset.fst_coe_eq_coe -- Syntactic equality #noalign multiset.coe_eq -- @[simp] -- Porting note (#10685): dsimp can prove this theorem Multiset.coe_mk {x : Ξ±} {i : Fin (m.count x)} : ↑(m.mkToType x i) = x := rfl #align multiset.coe_mk Multiset.coe_mk @[simp] lemma Multiset.coe_mem {x : m} : ↑x ∈ m := Multiset.count_pos.mp (by have := x.2.2; omega) #align multiset.coe_mem Multiset.coe_mem @[simp] protected theorem Multiset.forall_coe (p : m β†’ Prop) : (βˆ€ x : m, p x) ↔ βˆ€ (x : Ξ±) (i : Fin (m.count x)), p ⟨x, i⟩ := Sigma.forall #align multiset.forall_coe Multiset.forall_coe @[simp] protected theorem Multiset.exists_coe (p : m β†’ Prop) : (βˆƒ x : m, p x) ↔ βˆƒ (x : Ξ±) (i : Fin (m.count x)), p ⟨x, i⟩ := Sigma.exists #align multiset.exists_coe Multiset.exists_coe instance : Fintype { p : Ξ± Γ— β„• | p.2 < m.count p.1 } := Fintype.ofFinset (m.toFinset.biUnion fun x ↦ (Finset.range (m.count x)).map ⟨Prod.mk x, Prod.mk.inj_left x⟩) (by rintro ⟨x, i⟩ simp only [Finset.mem_biUnion, Multiset.mem_toFinset, Finset.mem_map, Finset.mem_range, Function.Embedding.coeFn_mk, Prod.mk.inj_iff, Set.mem_setOf_eq] simp only [← and_assoc, exists_eq_right, and_iff_right_iff_imp] exact fun h ↦ Multiset.count_pos.mp (by omega)) def Multiset.toEnumFinset (m : Multiset Ξ±) : Finset (Ξ± Γ— β„•) := { p : Ξ± Γ— β„• | p.2 < m.count p.1 }.toFinset #align multiset.to_enum_finset Multiset.toEnumFinset @[simp] theorem Multiset.mem_toEnumFinset (m : Multiset Ξ±) (p : Ξ± Γ— β„•) : p ∈ m.toEnumFinset ↔ p.2 < m.count p.1 := Set.mem_toFinset #align multiset.mem_to_enum_finset Multiset.mem_toEnumFinset theorem Multiset.mem_of_mem_toEnumFinset {p : Ξ± Γ— β„•} (h : p ∈ m.toEnumFinset) : p.1 ∈ m := have := (m.mem_toEnumFinset p).mp h; Multiset.count_pos.mp (by omega) #align multiset.mem_of_mem_to_enum_finset Multiset.mem_of_mem_toEnumFinset @[mono]
Mathlib/Data/Multiset/Fintype.lean
122
126
theorem Multiset.toEnumFinset_mono {m₁ mβ‚‚ : Multiset Ξ±} (h : m₁ ≀ mβ‚‚) : m₁.toEnumFinset βŠ† mβ‚‚.toEnumFinset := by
intro p simp only [Multiset.mem_toEnumFinset] exact gt_of_ge_of_gt (Multiset.le_iff_count.mp h p.1)
[ " 0 < count x.fst m", " βˆ€ (x : Ξ± Γ— β„•),\n (x ∈ m.toFinset.biUnion fun x => Finset.map { toFun := Prod.mk x, inj' := β‹― } (Finset.range (Multiset.count x m))) ↔\n x ∈ {p | p.2 < Multiset.count p.1 m}", " ((x, i) ∈\n m.toFinset.biUnion fun x => Finset.map { toFun := Prod.mk x, inj' := β‹― } (Finset.range...
[ " 0 < count x.fst m", " βˆ€ (x : Ξ± Γ— β„•),\n (x ∈ m.toFinset.biUnion fun x => Finset.map { toFun := Prod.mk x, inj' := β‹― } (Finset.range (Multiset.count x m))) ↔\n x ∈ {p | p.2 < Multiset.count p.1 m}", " ((x, i) ∈\n m.toFinset.biUnion fun x => Finset.map { toFun := Prod.mk x, inj' := β‹― } (Finset.range...
import Mathlib.Algebra.MvPolynomial.Supported import Mathlib.RingTheory.WittVector.Truncated #align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section namespace WittVector variable (p : β„•) [hp : Fact p.Prime] variable {k : Type*} [CommRing k] local notation "π•Ž" => WittVector p -- Porting note: new notation local notation "𝕄" => MvPolynomial (Fin 2 Γ— β„•) β„€ open Finset MvPolynomial def wittPolyProd (n : β„•) : 𝕄 := rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ n) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ n) #align witt_vector.witt_poly_prod WittVector.wittPolyProd theorem wittPolyProd_vars (n : β„•) : (wittPolyProd p n).vars βŠ† univ Γ—Λ’ range (n + 1) := by rw [wittPolyProd] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> Β· refine Subset.trans (vars_rename _ _) ?_ simp [wittPolynomial_vars, image_subset_iff] #align witt_vector.witt_poly_prod_vars WittVector.wittPolyProd_vars def wittPolyProdRemainder (n : β„•) : 𝕄 := βˆ‘ i ∈ range n, (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) #align witt_vector.witt_poly_prod_remainder WittVector.wittPolyProdRemainder theorem wittPolyProdRemainder_vars (n : β„•) : (wittPolyProdRemainder p n).vars βŠ† univ Γ—Λ’ range n := by rw [wittPolyProdRemainder] refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ Β· apply Subset.trans (vars_pow _ _) have : (p : 𝕄) = C (p : β„€) := by simp only [Int.cast_natCast, eq_intCast] rw [this, vars_C] apply empty_subset Β· apply Subset.trans (vars_pow _ _) apply Subset.trans (wittMul_vars _ _) apply product_subset_product (Subset.refl _) simp only [mem_range, range_subset] at hx ⊒ exact hx #align witt_vector.witt_poly_prod_remainder_vars WittVector.wittPolyProdRemainder_vars def remainder (n : β„•) : 𝕄 := (βˆ‘ x ∈ range (n + 1), (rename (Prod.mk 0)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : β„€) ^ x))) * βˆ‘ x ∈ range (n + 1), (rename (Prod.mk 1)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : β„€) ^ x)) #align witt_vector.remainder WittVector.remainder theorem remainder_vars (n : β„•) : (remainder p n).vars βŠ† univ Γ—Λ’ range (n + 1) := by rw [remainder] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> Β· refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx rw [rename_monomial, vars_monomial, Finsupp.mapDomain_single] Β· apply Subset.trans Finsupp.support_single_subset simpa using mem_range.mp hx Β· apply pow_ne_zero exact mod_cast hp.out.ne_zero #align witt_vector.remainder_vars WittVector.remainder_vars def polyOfInterest (n : β„•) : 𝕄 := wittMul p (n + 1) + (p : 𝕄) ^ (n + 1) * X (0, n + 1) * X (1, n + 1) - X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ (n + 1)) - X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ (n + 1)) #align witt_vector.poly_of_interest WittVector.polyOfInterest theorem mul_polyOfInterest_aux1 (n : β„•) : βˆ‘ i ∈ range (n + 1), (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) = wittPolyProd p n := by simp only [wittPolyProd] convert wittStructureInt_prop p (X (0 : Fin 2) * X 1) n using 1 Β· simp only [wittPolynomial, wittMul] rw [AlgHom.map_sum] congr 1 with i congr 1 have hsupp : (Finsupp.single i (p ^ (n - i))).support = {i} := by rw [Finsupp.support_eq_singleton] simp only [and_true_iff, Finsupp.single_eq_same, eq_self_iff_true, Ne] exact pow_ne_zero _ hp.out.ne_zero simp only [bind₁_monomial, hsupp, Int.cast_natCast, prod_singleton, eq_intCast, Finsupp.single_eq_same, C_pow, mul_eq_mul_left_iff, true_or_iff, eq_self_iff_true, Int.cast_pow] Β· simp only [map_mul, bind₁_X_right] #align witt_vector.mul_poly_of_interest_aux1 WittVector.mul_polyOfInterest_aux1 theorem mul_polyOfInterest_aux2 (n : β„•) : (p : 𝕄) ^ n * wittMul p n + wittPolyProdRemainder p n = wittPolyProd p n := by convert mul_polyOfInterest_aux1 p n rw [sum_range_succ, add_comm, Nat.sub_self, pow_zero, pow_one] rfl #align witt_vector.mul_poly_of_interest_aux2 WittVector.mul_polyOfInterest_aux2
Mathlib/RingTheory/WittVector/MulCoeff.lean
145
176
theorem mul_polyOfInterest_aux3 (n : β„•) : wittPolyProd p (n + 1) = -((p : 𝕄) ^ (n + 1) * X (0, n + 1)) * ((p : 𝕄) ^ (n + 1) * X (1, n + 1)) + (p : 𝕄) ^ (n + 1) * X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ (n + 1)) + (p : 𝕄) ^ (n + 1) * X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ (n + 1)) + remainder p n := by
-- a useful auxiliary fact have mvpz : (p : 𝕄) ^ (n + 1) = MvPolynomial.C ((p : β„€) ^ (n + 1)) := by norm_cast -- Porting note: the original proof applies `sum_range_succ` through a non-`conv` rewrite, -- but this does not work in Lean 4; the whole proof also times out very badly. The proof has been -- nearly totally rewritten here and now finishes quite fast. rw [wittPolyProd, wittPolynomial, AlgHom.map_sum, AlgHom.map_sum] conv_lhs => arg 1 rw [sum_range_succ, ← C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul, rename_C, rename_X, ← mvpz] conv_lhs => arg 2 rw [sum_range_succ, ← C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul, rename_C, rename_X, ← mvpz] conv_rhs => enter [1, 1, 2, 2] rw [sum_range_succ, ← C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul, rename_C, rename_X, ← mvpz] conv_rhs => enter [1, 2, 2] rw [sum_range_succ, ← C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul, rename_C, rename_X, ← mvpz] simp only [add_mul, mul_add] rw [add_comm _ (remainder p n)] simp only [add_assoc] apply congrArg (Add.add _) ring
[ " (wittPolyProd p n).vars βŠ† univ Γ—Λ’ range (n + 1)", " ((rename (Prod.mk 0)) (wittPolynomial p β„€ n) * (rename (Prod.mk 1)) (wittPolynomial p β„€ n)).vars βŠ†\n univ Γ—Λ’ range (n + 1)", " ((rename (Prod.mk 0)) (wittPolynomial p β„€ n)).vars βˆͺ ((rename (Prod.mk 1)) (wittPolynomial p β„€ n)).vars βŠ†\n univ Γ—Λ’ range (n ...
[ " (wittPolyProd p n).vars βŠ† univ Γ—Λ’ range (n + 1)", " ((rename (Prod.mk 0)) (wittPolynomial p β„€ n) * (rename (Prod.mk 1)) (wittPolynomial p β„€ n)).vars βŠ†\n univ Γ—Λ’ range (n + 1)", " ((rename (Prod.mk 0)) (wittPolynomial p β„€ n)).vars βˆͺ ((rename (Prod.mk 1)) (wittPolynomial p β„€ n)).vars βŠ†\n univ Γ—Λ’ range (n ...
import Mathlib.Data.Set.Lattice import Mathlib.Data.Set.Pairwise.Basic #align_import data.set.pairwise.lattice from "leanprover-community/mathlib"@"c4c2ed622f43768eff32608d4a0f8a6cec1c047d" open Function Set Order variable {Ξ± Ξ² Ξ³ ΞΉ ΞΉ' : Type*} {ΞΊ : Sort*} {r p q : Ξ± β†’ Ξ± β†’ Prop} section Pairwise variable {f g : ΞΉ β†’ Ξ±} {s t u : Set Ξ±} {a b : Ξ±} namespace Set section CompleteLattice variable [CompleteLattice Ξ±] {s : Set ΞΉ} {t : Set ΞΉ'} theorem PairwiseDisjoint.biUnion {s : Set ΞΉ'} {g : ΞΉ' β†’ Set ΞΉ} {f : ΞΉ β†’ Ξ±} (hs : s.PairwiseDisjoint fun i' : ΞΉ' => ⨆ i ∈ g i', f i) (hg : βˆ€ i ∈ s, (g i).PairwiseDisjoint f) : (⋃ i ∈ s, g i).PairwiseDisjoint f := by rintro a ha b hb hab simp_rw [Set.mem_iUnion] at ha hb obtain ⟨c, hc, ha⟩ := ha obtain ⟨d, hd, hb⟩ := hb obtain hcd | hcd := eq_or_ne (g c) (g d) Β· exact hg d hd (hcd.subst ha) hb hab -- Porting note: the elaborator couldn't figure out `f` here. Β· exact (hs hc hd <| ne_of_apply_ne _ hcd).mono (le_iSupβ‚‚ (f := fun i (_ : i ∈ g c) => f i) a ha) (le_iSupβ‚‚ (f := fun i (_ : i ∈ g d) => f i) b hb) #align set.pairwise_disjoint.bUnion Set.PairwiseDisjoint.biUnion
Mathlib/Data/Set/Pairwise/Lattice.lean
89
101
theorem PairwiseDisjoint.prod_left {f : ΞΉ Γ— ΞΉ' β†’ Ξ±} (hs : s.PairwiseDisjoint fun i => ⨆ i' ∈ t, f (i, i')) (ht : t.PairwiseDisjoint fun i' => ⨆ i ∈ s, f (i, i')) : (s Γ—Λ’ t : Set (ΞΉ Γ— ΞΉ')).PairwiseDisjoint f := by
rintro ⟨i, i'⟩ hi ⟨j, j'⟩ hj h rw [mem_prod] at hi hj obtain rfl | hij := eq_or_ne i j Β· refine (ht hi.2 hj.2 <| (Prod.mk.inj_left _).ne_iff.1 h).mono ?_ ?_ Β· convert le_iSupβ‚‚ (Ξ± := Ξ±) i hi.1; rfl Β· convert le_iSupβ‚‚ (Ξ± := Ξ±) i hj.1; rfl Β· refine (hs hi.1 hj.1 hij).mono ?_ ?_ Β· convert le_iSupβ‚‚ (Ξ± := Ξ±) i' hi.2; rfl Β· convert le_iSupβ‚‚ (Ξ± := Ξ±) j' hj.2; rfl
[ " (⋃ i ∈ s, g i).PairwiseDisjoint f", " (Disjoint on f) a b", " (s Γ—Λ’ t).PairwiseDisjoint f", " (Disjoint on f) (i, i') (j, j')", " (Disjoint on f) (i, i') (i, j')", " f (i, i') ≀ (fun i' => ⨆ i ∈ s, f (i, i')) (i, i').2", " f (i, i') = f (i, (i, i').2)", " f (i, j') ≀ (fun i' => ⨆ i ∈ s, f (i, i')) (...
[ " (⋃ i ∈ s, g i).PairwiseDisjoint f", " (Disjoint on f) a b" ]
import Mathlib.Algebra.CharP.ExpChar import Mathlib.Algebra.GeomSum import Mathlib.Algebra.MvPolynomial.CommRing import Mathlib.Algebra.MvPolynomial.Equiv import Mathlib.RingTheory.Polynomial.Content import Mathlib.RingTheory.UniqueFactorizationDomain #align_import ring_theory.polynomial.basic from "leanprover-community/mathlib"@"da420a8c6dd5bdfb85c4ced85c34388f633bc6ff" noncomputable section open Polynomial open Finset universe u v w variable {R : Type u} {S : Type*} namespace Polynomial section Semiring variable [Semiring R] instance instCharP (p : β„•) [h : CharP R p] : CharP R[X] p := let ⟨h⟩ := h ⟨fun n => by rw [← map_natCast C, ← C_0, C_inj, h]⟩ instance instExpChar (p : β„•) [h : ExpChar R p] : ExpChar R[X] p := by cases h; exacts [ExpChar.zero, ExpChar.prime β€Ή_β€Ί] variable (R) def degreeLE (n : WithBot β„•) : Submodule R R[X] := β¨… k : β„•, β¨… _ : ↑k > n, LinearMap.ker (lcoeff R k) #align polynomial.degree_le Polynomial.degreeLE def degreeLT (n : β„•) : Submodule R R[X] := β¨… k : β„•, β¨… (_ : k β‰₯ n), LinearMap.ker (lcoeff R k) #align polynomial.degree_lt Polynomial.degreeLT variable {R} theorem mem_degreeLE {n : WithBot β„•} {f : R[X]} : f ∈ degreeLE R n ↔ degree f ≀ n := by simp only [degreeLE, Submodule.mem_iInf, degree_le_iff_coeff_zero, LinearMap.mem_ker]; rfl #align polynomial.mem_degree_le Polynomial.mem_degreeLE @[mono] theorem degreeLE_mono {m n : WithBot β„•} (H : m ≀ n) : degreeLE R m ≀ degreeLE R n := fun _ hf => mem_degreeLE.2 (le_trans (mem_degreeLE.1 hf) H) #align polynomial.degree_le_mono Polynomial.degreeLE_mono theorem degreeLE_eq_span_X_pow [DecidableEq R] {n : β„•} : degreeLE R n = Submodule.span R ↑((Finset.range (n + 1)).image fun n => (X : R[X]) ^ n) := by apply le_antisymm Β· intro p hp replace hp := mem_degreeLE.1 hp rw [← Polynomial.sum_monomial_eq p, Polynomial.sum] refine Submodule.sum_mem _ fun k hk => ?_ have := WithBot.coe_le_coe.1 (Finset.sup_le_iff.1 hp k hk) rw [← C_mul_X_pow_eq_monomial, C_mul'] refine Submodule.smul_mem _ _ (Submodule.subset_span <| Finset.mem_coe.2 <| Finset.mem_image.2 ⟨_, Finset.mem_range.2 (Nat.lt_succ_of_le this), rfl⟩) rw [Submodule.span_le, Finset.coe_image, Set.image_subset_iff] intro k hk apply mem_degreeLE.2 exact (degree_X_pow_le _).trans (WithBot.coe_le_coe.2 <| Nat.le_of_lt_succ <| Finset.mem_range.1 hk) set_option linter.uppercaseLean3 false in #align polynomial.degree_le_eq_span_X_pow Polynomial.degreeLE_eq_span_X_pow theorem mem_degreeLT {n : β„•} {f : R[X]} : f ∈ degreeLT R n ↔ degree f < n := by rw [degreeLT, Submodule.mem_iInf] conv_lhs => intro i; rw [Submodule.mem_iInf] rw [degree, Finset.max_eq_sup_coe] rw [Finset.sup_lt_iff ?_] rotate_left Β· apply WithBot.bot_lt_coe conv_rhs => simp only [mem_support_iff] intro b rw [Nat.cast_withBot, WithBot.coe_lt_coe, lt_iff_not_le, Ne, not_imp_not] rfl #align polynomial.mem_degree_lt Polynomial.mem_degreeLT @[mono] theorem degreeLT_mono {m n : β„•} (H : m ≀ n) : degreeLT R m ≀ degreeLT R n := fun _ hf => mem_degreeLT.2 (lt_of_lt_of_le (mem_degreeLT.1 hf) <| WithBot.coe_le_coe.2 H) #align polynomial.degree_lt_mono Polynomial.degreeLT_mono
Mathlib/RingTheory/Polynomial/Basic.lean
117
133
theorem degreeLT_eq_span_X_pow [DecidableEq R] {n : β„•} : degreeLT R n = Submodule.span R ↑((Finset.range n).image fun n => X ^ n : Finset R[X]) := by
apply le_antisymm Β· intro p hp replace hp := mem_degreeLT.1 hp rw [← Polynomial.sum_monomial_eq p, Polynomial.sum] refine Submodule.sum_mem _ fun k hk => ?_ have := WithBot.coe_lt_coe.1 ((Finset.sup_lt_iff <| WithBot.bot_lt_coe n).1 hp k hk) rw [← C_mul_X_pow_eq_monomial, C_mul'] refine Submodule.smul_mem _ _ (Submodule.subset_span <| Finset.mem_coe.2 <| Finset.mem_image.2 ⟨_, Finset.mem_range.2 this, rfl⟩) rw [Submodule.span_le, Finset.coe_image, Set.image_subset_iff] intro k hk apply mem_degreeLT.2 exact lt_of_le_of_lt (degree_X_pow_le _) (WithBot.coe_lt_coe.2 <| Finset.mem_range.1 hk)
[ " ↑n = 0 ↔ p ∣ n", " ExpChar R[X] p", " f ∈ degreeLE R n ↔ f.degree ≀ n", " (βˆ€ (i : β„•), ↑i > n β†’ (lcoeff R i) f = 0) ↔ βˆ€ (m : β„•), n < ↑m β†’ f.coeff m = 0", " degreeLE R ↑n = Submodule.span R ↑(image (fun n => X ^ n) (range (n + 1)))", " degreeLE R ↑n ≀ Submodule.span R ↑(image (fun n => X ^ n) (range (n + ...
[ " ↑n = 0 ↔ p ∣ n", " ExpChar R[X] p", " f ∈ degreeLE R n ↔ f.degree ≀ n", " (βˆ€ (i : β„•), ↑i > n β†’ (lcoeff R i) f = 0) ↔ βˆ€ (m : β„•), n < ↑m β†’ f.coeff m = 0", " degreeLE R ↑n = Submodule.span R ↑(image (fun n => X ^ n) (range (n + 1)))", " degreeLE R ↑n ≀ Submodule.span R ↑(image (fun n => X ^ n) (range (n + ...
import Mathlib.Algebra.Group.Defs #align_import group_theory.eckmann_hilton from "leanprover-community/mathlib"@"41cf0cc2f528dd40a8f2db167ea4fb37b8fde7f3" universe u namespace EckmannHilton variable {X : Type u} local notation a " <" m:51 "> " b => m a b structure IsUnital (m : X β†’ X β†’ X) (e : X) extends Std.LawfulIdentity m e : Prop #align eckmann_hilton.is_unital EckmannHilton.IsUnital @[to_additive EckmannHilton.AddZeroClass.IsUnital] theorem MulOneClass.isUnital [_G : MulOneClass X] : IsUnital (Β· * Β·) (1 : X) := IsUnital.mk { left_id := MulOneClass.one_mul, right_id := MulOneClass.mul_one } #align eckmann_hilton.mul_one_class.is_unital EckmannHilton.MulOneClass.isUnital #align eckmann_hilton.add_zero_class.is_unital EckmannHilton.AddZeroClass.IsUnital variable {m₁ mβ‚‚ : X β†’ X β†’ X} {e₁ eβ‚‚ : X} variable (h₁ : IsUnital m₁ e₁) (hβ‚‚ : IsUnital mβ‚‚ eβ‚‚) variable (distrib : βˆ€ a b c d, ((a <mβ‚‚> b) <m₁> c <mβ‚‚> d) = (a <m₁> c) <mβ‚‚> b <m₁> d) theorem one : e₁ = eβ‚‚ := by simpa only [h₁.left_id, h₁.right_id, hβ‚‚.left_id, hβ‚‚.right_id] using distrib eβ‚‚ e₁ e₁ eβ‚‚ #align eckmann_hilton.one EckmannHilton.one
Mathlib/GroupTheory/EckmannHilton.lean
64
69
theorem mul : m₁ = mβ‚‚ := by
funext a b calc m₁ a b = m₁ (mβ‚‚ a e₁) (mβ‚‚ e₁ b) := by { simp only [one h₁ hβ‚‚ distrib, h₁.left_id, h₁.right_id, hβ‚‚.left_id, hβ‚‚.right_id] } _ = mβ‚‚ a b := by simp only [distrib, h₁.left_id, h₁.right_id, hβ‚‚.left_id, hβ‚‚.right_id]
[ " e₁ = eβ‚‚", " m₁ = mβ‚‚", " m₁ a b = mβ‚‚ a b", " m₁ a b = m₁ (mβ‚‚ a e₁) (mβ‚‚ e₁ b)", " m₁ (mβ‚‚ a e₁) (mβ‚‚ e₁ b) = mβ‚‚ a b" ]
[ " e₁ = eβ‚‚" ]
import Mathlib.Init.Function #align_import data.option.n_ary from "leanprover-community/mathlib"@"995b47e555f1b6297c7cf16855f1023e355219fb" universe u open Function namespace Option variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {f : Ξ± β†’ Ξ² β†’ Ξ³} {a : Option Ξ±} {b : Option Ξ²} {c : Option Ξ³} def mapβ‚‚ (f : Ξ± β†’ Ξ² β†’ Ξ³) (a : Option Ξ±) (b : Option Ξ²) : Option Ξ³ := a.bind fun a => b.map <| f a #align option.mapβ‚‚ Option.mapβ‚‚ theorem mapβ‚‚_def {Ξ± Ξ² Ξ³ : Type u} (f : Ξ± β†’ Ξ² β†’ Ξ³) (a : Option Ξ±) (b : Option Ξ²) : mapβ‚‚ f a b = f <$> a <*> b := by cases a <;> rfl #align option.mapβ‚‚_def Option.mapβ‚‚_def -- Porting note (#10618): In Lean3, was `@[simp]` but now `simp` can prove it theorem mapβ‚‚_some_some (f : Ξ± β†’ Ξ² β†’ Ξ³) (a : Ξ±) (b : Ξ²) : mapβ‚‚ f (some a) (some b) = f a b := rfl #align option.mapβ‚‚_some_some Option.mapβ‚‚_some_some theorem mapβ‚‚_coe_coe (f : Ξ± β†’ Ξ² β†’ Ξ³) (a : Ξ±) (b : Ξ²) : mapβ‚‚ f a b = f a b := rfl #align option.mapβ‚‚_coe_coe Option.mapβ‚‚_coe_coe @[simp] theorem mapβ‚‚_none_left (f : Ξ± β†’ Ξ² β†’ Ξ³) (b : Option Ξ²) : mapβ‚‚ f none b = none := rfl #align option.mapβ‚‚_none_left Option.mapβ‚‚_none_left @[simp] theorem mapβ‚‚_none_right (f : Ξ± β†’ Ξ² β†’ Ξ³) (a : Option Ξ±) : mapβ‚‚ f a none = none := by cases a <;> rfl #align option.mapβ‚‚_none_right Option.mapβ‚‚_none_right @[simp] theorem mapβ‚‚_coe_left (f : Ξ± β†’ Ξ² β†’ Ξ³) (a : Ξ±) (b : Option Ξ²) : mapβ‚‚ f a b = b.map fun b => f a b := rfl #align option.mapβ‚‚_coe_left Option.mapβ‚‚_coe_left -- Porting note: This proof was `rfl` in Lean3, but now is not. @[simp] theorem mapβ‚‚_coe_right (f : Ξ± β†’ Ξ² β†’ Ξ³) (a : Option Ξ±) (b : Ξ²) : mapβ‚‚ f a b = a.map fun a => f a b := by cases a <;> rfl #align option.mapβ‚‚_coe_right Option.mapβ‚‚_coe_right -- Porting note: Removed the `@[simp]` tag as membership of an `Option` is no-longer simp-normal. theorem mem_mapβ‚‚_iff {c : Ξ³} : c ∈ mapβ‚‚ f a b ↔ βˆƒ a' b', a' ∈ a ∧ b' ∈ b ∧ f a' b' = c := by simp [mapβ‚‚, bind_eq_some] #align option.mem_mapβ‚‚_iff Option.mem_mapβ‚‚_iff @[simp] theorem mapβ‚‚_eq_none_iff : mapβ‚‚ f a b = none ↔ a = none ∨ b = none := by cases a <;> cases b <;> simp #align option.mapβ‚‚_eq_none_iff Option.mapβ‚‚_eq_none_iff theorem mapβ‚‚_swap (f : Ξ± β†’ Ξ² β†’ Ξ³) (a : Option Ξ±) (b : Option Ξ²) : mapβ‚‚ f a b = mapβ‚‚ (fun a b => f b a) b a := by cases a <;> cases b <;> rfl #align option.mapβ‚‚_swap Option.mapβ‚‚_swap theorem map_mapβ‚‚ (f : Ξ± β†’ Ξ² β†’ Ξ³) (g : Ξ³ β†’ Ξ΄) : (mapβ‚‚ f a b).map g = mapβ‚‚ (fun a b => g (f a b)) a b := by cases a <;> cases b <;> rfl #align option.map_mapβ‚‚ Option.map_mapβ‚‚ theorem mapβ‚‚_map_left (f : Ξ³ β†’ Ξ² β†’ Ξ΄) (g : Ξ± β†’ Ξ³) : mapβ‚‚ f (a.map g) b = mapβ‚‚ (fun a b => f (g a) b) a b := by cases a <;> rfl #align option.mapβ‚‚_map_left Option.mapβ‚‚_map_left theorem mapβ‚‚_map_right (f : Ξ± β†’ Ξ³ β†’ Ξ΄) (g : Ξ² β†’ Ξ³) : mapβ‚‚ f a (b.map g) = mapβ‚‚ (fun a b => f a (g b)) a b := by cases b <;> rfl #align option.mapβ‚‚_map_right Option.mapβ‚‚_map_right @[simp] theorem mapβ‚‚_curry (f : Ξ± Γ— Ξ² β†’ Ξ³) (a : Option Ξ±) (b : Option Ξ²) : mapβ‚‚ (curry f) a b = Option.map f (mapβ‚‚ Prod.mk a b) := (map_mapβ‚‚ _ _).symm #align option.mapβ‚‚_curry Option.mapβ‚‚_curry @[simp]
Mathlib/Data/Option/NAry.lean
109
110
theorem map_uncurry (f : Ξ± β†’ Ξ² β†’ Ξ³) (x : Option (Ξ± Γ— Ξ²)) : x.map (uncurry f) = mapβ‚‚ f (x.map Prod.fst) (x.map Prod.snd) := by
cases x <;> rfl
[ " mapβ‚‚ f a b = Seq.seq (f <$> a) fun x => b", " mapβ‚‚ f none b = Seq.seq (f <$> none) fun x => b", " mapβ‚‚ f (some val✝) b = Seq.seq (f <$> some val✝) fun x => b", " mapβ‚‚ f a none = none", " mapβ‚‚ f none none = none", " mapβ‚‚ f (some val✝) none = none", " mapβ‚‚ f a (some b) = Option.map (fun a => f a b) a", ...
[ " mapβ‚‚ f a b = Seq.seq (f <$> a) fun x => b", " mapβ‚‚ f none b = Seq.seq (f <$> none) fun x => b", " mapβ‚‚ f (some val✝) b = Seq.seq (f <$> some val✝) fun x => b", " mapβ‚‚ f a none = none", " mapβ‚‚ f none none = none", " mapβ‚‚ f (some val✝) none = none", " mapβ‚‚ f a (some b) = Option.map (fun a => f a b) a", ...
import Mathlib.Analysis.SpecialFunctions.Complex.Log import Mathlib.RingTheory.RootsOfUnity.Basic #align_import ring_theory.roots_of_unity.complex from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f" namespace Complex open Polynomial Real open scoped Nat Real
Mathlib/RingTheory/RootsOfUnity/Complex.lean
33
50
theorem isPrimitiveRoot_exp_of_coprime (i n : β„•) (h0 : n β‰  0) (hi : i.Coprime n) : IsPrimitiveRoot (exp (2 * Ο€ * I * (i / n))) n := by
rw [IsPrimitiveRoot.iff_def] simp only [← exp_nat_mul, exp_eq_one_iff] have hn0 : (n : β„‚) β‰  0 := mod_cast h0 constructor Β· use i field_simp [hn0, mul_comm (i : β„‚), mul_comm (n : β„‚)] Β· simp only [hn0, mul_right_comm _ _ ↑n, mul_left_inj' two_pi_I_ne_zero, Ne, not_false_iff, mul_comm _ (i : β„‚), ← mul_assoc _ (i : β„‚), exists_imp, field_simps] norm_cast rintro l k hk conv_rhs at hk => rw [mul_comm, ← mul_assoc] have hz : 2 * ↑π * I β‰  0 := by simp [pi_pos.ne.symm, I_ne_zero] field_simp [hz] at hk norm_cast at hk have : n ∣ i * l := by rw [← Int.natCast_dvd_natCast, hk, mul_comm]; apply dvd_mul_left exact hi.symm.dvd_of_dvd_mul_left this
[ " IsPrimitiveRoot (cexp (2 * ↑π * I * (↑i / ↑n))) n", " cexp (2 * ↑π * I * (↑i / ↑n)) ^ n = 1 ∧ βˆ€ (l : β„•), cexp (2 * ↑π * I * (↑i / ↑n)) ^ l = 1 β†’ n ∣ l", " (βˆƒ n_1, ↑n * (2 * ↑π * I * (↑i / ↑n)) = ↑n_1 * (2 * ↑π * I)) ∧\n βˆ€ (l : β„•), (βˆƒ n_1, ↑l * (2 * ↑π * I * (↑i / ↑n)) = ↑n_1 * (2 * ↑π * I)) β†’ n ∣ l", " βˆƒ...
[]
import Mathlib.Topology.Order.LeftRightNhds open Set Filter TopologicalSpace Topology Function open OrderDual (toDual ofDual) variable {Ξ± Ξ² Ξ³ : Type*} section OrderTopology variable [TopologicalSpace Ξ±] [TopologicalSpace Ξ²] [LinearOrder Ξ±] [LinearOrder Ξ²] [OrderTopology Ξ±] [OrderTopology Ξ²] theorem IsLUB.frequently_mem {a : Ξ±} {s : Set Ξ±} (ha : IsLUB s a) (hs : s.Nonempty) : βˆƒαΆ  x in 𝓝[≀] a, x ∈ s := by rcases hs with ⟨a', ha'⟩ intro h rcases (ha.1 ha').eq_or_lt with (rfl | ha'a) Β· exact h.self_of_nhdsWithin le_rfl ha' Β· rcases (mem_nhdsWithin_Iic_iff_exists_Ioc_subset' ha'a).1 h with ⟨b, hba, hb⟩ rcases ha.exists_between hba with ⟨b', hb's, hb'⟩ exact hb hb' hb's #align is_lub.frequently_mem IsLUB.frequently_mem theorem IsLUB.frequently_nhds_mem {a : Ξ±} {s : Set Ξ±} (ha : IsLUB s a) (hs : s.Nonempty) : βˆƒαΆ  x in 𝓝 a, x ∈ s := (ha.frequently_mem hs).filter_mono inf_le_left #align is_lub.frequently_nhds_mem IsLUB.frequently_nhds_mem theorem IsGLB.frequently_mem {a : Ξ±} {s : Set Ξ±} (ha : IsGLB s a) (hs : s.Nonempty) : βˆƒαΆ  x in 𝓝[β‰₯] a, x ∈ s := IsLUB.frequently_mem (Ξ± := Ξ±α΅’α΅ˆ) ha hs #align is_glb.frequently_mem IsGLB.frequently_mem theorem IsGLB.frequently_nhds_mem {a : Ξ±} {s : Set Ξ±} (ha : IsGLB s a) (hs : s.Nonempty) : βˆƒαΆ  x in 𝓝 a, x ∈ s := (ha.frequently_mem hs).filter_mono inf_le_left #align is_glb.frequently_nhds_mem IsGLB.frequently_nhds_mem theorem IsLUB.mem_closure {a : Ξ±} {s : Set Ξ±} (ha : IsLUB s a) (hs : s.Nonempty) : a ∈ closure s := (ha.frequently_nhds_mem hs).mem_closure #align is_lub.mem_closure IsLUB.mem_closure theorem IsGLB.mem_closure {a : Ξ±} {s : Set Ξ±} (ha : IsGLB s a) (hs : s.Nonempty) : a ∈ closure s := (ha.frequently_nhds_mem hs).mem_closure #align is_glb.mem_closure IsGLB.mem_closure theorem IsLUB.nhdsWithin_neBot {a : Ξ±} {s : Set Ξ±} (ha : IsLUB s a) (hs : s.Nonempty) : NeBot (𝓝[s] a) := mem_closure_iff_nhdsWithin_neBot.1 (ha.mem_closure hs) #align is_lub.nhds_within_ne_bot IsLUB.nhdsWithin_neBot theorem IsGLB.nhdsWithin_neBot : βˆ€ {a : Ξ±} {s : Set Ξ±}, IsGLB s a β†’ s.Nonempty β†’ NeBot (𝓝[s] a) := IsLUB.nhdsWithin_neBot (Ξ± := Ξ±α΅’α΅ˆ) #align is_glb.nhds_within_ne_bot IsGLB.nhdsWithin_neBot theorem isLUB_of_mem_nhds {s : Set Ξ±} {a : Ξ±} {f : Filter Ξ±} (hsa : a ∈ upperBounds s) (hsf : s ∈ f) [NeBot (f βŠ“ 𝓝 a)] : IsLUB s a := ⟨hsa, fun b hb => not_lt.1 fun hba => have : s ∩ { a | b < a } ∈ f βŠ“ 𝓝 a := inter_mem_inf hsf (IsOpen.mem_nhds (isOpen_lt' _) hba) let ⟨_x, ⟨hxs, hxb⟩⟩ := Filter.nonempty_of_mem this have : b < b := lt_of_lt_of_le hxb <| hb hxs lt_irrefl b this⟩ #align is_lub_of_mem_nhds isLUB_of_mem_nhds
Mathlib/Topology/Order/IsLUB.lean
77
80
theorem isLUB_of_mem_closure {s : Set α} {a : α} (hsa : a ∈ upperBounds s) (hsf : a ∈ closure s) : IsLUB s a := by
rw [mem_closure_iff_clusterPt, ClusterPt, inf_comm] at hsf exact isLUB_of_mem_nhds hsa (mem_principal_self s)
[ " βˆƒαΆ  (x : Ξ±) in 𝓝[≀] a, x ∈ s", " False", " IsLUB s a" ]
[ " βˆƒαΆ  (x : Ξ±) in 𝓝[≀] a, x ∈ s", " False" ]
import Mathlib.Algebra.Homology.ShortComplex.ModuleCat import Mathlib.RepresentationTheory.GroupCohomology.Basic import Mathlib.RepresentationTheory.Invariants universe v u noncomputable section open CategoryTheory Limits Representation variable {k G : Type u} [CommRing k] [Group G] (A : Rep k G) namespace groupCohomology section IsCocycle section variable {G A : Type*} [Mul G] [AddCommGroup A] [SMul G A] def IsOneCocycle (f : G β†’ A) : Prop := βˆ€ g h : G, f (g * h) = g β€’ f h + f g def IsTwoCocycle (f : G Γ— G β†’ A) : Prop := βˆ€ g h j : G, f (g * h, j) + f (g, h) = g β€’ (f (h, j)) + f (g, h * j) end section variable {G A : Type*} [Monoid G] [AddCommGroup A] [MulAction G A]
Mathlib/RepresentationTheory/GroupCohomology/LowDegree.lean
401
403
theorem map_one_of_isOneCocycle {f : G β†’ A} (hf : IsOneCocycle f) : f 1 = 0 := by
simpa only [mul_one, one_smul, self_eq_add_right] using hf 1 1
[ " f 1 = 0" ]
[]
import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.FDeriv.Mul import Mathlib.Analysis.Calculus.FDeriv.Add #align_import analysis.calculus.deriv.mul from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" universe u v w noncomputable section open scoped Classical Topology Filter ENNReal open Filter Asymptotics Set open ContinuousLinearMap (smulRight smulRight_one_eq_iff) variable {π•œ : Type u} [NontriviallyNormedField π•œ] variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π•œ G] variable {f fβ‚€ f₁ g : π•œ β†’ F} variable {f' fβ‚€' f₁' g' : F} variable {x : π•œ} variable {s t : Set π•œ} variable {L L₁ Lβ‚‚ : Filter π•œ} section Prod section CLMCompApply open ContinuousLinearMap variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π•œ G] {c : π•œ β†’ F β†’L[π•œ] G} {c' : F β†’L[π•œ] G} {d : π•œ β†’ E β†’L[π•œ] F} {d' : E β†’L[π•œ] F} {u : π•œ β†’ F} {u' : F} theorem HasStrictDerivAt.clm_comp (hc : HasStrictDerivAt c c' x) (hd : HasStrictDerivAt d d' x) : HasStrictDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x := by have := (hc.hasStrictFDerivAt.clm_comp hd.hasStrictFDerivAt).hasStrictDerivAt rwa [add_apply, comp_apply, comp_apply, smulRight_apply, smulRight_apply, one_apply, one_smul, one_smul, add_comm] at this #align has_strict_deriv_at.clm_comp HasStrictDerivAt.clm_comp theorem HasDerivWithinAt.clm_comp (hc : HasDerivWithinAt c c' s x) (hd : HasDerivWithinAt d d' s x) : HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') s x := by have := (hc.hasFDerivWithinAt.clm_comp hd.hasFDerivWithinAt).hasDerivWithinAt rwa [add_apply, comp_apply, comp_apply, smulRight_apply, smulRight_apply, one_apply, one_smul, one_smul, add_comm] at this #align has_deriv_within_at.clm_comp HasDerivWithinAt.clm_comp theorem HasDerivAt.clm_comp (hc : HasDerivAt c c' x) (hd : HasDerivAt d d' x) : HasDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x := by rw [← hasDerivWithinAt_univ] at * exact hc.clm_comp hd #align has_deriv_at.clm_comp HasDerivAt.clm_comp theorem derivWithin_clm_comp (hc : DifferentiableWithinAt π•œ c s x) (hd : DifferentiableWithinAt π•œ d s x) (hxs : UniqueDiffWithinAt π•œ s x) : derivWithin (fun y => (c y).comp (d y)) s x = (derivWithin c s x).comp (d x) + (c x).comp (derivWithin d s x) := (hc.hasDerivWithinAt.clm_comp hd.hasDerivWithinAt).derivWithin hxs #align deriv_within_clm_comp derivWithin_clm_comp theorem deriv_clm_comp (hc : DifferentiableAt π•œ c x) (hd : DifferentiableAt π•œ d x) : deriv (fun y => (c y).comp (d y)) x = (deriv c x).comp (d x) + (c x).comp (deriv d x) := (hc.hasDerivAt.clm_comp hd.hasDerivAt).deriv #align deriv_clm_comp deriv_clm_comp
Mathlib/Analysis/Calculus/Deriv/Mul.lean
480
484
theorem HasStrictDerivAt.clm_apply (hc : HasStrictDerivAt c c' x) (hu : HasStrictDerivAt u u' x) : HasStrictDerivAt (fun y => (c y) (u y)) (c' (u x) + c x u') x := by
have := (hc.hasStrictFDerivAt.clm_apply hu.hasStrictFDerivAt).hasStrictDerivAt rwa [add_apply, comp_apply, flip_apply, smulRight_apply, smulRight_apply, one_apply, one_smul, one_smul, add_comm] at this
[ " HasStrictDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x", " HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') s x", " HasDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x", " HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (...
[ " HasStrictDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x", " HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') s x", " HasDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x", " HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (...
import Mathlib.CategoryTheory.Limits.Shapes.SplitCoequalizer import Mathlib.CategoryTheory.Limits.Preserves.Basic #align_import category_theory.limits.preserves.shapes.equalizers from "leanprover-community/mathlib"@"4698e35ca56a0d4fa53aa5639c3364e0a77f4eba" noncomputable section universe w v₁ vβ‚‚ u₁ uβ‚‚ open CategoryTheory CategoryTheory.Category CategoryTheory.Limits variable {C : Type u₁} [Category.{v₁} C] variable {D : Type uβ‚‚} [Category.{vβ‚‚} D] variable (G : C β₯€ D) namespace CategoryTheory.Limits section Equalizers variable {X Y Z : C} {f g : X ⟢ Y} {h : Z ⟢ X} (w : h ≫ f = h ≫ g) def isLimitMapConeForkEquiv : IsLimit (G.mapCone (Fork.ofΞΉ h w)) ≃ IsLimit (Fork.ofΞΉ (G.map h) (by simp only [← G.map_comp, w]) : Fork (G.map f) (G.map g)) := (IsLimit.postcomposeHomEquiv (diagramIsoParallelPair _) _).symm.trans (IsLimit.equivIsoLimit (Fork.ext (Iso.refl _) (by simp [Fork.ΞΉ]))) #align category_theory.limits.is_limit_map_cone_fork_equiv CategoryTheory.Limits.isLimitMapConeForkEquiv def isLimitForkMapOfIsLimit [PreservesLimit (parallelPair f g) G] (l : IsLimit (Fork.ofΞΉ h w)) : IsLimit (Fork.ofΞΉ (G.map h) (by simp only [← G.map_comp, w]) : Fork (G.map f) (G.map g)) := isLimitMapConeForkEquiv G w (PreservesLimit.preserves l) #align category_theory.limits.is_limit_fork_map_of_is_limit CategoryTheory.Limits.isLimitForkMapOfIsLimit def isLimitOfIsLimitForkMap [ReflectsLimit (parallelPair f g) G] (l : IsLimit (Fork.ofΞΉ (G.map h) (by simp only [← G.map_comp, w]) : Fork (G.map f) (G.map g))) : IsLimit (Fork.ofΞΉ h w) := ReflectsLimit.reflects ((isLimitMapConeForkEquiv G w).symm l) #align category_theory.limits.is_limit_of_is_limit_fork_map CategoryTheory.Limits.isLimitOfIsLimitForkMap variable (f g) [HasEqualizer f g] def isLimitOfHasEqualizerOfPreservesLimit [PreservesLimit (parallelPair f g) G] : IsLimit (Fork.ofΞΉ (G.map (equalizer.ΞΉ f g)) (by simp only [← G.map_comp]; rw [equalizer.condition]) : Fork (G.map f) (G.map g)) := isLimitForkMapOfIsLimit G _ (equalizerIsEqualizer f g) #align category_theory.limits.is_limit_of_has_equalizer_of_preserves_limit CategoryTheory.Limits.isLimitOfHasEqualizerOfPreservesLimit variable [HasEqualizer (G.map f) (G.map g)] def PreservesEqualizer.ofIsoComparison [i : IsIso (equalizerComparison f g G)] : PreservesLimit (parallelPair f g) G := by apply preservesLimitOfPreservesLimitCone (equalizerIsEqualizer f g) apply (isLimitMapConeForkEquiv _ _).symm _ refine @IsLimit.ofPointIso _ _ _ _ _ _ _ (limit.isLimit (parallelPair (G.map f) (G.map g))) ?_ apply i #align category_theory.limits.preserves_equalizer.of_iso_comparison CategoryTheory.Limits.PreservesEqualizer.ofIsoComparison variable [PreservesLimit (parallelPair f g) G] def PreservesEqualizer.iso : G.obj (equalizer f g) β‰… equalizer (G.map f) (G.map g) := IsLimit.conePointUniqueUpToIso (isLimitOfHasEqualizerOfPreservesLimit G f g) (limit.isLimit _) #align category_theory.limits.preserves_equalizer.iso CategoryTheory.Limits.PreservesEqualizer.iso @[simp] theorem PreservesEqualizer.iso_hom : (PreservesEqualizer.iso G f g).hom = equalizerComparison f g G := rfl #align category_theory.limits.preserves_equalizer.iso_hom CategoryTheory.Limits.PreservesEqualizer.iso_hom @[simp]
Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean
104
108
theorem PreservesEqualizer.iso_inv_ΞΉ : (PreservesEqualizer.iso G f g).inv ≫ G.map (equalizer.ΞΉ f g) = equalizer.ΞΉ (G.map f) (G.map g) := by
rw [← Iso.cancel_iso_hom_left (PreservesEqualizer.iso G f g), ← Category.assoc, Iso.hom_inv_id] simp
[ " G.map h ≫ G.map f = G.map h ≫ G.map g", " (Iso.refl\n ((Cones.postcompose (diagramIsoParallelPair (parallelPair f g β‹™ G)).hom).obj\n (G.mapCone (Fork.ofΞΉ h w))).pt).hom ≫\n (Fork.ofΞΉ (G.map h) β‹―).ΞΉ =\n Fork.ΞΉ ((Cones.postcompose (diagramIsoParallelPair (parallelPair f g β‹™ G)).hom)....
[ " G.map h ≫ G.map f = G.map h ≫ G.map g", " (Iso.refl\n ((Cones.postcompose (diagramIsoParallelPair (parallelPair f g β‹™ G)).hom).obj\n (G.mapCone (Fork.ofΞΉ h w))).pt).hom ≫\n (Fork.ofΞΉ (G.map h) β‹―).ΞΉ =\n Fork.ΞΉ ((Cones.postcompose (diagramIsoParallelPair (parallelPair f g β‹™ G)).hom)....
import Batteries.Data.List.Lemmas import Batteries.Tactic.Classical import Mathlib.Tactic.TypeStar import Mathlib.Mathport.Rename #align_import data.list.tfae from "leanprover-community/mathlib"@"5a3e819569b0f12cbec59d740a2613018e7b8eec" namespace List def TFAE (l : List Prop) : Prop := βˆ€ x ∈ l, βˆ€ y ∈ l, x ↔ y #align list.tfae List.TFAE theorem tfae_nil : TFAE [] := forall_mem_nil _ #align list.tfae_nil List.tfae_nil @[simp] theorem tfae_singleton (p) : TFAE [p] := by simp [TFAE, -eq_iff_iff] #align list.tfae_singleton List.tfae_singleton theorem tfae_cons_of_mem {a b} {l : List Prop} (h : b ∈ l) : TFAE (a :: l) ↔ (a ↔ b) ∧ TFAE l := ⟨fun H => ⟨H a (by simp) b (Mem.tail a h), fun p hp q hq => H _ (Mem.tail a hp) _ (Mem.tail a hq)⟩, by rintro ⟨ab, H⟩ p (_ | ⟨_, hp⟩) q (_ | ⟨_, hq⟩) Β· rfl Β· exact ab.trans (H _ h _ hq) Β· exact (ab.trans (H _ h _ hp)).symm Β· exact H _ hp _ hq⟩ #align list.tfae_cons_of_mem List.tfae_cons_of_mem theorem tfae_cons_cons {a b} {l : List Prop} : TFAE (a :: b :: l) ↔ (a ↔ b) ∧ TFAE (b :: l) := tfae_cons_of_mem (Mem.head _) #align list.tfae_cons_cons List.tfae_cons_cons @[simp] theorem tfae_cons_self {a} {l : List Prop} : TFAE (a :: a :: l) ↔ TFAE (a :: l) := by simp [tfae_cons_cons] theorem tfae_of_forall (b : Prop) (l : List Prop) (h : βˆ€ a ∈ l, a ↔ b) : TFAE l := fun _a₁ h₁ _aβ‚‚ hβ‚‚ => (h _ h₁).trans (h _ hβ‚‚).symm #align list.tfae_of_forall List.tfae_of_forall theorem tfae_of_cycle {a b} {l : List Prop} (h_chain : List.Chain (Β· β†’ Β·) a (b :: l)) (h_last : getLastD l b β†’ a) : TFAE (a :: b :: l) := by induction l generalizing a b with | nil => simp_all [tfae_cons_cons, iff_def] | cons c l IH => simp only [tfae_cons_cons, getLastD_cons, tfae_singleton, and_true, chain_cons, Chain.nil] at * rcases h_chain with ⟨ab, ⟨bc, ch⟩⟩ have := IH ⟨bc, ch⟩ (ab ∘ h_last) exact ⟨⟨ab, h_last ∘ (this.2 c (.head _) _ (getLastD_mem_cons _ _)).1 ∘ bc⟩, this⟩ #align list.tfae_of_cycle List.tfae_of_cycle theorem TFAE.out {l} (h : TFAE l) (n₁ nβ‚‚) {a b} (h₁ : List.get? l n₁ = some a := by rfl) (hβ‚‚ : List.get? l nβ‚‚ = some b := by rfl) : a ↔ b := h _ (List.get?_mem h₁) _ (List.get?_mem hβ‚‚) #align list.tfae.out List.TFAE.out theorem forall_tfae {Ξ± : Type*} (l : List (Ξ± β†’ Prop)) (H : βˆ€ a : Ξ±, (l.map (fun p ↦ p a)).TFAE) : (l.map (fun p ↦ βˆ€ a, p a)).TFAE := by simp only [TFAE, List.forall_mem_map_iff] intros p₁ hp₁ pβ‚‚ hpβ‚‚ exact forall_congr' fun a ↦ H a (p₁ a) (mem_map_of_mem (fun p ↦ p a) hp₁) (pβ‚‚ a) (mem_map_of_mem (fun p ↦ p a) hpβ‚‚) theorem exists_tfae {Ξ± : Type*} (l : List (Ξ± β†’ Prop)) (H : βˆ€ a : Ξ±, (l.map (fun p ↦ p a)).TFAE) : (l.map (fun p ↦ βˆƒ a, p a)).TFAE := by simp only [TFAE, List.forall_mem_map_iff] intros p₁ hp₁ pβ‚‚ hpβ‚‚ exact exists_congr fun a ↦ H a (p₁ a) (mem_map_of_mem (fun p ↦ p a) hp₁) (pβ‚‚ a) (mem_map_of_mem (fun p ↦ p a) hpβ‚‚)
Mathlib/Data/List/TFAE.lean
117
120
theorem tfae_not_iff {l : List Prop} : TFAE (l.map Not) ↔ TFAE l := by
classical simp only [TFAE, mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ‚‚, Decidable.not_iff_not]
[ " [p].TFAE", " a ∈ a :: l", " (a ↔ b) ∧ l.TFAE β†’ (a :: l).TFAE", " a ↔ a", " a ↔ q", " p ↔ a", " p ↔ q", " (a :: a :: l).TFAE ↔ (a :: l).TFAE", " (a :: b :: l).TFAE", " [a, b].TFAE", " (a :: b :: c :: l).TFAE", " (a ↔ b) ∧ (b ↔ c) ∧ (c :: l).TFAE", " (map (fun p => βˆ€ (a : Ξ±), p a) l).TFAE", ...
[ " [p].TFAE", " a ∈ a :: l", " (a ↔ b) ∧ l.TFAE β†’ (a :: l).TFAE", " a ↔ a", " a ↔ q", " p ↔ a", " p ↔ q", " (a :: a :: l).TFAE ↔ (a :: l).TFAE", " (a :: b :: l).TFAE", " [a, b].TFAE", " (a :: b :: c :: l).TFAE", " (a ↔ b) ∧ (b ↔ c) ∧ (c :: l).TFAE", " (map (fun p => βˆ€ (a : Ξ±), p a) l).TFAE", ...
import Mathlib.Data.Finset.Sigma import Mathlib.Data.Fintype.Card #align_import data.finset.pi_induction from "leanprover-community/mathlib"@"f93c11933efbc3c2f0299e47b8ff83e9b539cbf6" open Function variable {ΞΉ : Type*} {Ξ± : ΞΉ β†’ Type*} [Finite ΞΉ] [DecidableEq ΞΉ] [βˆ€ i, DecidableEq (Ξ± i)] namespace Finset
Mathlib/Data/Finset/PiInduction.lean
37
63
theorem induction_on_pi_of_choice (r : βˆ€ i, Ξ± i β†’ Finset (Ξ± i) β†’ Prop) (H_ex : βˆ€ (i) (s : Finset (Ξ± i)), s.Nonempty β†’ βˆƒ x ∈ s, r i x (s.erase x)) {p : (βˆ€ i, Finset (Ξ± i)) β†’ Prop} (f : βˆ€ i, Finset (Ξ± i)) (h0 : p fun _ ↦ βˆ…) (step : βˆ€ (g : βˆ€ i, Finset (Ξ± i)) (i : ΞΉ) (x : Ξ± i), r i x (g i) β†’ p g β†’ p (update g i (insert x (g i)))) : p f := by
cases nonempty_fintype ΞΉ induction' hs : univ.sigma f using Finset.strongInductionOn with s ihs generalizing f; subst s rcases eq_empty_or_nonempty (univ.sigma f) with he | hne Β· convert h0 using 1 simpa [funext_iff] using he Β· rcases sigma_nonempty.1 hne with ⟨i, -, hi⟩ rcases H_ex i (f i) hi with ⟨x, x_mem, hr⟩ set g := update f i ((f i).erase x) with hg clear_value g have hx' : x βˆ‰ g i := by rw [hg, update_same] apply not_mem_erase rw [show f = update g i (insert x (g i)) by rw [hg, update_idem, update_same, insert_erase x_mem, update_eq_self]] at hr ihs ⊒ clear hg rw [update_same, erase_insert hx'] at hr refine step _ _ _ hr (ihs (univ.sigma g) ?_ _ rfl) rw [ssubset_iff_of_subset (sigma_mono (Subset.refl _) _)] exacts [⟨⟨i, x⟩, mem_sigma.2 ⟨mem_univ _, by simp⟩, by simp [hx']⟩, (@le_update_iff _ _ _ _ g g i _).2 ⟨subset_insert _ _, fun _ _ ↦ le_rfl⟩]
[ " p f", " f = fun x => βˆ…", " x βˆ‰ g i", " x βˆ‰ (f i).erase x", " f = update g i (insert x (g i))", " p (update g i (insert x (g i)))", " univ.sigma g βŠ‚ univ.sigma (update g i (insert x (g i)))", " βˆ€ (i_1 : ΞΉ), g i_1 βŠ† update g i (insert x (g i)) i_1", " ⟨i, x⟩.snd ∈ update g i (insert x (g i)) ⟨i, x⟩....
[]
import Mathlib.RingTheory.FinitePresentation import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Away.AdjoinRoot import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.TensorProduct.Basic -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] @[mk_iff] class FormallyUnramified : Prop where comp_injective : βˆ€ ⦃B : Type u⦄ [CommRing B], βˆ€ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = βŠ₯), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) β†’ A →ₐ[R] B β§Έ I) #align algebra.formally_unramified Algebra.FormallyUnramified end namespace FormallyUnramified section variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) theorem lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ gβ‚‚ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp gβ‚‚) : g₁ = gβ‚‚ := by revert g₁ gβ‚‚ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI Β· intro B _ I hI _; exact FormallyUnramified.comp_injective I hI Β· intro B _ I J hIJ h₁ hβ‚‚ _ g₁ gβ‚‚ e apply h₁ apply hβ‚‚ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊒ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ gβ‚‚ : A →ₐ[R] B} (H : βˆ€ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (gβ‚‚ x)) : g₁ = gβ‚‚ := FormallyUnramified.lift_unique I hI g₁ gβ‚‚ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B β†’+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ gβ‚‚ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (gβ‚‚ : A β†’+* B)) : g₁ = gβ‚‚ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B β†’+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ gβ‚‚ : A →ₐ[R] B) (h : βˆ€ x, f (g₁ x) = f (gβ‚‚ x)) : g₁ = gβ‚‚ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ gβ‚‚ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B β†’+* C)) (g₁ gβ‚‚ : A →ₐ[R] B) (h : f.comp g₁ = f.comp gβ‚‚) : g₁ = gβ‚‚ := FormallyUnramified.ext' _ hf g₁ gβ‚‚ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' end section Localization variable {R S Rβ‚˜ Sβ‚˜ : Type u} [CommRing R] [CommRing S] [CommRing Rβ‚˜] [CommRing Sβ‚˜] variable (M : Submonoid R) variable [Algebra R S] [Algebra R Sβ‚˜] [Algebra S Sβ‚˜] [Algebra R Rβ‚˜] [Algebra Rβ‚˜ Sβ‚˜] variable [IsScalarTower R Rβ‚˜ Sβ‚˜] [IsScalarTower R S Sβ‚˜] variable [IsLocalization M Rβ‚˜] [IsLocalization (M.map (algebraMap R S)) Sβ‚˜] -- Porting note: no longer supported -- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on
Mathlib/RingTheory/Unramified/Basic.lean
201
207
theorem of_isLocalization : FormallyUnramified R Rβ‚˜ := by
constructor intro Q _ _ I _ f₁ fβ‚‚ _ apply AlgHom.coe_ringHom_injective refine IsLocalization.ringHom_ext M ?_ ext simp
[ " g₁ = gβ‚‚", " βˆ€ (g₁ gβ‚‚ : A →ₐ[R] B), (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp gβ‚‚ β†’ g₁ = gβ‚‚", " Function.Injective (Ideal.Quotient.mkₐ R I).comp", " βˆ€ [_RB : Algebra R B], Function.Injective (Ideal.Quotient.mkₐ R I).comp", " βˆ€ ⦃S : Type u⦄ [inst : CommRing S] (I : Ideal S),\n I ^ 2...
[ " g₁ = gβ‚‚", " βˆ€ (g₁ gβ‚‚ : A →ₐ[R] B), (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp gβ‚‚ β†’ g₁ = gβ‚‚", " Function.Injective (Ideal.Quotient.mkₐ R I).comp", " βˆ€ [_RB : Algebra R B], Function.Injective (Ideal.Quotient.mkₐ R I).comp", " βˆ€ ⦃S : Type u⦄ [inst : CommRing S] (I : Ideal S),\n I ^ 2...
import Mathlib.Algebra.PUnitInstances import Mathlib.Tactic.Abel import Mathlib.Tactic.Ring import Mathlib.Order.Hom.Lattice #align_import algebra.ring.boolean_ring from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" open scoped symmDiff variable {Ξ± Ξ² Ξ³ : Type*} class BooleanRing (Ξ±) extends Ring Ξ± where mul_self : βˆ€ a : Ξ±, a * a = a #align boolean_ring BooleanRing section BooleanRing variable [BooleanRing Ξ±] (a b : Ξ±) instance : Std.IdempotentOp (Ξ± := Ξ±) (Β· * Β·) := ⟨BooleanRing.mul_self⟩ @[simp] theorem mul_self : a * a = a := BooleanRing.mul_self _ #align mul_self mul_self @[simp] theorem add_self : a + a = 0 := by have : a + a = a + a + (a + a) := calc a + a = (a + a) * (a + a) := by rw [mul_self] _ = a * a + a * a + (a * a + a * a) := by rw [add_mul, mul_add] _ = a + a + (a + a) := by rw [mul_self] rwa [self_eq_add_left] at this #align add_self add_self @[simp] theorem neg_eq : -a = a := calc -a = -a + 0 := by rw [add_zero] _ = -a + -a + a := by rw [← neg_add_self, add_assoc] _ = a := by rw [add_self, zero_add] #align neg_eq neg_eq theorem add_eq_zero' : a + b = 0 ↔ a = b := calc a + b = 0 ↔ a = -b := add_eq_zero_iff_eq_neg _ ↔ a = b := by rw [neg_eq] #align add_eq_zero' add_eq_zero' @[simp] theorem mul_add_mul : a * b + b * a = 0 := by have : a + b = a + b + (a * b + b * a) := calc a + b = (a + b) * (a + b) := by rw [mul_self] _ = a * a + a * b + (b * a + b * b) := by rw [add_mul, mul_add, mul_add] _ = a + a * b + (b * a + b) := by simp only [mul_self] _ = a + b + (a * b + b * a) := by abel rwa [self_eq_add_right] at this #align mul_add_mul mul_add_mul @[simp]
Mathlib/Algebra/Ring/BooleanRing.lean
101
101
theorem sub_eq_add : a - b = a + b := by
rw [sub_eq_add_neg, add_right_inj, neg_eq]
[ " a + a = 0", " a + a = (a + a) * (a + a)", " (a + a) * (a + a) = a * a + a * a + (a * a + a * a)", " a * a + a * a + (a * a + a * a) = a + a + (a + a)", " -a = -a + 0", " -a + 0 = -a + -a + a", " -a + -a + a = a", " a = -b ↔ a = b", " a * b + b * a = 0", " a + b = (a + b) * (a + b)", " (a + b) ...
[ " a + a = 0", " a + a = (a + a) * (a + a)", " (a + a) * (a + a) = a * a + a * a + (a * a + a * a)", " a * a + a * a + (a * a + a * a) = a + a + (a + a)", " -a = -a + 0", " -a + 0 = -a + -a + a", " -a + -a + a = a", " a = -b ↔ a = b", " a * b + b * a = 0", " a + b = (a + b) * (a + b)", " (a + b) ...
import Mathlib.Order.Interval.Finset.Nat #align_import data.fin.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29" assert_not_exists MonoidWithZero open Finset Fin Function namespace Fin variable (n : β„•) instance instLocallyFiniteOrder : LocallyFiniteOrder (Fin n) := OrderIso.locallyFiniteOrder Fin.orderIsoSubtype instance instLocallyFiniteOrderBot : LocallyFiniteOrderBot (Fin n) := OrderIso.locallyFiniteOrderBot Fin.orderIsoSubtype instance instLocallyFiniteOrderTop : βˆ€ n, LocallyFiniteOrderTop (Fin n) | 0 => IsEmpty.toLocallyFiniteOrderTop | _ + 1 => inferInstance variable {n} (a b : Fin n) theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : β„•) b).fin n := rfl #align fin.Icc_eq_finset_subtype Fin.Icc_eq_finset_subtype theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : β„•) b).fin n := rfl #align fin.Ico_eq_finset_subtype Fin.Ico_eq_finset_subtype theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : β„•) b).fin n := rfl #align fin.Ioc_eq_finset_subtype Fin.Ioc_eq_finset_subtype theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : β„•) b).fin n := rfl #align fin.Ioo_eq_finset_subtype Fin.Ioo_eq_finset_subtype theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : β„•) b).fin n := rfl #align fin.uIcc_eq_finset_subtype Fin.uIcc_eq_finset_subtype @[simp] theorem map_valEmbedding_Icc : (Icc a b).map Fin.valEmbedding = Icc ↑a ↑b := by simp [Icc_eq_finset_subtype, Finset.fin, Finset.map_map, Icc_filter_lt_of_lt_right] #align fin.map_subtype_embedding_Icc Fin.map_valEmbedding_Icc @[simp] theorem map_valEmbedding_Ico : (Ico a b).map Fin.valEmbedding = Ico ↑a ↑b := by simp [Ico_eq_finset_subtype, Finset.fin, Finset.map_map] #align fin.map_subtype_embedding_Ico Fin.map_valEmbedding_Ico @[simp] theorem map_valEmbedding_Ioc : (Ioc a b).map Fin.valEmbedding = Ioc ↑a ↑b := by simp [Ioc_eq_finset_subtype, Finset.fin, Finset.map_map, Ioc_filter_lt_of_lt_right] #align fin.map_subtype_embedding_Ioc Fin.map_valEmbedding_Ioc @[simp] theorem map_valEmbedding_Ioo : (Ioo a b).map Fin.valEmbedding = Ioo ↑a ↑b := by simp [Ioo_eq_finset_subtype, Finset.fin, Finset.map_map] #align fin.map_subtype_embedding_Ioo Fin.map_valEmbedding_Ioo @[simp] theorem map_subtype_embedding_uIcc : (uIcc a b).map valEmbedding = uIcc ↑a ↑b := map_valEmbedding_Icc _ _ #align fin.map_subtype_embedding_uIcc Fin.map_subtype_embedding_uIcc @[simp] theorem card_Icc : (Icc a b).card = b + 1 - a := by rw [← Nat.card_Icc, ← map_valEmbedding_Icc, card_map] #align fin.card_Icc Fin.card_Icc @[simp] theorem card_Ico : (Ico a b).card = b - a := by rw [← Nat.card_Ico, ← map_valEmbedding_Ico, card_map] #align fin.card_Ico Fin.card_Ico @[simp]
Mathlib/Order/Interval/Finset/Fin.lean
114
115
theorem card_Ioc : (Ioc a b).card = b - a := by
rw [← Nat.card_Ioc, ← map_valEmbedding_Ioc, card_map]
[ " map valEmbedding (Icc a b) = Icc ↑a ↑b", " map valEmbedding (Ico a b) = Ico ↑a ↑b", " map valEmbedding (Ioc a b) = Ioc ↑a ↑b", " map valEmbedding (Ioo a b) = Ioo ↑a ↑b", " (Icc a b).card = ↑b + 1 - ↑a", " (Ico a b).card = ↑b - ↑a", " (Ioc a b).card = ↑b - ↑a" ]
[ " map valEmbedding (Icc a b) = Icc ↑a ↑b", " map valEmbedding (Ico a b) = Ico ↑a ↑b", " map valEmbedding (Ioc a b) = Ioc ↑a ↑b", " map valEmbedding (Ioo a b) = Ioo ↑a ↑b", " (Icc a b).card = ↑b + 1 - ↑a", " (Ico a b).card = ↑b - ↑a" ]
import Mathlib.CategoryTheory.EqToHom #align_import category_theory.sums.basic from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" namespace CategoryTheory universe v₁ u₁ -- morphism levels before object levels. See note [category_theory universes]. open Sum section variable (C : Type u₁) [Category.{v₁} C] (D : Type u₁) [Category.{v₁} D] instance sum : Category.{v₁} (Sum C D) where Hom X Y := match X, Y with | inl X, inl Y => X ⟢ Y | inl _, inr _ => PEmpty | inr _, inl _ => PEmpty | inr X, inr Y => X ⟢ Y id X := match X with | inl X => πŸ™ X | inr X => πŸ™ X comp {X Y Z} f g := match X, Y, Z, f, g with | inl X, inl Y, inl Z, f, g => f ≫ g | inr X, inr Y, inr Z, f, g => f ≫ g assoc {W X Y Z} f g h := match X, Y, Z, W with | inl X, inl Y, inl Z, inl W => Category.assoc f g h | inr X, inr Y, inr Z, inr W => Category.assoc f g h #align category_theory.sum CategoryTheory.sum @[aesop norm -10 destruct (rule_sets := [CategoryTheory])]
Mathlib/CategoryTheory/Sums/Basic.lean
62
63
theorem hom_inl_inr_false {X : C} {Y : D} (f : Sum.inl X ⟢ Sum.inr Y) : False := by
cases f
[ " False" ]
[]
import Mathlib.CategoryTheory.NatTrans import Mathlib.CategoryTheory.Iso #align_import category_theory.functor.category from "leanprover-community/mathlib"@"63721b2c3eba6c325ecf8ae8cca27155a4f6306f" namespace CategoryTheory -- declare the `v`'s first; see note [CategoryTheory universes]. universe v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ open NatTrans Category CategoryTheory.Functor variable (C : Type u₁) [Category.{v₁} C] (D : Type uβ‚‚) [Category.{vβ‚‚} D] attribute [local simp] vcomp_app variable {C D} {E : Type u₃} [Category.{v₃} E] variable {F G H I : C β₯€ D} instance Functor.category : Category.{max u₁ vβ‚‚} (C β₯€ D) where Hom F G := NatTrans F G id F := NatTrans.id F comp Ξ± Ξ² := vcomp Ξ± Ξ² #align category_theory.functor.category CategoryTheory.Functor.category namespace NatTrans -- Porting note: the behaviour of `ext` has changed here. -- We need to provide a copy of the `NatTrans.ext` lemma, -- written in terms of `F ⟢ G` rather than `NatTrans F G`, -- or `ext` will not retrieve it from the cache. @[ext] theorem ext' {Ξ± Ξ² : F ⟢ G} (w : Ξ±.app = Ξ².app) : Ξ± = Ξ² := NatTrans.ext _ _ w @[simp] theorem vcomp_eq_comp (Ξ± : F ⟢ G) (Ξ² : G ⟢ H) : vcomp Ξ± Ξ² = Ξ± ≫ Ξ² := rfl #align category_theory.nat_trans.vcomp_eq_comp CategoryTheory.NatTrans.vcomp_eq_comp theorem vcomp_app' (Ξ± : F ⟢ G) (Ξ² : G ⟢ H) (X : C) : (Ξ± ≫ Ξ²).app X = Ξ±.app X ≫ Ξ².app X := rfl #align category_theory.nat_trans.vcomp_app' CategoryTheory.NatTrans.vcomp_app' theorem congr_app {Ξ± Ξ² : F ⟢ G} (h : Ξ± = Ξ²) (X : C) : Ξ±.app X = Ξ².app X := by rw [h] #align category_theory.nat_trans.congr_app CategoryTheory.NatTrans.congr_app @[simp] theorem id_app (F : C β₯€ D) (X : C) : (πŸ™ F : F ⟢ F).app X = πŸ™ (F.obj X) := rfl #align category_theory.nat_trans.id_app CategoryTheory.NatTrans.id_app @[simp] theorem comp_app {F G H : C β₯€ D} (Ξ± : F ⟢ G) (Ξ² : G ⟢ H) (X : C) : (Ξ± ≫ Ξ²).app X = Ξ±.app X ≫ Ξ².app X := rfl #align category_theory.nat_trans.comp_app CategoryTheory.NatTrans.comp_app attribute [reassoc] comp_app @[reassoc] theorem app_naturality {F G : C β₯€ D β₯€ E} (T : F ⟢ G) (X : C) {Y Z : D} (f : Y ⟢ Z) : (F.obj X).map f ≫ (T.app X).app Z = (T.app X).app Y ≫ (G.obj X).map f := (T.app X).naturality f #align category_theory.nat_trans.app_naturality CategoryTheory.NatTrans.app_naturality @[reassoc] theorem naturality_app {F G : C β₯€ D β₯€ E} (T : F ⟢ G) (Z : D) {X Y : C} (f : X ⟢ Y) : (F.map f).app Z ≫ (T.app Y).app Z = (T.app X).app Z ≫ (G.map f).app Z := congr_fun (congr_arg app (T.naturality f)) Z #align category_theory.nat_trans.naturality_app CategoryTheory.NatTrans.naturality_app theorem mono_of_mono_app (Ξ± : F ⟢ G) [βˆ€ X : C, Mono (Ξ±.app X)] : Mono Ξ± := ⟨fun g h eq => by ext X rw [← cancel_mono (Ξ±.app X), ← comp_app, eq, comp_app]⟩ #align category_theory.nat_trans.mono_of_mono_app CategoryTheory.NatTrans.mono_of_mono_app theorem epi_of_epi_app (Ξ± : F ⟢ G) [βˆ€ X : C, Epi (Ξ±.app X)] : Epi Ξ± := ⟨fun g h eq => by ext X rw [← cancel_epi (Ξ±.app X), ← comp_app, eq, comp_app]⟩ #align category_theory.nat_trans.epi_of_epi_app CategoryTheory.NatTrans.epi_of_epi_app @[simps] def hcomp {H I : D β₯€ E} (Ξ± : F ⟢ G) (Ξ² : H ⟢ I) : F β‹™ H ⟢ G β‹™ I where app := fun X : C => Ξ².app (F.obj X) ≫ I.map (Ξ±.app X) naturality X Y f := by rw [Functor.comp_map, Functor.comp_map, ← assoc, naturality, assoc, ← map_comp I, naturality, map_comp, assoc] #align category_theory.nat_trans.hcomp CategoryTheory.NatTrans.hcomp #align category_theory.nat_trans.hcomp_app CategoryTheory.NatTrans.hcomp_app infixl:80 " β—« " => hcomp theorem hcomp_id_app {H : D β₯€ E} (Ξ± : F ⟢ G) (X : C) : (Ξ± β—« πŸ™ H).app X = H.map (Ξ±.app X) := by simp #align category_theory.nat_trans.hcomp_id_app CategoryTheory.NatTrans.hcomp_id_app
Mathlib/CategoryTheory/Functor/Category.lean
125
125
theorem id_hcomp_app {H : E β₯€ C} (Ξ± : F ⟢ G) (X : E) : (πŸ™ H β—« Ξ±).app X = Ξ±.app _ := by
simp
[ " Ξ±.app X = Ξ².app X", " g = h", " g.app X = h.app X", " (F β‹™ H).map f ≫ (fun X => Ξ².app (F.obj X) ≫ I.map (Ξ±.app X)) Y =\n (fun X => Ξ².app (F.obj X) ≫ I.map (Ξ±.app X)) X ≫ (G β‹™ I).map f", " (Ξ± β—« πŸ™ H).app X = H.map (Ξ±.app X)", " (πŸ™ H β—« Ξ±).app X = Ξ±.app (H.obj X)" ]
[ " Ξ±.app X = Ξ².app X", " g = h", " g.app X = h.app X", " (F β‹™ H).map f ≫ (fun X => Ξ².app (F.obj X) ≫ I.map (Ξ±.app X)) Y =\n (fun X => Ξ².app (F.obj X) ≫ I.map (Ξ±.app X)) X ≫ (G β‹™ I).map f", " (Ξ± β—« πŸ™ H).app X = H.map (Ξ±.app X)" ]
import Mathlib.Order.Interval.Finset.Fin #align_import data.fintype.fin from "leanprover-community/mathlib"@"759575657f189ccb424b990164c8b1fa9f55cdfe" open Finset open Fintype namespace Fin variable {Ξ± Ξ² : Type*} {n : β„•} theorem map_valEmbedding_univ : (Finset.univ : Finset (Fin n)).map Fin.valEmbedding = Iio n := by ext simp [orderIsoSubtype.symm.surjective.exists, OrderIso.symm] #align fin.map_subtype_embedding_univ Fin.map_valEmbedding_univ @[simp] theorem Ioi_zero_eq_map : Ioi (0 : Fin n.succ) = univ.map (Fin.succEmb _) := coe_injective <| by ext; simp [pos_iff_ne_zero] #align fin.Ioi_zero_eq_map Fin.Ioi_zero_eq_map @[simp] theorem Iio_last_eq_map : Iio (Fin.last n) = Finset.univ.map Fin.castSuccEmb := coe_injective <| by ext; simp [lt_def] #align fin.Iio_last_eq_map Fin.Iio_last_eq_map @[simp] theorem Ioi_succ (i : Fin n) : Ioi i.succ = (Ioi i).map (Fin.succEmb _) := by ext i simp only [mem_filter, mem_Ioi, mem_map, mem_univ, true_and_iff, Function.Embedding.coeFn_mk, exists_true_left] constructor Β· refine cases ?_ ?_ i Β· rintro ⟨⟨⟩⟩ Β· intro i hi exact ⟨i, succ_lt_succ_iff.mp hi, rfl⟩ Β· rintro ⟨i, hi, rfl⟩ simpa #align fin.Ioi_succ Fin.Ioi_succ @[simp] theorem Iio_castSucc (i : Fin n) : Iio (castSucc i) = (Iio i).map Fin.castSuccEmb := by apply Finset.map_injective Fin.valEmbedding rw [Finset.map_map, Fin.map_valEmbedding_Iio] exact (Fin.map_valEmbedding_Iio i).symm #align fin.Iio_cast_succ Fin.Iio_castSucc
Mathlib/Data/Fintype/Fin.lean
61
64
theorem card_filter_univ_succ' (p : Fin (n + 1) β†’ Prop) [DecidablePred p] : (univ.filter p).card = ite (p 0) 1 0 + (univ.filter (p ∘ Fin.succ)).card := by
rw [Fin.univ_succ, filter_cons, card_disjUnion, filter_map, card_map] split_ifs <;> simp
[ " map valEmbedding univ = Iio n", " a✝ ∈ map valEmbedding univ ↔ a✝ ∈ Iio n", " ↑(Ioi 0) = ↑(map (succEmb n) univ)", " x✝ ∈ ↑(Ioi 0) ↔ x✝ ∈ ↑(map (succEmb n) univ)", " ↑(Iio (last n)) = ↑(map castSuccEmb univ)", " x✝ ∈ ↑(Iio (last n)) ↔ x✝ ∈ ↑(map castSuccEmb univ)", " Ioi i.succ = map (succEmb n) (Ioi ...
[ " map valEmbedding univ = Iio n", " a✝ ∈ map valEmbedding univ ↔ a✝ ∈ Iio n", " ↑(Ioi 0) = ↑(map (succEmb n) univ)", " x✝ ∈ ↑(Ioi 0) ↔ x✝ ∈ ↑(map (succEmb n) univ)", " ↑(Iio (last n)) = ↑(map castSuccEmb univ)", " x✝ ∈ ↑(Iio (last n)) ↔ x✝ ∈ ↑(map castSuccEmb univ)", " Ioi i.succ = map (succEmb n) (Ioi ...
import Mathlib.Logic.Function.Basic import Mathlib.Tactic.MkIffOfInductiveProp #align_import data.sum.basic from "leanprover-community/mathlib"@"bd9851ca476957ea4549eb19b40e7b5ade9428cc" universe u v w x variable {Ξ± : Type u} {Ξ±' : Type w} {Ξ² : Type v} {Ξ²' : Type x} {Ξ³ Ξ΄ : Type*} namespace Sum #align sum.forall Sum.forall #align sum.exists Sum.exists theorem exists_sum {Ξ³ : Ξ± βŠ• Ξ² β†’ Sort*} (p : (βˆ€ ab, Ξ³ ab) β†’ Prop) : (βˆƒ fab, p fab) ↔ (βˆƒ fa fb, p (Sum.rec fa fb)) := by rw [← not_forall_not, forall_sum] simp theorem inl_injective : Function.Injective (inl : Ξ± β†’ Sum Ξ± Ξ²) := fun _ _ ↦ inl.inj #align sum.inl_injective Sum.inl_injective theorem inr_injective : Function.Injective (inr : Ξ² β†’ Sum Ξ± Ξ²) := fun _ _ ↦ inr.inj #align sum.inr_injective Sum.inr_injective theorem sum_rec_congr (P : Ξ± βŠ• Ξ² β†’ Sort*) (f : βˆ€ i, P (inl i)) (g : βˆ€ i, P (inr i)) {x y : Ξ± βŠ• Ξ²} (h : x = y) : @Sum.rec _ _ _ f g x = cast (congr_arg P h.symm) (@Sum.rec _ _ _ f g y) := by cases h; rfl section get #align sum.is_left Sum.isLeft #align sum.is_right Sum.isRight #align sum.get_left Sum.getLeft? #align sum.get_right Sum.getRight? variable {x y : Sum Ξ± Ξ²} #align sum.get_left_eq_none_iff Sum.getLeft?_eq_none_iff #align sum.get_right_eq_none_iff Sum.getRight?_eq_none_iff
Mathlib/Data/Sum/Basic.lean
54
55
theorem eq_left_iff_getLeft_eq {a : Ξ±} : x = inl a ↔ βˆƒ h, x.getLeft h = a := by
cases x <;> simp
[ " (βˆƒ fab, p fab) ↔ βˆƒ fa fb, p fun t => rec fa fb t", " (Β¬βˆ€ (fa : (val : Ξ±) β†’ Ξ³ (inl val)) (fb : (val : Ξ²) β†’ Ξ³ (inr val)), Β¬p fun t => rec fa fb t) ↔\n βˆƒ fa fb, p fun t => rec fa fb t", " rec f g x = cast β‹― (rec f g y)", " rec f g x = cast β‹― (rec f g x)", " x = inl a ↔ βˆƒ h, x.getLeft h = a", " inl val✝ ...
[ " (βˆƒ fab, p fab) ↔ βˆƒ fa fb, p fun t => rec fa fb t", " (Β¬βˆ€ (fa : (val : Ξ±) β†’ Ξ³ (inl val)) (fb : (val : Ξ²) β†’ Ξ³ (inr val)), Β¬p fun t => rec fa fb t) ↔\n βˆƒ fa fb, p fun t => rec fa fb t", " rec f g x = cast β‹― (rec f g y)", " rec f g x = cast β‹― (rec f g x)" ]
import Mathlib.Analysis.NormedSpace.Exponential import Mathlib.Analysis.Calculus.FDeriv.Analytic import Mathlib.Topology.MetricSpace.CauSeqFilter #align_import analysis.special_functions.exponential from "leanprover-community/mathlib"@"e1a18cad9cd462973d760af7de36b05776b8811c" open Filter RCLike ContinuousMultilinearMap NormedField NormedSpace Asymptotics open scoped Nat Topology ENNReal section AnyFieldAnyAlgebra variable {𝕂 𝔸 : Type*} [NontriviallyNormedField 𝕂] [NormedRing 𝔸] [NormedAlgebra 𝕂 𝔸] [CompleteSpace 𝔸]
Mathlib/Analysis/SpecialFunctions/Exponential.lean
67
72
theorem hasStrictFDerivAt_exp_zero_of_radius_pos (h : 0 < (expSeries 𝕂 𝔸).radius) : HasStrictFDerivAt (exp 𝕂) (1 : 𝔸 β†’L[𝕂] 𝔸) 0 := by
convert (hasFPowerSeriesAt_exp_zero_of_radius_pos h).hasStrictFDerivAt ext x change x = expSeries 𝕂 𝔸 1 fun _ => x simp [expSeries_apply_eq, Nat.factorial]
[ " HasStrictFDerivAt (exp 𝕂) 1 0", " 1 = (continuousMultilinearCurryFin1 𝕂 𝔸 𝔸) (expSeries 𝕂 𝔸 1)", " 1 x = ((continuousMultilinearCurryFin1 𝕂 𝔸 𝔸) (expSeries 𝕂 𝔸 1)) x", " x = (expSeries 𝕂 𝔸 1) fun x_1 => x" ]
[]
import Mathlib.CategoryTheory.Limits.Shapes.Images import Mathlib.CategoryTheory.Limits.Constructions.EpiMono #align_import category_theory.limits.preserves.shapes.images from "leanprover-community/mathlib"@"fc78e3c190c72a109699385da6be2725e88df841" noncomputable section namespace CategoryTheory namespace PreservesImage open CategoryTheory open CategoryTheory.Limits universe u₁ uβ‚‚ v₁ vβ‚‚ variable {A : Type u₁} {B : Type uβ‚‚} [Category.{v₁} A] [Category.{vβ‚‚} B] variable [HasEqualizers A] [HasImages A] variable [StrongEpiCategory B] [HasImages B] variable (L : A β₯€ B) variable [βˆ€ {X Y Z : A} (f : X ⟢ Z) (g : Y ⟢ Z), PreservesLimit (cospan f g) L] variable [βˆ€ {X Y Z : A} (f : X ⟢ Y) (g : X ⟢ Z), PreservesColimit (span f g) L] @[simps!] def iso {X Y : A} (f : X ⟢ Y) : image (L.map f) β‰… L.obj (image f) := let aux1 : StrongEpiMonoFactorisation (L.map f) := { I := L.obj (Limits.image f) m := L.map <| Limits.image.ΞΉ _ m_mono := preserves_mono_of_preservesLimit _ _ e := L.map <| factorThruImage _ e_strong_epi := @strongEpi_of_epi B _ _ _ _ _ (preserves_epi_of_preservesColimit L _) fac := by rw [← L.map_comp, Limits.image.fac] } IsImage.isoExt (Image.isImage (L.map f)) aux1.toMonoIsImage #align category_theory.preserves_image.iso CategoryTheory.PreservesImage.iso @[reassoc] theorem factorThruImage_comp_hom {X Y : A} (f : X ⟢ Y) : factorThruImage (L.map f) ≫ (iso L f).hom = L.map (factorThruImage f) := by simp #align category_theory.preserves_image.factor_thru_image_comp_hom CategoryTheory.PreservesImage.factorThruImage_comp_hom @[reassoc] theorem hom_comp_map_image_ΞΉ {X Y : A} (f : X ⟢ Y) : (iso L f).hom ≫ L.map (image.ΞΉ f) = image.ΞΉ (L.map f) := by rw [iso_hom, image.lift_fac] #align category_theory.preserves_image.hom_comp_map_image_ΞΉ CategoryTheory.PreservesImage.hom_comp_map_image_ΞΉ @[reassoc]
Mathlib/CategoryTheory/Limits/Preserves/Shapes/Images.lean
62
63
theorem inv_comp_image_ΞΉ_map {X Y : A} (f : X ⟢ Y) : (iso L f).inv ≫ image.ΞΉ (L.map f) = L.map (image.ΞΉ f) := by
simp
[ " L.map (factorThruImage f) ≫ L.map (image.ΞΉ f) = L.map f", " factorThruImage (L.map f) ≫ (iso L f).hom = L.map (factorThruImage f)", " (iso L f).hom ≫ L.map (image.ΞΉ f) = image.ΞΉ (L.map f)", " (iso L f).inv ≫ image.ΞΉ (L.map f) = L.map (image.ΞΉ f)" ]
[ " L.map (factorThruImage f) ≫ L.map (image.ΞΉ f) = L.map f", " factorThruImage (L.map f) ≫ (iso L f).hom = L.map (factorThruImage f)", " (iso L f).hom ≫ L.map (image.ΞΉ f) = image.ΞΉ (L.map f)" ]
import Mathlib.RingTheory.FiniteType import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Integer import Mathlib.RingTheory.Localization.Submodule import Mathlib.RingTheory.Nilpotent.Lemmas import Mathlib.RingTheory.RingHomProperties import Mathlib.Data.Set.Subsingleton #align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0" open scoped Pointwise Classical universe u variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R) variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R β†’+* S) variable [Algebra R R'] [Algebra S S'] section Properties section RingHom variable (P : βˆ€ {R S : Type u} [CommRing R] [CommRing S] (_ : R β†’+* S), Prop) def RingHom.LocalizationPreserves := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (M : Submonoid R) (R' S' : Type u) [CommRing R'] [CommRing S'] [Algebra R R'] [Algebra S S'] [IsLocalization M R'] [IsLocalization (M.map f) S'], P f β†’ P (IsLocalization.map S' f (Submonoid.le_comap_map M) : R' β†’+* S') #align ring_hom.localization_preserves RingHom.LocalizationPreserves def RingHom.OfLocalizationFiniteSpan := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Finset R) (_ : Ideal.span (s : Set R) = ⊀) (_ : βˆ€ r : s, P (Localization.awayMap f r)), P f #align ring_hom.of_localization_finite_span RingHom.OfLocalizationFiniteSpan def RingHom.OfLocalizationSpan := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Set R) (_ : Ideal.span s = ⊀) (_ : βˆ€ r : s, P (Localization.awayMap f r)), P f #align ring_hom.of_localization_span RingHom.OfLocalizationSpan def RingHom.HoldsForLocalizationAway : Prop := βˆ€ ⦃R : Type u⦄ (S : Type u) [CommRing R] [CommRing S] [Algebra R S] (r : R) [IsLocalization.Away r S], P (algebraMap R S) #align ring_hom.holds_for_localization_away RingHom.HoldsForLocalizationAway def RingHom.OfLocalizationFiniteSpanTarget : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Finset S) (_ : Ideal.span (s : Set S) = ⊀) (_ : βˆ€ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f #align ring_hom.of_localization_finite_span_target RingHom.OfLocalizationFiniteSpanTarget def RingHom.OfLocalizationSpanTarget : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Set S) (_ : Ideal.span s = ⊀) (_ : βˆ€ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f #align ring_hom.of_localization_span_target RingHom.OfLocalizationSpanTarget def RingHom.OfLocalizationPrime : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S), (βˆ€ (J : Ideal S) (_ : J.IsPrime), P (Localization.localRingHom _ J f rfl)) β†’ P f #align ring_hom.of_localization_prime RingHom.OfLocalizationPrime structure RingHom.PropertyIsLocal : Prop where LocalizationPreserves : RingHom.LocalizationPreserves @P OfLocalizationSpanTarget : RingHom.OfLocalizationSpanTarget @P StableUnderComposition : RingHom.StableUnderComposition @P HoldsForLocalizationAway : RingHom.HoldsForLocalizationAway @P #align ring_hom.property_is_local RingHom.PropertyIsLocal theorem RingHom.ofLocalizationSpan_iff_finite : RingHom.OfLocalizationSpan @P ↔ RingHom.OfLocalizationFiniteSpan @P := by delta RingHom.OfLocalizationSpan RingHom.OfLocalizationFiniteSpan apply forallβ‚…_congr -- TODO: Using `refine` here breaks `resetI`. intros constructor Β· intro h s; exact h s Β· intro h s hs hs' obtain ⟨s', h₁, hβ‚‚βŸ© := (Ideal.span_eq_top_iff_finite s).mp hs exact h s' hβ‚‚ fun x => hs' ⟨_, h₁ x.prop⟩ #align ring_hom.of_localization_span_iff_finite RingHom.ofLocalizationSpan_iff_finite theorem RingHom.ofLocalizationSpanTarget_iff_finite : RingHom.OfLocalizationSpanTarget @P ↔ RingHom.OfLocalizationFiniteSpanTarget @P := by delta RingHom.OfLocalizationSpanTarget RingHom.OfLocalizationFiniteSpanTarget apply forallβ‚…_congr -- TODO: Using `refine` here breaks `resetI`. intros constructor Β· intro h s; exact h s Β· intro h s hs hs' obtain ⟨s', h₁, hβ‚‚βŸ© := (Ideal.span_eq_top_iff_finite s).mp hs exact h s' hβ‚‚ fun x => hs' ⟨_, h₁ x.prop⟩ #align ring_hom.of_localization_span_target_iff_finite RingHom.ofLocalizationSpanTarget_iff_finite variable {P f R' S'}
Mathlib/RingTheory/LocalProperties.lean
181
189
theorem RingHom.PropertyIsLocal.respectsIso (hP : RingHom.PropertyIsLocal @P) : RingHom.RespectsIso @P := by
apply hP.StableUnderComposition.respectsIso introv letI := e.toRingHom.toAlgebra -- Porting note: was `apply_with hP.holds_for_localization_away { instances := ff }` have : IsLocalization.Away (1 : R) S := by apply IsLocalization.away_of_isUnit_of_bijective _ isUnit_one e.bijective exact RingHom.PropertyIsLocal.HoldsForLocalizationAway hP S (1 : R)
[ " OfLocalizationSpan P ↔ OfLocalizationFiniteSpan P", " (βˆ€ ⦃R S : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] (f : R β†’+* S) (s : Set R),\n Ideal.span s = ⊀ β†’ (βˆ€ (r : ↑s), P (Localization.awayMap f ↑r)) β†’ P f) ↔\n βˆ€ ⦃R S : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] (f : R β†’+* S) (s : Finset R)...
[ " OfLocalizationSpan P ↔ OfLocalizationFiniteSpan P", " (βˆ€ ⦃R S : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] (f : R β†’+* S) (s : Set R),\n Ideal.span s = ⊀ β†’ (βˆ€ (r : ↑s), P (Localization.awayMap f ↑r)) β†’ P f) ↔\n βˆ€ ⦃R S : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] (f : R β†’+* S) (s : Finset R)...
import Mathlib.Data.Part import Mathlib.Data.Rel #align_import data.pfun from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" open Function def PFun (Ξ± Ξ² : Type*) := Ξ± β†’ Part Ξ² #align pfun PFun infixr:25 " β†’. " => PFun namespace PFun variable {Ξ± Ξ² Ξ³ Ξ΄ Ξ΅ ΞΉ : Type*} instance inhabited : Inhabited (Ξ± β†’. Ξ²) := ⟨fun _ => Part.none⟩ #align pfun.inhabited PFun.inhabited def Dom (f : Ξ± β†’. Ξ²) : Set Ξ± := { a | (f a).Dom } #align pfun.dom PFun.Dom @[simp] theorem mem_dom (f : Ξ± β†’. Ξ²) (x : Ξ±) : x ∈ Dom f ↔ βˆƒ y, y ∈ f x := by simp [Dom, Part.dom_iff_mem] #align pfun.mem_dom PFun.mem_dom @[simp] theorem dom_mk (p : Ξ± β†’ Prop) (f : βˆ€ a, p a β†’ Ξ²) : (PFun.Dom fun x => ⟨p x, f x⟩) = { x | p x } := rfl #align pfun.dom_mk PFun.dom_mk theorem dom_eq (f : Ξ± β†’. Ξ²) : Dom f = { x | βˆƒ y, y ∈ f x } := Set.ext (mem_dom f) #align pfun.dom_eq PFun.dom_eq def fn (f : Ξ± β†’. Ξ²) (a : Ξ±) : Dom f a β†’ Ξ² := (f a).get #align pfun.fn PFun.fn @[simp] theorem fn_apply (f : Ξ± β†’. Ξ²) (a : Ξ±) : f.fn a = (f a).get := rfl #align pfun.fn_apply PFun.fn_apply def evalOpt (f : Ξ± β†’. Ξ²) [D : DecidablePred (Β· ∈ Dom f)] (x : Ξ±) : Option Ξ² := @Part.toOption _ _ (D x) #align pfun.eval_opt PFun.evalOpt theorem ext' {f g : Ξ± β†’. Ξ²} (H1 : βˆ€ a, a ∈ Dom f ↔ a ∈ Dom g) (H2 : βˆ€ a p q, f.fn a p = g.fn a q) : f = g := funext fun a => Part.ext' (H1 a) (H2 a) #align pfun.ext' PFun.ext' theorem ext {f g : Ξ± β†’. Ξ²} (H : βˆ€ a b, b ∈ f a ↔ b ∈ g a) : f = g := funext fun a => Part.ext (H a) #align pfun.ext PFun.ext def asSubtype (f : Ξ± β†’. Ξ²) (s : f.Dom) : Ξ² := f.fn s s.2 #align pfun.as_subtype PFun.asSubtype def equivSubtype : (Ξ± β†’. Ξ²) ≃ Ξ£p : Ξ± β†’ Prop, Subtype p β†’ Ξ² := ⟨fun f => ⟨fun a => (f a).Dom, asSubtype f⟩, fun f x => ⟨f.1 x, fun h => f.2 ⟨x, h⟩⟩, fun f => funext fun a => Part.eta _, fun ⟨p, f⟩ => by dsimp; congr⟩ #align pfun.equiv_subtype PFun.equivSubtype theorem asSubtype_eq_of_mem {f : Ξ± β†’. Ξ²} {x : Ξ±} {y : Ξ²} (fxy : y ∈ f x) (domx : x ∈ f.Dom) : f.asSubtype ⟨x, domx⟩ = y := Part.mem_unique (Part.get_mem _) fxy #align pfun.as_subtype_eq_of_mem PFun.asSubtype_eq_of_mem @[coe] protected def lift (f : Ξ± β†’ Ξ²) : Ξ± β†’. Ξ² := fun a => Part.some (f a) #align pfun.lift PFun.lift instance coe : Coe (Ξ± β†’ Ξ²) (Ξ± β†’. Ξ²) := ⟨PFun.lift⟩ #align pfun.has_coe PFun.coe @[simp] theorem coe_val (f : Ξ± β†’ Ξ²) (a : Ξ±) : (f : Ξ± β†’. Ξ²) a = Part.some (f a) := rfl #align pfun.coe_val PFun.coe_val @[simp] theorem dom_coe (f : Ξ± β†’ Ξ²) : (f : Ξ± β†’. Ξ²).Dom = Set.univ := rfl #align pfun.dom_coe PFun.dom_coe theorem lift_injective : Injective (PFun.lift : (Ξ± β†’ Ξ²) β†’ Ξ± β†’. Ξ²) := fun _ _ h => funext fun a => Part.some_injective <| congr_fun h a #align pfun.coe_injective PFun.lift_injective def graph (f : Ξ± β†’. Ξ²) : Set (Ξ± Γ— Ξ²) := { p | p.2 ∈ f p.1 } #align pfun.graph PFun.graph def graph' (f : Ξ± β†’. Ξ²) : Rel Ξ± Ξ² := fun x y => y ∈ f x #align pfun.graph' PFun.graph' def ran (f : Ξ± β†’. Ξ²) : Set Ξ² := { b | βˆƒ a, b ∈ f a } #align pfun.ran PFun.ran def restrict (f : Ξ± β†’. Ξ²) {p : Set Ξ±} (H : p βŠ† f.Dom) : Ξ± β†’. Ξ² := fun x => (f x).restrict (x ∈ p) (@H x) #align pfun.restrict PFun.restrict @[simp] theorem mem_restrict {f : Ξ± β†’. Ξ²} {s : Set Ξ±} (h : s βŠ† f.Dom) (a : Ξ±) (b : Ξ²) : b ∈ f.restrict h a ↔ a ∈ s ∧ b ∈ f a := by simp [restrict] #align pfun.mem_restrict PFun.mem_restrict def res (f : Ξ± β†’ Ξ²) (s : Set Ξ±) : Ξ± β†’. Ξ² := (PFun.lift f).restrict s.subset_univ #align pfun.res PFun.res
Mathlib/Data/PFun.lean
189
190
theorem mem_res (f : Ξ± β†’ Ξ²) (s : Set Ξ±) (a : Ξ±) (b : Ξ²) : b ∈ res f s a ↔ a ∈ s ∧ f a = b := by
simp [res, @eq_comm _ b]
[ " x ∈ f.Dom ↔ βˆƒ y, y ∈ f x", " (fun f => ⟨fun a => (f a).Dom, f.asSubtype⟩) ((fun f x => { Dom := f.fst x, get := fun h => f.snd ⟨x, h⟩ }) ⟨p, f⟩) =\n ⟨p, f⟩", " ⟨fun a => p a, asSubtype fun x => { Dom := p x, get := fun h => f ⟨x, h⟩ }⟩ = ⟨p, f⟩", " b ∈ f.restrict h a ↔ a ∈ s ∧ b ∈ f a", " b ∈ res f s a...
[ " x ∈ f.Dom ↔ βˆƒ y, y ∈ f x", " (fun f => ⟨fun a => (f a).Dom, f.asSubtype⟩) ((fun f x => { Dom := f.fst x, get := fun h => f.snd ⟨x, h⟩ }) ⟨p, f⟩) =\n ⟨p, f⟩", " ⟨fun a => p a, asSubtype fun x => { Dom := p x, get := fun h => f ⟨x, h⟩ }⟩ = ⟨p, f⟩", " b ∈ f.restrict h a ↔ a ∈ s ∧ b ∈ f a" ]
import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.FDeriv.Comp import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars #align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" universe u v w open scoped Classical open Topology Filter ENNReal open Filter Asymptotics Set open ContinuousLinearMap (smulRight smulRight_one_eq_iff) variable {π•œ : Type u} [NontriviallyNormedField π•œ] variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {f fβ‚€ f₁ g : π•œ β†’ F} variable {f' fβ‚€' f₁' g' : F} variable {x : π•œ} variable {s t : Set π•œ} variable {L L₁ Lβ‚‚ : Filter π•œ} section CompositionVector open ContinuousLinearMap variable {l : F β†’ E} {l' : F β†’L[π•œ] E} {y : F} variable (x) theorem HasFDerivWithinAt.comp_hasDerivWithinAt {t : Set F} (hl : HasFDerivWithinAt l l' t (f x)) (hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) : HasDerivWithinAt (l ∘ f) (l' f') s x := by simpa only [one_apply, one_smul, smulRight_apply, coe_comp', (Β· ∘ Β·)] using (hl.comp x hf.hasFDerivWithinAt hst).hasDerivWithinAt #align has_fderiv_within_at.comp_has_deriv_within_at HasFDerivWithinAt.comp_hasDerivWithinAt theorem HasFDerivWithinAt.comp_hasDerivWithinAt_of_eq {t : Set F} (hl : HasFDerivWithinAt l l' t y) (hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) (hy : y = f x) : HasDerivWithinAt (l ∘ f) (l' f') s x := by rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf hst theorem HasFDerivAt.comp_hasDerivWithinAt (hl : HasFDerivAt l l' (f x)) (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (l ∘ f) (l' f') s x := hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf (mapsTo_univ _ _) #align has_fderiv_at.comp_has_deriv_within_at HasFDerivAt.comp_hasDerivWithinAt theorem HasFDerivAt.comp_hasDerivWithinAt_of_eq (hl : HasFDerivAt l l' y) (hf : HasDerivWithinAt f f' s x) (hy : y = f x) : HasDerivWithinAt (l ∘ f) (l' f') s x := by rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf theorem HasFDerivAt.comp_hasDerivAt (hl : HasFDerivAt l l' (f x)) (hf : HasDerivAt f f' x) : HasDerivAt (l ∘ f) (l' f') x := hasDerivWithinAt_univ.mp <| hl.comp_hasDerivWithinAt x hf.hasDerivWithinAt #align has_fderiv_at.comp_has_deriv_at HasFDerivAt.comp_hasDerivAt theorem HasFDerivAt.comp_hasDerivAt_of_eq (hl : HasFDerivAt l l' y) (hf : HasDerivAt f f' x) (hy : y = f x) : HasDerivAt (l ∘ f) (l' f') x := by rw [hy] at hl; exact hl.comp_hasDerivAt x hf theorem HasStrictFDerivAt.comp_hasStrictDerivAt (hl : HasStrictFDerivAt l l' (f x)) (hf : HasStrictDerivAt f f' x) : HasStrictDerivAt (l ∘ f) (l' f') x := by simpa only [one_apply, one_smul, smulRight_apply, coe_comp', (Β· ∘ Β·)] using (hl.comp x hf.hasStrictFDerivAt).hasStrictDerivAt #align has_strict_fderiv_at.comp_has_strict_deriv_at HasStrictFDerivAt.comp_hasStrictDerivAt theorem HasStrictFDerivAt.comp_hasStrictDerivAt_of_eq (hl : HasStrictFDerivAt l l' y) (hf : HasStrictDerivAt f f' x) (hy : y = f x) : HasStrictDerivAt (l ∘ f) (l' f') x := by rw [hy] at hl; exact hl.comp_hasStrictDerivAt x hf theorem fderivWithin.comp_derivWithin {t : Set F} (hl : DifferentiableWithinAt π•œ l t (f x)) (hf : DifferentiableWithinAt π•œ f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt π•œ s x) : derivWithin (l ∘ f) s x = (fderivWithin π•œ l t (f x) : F β†’ E) (derivWithin f s x) := (hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf.hasDerivWithinAt hs).derivWithin hxs #align fderiv_within.comp_deriv_within fderivWithin.comp_derivWithin theorem fderivWithin.comp_derivWithin_of_eq {t : Set F} (hl : DifferentiableWithinAt π•œ l t y) (hf : DifferentiableWithinAt π•œ f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt π•œ s x) (hy : y = f x) : derivWithin (l ∘ f) s x = (fderivWithin π•œ l t (f x) : F β†’ E) (derivWithin f s x) := by rw [hy] at hl; exact fderivWithin.comp_derivWithin x hl hf hs hxs theorem fderiv.comp_deriv (hl : DifferentiableAt π•œ l (f x)) (hf : DifferentiableAt π•œ f x) : deriv (l ∘ f) x = (fderiv π•œ l (f x) : F β†’ E) (deriv f x) := (hl.hasFDerivAt.comp_hasDerivAt x hf.hasDerivAt).deriv #align fderiv.comp_deriv fderiv.comp_deriv
Mathlib/Analysis/Calculus/Deriv/Comp.lean
415
418
theorem fderiv.comp_deriv_of_eq (hl : DifferentiableAt π•œ l y) (hf : DifferentiableAt π•œ f x) (hy : y = f x) : deriv (l ∘ f) x = (fderiv π•œ l (f x) : F β†’ E) (deriv f x) := by
rw [hy] at hl; exact fderiv.comp_deriv x hl hf
[ " HasDerivWithinAt (l ∘ f) (l' f') s x", " HasDerivAt (l ∘ f) (l' f') x", " HasStrictDerivAt (l ∘ f) (l' f') x", " derivWithin (l ∘ f) s x = (fderivWithin π•œ l t (f x)) (derivWithin f s x)", " deriv (l ∘ f) x = (fderiv π•œ l (f x)) (deriv f x)" ]
[ " HasDerivWithinAt (l ∘ f) (l' f') s x", " HasDerivAt (l ∘ f) (l' f') x", " HasStrictDerivAt (l ∘ f) (l' f') x", " derivWithin (l ∘ f) s x = (fderivWithin π•œ l t (f x)) (derivWithin f s x)" ]
import Mathlib.RingTheory.Localization.Basic #align_import ring_theory.localization.integer from "leanprover-community/mathlib"@"9556784a5b84697562e9c6acb40500d4a82e675a" variable {R : Type*} [CommSemiring R] {M : Submonoid R} {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] open Function namespace IsLocalization section variable (R) -- TODO: define a subalgebra of `IsInteger`s def IsInteger (a : S) : Prop := a ∈ (algebraMap R S).rangeS #align is_localization.is_integer IsLocalization.IsInteger end theorem isInteger_zero : IsInteger R (0 : S) := Subsemiring.zero_mem _ #align is_localization.is_integer_zero IsLocalization.isInteger_zero theorem isInteger_one : IsInteger R (1 : S) := Subsemiring.one_mem _ #align is_localization.is_integer_one IsLocalization.isInteger_one theorem isInteger_add {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a + b) := Subsemiring.add_mem _ ha hb #align is_localization.is_integer_add IsLocalization.isInteger_add theorem isInteger_mul {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a * b) := Subsemiring.mul_mem _ ha hb #align is_localization.is_integer_mul IsLocalization.isInteger_mul theorem isInteger_smul {a : R} {b : S} (hb : IsInteger R b) : IsInteger R (a β€’ b) := by rcases hb with ⟨b', hb⟩ use a * b' rw [← hb, (algebraMap R S).map_mul, Algebra.smul_def] #align is_localization.is_integer_smul IsLocalization.isInteger_smul variable (M) variable [IsLocalization M S] theorem exists_integer_multiple' (a : S) : βˆƒ b : M, IsInteger R (a * algebraMap R S b) := let ⟨⟨Num, denom⟩, h⟩ := IsLocalization.surj _ a ⟨denom, Set.mem_range.mpr ⟨Num, h.symm⟩⟩ #align is_localization.exists_integer_multiple' IsLocalization.exists_integer_multiple' theorem exists_integer_multiple (a : S) : βˆƒ b : M, IsInteger R ((b : R) β€’ a) := by simp_rw [Algebra.smul_def, mul_comm _ a] apply exists_integer_multiple' #align is_localization.exists_integer_multiple IsLocalization.exists_integer_multiple
Mathlib/RingTheory/Localization/Integer.lean
91
103
theorem exist_integer_multiples {ΞΉ : Type*} (s : Finset ΞΉ) (f : ΞΉ β†’ S) : βˆƒ b : M, βˆ€ i ∈ s, IsLocalization.IsInteger R ((b : R) β€’ f i) := by
haveI := Classical.propDecidable refine ⟨∏ i ∈ s, (sec M (f i)).2, fun i hi => ⟨?_, ?_⟩⟩ Β· exact (∏ j ∈ s.erase i, (sec M (f j)).2) * (sec M (f i)).1 rw [RingHom.map_mul, sec_spec', ← mul_assoc, ← (algebraMap R S).map_mul, ← Algebra.smul_def] congr 2 refine _root_.trans ?_ (map_prod (Submonoid.subtype M) _ _).symm rw [mul_comm,Submonoid.coe_finset_prod, -- Porting note: explicitly supplied `f` ← Finset.prod_insert (f := fun i => ((sec M (f i)).snd : R)) (s.not_mem_erase i), Finset.insert_erase hi] rfl
[ " IsInteger R (a β€’ b)", " (algebraMap R S) (a * b') = a β€’ b", " βˆƒ b, IsInteger R (↑b β€’ a)", " βˆƒ b, IsInteger R (a * (algebraMap R S) ↑b)", " βˆƒ b, βˆ€ i ∈ s, IsInteger R (↑b β€’ f i)", " R", " (algebraMap R S) (↑(∏ j ∈ s.erase i, (sec M (f j)).2) * (sec M (f i)).1) = ↑(∏ i ∈ s, (sec M (f i)).2) β€’ f i", " (...
[ " IsInteger R (a β€’ b)", " (algebraMap R S) (a * b') = a β€’ b", " βˆƒ b, IsInteger R (↑b β€’ a)", " βˆƒ b, IsInteger R (a * (algebraMap R S) ↑b)" ]
import Mathlib.CategoryTheory.Sites.Sheaf import Mathlib.CategoryTheory.Sites.CoverLifting import Mathlib.CategoryTheory.Adjunction.FullyFaithful #align_import category_theory.sites.dense_subsite from "leanprover-community/mathlib"@"1d650c2e131f500f3c17f33b4d19d2ea15987f2c" universe w v u namespace CategoryTheory variable {C : Type*} [Category C] {D : Type*} [Category D] {E : Type*} [Category E] variable (J : GrothendieckTopology C) (K : GrothendieckTopology D) variable {L : GrothendieckTopology E} -- Porting note(#5171): removed `@[nolint has_nonempty_instance]` structure Presieve.CoverByImageStructure (G : C β₯€ D) {V U : D} (f : V ⟢ U) where obj : C lift : V ⟢ G.obj obj map : G.obj obj ⟢ U fac : lift ≫ map = f := by aesop_cat #align category_theory.presieve.cover_by_image_structure CategoryTheory.Presieve.CoverByImageStructure attribute [nolint docBlame] Presieve.CoverByImageStructure.obj Presieve.CoverByImageStructure.lift Presieve.CoverByImageStructure.map Presieve.CoverByImageStructure.fac attribute [reassoc (attr := simp)] Presieve.CoverByImageStructure.fac def Presieve.coverByImage (G : C β₯€ D) (U : D) : Presieve U := fun _ f => Nonempty (Presieve.CoverByImageStructure G f) #align category_theory.presieve.cover_by_image CategoryTheory.Presieve.coverByImage def Sieve.coverByImage (G : C β₯€ D) (U : D) : Sieve U := ⟨Presieve.coverByImage G U, fun ⟨⟨Z, f₁, fβ‚‚, (e : _ = _)⟩⟩ g => ⟨⟨Z, g ≫ f₁, fβ‚‚, show (g ≫ f₁) ≫ fβ‚‚ = g ≫ _ by rw [Category.assoc, ← e]⟩⟩⟩ #align category_theory.sieve.cover_by_image CategoryTheory.Sieve.coverByImage theorem Presieve.in_coverByImage (G : C β₯€ D) {X : D} {Y : C} (f : G.obj Y ⟢ X) : Presieve.coverByImage G X f := ⟨⟨Y, πŸ™ _, f, by simp⟩⟩ #align category_theory.presieve.in_cover_by_image CategoryTheory.Presieve.in_coverByImage class Functor.IsCoverDense (G : C β₯€ D) (K : GrothendieckTopology D) : Prop where is_cover : βˆ€ U : D, Sieve.coverByImage G U ∈ K U #align category_theory.cover_dense CategoryTheory.Functor.IsCoverDense lemma Functor.is_cover_of_isCoverDense (G : C β₯€ D) (K : GrothendieckTopology D) [G.IsCoverDense K] (U : D) : Sieve.coverByImage G U ∈ K U := by apply Functor.IsCoverDense.is_cover lemma Functor.isCoverDense_of_generate_singleton_functor_Ο€_mem (G : C β₯€ D) (K : GrothendieckTopology D) (h : βˆ€ B, βˆƒ (X : C) (f : G.obj X ⟢ B), Sieve.generate (Presieve.singleton f) ∈ K B) : G.IsCoverDense K where is_cover B := by obtain ⟨X, f, h⟩ := h B refine K.superset_covering ?_ h intro Y f ⟨Z, g, _, h, w⟩ cases h exact ⟨⟨_, g, _, w⟩⟩ attribute [nolint docBlame] CategoryTheory.Functor.IsCoverDense.is_cover open Presieve Opposite namespace Functor namespace IsCoverDense variable {K} variable {A : Type*} [Category A] (G : C β₯€ D) [G.IsCoverDense K] -- this is not marked with `@[ext]` because `H` can not be inferred from the type
Mathlib/CategoryTheory/Sites/DenseSubsite.lean
124
128
theorem ext (β„± : SheafOfTypes K) (X : D) {s t : β„±.val.obj (op X)} (h : βˆ€ ⦃Y : C⦄ (f : G.obj Y ⟢ X), β„±.val.map f.op s = β„±.val.map f.op t) : s = t := by
apply (β„±.cond (Sieve.coverByImage G X) (G.is_cover_of_isCoverDense K X)).isSeparatedFor.ext rintro Y _ ⟨Z, f₁, fβ‚‚, ⟨rfl⟩⟩ simp [h fβ‚‚]
[ " (g ≫ f₁) ≫ fβ‚‚ = g ≫ f✝", " πŸ™ (G.obj Y) ≫ f = f", " Sieve.coverByImage G U ∈ K.sieves U", " Sieve.coverByImage G B ∈ K.sieves B", " Sieve.generate (Presieve.singleton f) ≀ Sieve.coverByImage G B", " (Sieve.coverByImage G B).arrows f", " s = t", " βˆ€ ⦃Y : D⦄ ⦃f : Y ⟢ X⦄, (Sieve.coverByImage G X).arrow...
[ " (g ≫ f₁) ≫ fβ‚‚ = g ≫ f✝", " πŸ™ (G.obj Y) ≫ f = f", " Sieve.coverByImage G U ∈ K.sieves U", " Sieve.coverByImage G B ∈ K.sieves B", " Sieve.generate (Presieve.singleton f) ≀ Sieve.coverByImage G B", " (Sieve.coverByImage G B).arrows f" ]
import Mathlib.Algebra.Order.Group.Abs import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax #align_import algebra.order.group.min_max from "leanprover-community/mathlib"@"10b4e499f43088dd3bb7b5796184ad5216648ab1" section variable {Ξ± : Type*} [Group Ξ±] [LinearOrder Ξ±] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· ≀ Β·)] -- TODO: This duplicates `oneLePart_div_leOnePart` @[to_additive (attr := simp)] theorem max_one_div_max_inv_one_eq_self (a : Ξ±) : max a 1 / max a⁻¹ 1 = a := by rcases le_total a 1 with (h | h) <;> simp [h] #align max_one_div_max_inv_one_eq_self max_one_div_max_inv_one_eq_self #align max_zero_sub_max_neg_zero_eq_self max_zero_sub_max_neg_zero_eq_self alias max_zero_sub_eq_self := max_zero_sub_max_neg_zero_eq_self #align max_zero_sub_eq_self max_zero_sub_eq_self @[to_additive] lemma max_inv_one (a : Ξ±) : max a⁻¹ 1 = a⁻¹ * max a 1 := by rw [eq_inv_mul_iff_mul_eq, ← eq_div_iff_mul_eq', max_one_div_max_inv_one_eq_self] end section LinearOrderedCommGroup variable {Ξ± : Type*} [LinearOrderedCommGroup Ξ±] {a b c : Ξ±} @[to_additive min_neg_neg] theorem min_inv_inv' (a b : Ξ±) : min a⁻¹ b⁻¹ = (max a b)⁻¹ := Eq.symm <| (@Monotone.map_max Ξ± Ξ±α΅’α΅ˆ _ _ Inv.inv a b) fun _ _ => -- Porting note: Explicit `Ξ±` necessary to infer `CovariantClass` instance (@inv_le_inv_iff Ξ± _ _ _).mpr #align min_inv_inv' min_inv_inv' #align min_neg_neg min_neg_neg @[to_additive max_neg_neg] theorem max_inv_inv' (a b : Ξ±) : max a⁻¹ b⁻¹ = (min a b)⁻¹ := Eq.symm <| (@Monotone.map_min Ξ± Ξ±α΅’α΅ˆ _ _ Inv.inv a b) fun _ _ => -- Porting note: Explicit `Ξ±` necessary to infer `CovariantClass` instance (@inv_le_inv_iff Ξ± _ _ _).mpr #align max_inv_inv' max_inv_inv' #align max_neg_neg max_neg_neg @[to_additive min_sub_sub_right] theorem min_div_div_right' (a b c : Ξ±) : min (a / c) (b / c) = min a b / c := by simpa only [div_eq_mul_inv] using min_mul_mul_right a b c⁻¹ #align min_div_div_right' min_div_div_right' #align min_sub_sub_right min_sub_sub_right @[to_additive max_sub_sub_right] theorem max_div_div_right' (a b c : Ξ±) : max (a / c) (b / c) = max a b / c := by simpa only [div_eq_mul_inv] using max_mul_mul_right a b c⁻¹ #align max_div_div_right' max_div_div_right' #align max_sub_sub_right max_sub_sub_right @[to_additive min_sub_sub_left]
Mathlib/Algebra/Order/Group/MinMax.lean
69
70
theorem min_div_div_left' (a b c : Ξ±) : min (a / b) (a / c) = a / max b c := by
simp only [div_eq_mul_inv, min_mul_mul_left, min_inv_inv']
[ " max a 1 / max a⁻¹ 1 = a", " max a⁻¹ 1 = a⁻¹ * max a 1", " min (a / c) (b / c) = min a b / c", " max (a / c) (b / c) = max a b / c", " min (a / b) (a / c) = a / max b c" ]
[ " max a 1 / max a⁻¹ 1 = a", " max a⁻¹ 1 = a⁻¹ * max a 1", " min (a / c) (b / c) = min a b / c", " max (a / c) (b / c) = max a b / c" ]
import Mathlib.Algebra.Group.Prod import Mathlib.Data.Set.Lattice #align_import data.nat.pairing from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" assert_not_exists MonoidWithZero open Prod Decidable Function namespace Nat -- Porting note: no pp_nodot --@[pp_nodot] def pair (a b : β„•) : β„• := if a < b then b * b + a else a * a + a + b #align nat.mkpair Nat.pair -- Porting note: no pp_nodot --@[pp_nodot] def unpair (n : β„•) : β„• Γ— β„• := let s := sqrt n if n - s * s < s then (n - s * s, s) else (s, n - s * s - s) #align nat.unpair Nat.unpair @[simp] theorem pair_unpair (n : β„•) : pair (unpair n).1 (unpair n).2 = n := by dsimp only [unpair]; let s := sqrt n have sm : s * s + (n - s * s) = n := Nat.add_sub_cancel' (sqrt_le _) split_ifs with h Β· simp [pair, h, sm] Β· have hl : n - s * s - s ≀ s := Nat.sub_le_iff_le_add.2 (Nat.sub_le_iff_le_add'.2 <| by rw [← Nat.add_assoc]; apply sqrt_le_add) simp [pair, hl.not_lt, Nat.add_assoc, Nat.add_sub_cancel' (le_of_not_gt h), sm] #align nat.mkpair_unpair Nat.pair_unpair theorem pair_unpair' {n a b} (H : unpair n = (a, b)) : pair a b = n := by simpa [H] using pair_unpair n #align nat.mkpair_unpair' Nat.pair_unpair' @[simp] theorem unpair_pair (a b : β„•) : unpair (pair a b) = (a, b) := by dsimp only [pair]; split_ifs with h Β· show unpair (b * b + a) = (a, b) have be : sqrt (b * b + a) = b := sqrt_add_eq _ (le_trans (le_of_lt h) (Nat.le_add_left _ _)) simp [unpair, be, Nat.add_sub_cancel_left, h] Β· show unpair (a * a + a + b) = (a, b) have ae : sqrt (a * a + (a + b)) = a := by rw [sqrt_add_eq] exact Nat.add_le_add_left (le_of_not_gt h) _ simp [unpair, ae, Nat.not_lt_zero, Nat.add_assoc, Nat.add_sub_cancel_left] #align nat.unpair_mkpair Nat.unpair_pair @[simps (config := .asFn)] def pairEquiv : β„• Γ— β„• ≃ β„• := ⟨uncurry pair, unpair, fun ⟨a, b⟩ => unpair_pair a b, pair_unpair⟩ #align nat.mkpair_equiv Nat.pairEquiv #align nat.mkpair_equiv_apply Nat.pairEquiv_apply #align nat.mkpair_equiv_symm_apply Nat.pairEquiv_symm_apply theorem surjective_unpair : Surjective unpair := pairEquiv.symm.surjective #align nat.surjective_unpair Nat.surjective_unpair @[simp] theorem pair_eq_pair {a b c d : β„•} : pair a b = pair c d ↔ a = c ∧ b = d := pairEquiv.injective.eq_iff.trans (@Prod.ext_iff β„• β„• (a, b) (c, d)) #align nat.mkpair_eq_mkpair Nat.pair_eq_pair
Mathlib/Data/Nat/Pairing.lean
93
100
theorem unpair_lt {n : β„•} (n1 : 1 ≀ n) : (unpair n).1 < n := by
let s := sqrt n simp only [unpair, ge_iff_le, Nat.sub_le_iff_le_add] by_cases h : n - s * s < s <;> simp [h] Β· exact lt_of_lt_of_le h (sqrt_le_self _) Β· simp at h have s0 : 0 < s := sqrt_pos.2 n1 exact lt_of_le_of_lt h (Nat.sub_lt n1 (Nat.mul_pos s0 s0))
[ " n.unpair.1.pair n.unpair.2 = n", " (if n - n.sqrt * n.sqrt < n.sqrt then (n - n.sqrt * n.sqrt, n.sqrt)\n else (n.sqrt, n - n.sqrt * n.sqrt - n.sqrt)).1.pair\n (if n - n.sqrt * n.sqrt < n.sqrt then (n - n.sqrt * n.sqrt, n.sqrt)\n else (n.sqrt, n - n.sqrt * n.sqrt - n.sqrt)).2 =\n n", " ...
[ " n.unpair.1.pair n.unpair.2 = n", " (if n - n.sqrt * n.sqrt < n.sqrt then (n - n.sqrt * n.sqrt, n.sqrt)\n else (n.sqrt, n - n.sqrt * n.sqrt - n.sqrt)).1.pair\n (if n - n.sqrt * n.sqrt < n.sqrt then (n - n.sqrt * n.sqrt, n.sqrt)\n else (n.sqrt, n - n.sqrt * n.sqrt - n.sqrt)).2 =\n n", " ...
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine #align_import geometry.euclidean.angle.unoriented.right_angle from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" noncomputable section open scoped EuclideanGeometry open scoped Real open scoped RealInnerProductSpace namespace InnerProductGeometry variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] theorem norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two (x y : V) : β€–x + yβ€– * β€–x + yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– ↔ angle x y = Ο€ / 2 := by rw [norm_add_sq_eq_norm_sq_add_norm_sq_iff_real_inner_eq_zero] exact inner_eq_zero_iff_angle_eq_pi_div_two x y #align inner_product_geometry.norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two InnerProductGeometry.norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two theorem norm_add_sq_eq_norm_sq_add_norm_sq' (x y : V) (h : angle x y = Ο€ / 2) : β€–x + yβ€– * β€–x + yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– := (norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two x y).2 h #align inner_product_geometry.norm_add_sq_eq_norm_sq_add_norm_sq' InnerProductGeometry.norm_add_sq_eq_norm_sq_add_norm_sq'
Mathlib/Geometry/Euclidean/Angle/Unoriented/RightAngle.lean
56
59
theorem norm_sub_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two (x y : V) : β€–x - yβ€– * β€–x - yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– ↔ angle x y = Ο€ / 2 := by
rw [norm_sub_sq_eq_norm_sq_add_norm_sq_iff_real_inner_eq_zero] exact inner_eq_zero_iff_angle_eq_pi_div_two x y
[ " β€–x + yβ€– * β€–x + yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– ↔ angle x y = Ο€ / 2", " βŸͺx, y⟫_ℝ = 0 ↔ angle x y = Ο€ / 2", " β€–x - yβ€– * β€–x - yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– ↔ angle x y = Ο€ / 2" ]
[ " β€–x + yβ€– * β€–x + yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– ↔ angle x y = Ο€ / 2", " βŸͺx, y⟫_ℝ = 0 ↔ angle x y = Ο€ / 2" ]
import Mathlib.Topology.Separation #align_import topology.sober from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Set variable {Ξ± Ξ² : Type*} [TopologicalSpace Ξ±] [TopologicalSpace Ξ²] section genericPoint def IsGenericPoint (x : Ξ±) (S : Set Ξ±) : Prop := closure ({x} : Set Ξ±) = S #align is_generic_point IsGenericPoint theorem isGenericPoint_def {x : Ξ±} {S : Set Ξ±} : IsGenericPoint x S ↔ closure ({x} : Set Ξ±) = S := Iff.rfl #align is_generic_point_def isGenericPoint_def theorem IsGenericPoint.def {x : Ξ±} {S : Set Ξ±} (h : IsGenericPoint x S) : closure ({x} : Set Ξ±) = S := h #align is_generic_point.def IsGenericPoint.def theorem isGenericPoint_closure {x : Ξ±} : IsGenericPoint x (closure ({x} : Set Ξ±)) := refl _ #align is_generic_point_closure isGenericPoint_closure variable {x y : Ξ±} {S U Z : Set Ξ±} theorem isGenericPoint_iff_specializes : IsGenericPoint x S ↔ βˆ€ y, x β€³ y ↔ y ∈ S := by simp only [specializes_iff_mem_closure, IsGenericPoint, Set.ext_iff] #align is_generic_point_iff_specializes isGenericPoint_iff_specializes
Mathlib/Topology/Sober.lean
107
111
theorem isGenericPoint_iff_forall_closed (hS : IsClosed S) (hxS : x ∈ S) : IsGenericPoint x S ↔ βˆ€ Z : Set Ξ±, IsClosed Z β†’ x ∈ Z β†’ S βŠ† Z := by
have : closure {x} βŠ† S := closure_minimal (singleton_subset_iff.2 hxS) hS simp_rw [IsGenericPoint, subset_antisymm_iff, this, true_and_iff, closure, subset_sInter_iff, mem_setOf_eq, and_imp, singleton_subset_iff]
[ " IsGenericPoint x S ↔ βˆ€ (y : Ξ±), x β€³ y ↔ y ∈ S", " IsGenericPoint x S ↔ βˆ€ (Z : Set Ξ±), IsClosed Z β†’ x ∈ Z β†’ S βŠ† Z" ]
[ " IsGenericPoint x S ↔ βˆ€ (y : Ξ±), x β€³ y ↔ y ∈ S" ]
import Mathlib.Data.Nat.Factorial.Basic import Mathlib.Order.Monotone.Basic #align_import data.nat.choose.basic from "leanprover-community/mathlib"@"2f3994e1b117b1e1da49bcfb67334f33460c3ce4" open Nat namespace Nat def choose : β„• β†’ β„• β†’ β„• | _, 0 => 1 | 0, _ + 1 => 0 | n + 1, k + 1 => choose n k + choose n (k + 1) #align nat.choose Nat.choose @[simp] theorem choose_zero_right (n : β„•) : choose n 0 = 1 := by cases n <;> rfl #align nat.choose_zero_right Nat.choose_zero_right @[simp] theorem choose_zero_succ (k : β„•) : choose 0 (succ k) = 0 := rfl #align nat.choose_zero_succ Nat.choose_zero_succ theorem choose_succ_succ (n k : β„•) : choose (succ n) (succ k) = choose n k + choose n (succ k) := rfl #align nat.choose_succ_succ Nat.choose_succ_succ theorem choose_succ_succ' (n k : β„•) : choose (n + 1) (k + 1) = choose n k + choose n (k + 1) := rfl theorem choose_eq_zero_of_lt : βˆ€ {n k}, n < k β†’ choose n k = 0 | _, 0, hk => absurd hk (Nat.not_lt_zero _) | 0, k + 1, _ => choose_zero_succ _ | n + 1, k + 1, hk => by have hnk : n < k := lt_of_succ_lt_succ hk have hnk1 : n < k + 1 := lt_of_succ_lt hk rw [choose_succ_succ, choose_eq_zero_of_lt hnk, choose_eq_zero_of_lt hnk1] #align nat.choose_eq_zero_of_lt Nat.choose_eq_zero_of_lt @[simp] theorem choose_self (n : β„•) : choose n n = 1 := by induction n <;> simp [*, choose, choose_eq_zero_of_lt (lt_succ_self _)] #align nat.choose_self Nat.choose_self @[simp] theorem choose_succ_self (n : β„•) : choose n (succ n) = 0 := choose_eq_zero_of_lt (lt_succ_self _) #align nat.choose_succ_self Nat.choose_succ_self @[simp] lemma choose_one_right (n : β„•) : choose n 1 = n := by induction n <;> simp [*, choose, Nat.add_comm] #align nat.choose_one_right Nat.choose_one_right -- The `n+1`-st triangle number is `n` more than the `n`-th triangle number theorem triangle_succ (n : β„•) : (n + 1) * (n + 1 - 1) / 2 = n * (n - 1) / 2 + n := by rw [← add_mul_div_left, Nat.mul_comm 2 n, ← Nat.mul_add, Nat.add_sub_cancel, Nat.mul_comm] cases n <;> rfl; apply zero_lt_succ #align nat.triangle_succ Nat.triangle_succ theorem choose_two_right (n : β„•) : choose n 2 = n * (n - 1) / 2 := by induction' n with n ih Β· simp Β· rw [triangle_succ n, choose, ih] simp [Nat.add_comm] #align nat.choose_two_right Nat.choose_two_right theorem choose_pos : βˆ€ {n k}, k ≀ n β†’ 0 < choose n k | 0, _, hk => by rw [Nat.eq_zero_of_le_zero hk]; decide | n + 1, 0, _ => by simp | n + 1, k + 1, hk => Nat.add_pos_left (choose_pos (le_of_succ_le_succ hk)) _ #align nat.choose_pos Nat.choose_pos theorem choose_eq_zero_iff {n k : β„•} : n.choose k = 0 ↔ n < k := ⟨fun h => lt_of_not_ge (mt Nat.choose_pos h.symm.not_lt), Nat.choose_eq_zero_of_lt⟩ #align nat.choose_eq_zero_iff Nat.choose_eq_zero_iff theorem succ_mul_choose_eq : βˆ€ n k, succ n * choose n k = choose (succ n) (succ k) * succ k | 0, 0 => by decide | 0, k + 1 => by simp [choose] | n + 1, 0 => by simp [choose, mul_succ, succ_eq_add_one, Nat.add_comm] | n + 1, k + 1 => by rw [choose_succ_succ (succ n) (succ k), Nat.add_mul, ← succ_mul_choose_eq n, mul_succ, ← succ_mul_choose_eq n, Nat.add_right_comm, ← Nat.mul_add, ← choose_succ_succ, ← succ_mul] #align nat.succ_mul_choose_eq Nat.succ_mul_choose_eq
Mathlib/Data/Nat/Choose/Basic.lean
125
142
theorem choose_mul_factorial_mul_factorial : βˆ€ {n k}, k ≀ n β†’ choose n k * k ! * (n - k)! = n ! | 0, _, hk => by simp [Nat.eq_zero_of_le_zero hk] | n + 1, 0, _ => by simp | n + 1, succ k, hk => by rcases lt_or_eq_of_le hk with hk₁ | hk₁ Β· have h : choose n k * k.succ ! * (n - k)! = (k + 1) * n ! := by
rw [← choose_mul_factorial_mul_factorial (le_of_succ_le_succ hk)] simp [factorial_succ, Nat.mul_comm, Nat.mul_left_comm, Nat.mul_assoc] have h₁ : (n - k)! = (n - k) * (n - k.succ)! := by rw [← succ_sub_succ, succ_sub (le_of_lt_succ hk₁), factorial_succ] have hβ‚‚ : choose n (succ k) * k.succ ! * ((n - k) * (n - k.succ)!) = (n - k) * n ! := by rw [← choose_mul_factorial_mul_factorial (le_of_lt_succ hk₁)] simp [factorial_succ, Nat.mul_comm, Nat.mul_left_comm, Nat.mul_assoc] have h₃ : k * n ! ≀ n * n ! := Nat.mul_le_mul_right _ (le_of_succ_le_succ hk) rw [choose_succ_succ, Nat.add_mul, Nat.add_mul, succ_sub_succ, h, h₁, hβ‚‚, Nat.add_mul, Nat.mul_sub_right_distrib, factorial_succ, ← Nat.add_sub_assoc h₃, Nat.add_assoc, ← Nat.add_mul, Nat.add_sub_cancel_left, Nat.add_comm] Β· rw [hk₁]; simp [hk₁, Nat.mul_comm, choose, Nat.sub_self]
[ " n.choose 0 = 1", " choose 0 0 = 1", " (n✝ + 1).choose 0 = 1", " (n + 1).choose (k + 1) = 0", " n.choose n = 1", " (n✝ + 1).choose (n✝ + 1) = 1", " n.choose 1 = n", " choose 0 1 = 0", " (n✝ + 1).choose 1 = n✝ + 1", " (n + 1) * (n + 1 - 1) / 2 = n * (n - 1) / 2 + n", " n * (n + 1) / 2 = n * (n -...
[ " n.choose 0 = 1", " choose 0 0 = 1", " (n✝ + 1).choose 0 = 1", " (n + 1).choose (k + 1) = 0", " n.choose n = 1", " (n✝ + 1).choose (n✝ + 1) = 1", " n.choose 1 = n", " choose 0 1 = 0", " (n✝ + 1).choose 1 = n✝ + 1", " (n + 1) * (n + 1 - 1) / 2 = n * (n - 1) / 2 + n", " n * (n + 1) / 2 = n * (n -...
import Mathlib.Algebra.Polynomial.Eval import Mathlib.RingTheory.Ideal.Quotient #align_import linear_algebra.smodeq from "leanprover-community/mathlib"@"146d3d1fa59c091fedaad8a4afa09d6802886d24" open Submodule open Polynomial variable {R : Type*} [Ring R] variable {A : Type*} [CommRing A] variable {M : Type*} [AddCommGroup M] [Module R M] (U U₁ Uβ‚‚ : Submodule R M) variable {x x₁ xβ‚‚ y y₁ yβ‚‚ z z₁ zβ‚‚ : M} variable {N : Type*} [AddCommGroup N] [Module R N] (V V₁ Vβ‚‚ : Submodule R N) set_option backward.isDefEq.lazyWhnfCore false in -- See https://github.com/leanprover-community/mathlib4/issues/12534 def SModEq (x y : M) : Prop := (Submodule.Quotient.mk x : M β§Έ U) = Submodule.Quotient.mk y #align smodeq SModEq notation:50 x " ≑ " y " [SMOD " N "]" => SModEq N x y variable {U U₁ Uβ‚‚} set_option backward.isDefEq.lazyWhnfCore false in -- See https://github.com/leanprover-community/mathlib4/issues/12534 protected theorem SModEq.def : x ≑ y [SMOD U] ↔ (Submodule.Quotient.mk x : M β§Έ U) = Submodule.Quotient.mk y := Iff.rfl #align smodeq.def SModEq.def namespace SModEq theorem sub_mem : x ≑ y [SMOD U] ↔ x - y ∈ U := by rw [SModEq.def, Submodule.Quotient.eq] #align smodeq.sub_mem SModEq.sub_mem @[simp] theorem top : x ≑ y [SMOD (⊀ : Submodule R M)] := (Submodule.Quotient.eq ⊀).2 mem_top #align smodeq.top SModEq.top @[simp]
Mathlib/LinearAlgebra/SModEq.lean
53
54
theorem bot : x ≑ y [SMOD (βŠ₯ : Submodule R M)] ↔ x = y := by
rw [SModEq.def, Submodule.Quotient.eq, mem_bot, sub_eq_zero]
[ " x ≑ y [SMOD U] ↔ x - y ∈ U", " x ≑ y [SMOD βŠ₯] ↔ x = y" ]
[ " x ≑ y [SMOD U] ↔ x - y ∈ U" ]
import Mathlib.Algebra.Group.Basic import Mathlib.Order.Basic import Mathlib.Order.Monotone.Basic #align_import algebra.covariant_and_contravariant from "leanprover-community/mathlib"@"2258b40dacd2942571c8ce136215350c702dc78f" -- TODO: convert `ExistsMulOfLE`, `ExistsAddOfLE`? -- TODO: relationship with `Con/AddCon` -- TODO: include equivalence of `LeftCancelSemigroup` with -- `Semigroup PartialOrder ContravariantClass Ξ± Ξ± (*) (≀)`? -- TODO : use β‡’, as per Eric's suggestion? See -- https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/ordered.20stuff/near/236148738 -- for a discussion. open Function section Variants variable {M N : Type*} (ΞΌ : M β†’ N β†’ N) (r : N β†’ N β†’ Prop) variable (M N) def Covariant : Prop := βˆ€ (m) {n₁ nβ‚‚}, r n₁ nβ‚‚ β†’ r (ΞΌ m n₁) (ΞΌ m nβ‚‚) #align covariant Covariant def Contravariant : Prop := βˆ€ (m) {n₁ nβ‚‚}, r (ΞΌ m n₁) (ΞΌ m nβ‚‚) β†’ r n₁ nβ‚‚ #align contravariant Contravariant class CovariantClass : Prop where protected elim : Covariant M N ΞΌ r #align covariant_class CovariantClass class ContravariantClass : Prop where protected elim : Contravariant M N ΞΌ r #align contravariant_class ContravariantClass theorem rel_iff_cov [CovariantClass M N ΞΌ r] [ContravariantClass M N ΞΌ r] (m : M) {a b : N} : r (ΞΌ m a) (ΞΌ m b) ↔ r a b := ⟨ContravariantClass.elim _, CovariantClass.elim _⟩ #align rel_iff_cov rel_iff_cov section Covariant variable {M N ΞΌ r} [CovariantClass M N ΞΌ r] theorem act_rel_act_of_rel (m : M) {a b : N} (ab : r a b) : r (ΞΌ m a) (ΞΌ m b) := CovariantClass.elim _ ab #align act_rel_act_of_rel act_rel_act_of_rel @[to_additive] theorem Group.covariant_iff_contravariant [Group N] : Covariant N N (Β· * Β·) r ↔ Contravariant N N (Β· * Β·) r := by refine ⟨fun h a b c bc ↦ ?_, fun h a b c bc ↦ ?_⟩ Β· rw [← inv_mul_cancel_left a b, ← inv_mul_cancel_left a c] exact h a⁻¹ bc Β· rw [← inv_mul_cancel_left a b, ← inv_mul_cancel_left a c] at bc exact h a⁻¹ bc #align group.covariant_iff_contravariant Group.covariant_iff_contravariant #align add_group.covariant_iff_contravariant AddGroup.covariant_iff_contravariant @[to_additive] instance (priority := 100) Group.covconv [Group N] [CovariantClass N N (Β· * Β·) r] : ContravariantClass N N (Β· * Β·) r := ⟨Group.covariant_iff_contravariant.mp CovariantClass.elim⟩ @[to_additive] theorem Group.covariant_swap_iff_contravariant_swap [Group N] : Covariant N N (swap (Β· * Β·)) r ↔ Contravariant N N (swap (Β· * Β·)) r := by refine ⟨fun h a b c bc ↦ ?_, fun h a b c bc ↦ ?_⟩ Β· rw [← mul_inv_cancel_right b a, ← mul_inv_cancel_right c a] exact h a⁻¹ bc Β· rw [← mul_inv_cancel_right b a, ← mul_inv_cancel_right c a] at bc exact h a⁻¹ bc #align group.covariant_swap_iff_contravariant_swap Group.covariant_swap_iff_contravariant_swap #align add_group.covariant_swap_iff_contravariant_swap AddGroup.covariant_swap_iff_contravariant_swap @[to_additive] instance (priority := 100) Group.covconv_swap [Group N] [CovariantClass N N (swap (Β· * Β·)) r] : ContravariantClass N N (swap (Β· * Β·)) r := ⟨Group.covariant_swap_iff_contravariant_swap.mp CovariantClass.elim⟩ -- Lemma with 4 elements.
Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean
281
286
theorem covariant_le_of_covariant_lt [PartialOrder N] : Covariant M N ΞΌ (Β· < Β·) β†’ Covariant M N ΞΌ (Β· ≀ Β·) := by
intro h a b c bc rcases bc.eq_or_lt with (rfl | bc) Β· exact le_rfl Β· exact (h _ bc).le
[ " Covariant N N (fun x x_1 => x * x_1) r ↔ Contravariant N N (fun x x_1 => x * x_1) r", " r b c", " r (a⁻¹ * (a * b)) (a⁻¹ * (a * c))", " r ((fun x x_1 => x * x_1) a b) ((fun x x_1 => x * x_1) a c)", " Covariant N N (swap fun x x_1 => x * x_1) r ↔ Contravariant N N (swap fun x x_1 => x * x_1) r", " r (b *...
[ " Covariant N N (fun x x_1 => x * x_1) r ↔ Contravariant N N (fun x x_1 => x * x_1) r", " r b c", " r (a⁻¹ * (a * b)) (a⁻¹ * (a * c))", " r ((fun x x_1 => x * x_1) a b) ((fun x x_1 => x * x_1) a c)", " Covariant N N (swap fun x x_1 => x * x_1) r ↔ Contravariant N N (swap fun x x_1 => x * x_1) r", " r (b *...
import Mathlib.Topology.Constructions #align_import topology.continuous_on from "leanprover-community/mathlib"@"d4f691b9e5f94cfc64639973f3544c95f8d5d494" open Set Filter Function Topology Filter variable {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*} {Ξ΄ : Type*} variable [TopologicalSpace Ξ±] @[simp] theorem nhds_bind_nhdsWithin {a : Ξ±} {s : Set Ξ±} : ((𝓝 a).bind fun x => 𝓝[s] x) = 𝓝[s] a := bind_inf_principal.trans <| congr_argβ‚‚ _ nhds_bind_nhds rfl #align nhds_bind_nhds_within nhds_bind_nhdsWithin @[simp] theorem eventually_nhds_nhdsWithin {a : Ξ±} {s : Set Ξ±} {p : Ξ± β†’ Prop} : (βˆ€αΆ  y in 𝓝 a, βˆ€αΆ  x in 𝓝[s] y, p x) ↔ βˆ€αΆ  x in 𝓝[s] a, p x := Filter.ext_iff.1 nhds_bind_nhdsWithin { x | p x } #align eventually_nhds_nhds_within eventually_nhds_nhdsWithin theorem eventually_nhdsWithin_iff {a : Ξ±} {s : Set Ξ±} {p : Ξ± β†’ Prop} : (βˆ€αΆ  x in 𝓝[s] a, p x) ↔ βˆ€αΆ  x in 𝓝 a, x ∈ s β†’ p x := eventually_inf_principal #align eventually_nhds_within_iff eventually_nhdsWithin_iff theorem frequently_nhdsWithin_iff {z : Ξ±} {s : Set Ξ±} {p : Ξ± β†’ Prop} : (βˆƒαΆ  x in 𝓝[s] z, p x) ↔ βˆƒαΆ  x in 𝓝 z, p x ∧ x ∈ s := frequently_inf_principal.trans <| by simp only [and_comm] #align frequently_nhds_within_iff frequently_nhdsWithin_iff
Mathlib/Topology/ContinuousOn.lean
57
59
theorem mem_closure_ne_iff_frequently_within {z : Ξ±} {s : Set Ξ±} : z ∈ closure (s \ {z}) ↔ βˆƒαΆ  x in 𝓝[β‰ ] z, x ∈ s := by
simp [mem_closure_iff_frequently, frequently_nhdsWithin_iff]
[ " (βˆƒαΆ  (x : Ξ±) in 𝓝 z, x ∈ s ∧ p x) ↔ βˆƒαΆ  (x : Ξ±) in 𝓝 z, p x ∧ x ∈ s", " z ∈ closure (s \\ {z}) ↔ βˆƒαΆ  (x : Ξ±) in 𝓝[β‰ ] z, x ∈ s" ]
[ " (βˆƒαΆ  (x : Ξ±) in 𝓝 z, x ∈ s ∧ p x) ↔ βˆƒαΆ  (x : Ξ±) in 𝓝 z, p x ∧ x ∈ s" ]
import Mathlib.Analysis.Convex.Normed import Mathlib.Analysis.Convex.Strict import Mathlib.Analysis.Normed.Order.Basic import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.NormedSpace.Ray #align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f" open Convex Pointwise Set Metric class StrictConvexSpace (π•œ E : Type*) [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] : Prop where strictConvex_closedBall : βˆ€ r : ℝ, 0 < r β†’ StrictConvex π•œ (closedBall (0 : E) r) #align strict_convex_space StrictConvexSpace variable (π•œ : Type*) {E : Type*} [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E]
Mathlib/Analysis/Convex/StrictConvexSpace.lean
76
81
theorem strictConvex_closedBall [StrictConvexSpace π•œ E] (x : E) (r : ℝ) : StrictConvex π•œ (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr Β· exact (subsingleton_closedBall x hr).strictConvex rw [← vadd_closedBall_zero] exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
[ " StrictConvex π•œ (closedBall x r)", " StrictConvex π•œ (x +α΅₯ closedBall 0 r)" ]
[]
import Mathlib.Order.Filter.CountableInter set_option autoImplicit true open Function Set Filter class HasCountableSeparatingOn (Ξ± : Type*) (p : Set Ξ± β†’ Prop) (t : Set Ξ±) : Prop where exists_countable_separating : βˆƒ S : Set (Set Ξ±), S.Countable ∧ (βˆ€ s ∈ S, p s) ∧ βˆ€ x ∈ t, βˆ€ y ∈ t, (βˆ€ s ∈ S, x ∈ s ↔ y ∈ s) β†’ x = y theorem exists_countable_separating (Ξ± : Type*) (p : Set Ξ± β†’ Prop) (t : Set Ξ±) [h : HasCountableSeparatingOn Ξ± p t] : βˆƒ S : Set (Set Ξ±), S.Countable ∧ (βˆ€ s ∈ S, p s) ∧ βˆ€ x ∈ t, βˆ€ y ∈ t, (βˆ€ s ∈ S, x ∈ s ↔ y ∈ s) β†’ x = y := h.1 theorem exists_nonempty_countable_separating (Ξ± : Type*) {p : Set Ξ± β†’ Prop} {sβ‚€} (hp : p sβ‚€) (t : Set Ξ±) [HasCountableSeparatingOn Ξ± p t] : βˆƒ S : Set (Set Ξ±), S.Nonempty ∧ S.Countable ∧ (βˆ€ s ∈ S, p s) ∧ βˆ€ x ∈ t, βˆ€ y ∈ t, (βˆ€ s ∈ S, x ∈ s ↔ y ∈ s) β†’ x = y := let ⟨S, hSc, hSp, hSt⟩ := exists_countable_separating Ξ± p t ⟨insert sβ‚€ S, insert_nonempty _ _, hSc.insert _, forall_insert_of_forall hSp hp, fun x hx y hy hxy ↦ hSt x hx y hy <| forall_of_forall_insert hxy⟩ theorem exists_seq_separating (Ξ± : Type*) {p : Set Ξ± β†’ Prop} {sβ‚€} (hp : p sβ‚€) (t : Set Ξ±) [HasCountableSeparatingOn Ξ± p t] : βˆƒ S : β„• β†’ Set Ξ±, (βˆ€ n, p (S n)) ∧ βˆ€ x ∈ t, βˆ€ y ∈ t, (βˆ€ n, x ∈ S n ↔ y ∈ S n) β†’ x = y := by rcases exists_nonempty_countable_separating Ξ± hp t with ⟨S, hSne, hSc, hS⟩ rcases hSc.exists_eq_range hSne with ⟨S, rfl⟩ use S simpa only [forall_mem_range] using hS theorem HasCountableSeparatingOn.mono {Ξ±} {p₁ pβ‚‚ : Set Ξ± β†’ Prop} {t₁ tβ‚‚ : Set Ξ±} [h : HasCountableSeparatingOn Ξ± p₁ t₁] (hp : βˆ€ s, p₁ s β†’ pβ‚‚ s) (ht : tβ‚‚ βŠ† t₁) : HasCountableSeparatingOn Ξ± pβ‚‚ tβ‚‚ where exists_countable_separating := let ⟨S, hSc, hSp, hSt⟩ := h.1 ⟨S, hSc, fun s hs ↦ hp s (hSp s hs), fun x hx y hy ↦ hSt x (ht hx) y (ht hy)⟩ theorem HasCountableSeparatingOn.of_subtype {Ξ± : Type*} {p : Set Ξ± β†’ Prop} {t : Set Ξ±} {q : Set t β†’ Prop} [h : HasCountableSeparatingOn t q univ] (hpq : βˆ€ U, q U β†’ βˆƒ V, p V ∧ (↑) ⁻¹' V = U) : HasCountableSeparatingOn Ξ± p t := by rcases h.1 with ⟨S, hSc, hSq, hS⟩ choose! V hpV hV using fun s hs ↦ hpq s (hSq s hs) refine ⟨⟨V '' S, hSc.image _, forall_mem_image.2 hpV, fun x hx y hy h ↦ ?_⟩⟩ refine congr_arg Subtype.val (hS ⟨x, hx⟩ trivial ⟨y, hy⟩ trivial fun U hU ↦ ?_) rw [← hV U hU] exact h _ (mem_image_of_mem _ hU) theorem HasCountableSeparatingOn.subtype_iff {Ξ± : Type*} {p : Set Ξ± β†’ Prop} {t : Set Ξ±} : HasCountableSeparatingOn t (fun u ↦ βˆƒ v, p v ∧ (↑) ⁻¹' v = u) univ ↔ HasCountableSeparatingOn Ξ± p t := by constructor <;> intro h Β· exact h.of_subtype $ fun s ↦ id rcases h with ⟨S, Sct, Sp, hS⟩ use {Subtype.val ⁻¹' s | s ∈ S}, Sct.image _, ?_, ?_ Β· rintro u ⟨t, tS, rfl⟩ exact ⟨t, Sp _ tS, rfl⟩ rintro x - y - hxy exact Subtype.val_injective $ hS _ (Subtype.coe_prop _) _ (Subtype.coe_prop _) fun s hs ↦ hxy (Subtype.val ⁻¹' s) ⟨s, hs, rfl⟩ namespace Filter variable {l : Filter Ξ±} [CountableInterFilter l] {f g : Ξ± β†’ Ξ²}
Mathlib/Order/Filter/CountableSeparatingOn.lean
158
172
theorem exists_subset_subsingleton_mem_of_forall_separating (p : Set Ξ± β†’ Prop) {s : Set Ξ±} [h : HasCountableSeparatingOn Ξ± p s] (hs : s ∈ l) (hl : βˆ€ U, p U β†’ U ∈ l ∨ Uᢜ ∈ l) : βˆƒ t, t βŠ† s ∧ t.Subsingleton ∧ t ∈ l := by
rcases h.1 with ⟨S, hSc, hSp, hS⟩ refine ⟨s ∩ β‹‚β‚€ (S ∩ l.sets) ∩ β‹‚ (U ∈ S) (_ : Uᢜ ∈ l), Uᢜ, ?_, ?_, ?_⟩ Β· exact fun _ h ↦ h.1.1 Β· intro x hx y hy simp only [mem_sInter, mem_inter_iff, mem_iInter, mem_compl_iff] at hx hy refine hS x hx.1.1 y hy.1.1 (fun s hsS ↦ ?_) cases hl s (hSp s hsS) with | inl hsl => simp only [hx.1.2 s ⟨hsS, hsl⟩, hy.1.2 s ⟨hsS, hsl⟩] | inr hsl => simp only [hx.2 s hsS hsl, hy.2 s hsS hsl] Β· exact inter_mem (inter_mem hs ((countable_sInter_mem (hSc.mono inter_subset_left)).2 fun _ h ↦ h.2)) ((countable_bInter_mem hSc).2 fun U hU ↦ iInter_mem.2 id)
[ " βˆƒ S, (βˆ€ (n : β„•), p (S n)) ∧ βˆ€ x ∈ t, βˆ€ y ∈ t, (βˆ€ (n : β„•), x ∈ S n ↔ y ∈ S n) β†’ x = y", " (βˆ€ (n : β„•), p (S n)) ∧ βˆ€ x ∈ t, βˆ€ y ∈ t, (βˆ€ (n : β„•), x ∈ S n ↔ y ∈ S n) β†’ x = y", " HasCountableSeparatingOn Ξ± p t", " x = y", " ⟨x, hx⟩ ∈ U ↔ ⟨y, hy⟩ ∈ U", " ⟨x, hx⟩ ∈ Subtype.val ⁻¹' V U ↔ ⟨y, hy⟩ ∈ Subtype.val ⁻¹...
[ " βˆƒ S, (βˆ€ (n : β„•), p (S n)) ∧ βˆ€ x ∈ t, βˆ€ y ∈ t, (βˆ€ (n : β„•), x ∈ S n ↔ y ∈ S n) β†’ x = y", " (βˆ€ (n : β„•), p (S n)) ∧ βˆ€ x ∈ t, βˆ€ y ∈ t, (βˆ€ (n : β„•), x ∈ S n ↔ y ∈ S n) β†’ x = y", " HasCountableSeparatingOn Ξ± p t", " x = y", " ⟨x, hx⟩ ∈ U ↔ ⟨y, hy⟩ ∈ U", " ⟨x, hx⟩ ∈ Subtype.val ⁻¹' V U ↔ ⟨y, hy⟩ ∈ Subtype.val ⁻¹...
import Mathlib.Algebra.Lie.Submodule #align_import algebra.lie.ideal_operations from "leanprover-community/mathlib"@"8983bec7cdf6cb2dd1f21315c8a34ab00d7b2f6d" universe u v w w₁ wβ‚‚ namespace LieSubmodule variable {R : Type u} {L : Type v} {M : Type w} {Mβ‚‚ : Type w₁} variable [CommRing R] [LieRing L] [LieAlgebra R L] variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M] variable [AddCommGroup Mβ‚‚] [Module R Mβ‚‚] [LieRingModule L Mβ‚‚] [LieModule R L Mβ‚‚] variable (N N' : LieSubmodule R L M) (I J : LieIdeal R L) (Nβ‚‚ : LieSubmodule R L Mβ‚‚) section LieIdealOperations instance hasBracket : Bracket (LieIdeal R L) (LieSubmodule R L M) := ⟨fun I N => lieSpan R L { m | βˆƒ (x : I) (n : N), ⁅(x : L), (n : M)⁆ = m }⟩ #align lie_submodule.has_bracket LieSubmodule.hasBracket theorem lieIdeal_oper_eq_span : ⁅I, N⁆ = lieSpan R L { m | βˆƒ (x : I) (n : N), ⁅(x : L), (n : M)⁆ = m } := rfl #align lie_submodule.lie_ideal_oper_eq_span LieSubmodule.lieIdeal_oper_eq_span theorem lieIdeal_oper_eq_linear_span : (↑⁅I, N⁆ : Submodule R M) = Submodule.span R { m | βˆƒ (x : I) (n : N), ⁅(x : L), (n : M)⁆ = m } := by apply le_antisymm Β· let s := { m : M | βˆƒ (x : β†₯I) (n : β†₯N), ⁅(x : L), (n : M)⁆ = m } have aux : βˆ€ (y : L), βˆ€ m' ∈ Submodule.span R s, ⁅y, m'⁆ ∈ Submodule.span R s := by intro y m' hm' refine Submodule.span_induction (R := R) (M := M) (s := s) (p := fun m' ↦ ⁅y, m'⁆ ∈ Submodule.span R s) hm' ?_ ?_ ?_ ?_ Β· rintro m'' ⟨x, n, hm''⟩; rw [← hm'', leibniz_lie] refine Submodule.add_mem _ ?_ ?_ <;> apply Submodule.subset_span Β· use βŸ¨β…y, ↑x⁆, I.lie_mem x.property⟩, n Β· use x, βŸ¨β…y, ↑n⁆, N.lie_mem n.property⟩ Β· simp only [lie_zero, Submodule.zero_mem] Β· intro m₁ mβ‚‚ hm₁ hmβ‚‚; rw [lie_add]; exact Submodule.add_mem _ hm₁ hmβ‚‚ Β· intro t m'' hm''; rw [lie_smul]; exact Submodule.smul_mem _ t hm'' change _ ≀ ({ Submodule.span R s with lie_mem := fun hm' => aux _ _ hm' } : LieSubmodule R L M) rw [lieIdeal_oper_eq_span, lieSpan_le] exact Submodule.subset_span Β· rw [lieIdeal_oper_eq_span]; apply submodule_span_le_lieSpan #align lie_submodule.lie_ideal_oper_eq_linear_span LieSubmodule.lieIdeal_oper_eq_linear_span theorem lieIdeal_oper_eq_linear_span' : (↑⁅I, N⁆ : Submodule R M) = Submodule.span R { m | βˆƒ x ∈ I, βˆƒ n ∈ N, ⁅x, n⁆ = m } := by rw [lieIdeal_oper_eq_linear_span] congr ext m constructor Β· rintro ⟨⟨x, hx⟩, ⟨n, hn⟩, rfl⟩ exact ⟨x, hx, n, hn, rfl⟩ Β· rintro ⟨x, hx, n, hn, rfl⟩ exact ⟨⟨x, hx⟩, ⟨n, hn⟩, rfl⟩ #align lie_submodule.lie_ideal_oper_eq_linear_span' LieSubmodule.lieIdeal_oper_eq_linear_span'
Mathlib/Algebra/Lie/IdealOperations.lean
96
100
theorem lie_le_iff : ⁅I, N⁆ ≀ N' ↔ βˆ€ x ∈ I, βˆ€ m ∈ N, ⁅x, m⁆ ∈ N' := by
rw [lieIdeal_oper_eq_span, LieSubmodule.lieSpan_le] refine ⟨fun h x hx m hm => h ⟨⟨x, hx⟩, ⟨m, hm⟩, rfl⟩, ?_⟩ rintro h _ ⟨⟨x, hx⟩, ⟨m, hm⟩, rfl⟩ exact h x hx m hm
[ " ↑⁅I, N⁆ = Submodule.span R {m | βˆƒ x n, ⁅↑x, ↑n⁆ = m}", " ↑⁅I, N⁆ ≀ Submodule.span R {m | βˆƒ x n, ⁅↑x, ↑n⁆ = m}", " βˆ€ (y : L), βˆ€ m' ∈ Submodule.span R s, ⁅y, m'⁆ ∈ Submodule.span R s", " ⁅y, m'⁆ ∈ Submodule.span R s", " βˆ€ x ∈ s, (fun m' => ⁅y, m'⁆ ∈ Submodule.span R s) x", " ⁅y, m''⁆ ∈ Submodule.span R s"...
[ " ↑⁅I, N⁆ = Submodule.span R {m | βˆƒ x n, ⁅↑x, ↑n⁆ = m}", " ↑⁅I, N⁆ ≀ Submodule.span R {m | βˆƒ x n, ⁅↑x, ↑n⁆ = m}", " βˆ€ (y : L), βˆ€ m' ∈ Submodule.span R s, ⁅y, m'⁆ ∈ Submodule.span R s", " ⁅y, m'⁆ ∈ Submodule.span R s", " βˆ€ x ∈ s, (fun m' => ⁅y, m'⁆ ∈ Submodule.span R s) x", " ⁅y, m''⁆ ∈ Submodule.span R s"...
import Mathlib.Data.Nat.Defs import Mathlib.Order.Interval.Set.Basic import Mathlib.Tactic.Monotonicity.Attr #align_import data.nat.log from "leanprover-community/mathlib"@"3e00d81bdcbf77c8188bbd18f5524ddc3ed8cac6" namespace Nat --@[pp_nodot] porting note: unknown attribute def log (b : β„•) : β„• β†’ β„• | n => if h : b ≀ n ∧ 1 < b then log b (n / b) + 1 else 0 decreasing_by -- putting this in the def triggers the `unusedHavesSuffices` linter: -- https://github.com/leanprover-community/batteries/issues/428 have : n / b < n := div_lt_self ((Nat.zero_lt_one.trans h.2).trans_le h.1) h.2 decreasing_trivial #align nat.log Nat.log @[simp] theorem log_eq_zero_iff {b n : β„•} : log b n = 0 ↔ n < b ∨ b ≀ 1 := by rw [log, dite_eq_right_iff] simp only [Nat.add_eq_zero_iff, Nat.one_ne_zero, and_false, imp_false, not_and_or, not_le, not_lt] #align nat.log_eq_zero_iff Nat.log_eq_zero_iff theorem log_of_lt {b n : β„•} (hb : n < b) : log b n = 0 := log_eq_zero_iff.2 (Or.inl hb) #align nat.log_of_lt Nat.log_of_lt theorem log_of_left_le_one {b : β„•} (hb : b ≀ 1) (n) : log b n = 0 := log_eq_zero_iff.2 (Or.inr hb) #align nat.log_of_left_le_one Nat.log_of_left_le_one @[simp] theorem log_pos_iff {b n : β„•} : 0 < log b n ↔ b ≀ n ∧ 1 < b := by rw [Nat.pos_iff_ne_zero, Ne, log_eq_zero_iff, not_or, not_lt, not_le] #align nat.log_pos_iff Nat.log_pos_iff theorem log_pos {b n : β„•} (hb : 1 < b) (hbn : b ≀ n) : 0 < log b n := log_pos_iff.2 ⟨hbn, hb⟩ #align nat.log_pos Nat.log_pos theorem log_of_one_lt_of_le {b n : β„•} (h : 1 < b) (hn : b ≀ n) : log b n = log b (n / b) + 1 := by rw [log] exact if_pos ⟨hn, h⟩ #align nat.log_of_one_lt_of_le Nat.log_of_one_lt_of_le @[simp] lemma log_zero_left : βˆ€ n, log 0 n = 0 := log_of_left_le_one $ Nat.zero_le _ #align nat.log_zero_left Nat.log_zero_left @[simp] theorem log_zero_right (b : β„•) : log b 0 = 0 := log_eq_zero_iff.2 (le_total 1 b) #align nat.log_zero_right Nat.log_zero_right @[simp] theorem log_one_left : βˆ€ n, log 1 n = 0 := log_of_left_le_one le_rfl #align nat.log_one_left Nat.log_one_left @[simp] theorem log_one_right (b : β„•) : log b 1 = 0 := log_eq_zero_iff.2 (lt_or_le _ _) #align nat.log_one_right Nat.log_one_right theorem pow_le_iff_le_log {b : β„•} (hb : 1 < b) {x y : β„•} (hy : y β‰  0) : b ^ x ≀ y ↔ x ≀ log b y := by induction' y using Nat.strong_induction_on with y ih generalizing x cases x with | zero => dsimp; omega | succ x => rw [log]; split_ifs with h Β· have b_pos : 0 < b := lt_of_succ_lt hb rw [Nat.add_le_add_iff_right, ← ih (y / b) (div_lt_self (Nat.pos_iff_ne_zero.2 hy) hb) (Nat.div_pos h.1 b_pos).ne', le_div_iff_mul_le b_pos, pow_succ', Nat.mul_comm] Β· exact iff_of_false (fun hby => h ⟨(le_self_pow x.succ_ne_zero _).trans hby, hb⟩) (not_succ_le_zero _) #align nat.pow_le_iff_le_log Nat.pow_le_iff_le_log theorem lt_pow_iff_log_lt {b : β„•} (hb : 1 < b) {x y : β„•} (hy : y β‰  0) : y < b ^ x ↔ log b y < x := lt_iff_lt_of_le_iff_le (pow_le_iff_le_log hb hy) #align nat.lt_pow_iff_log_lt Nat.lt_pow_iff_log_lt
Mathlib/Data/Nat/Log.lean
108
111
theorem pow_le_of_le_log {b x y : β„•} (hy : y β‰  0) (h : x ≀ log b y) : b ^ x ≀ y := by
refine (le_or_lt b 1).elim (fun hb => ?_) fun hb => (pow_le_iff_le_log hb hy).2 h rw [log_of_left_le_one hb, Nat.le_zero] at h rwa [h, Nat.pow_zero, one_le_iff_ne_zero]
[ " (invImage (fun x => x) instWellFoundedRelationOfSizeOf).1 (n / b) a✝", " b.log n = 0 ↔ n < b ∨ b ≀ 1", " (βˆ€ (h : b ≀ n ∧ 1 < b), b.log (n / b) + 1 = 0) ↔ n < b ∨ b ≀ 1", " 0 < b.log n ↔ b ≀ n ∧ 1 < b", " b.log n = b.log (n / b) + 1", " (if h : b ≀ n ∧ 1 < b then b.log (n / b) + 1 else 0) = b.log (n / b)...
[ " (invImage (fun x => x) instWellFoundedRelationOfSizeOf).1 (n / b) a✝", " b.log n = 0 ↔ n < b ∨ b ≀ 1", " (βˆ€ (h : b ≀ n ∧ 1 < b), b.log (n / b) + 1 = 0) ↔ n < b ∨ b ≀ 1", " 0 < b.log n ↔ b ≀ n ∧ 1 < b", " b.log n = b.log (n / b) + 1", " (if h : b ≀ n ∧ 1 < b then b.log (n / b) + 1 else 0) = b.log (n / b)...
import Mathlib.Analysis.Normed.Group.InfiniteSum import Mathlib.Topology.Instances.ENNReal #align_import analysis.calculus.series from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Set Metric TopologicalSpace Function Filter open scoped Topology NNReal variable {Ξ± Ξ² F : Type*} [NormedAddCommGroup F] [CompleteSpace F] {u : Ξ± β†’ ℝ} theorem tendstoUniformlyOn_tsum {f : Ξ± β†’ Ξ² β†’ F} (hu : Summable u) {s : Set Ξ²} (hfu : βˆ€ n x, x ∈ s β†’ β€–f n xβ€– ≀ u n) : TendstoUniformlyOn (fun t : Finset Ξ± => fun x => βˆ‘ n ∈ t, f n x) (fun x => βˆ‘' n, f n x) atTop s := by refine tendstoUniformlyOn_iff.2 fun Ξ΅ Ξ΅pos => ?_ filter_upwards [(tendsto_order.1 (tendsto_tsum_compl_atTop_zero u)).2 _ Ξ΅pos] with t ht x hx have A : Summable fun n => β€–f n xβ€– := .of_nonneg_of_le (fun _ ↦ norm_nonneg _) (fun n => hfu n x hx) hu rw [dist_eq_norm, ← sum_add_tsum_subtype_compl A.of_norm t, add_sub_cancel_left] apply lt_of_le_of_lt _ ht apply (norm_tsum_le_tsum_norm (A.subtype _)).trans exact tsum_le_tsum (fun n => hfu _ _ hx) (A.subtype _) (hu.subtype _) #align tendsto_uniformly_on_tsum tendstoUniformlyOn_tsum theorem tendstoUniformlyOn_tsum_nat {f : β„• β†’ Ξ² β†’ F} {u : β„• β†’ ℝ} (hu : Summable u) {s : Set Ξ²} (hfu : βˆ€ n x, x ∈ s β†’ β€–f n xβ€– ≀ u n) : TendstoUniformlyOn (fun N => fun x => βˆ‘ n ∈ Finset.range N, f n x) (fun x => βˆ‘' n, f n x) atTop s := fun v hv => tendsto_finset_range.eventually (tendstoUniformlyOn_tsum hu hfu v hv) #align tendsto_uniformly_on_tsum_nat tendstoUniformlyOn_tsum_nat
Mathlib/Analysis/NormedSpace/FunctionSeries.lean
53
56
theorem tendstoUniformly_tsum {f : Ξ± β†’ Ξ² β†’ F} (hu : Summable u) (hfu : βˆ€ n x, β€–f n xβ€– ≀ u n) : TendstoUniformly (fun t : Finset Ξ± => fun x => βˆ‘ n ∈ t, f n x) (fun x => βˆ‘' n, f n x) atTop := by
rw [← tendstoUniformlyOn_univ]; exact tendstoUniformlyOn_tsum hu fun n x _ => hfu n x
[ " TendstoUniformlyOn (fun t x => βˆ‘ n ∈ t, f n x) (fun x => βˆ‘' (n : Ξ±), f n x) atTop s", " βˆ€αΆ  (n : Finset Ξ±) in atTop, βˆ€ x ∈ s, dist (βˆ‘' (n : Ξ±), f n x) (βˆ‘ n ∈ n, f n x) < Ξ΅", " dist (βˆ‘' (n : Ξ±), f n x) (βˆ‘ n ∈ t, f n x) < Ξ΅", " β€–βˆ‘' (x_1 : { x // x βˆ‰ t }), f (↑x_1) xβ€– < Ξ΅", " β€–βˆ‘' (x_1 : { x // x βˆ‰ t }), f (↑x...
[ " TendstoUniformlyOn (fun t x => βˆ‘ n ∈ t, f n x) (fun x => βˆ‘' (n : Ξ±), f n x) atTop s", " βˆ€αΆ  (n : Finset Ξ±) in atTop, βˆ€ x ∈ s, dist (βˆ‘' (n : Ξ±), f n x) (βˆ‘ n ∈ n, f n x) < Ξ΅", " dist (βˆ‘' (n : Ξ±), f n x) (βˆ‘ n ∈ t, f n x) < Ξ΅", " β€–βˆ‘' (x_1 : { x // x βˆ‰ t }), f (↑x_1) xβ€– < Ξ΅", " β€–βˆ‘' (x_1 : { x // x βˆ‰ t }), f (↑x...
import Mathlib.Algebra.BigOperators.Module import Mathlib.Algebra.Order.Field.Basic import Mathlib.Order.Filter.ModEq import Mathlib.Analysis.Asymptotics.Asymptotics import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.List.TFAE import Mathlib.Analysis.NormedSpace.Basic #align_import analysis.specific_limits.normed from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open scoped Classical open Set Function Filter Finset Metric Asymptotics open scoped Classical open Topology Nat uniformity NNReal ENNReal variable {Ξ± : Type*} {Ξ² : Type*} {ΞΉ : Type*} theorem tendsto_norm_atTop_atTop : Tendsto (norm : ℝ β†’ ℝ) atTop atTop := tendsto_abs_atTop_atTop #align tendsto_norm_at_top_at_top tendsto_norm_atTop_atTop theorem summable_of_absolute_convergence_real {f : β„• β†’ ℝ} : (βˆƒ r, Tendsto (fun n ↦ βˆ‘ i ∈ range n, |f i|) atTop (𝓝 r)) β†’ Summable f | ⟨r, hr⟩ => by refine .of_norm ⟨r, (hasSum_iff_tendsto_nat_of_nonneg ?_ _).2 ?_⟩ Β· exact fun i ↦ norm_nonneg _ Β· simpa only using hr #align summable_of_absolute_convergence_real summable_of_absolute_convergence_real theorem tendsto_norm_zero' {π•œ : Type*} [NormedAddCommGroup π•œ] : Tendsto (norm : π•œ β†’ ℝ) (𝓝[β‰ ] 0) (𝓝[>] 0) := tendsto_norm_zero.inf <| tendsto_principal_principal.2 fun _ hx ↦ norm_pos_iff.2 hx #align tendsto_norm_zero' tendsto_norm_zero' theorem isLittleO_pow_pow_of_lt_left {r₁ rβ‚‚ : ℝ} (h₁ : 0 ≀ r₁) (hβ‚‚ : r₁ < rβ‚‚) : (fun n : β„• ↦ r₁ ^ n) =o[atTop] fun n ↦ rβ‚‚ ^ n := have H : 0 < rβ‚‚ := h₁.trans_lt hβ‚‚ (isLittleO_of_tendsto fun _ hn ↦ False.elim <| H.ne' <| pow_eq_zero hn) <| (tendsto_pow_atTop_nhds_zero_of_lt_one (div_nonneg h₁ (h₁.trans hβ‚‚.le)) ((div_lt_one H).2 hβ‚‚)).congr fun _ ↦ div_pow _ _ _ #align is_o_pow_pow_of_lt_left isLittleO_pow_pow_of_lt_left theorem isBigO_pow_pow_of_le_left {r₁ rβ‚‚ : ℝ} (h₁ : 0 ≀ r₁) (hβ‚‚ : r₁ ≀ rβ‚‚) : (fun n : β„• ↦ r₁ ^ n) =O[atTop] fun n ↦ rβ‚‚ ^ n := hβ‚‚.eq_or_lt.elim (fun h ↦ h β–Έ isBigO_refl _ _) fun h ↦ (isLittleO_pow_pow_of_lt_left h₁ h).isBigO set_option linter.uppercaseLean3 false in #align is_O_pow_pow_of_le_left isBigO_pow_pow_of_le_left theorem isLittleO_pow_pow_of_abs_lt_left {r₁ rβ‚‚ : ℝ} (h : |r₁| < |rβ‚‚|) : (fun n : β„• ↦ r₁ ^ n) =o[atTop] fun n ↦ rβ‚‚ ^ n := by refine (IsLittleO.of_norm_left ?_).of_norm_right exact (isLittleO_pow_pow_of_lt_left (abs_nonneg r₁) h).congr (pow_abs r₁) (pow_abs rβ‚‚) #align is_o_pow_pow_of_abs_lt_left isLittleO_pow_pow_of_abs_lt_left open List in
Mathlib/Analysis/SpecificLimits/Normed.lean
132
189
theorem TFAE_exists_lt_isLittleO_pow (f : β„• β†’ ℝ) (R : ℝ) : TFAE [βˆƒ a ∈ Ioo (-R) R, f =o[atTop] (a ^ Β·), βˆƒ a ∈ Ioo 0 R, f =o[atTop] (a ^ Β·), βˆƒ a ∈ Ioo (-R) R, f =O[atTop] (a ^ Β·), βˆƒ a ∈ Ioo 0 R, f =O[atTop] (a ^ Β·), βˆƒ a < R, βˆƒ C : ℝ, (0 < C ∨ 0 < R) ∧ βˆ€ n, |f n| ≀ C * a ^ n, βˆƒ a ∈ Ioo 0 R, βˆƒ C > 0, βˆ€ n, |f n| ≀ C * a ^ n, βˆƒ a < R, βˆ€αΆ  n in atTop, |f n| ≀ a ^ n, βˆƒ a ∈ Ioo 0 R, βˆ€αΆ  n in atTop, |f n| ≀ a ^ n] := by
have A : Ico 0 R βŠ† Ioo (-R) R := fun x hx ↦ ⟨(neg_lt_zero.2 (hx.1.trans_lt hx.2)).trans_le hx.1, hx.2⟩ have B : Ioo 0 R βŠ† Ioo (-R) R := Subset.trans Ioo_subset_Ico_self A -- First we prove that 1-4 are equivalent using 2 β†’ 3 β†’ 4, 1 β†’ 3, and 2 β†’ 1 tfae_have 1 β†’ 3 Β· exact fun ⟨a, ha, H⟩ ↦ ⟨a, ha, H.isBigO⟩ tfae_have 2 β†’ 1 Β· exact fun ⟨a, ha, H⟩ ↦ ⟨a, B ha, H⟩ tfae_have 3 β†’ 2 Β· rintro ⟨a, ha, H⟩ rcases exists_between (abs_lt.2 ha) with ⟨b, hab, hbR⟩ exact ⟨b, ⟨(abs_nonneg a).trans_lt hab, hbR⟩, H.trans_isLittleO (isLittleO_pow_pow_of_abs_lt_left (hab.trans_le (le_abs_self b)))⟩ tfae_have 2 β†’ 4 Β· exact fun ⟨a, ha, H⟩ ↦ ⟨a, ha, H.isBigO⟩ tfae_have 4 β†’ 3 Β· exact fun ⟨a, ha, H⟩ ↦ ⟨a, B ha, H⟩ -- Add 5 and 6 using 4 β†’ 6 β†’ 5 β†’ 3 tfae_have 4 β†’ 6 Β· rintro ⟨a, ha, H⟩ rcases bound_of_isBigO_nat_atTop H with ⟨C, hCβ‚€, hC⟩ refine ⟨a, ha, C, hCβ‚€, fun n ↦ ?_⟩ simpa only [Real.norm_eq_abs, abs_pow, abs_of_nonneg ha.1.le] using hC (pow_ne_zero n ha.1.ne') tfae_have 6 β†’ 5 Β· exact fun ⟨a, ha, C, Hβ‚€, H⟩ ↦ ⟨a, ha.2, C, Or.inl Hβ‚€, H⟩ tfae_have 5 β†’ 3 Β· rintro ⟨a, ha, C, hβ‚€, H⟩ rcases sign_cases_of_C_mul_pow_nonneg fun n ↦ (abs_nonneg _).trans (H n) with (rfl | ⟨hCβ‚€, haβ‚€βŸ©) Β· obtain rfl : f = 0 := by ext n simpa using H n simp only [lt_irrefl, false_or_iff] at hβ‚€ exact ⟨0, ⟨neg_lt_zero.2 hβ‚€, hβ‚€βŸ©, isBigO_zero _ _⟩ exact ⟨a, A ⟨haβ‚€, ha⟩, isBigO_of_le' _ fun n ↦ (H n).trans <| mul_le_mul_of_nonneg_left (le_abs_self _) hCβ‚€.le⟩ -- Add 7 and 8 using 2 β†’ 8 β†’ 7 β†’ 3 tfae_have 2 β†’ 8 Β· rintro ⟨a, ha, H⟩ refine ⟨a, ha, (H.def zero_lt_one).mono fun n hn ↦ ?_⟩ rwa [Real.norm_eq_abs, Real.norm_eq_abs, one_mul, abs_pow, abs_of_pos ha.1] at hn tfae_have 8 β†’ 7 Β· exact fun ⟨a, ha, H⟩ ↦ ⟨a, ha.2, H⟩ tfae_have 7 β†’ 3 Β· rintro ⟨a, ha, H⟩ have : 0 ≀ a := nonneg_of_eventually_pow_nonneg (H.mono fun n ↦ (abs_nonneg _).trans) refine ⟨a, A ⟨this, ha⟩, IsBigO.of_bound 1 ?_⟩ simpa only [Real.norm_eq_abs, one_mul, abs_pow, abs_of_nonneg this] -- Porting note: used to work without explicitly having 6 β†’ 7 tfae_have 6 β†’ 7 Β· exact fun h ↦ tfae_8_to_7 <| tfae_2_to_8 <| tfae_3_to_2 <| tfae_5_to_3 <| tfae_6_to_5 h tfae_finish
[ " Summable f", " βˆ€ (i : β„•), 0 ≀ β€–f iβ€–", " Tendsto (fun n => βˆ‘ i ∈ Finset.range n, β€–f iβ€–) atTop (𝓝 r)", " (fun n => r₁ ^ n) =o[atTop] fun n => rβ‚‚ ^ n", " (fun x => β€–r₁ ^ xβ€–) =o[atTop] fun x => β€–rβ‚‚ ^ xβ€–", " [βˆƒ a ∈ Set.Ioo (-R) R, f =o[atTop] fun x => a ^ x, βˆƒ a ∈ Set.Ioo 0 R, f =o[atTop] fun x => a ^ x,\n ...
[ " Summable f", " βˆ€ (i : β„•), 0 ≀ β€–f iβ€–", " Tendsto (fun n => βˆ‘ i ∈ Finset.range n, β€–f iβ€–) atTop (𝓝 r)", " (fun n => r₁ ^ n) =o[atTop] fun n => rβ‚‚ ^ n", " (fun x => β€–r₁ ^ xβ€–) =o[atTop] fun x => β€–rβ‚‚ ^ xβ€–" ]
import Mathlib.MeasureTheory.Measure.Haar.Basic import Mathlib.Analysis.InnerProductSpace.PiL2 #align_import measure_theory.measure.haar.of_basis from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d" open Set TopologicalSpace MeasureTheory MeasureTheory.Measure FiniteDimensional open scoped Pointwise noncomputable section variable {ΞΉ ΞΉ' E F : Type*} section Fintype variable [Fintype ΞΉ] [Fintype ΞΉ'] section AddCommGroup variable [AddCommGroup E] [Module ℝ E] [AddCommGroup F] [Module ℝ F] def parallelepiped (v : ΞΉ β†’ E) : Set E := (fun t : ΞΉ β†’ ℝ => βˆ‘ i, t i β€’ v i) '' Icc 0 1 #align parallelepiped parallelepiped theorem mem_parallelepiped_iff (v : ΞΉ β†’ E) (x : E) : x ∈ parallelepiped v ↔ βˆƒ t ∈ Icc (0 : ΞΉ β†’ ℝ) 1, x = βˆ‘ i, t i β€’ v i := by simp [parallelepiped, eq_comm] #align mem_parallelepiped_iff mem_parallelepiped_iff theorem parallelepiped_basis_eq (b : Basis ΞΉ ℝ E) : parallelepiped b = {x | βˆ€ i, b.repr x i ∈ Set.Icc 0 1} := by classical ext x simp_rw [mem_parallelepiped_iff, mem_setOf_eq, b.ext_elem_iff, _root_.map_sum, _root_.map_smul, Finset.sum_apply', Basis.repr_self, Finsupp.smul_single, smul_eq_mul, mul_one, Finsupp.single_apply, Finset.sum_ite_eq', Finset.mem_univ, ite_true, mem_Icc, Pi.le_def, Pi.zero_apply, Pi.one_apply, ← forall_and] aesop
Mathlib/MeasureTheory/Measure/Haar/OfBasis.lean
67
71
theorem image_parallelepiped (f : E β†’β‚—[ℝ] F) (v : ΞΉ β†’ E) : f '' parallelepiped v = parallelepiped (f ∘ v) := by
simp only [parallelepiped, ← image_comp] congr 1 with t simp only [Function.comp_apply, _root_.map_sum, LinearMap.map_smulβ‚›β‚—, RingHom.id_apply]
[ " x ∈ parallelepiped v ↔ βˆƒ t ∈ Icc 0 1, x = βˆ‘ i : ΞΉ, t i β€’ v i", " parallelepiped ⇑b = {x | βˆ€ (i : ΞΉ), (b.repr x) i ∈ Icc 0 1}", " x ∈ parallelepiped ⇑b ↔ x ∈ {x | βˆ€ (i : ΞΉ), (b.repr x) i ∈ Icc 0 1}", " (βˆƒ t, βˆ€ (x_1 : ΞΉ), (0 ≀ t x_1 ∧ t x_1 ≀ 1) ∧ (b.repr x) x_1 = t x_1) ↔ βˆ€ (i : ΞΉ), 0 ≀ (b.repr x) i ∧ (b.rep...
[ " x ∈ parallelepiped v ↔ βˆƒ t ∈ Icc 0 1, x = βˆ‘ i : ΞΉ, t i β€’ v i", " parallelepiped ⇑b = {x | βˆ€ (i : ΞΉ), (b.repr x) i ∈ Icc 0 1}", " x ∈ parallelepiped ⇑b ↔ x ∈ {x | βˆ€ (i : ΞΉ), (b.repr x) i ∈ Icc 0 1}", " (βˆƒ t, βˆ€ (x_1 : ΞΉ), (0 ≀ t x_1 ∧ t x_1 ≀ 1) ∧ (b.repr x) x_1 = t x_1) ↔ βˆ€ (i : ΞΉ), 0 ≀ (b.repr x) i ∧ (b.rep...