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
import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv #align_import linear_algebra.affine_space.midpoint from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" open AffineMap AffineEquiv section variable (R : Type*) {V V' P P' : Type*} [Ring R] [Invertible (2 : R)] [AddCommGroup V] [Module R V] [AddTorsor V P] [AddCommGroup V'] [Module R V'] [AddTorsor V' P'] def midpoint (x y : P) : P := lineMap x y (β…Ÿ 2 : R) #align midpoint midpoint variable {R} {x y z : P} @[simp] theorem AffineMap.map_midpoint (f : P →ᡃ[R] P') (a b : P) : f (midpoint R a b) = midpoint R (f a) (f b) := f.apply_lineMap a b _ #align affine_map.map_midpoint AffineMap.map_midpoint @[simp] theorem AffineEquiv.map_midpoint (f : P ≃ᡃ[R] P') (a b : P) : f (midpoint R a b) = midpoint R (f a) (f b) := f.apply_lineMap a b _ #align affine_equiv.map_midpoint AffineEquiv.map_midpoint theorem AffineEquiv.pointReflection_midpoint_left (x y : P) : pointReflection R (midpoint R x y) x = y := by rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul, mul_invOf_self, one_smul, vsub_vadd] #align affine_equiv.point_reflection_midpoint_left AffineEquiv.pointReflection_midpoint_left @[simp] -- Porting note: added variant with `Equiv.pointReflection` for `simp` theorem Equiv.pointReflection_midpoint_left (x y : P) : (Equiv.pointReflection (midpoint R x y)) x = y := by rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul, mul_invOf_self, one_smul, vsub_vadd] theorem midpoint_comm (x y : P) : midpoint R x y = midpoint R y x := by rw [midpoint, ← lineMap_apply_one_sub, one_sub_invOf_two, midpoint] #align midpoint_comm midpoint_comm theorem AffineEquiv.pointReflection_midpoint_right (x y : P) : pointReflection R (midpoint R x y) y = x := by rw [midpoint_comm, AffineEquiv.pointReflection_midpoint_left] #align affine_equiv.point_reflection_midpoint_right AffineEquiv.pointReflection_midpoint_right @[simp] -- Porting note: added variant with `Equiv.pointReflection` for `simp` theorem Equiv.pointReflection_midpoint_right (x y : P) : (Equiv.pointReflection (midpoint R x y)) y = x := by rw [midpoint_comm, Equiv.pointReflection_midpoint_left] theorem midpoint_vsub_midpoint (p₁ pβ‚‚ p₃ pβ‚„ : P) : midpoint R p₁ pβ‚‚ -α΅₯ midpoint R p₃ pβ‚„ = midpoint R (p₁ -α΅₯ p₃) (pβ‚‚ -α΅₯ pβ‚„) := lineMap_vsub_lineMap _ _ _ _ _ #align midpoint_vsub_midpoint midpoint_vsub_midpoint theorem midpoint_vadd_midpoint (v v' : V) (p p' : P) : midpoint R v v' +α΅₯ midpoint R p p' = midpoint R (v +α΅₯ p) (v' +α΅₯ p') := lineMap_vadd_lineMap _ _ _ _ _ #align midpoint_vadd_midpoint midpoint_vadd_midpoint theorem midpoint_eq_iff {x y z : P} : midpoint R x y = z ↔ pointReflection R z x = y := eq_comm.trans ((injective_pointReflection_left_of_module R x).eq_iff' (AffineEquiv.pointReflection_midpoint_left x y)).symm #align midpoint_eq_iff midpoint_eq_iff @[simp] theorem midpoint_pointReflection_left (x y : P) : midpoint R (Equiv.pointReflection x y) y = x := midpoint_eq_iff.2 <| Equiv.pointReflection_involutive _ _ @[simp] theorem midpoint_pointReflection_right (x y : P) : midpoint R y (Equiv.pointReflection x y) = x := midpoint_eq_iff.2 rfl @[simp] theorem midpoint_vsub_left (p₁ pβ‚‚ : P) : midpoint R p₁ pβ‚‚ -α΅₯ p₁ = (β…Ÿ 2 : R) β€’ (pβ‚‚ -α΅₯ p₁) := lineMap_vsub_left _ _ _ #align midpoint_vsub_left midpoint_vsub_left @[simp] theorem midpoint_vsub_right (p₁ pβ‚‚ : P) : midpoint R p₁ pβ‚‚ -α΅₯ pβ‚‚ = (β…Ÿ 2 : R) β€’ (p₁ -α΅₯ pβ‚‚) := by rw [midpoint_comm, midpoint_vsub_left] #align midpoint_vsub_right midpoint_vsub_right @[simp] theorem left_vsub_midpoint (p₁ pβ‚‚ : P) : p₁ -α΅₯ midpoint R p₁ pβ‚‚ = (β…Ÿ 2 : R) β€’ (p₁ -α΅₯ pβ‚‚) := left_vsub_lineMap _ _ _ #align left_vsub_midpoint left_vsub_midpoint @[simp] theorem right_vsub_midpoint (p₁ pβ‚‚ : P) : pβ‚‚ -α΅₯ midpoint R p₁ pβ‚‚ = (β…Ÿ 2 : R) β€’ (pβ‚‚ -α΅₯ p₁) := by rw [midpoint_comm, left_vsub_midpoint] #align right_vsub_midpoint right_vsub_midpoint
Mathlib/LinearAlgebra/AffineSpace/Midpoint.lean
133
137
theorem midpoint_vsub (p₁ pβ‚‚ p : P) : midpoint R p₁ pβ‚‚ -α΅₯ p = (β…Ÿ 2 : R) β€’ (p₁ -α΅₯ p) + (β…Ÿ 2 : R) β€’ (pβ‚‚ -α΅₯ p) := by
rw [← vsub_sub_vsub_cancel_right p₁ p pβ‚‚, smul_sub, sub_eq_add_neg, ← smul_neg, neg_vsub_eq_vsub_rev, add_assoc, invOf_two_smul_add_invOf_two_smul, ← vadd_vsub_assoc, midpoint_comm, midpoint, lineMap_apply]
[ " (pointReflection R (midpoint R x y)) x = y", " (pointReflection (midpoint R x y)) x = y", " midpoint R x y = midpoint R y x", " (pointReflection R (midpoint R x y)) y = x", " (pointReflection (midpoint R x y)) y = x", " midpoint R p₁ pβ‚‚ -α΅₯ pβ‚‚ = β…Ÿ2 β€’ (p₁ -α΅₯ pβ‚‚)", " pβ‚‚ -α΅₯ midpoint R p₁ pβ‚‚ = β…Ÿ2 β€’ (pβ‚‚ -α΅₯ ...
import Mathlib.Algebra.BigOperators.Group.Multiset import Mathlib.Data.Multiset.Dedup #align_import data.multiset.bind from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" assert_not_exists MonoidWithZero assert_not_exists MulAction universe v variable {Ξ± : Type*} {Ξ² : Type v} {Ξ³ Ξ΄ : Type*} namespace Multiset def join : Multiset (Multiset Ξ±) β†’ Multiset Ξ± := sum #align multiset.join Multiset.join theorem coe_join : βˆ€ L : List (List Ξ±), join (L.map ((↑) : List Ξ± β†’ Multiset Ξ±) : Multiset (Multiset Ξ±)) = L.join | [] => rfl | l :: L => by exact congr_arg (fun s : Multiset Ξ± => ↑l + s) (coe_join L) #align multiset.coe_join Multiset.coe_join @[simp] theorem join_zero : @join Ξ± 0 = 0 := rfl #align multiset.join_zero Multiset.join_zero @[simp] theorem join_cons (s S) : @join Ξ± (s ::β‚˜ S) = s + join S := sum_cons _ _ #align multiset.join_cons Multiset.join_cons @[simp] theorem join_add (S T) : @join Ξ± (S + T) = join S + join T := sum_add _ _ #align multiset.join_add Multiset.join_add @[simp] theorem singleton_join (a) : join ({a} : Multiset (Multiset Ξ±)) = a := sum_singleton _ #align multiset.singleton_join Multiset.singleton_join @[simp] theorem mem_join {a S} : a ∈ @join Ξ± S ↔ βˆƒ s ∈ S, a ∈ s := Multiset.induction_on S (by simp) <| by simp (config := { contextual := true }) [or_and_right, exists_or] #align multiset.mem_join Multiset.mem_join @[simp] theorem card_join (S) : card (@join Ξ± S) = sum (map card S) := Multiset.induction_on S (by simp) (by simp) #align multiset.card_join Multiset.card_join @[simp] theorem map_join (f : Ξ± β†’ Ξ²) (S : Multiset (Multiset Ξ±)) : map f (join S) = join (map (map f) S) := by induction S using Multiset.induction with | empty => simp | cons _ _ ih => simp [ih] @[to_additive (attr := simp)] theorem prod_join [CommMonoid Ξ±] {S : Multiset (Multiset Ξ±)} : prod (join S) = prod (map prod S) := by induction S using Multiset.induction with | empty => simp | cons _ _ ih => simp [ih] theorem rel_join {r : Ξ± β†’ Ξ² β†’ Prop} {s t} (h : Rel (Rel r) s t) : Rel r s.join t.join := by induction h with | zero => simp | cons hab hst ih => simpa using hab.add ih #align multiset.rel_join Multiset.rel_join section Bind variable (a : Ξ±) (s t : Multiset Ξ±) (f g : Ξ± β†’ Multiset Ξ²) def bind (s : Multiset Ξ±) (f : Ξ± β†’ Multiset Ξ²) : Multiset Ξ² := (s.map f).join #align multiset.bind Multiset.bind @[simp]
Mathlib/Data/Multiset/Bind.lean
115
117
theorem coe_bind (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : (@bind Ξ± Ξ² l fun a => f a) = l.bind f := by
rw [List.bind, ← coe_join, List.map_map] rfl
[ " (↑(List.map ofList (l :: L))).join = ↑(l :: L).join", " a ∈ join 0 ↔ βˆƒ s ∈ 0, a ∈ s", " βˆ€ (a_1 : Multiset Ξ±) (s : Multiset (Multiset Ξ±)),\n (a ∈ s.join ↔ βˆƒ s_1 ∈ s, a ∈ s_1) β†’ (a ∈ (a_1 ::β‚˜ s).join ↔ βˆƒ s_1 ∈ a_1 ::β‚˜ s, a ∈ s_1)", " card (join 0) = (map (⇑card) 0).sum", " βˆ€ (a : Multiset Ξ±) (s : Multise...
import Mathlib.Data.Finset.Lattice import Mathlib.Data.Multiset.Powerset #align_import data.finset.powerset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" namespace Finset open Function Multiset variable {Ξ± : Type*} {s t : Finset Ξ±} section powersetCard variable {n} {s t : Finset Ξ±} def powersetCard (n : β„•) (s : Finset Ξ±) : Finset (Finset Ξ±) := ⟨((s.1.powersetCard n).pmap Finset.mk) fun _t h => nodup_of_le (mem_powersetCard.1 h).1 s.2, s.2.powersetCard.pmap fun _a _ha _b _hb => congr_arg Finset.val⟩ #align finset.powerset_len Finset.powersetCard @[simp] lemma mem_powersetCard : s ∈ powersetCard n t ↔ s βŠ† t ∧ card s = n := by cases s; simp [powersetCard, val_le_iff.symm] #align finset.mem_powerset_len Finset.mem_powersetCard @[simp] theorem powersetCard_mono {n} {s t : Finset Ξ±} (h : s βŠ† t) : powersetCard n s βŠ† powersetCard n t := fun _u h' => mem_powersetCard.2 <| And.imp (fun hβ‚‚ => Subset.trans hβ‚‚ h) id (mem_powersetCard.1 h') #align finset.powerset_len_mono Finset.powersetCard_mono @[simp] theorem card_powersetCard (n : β„•) (s : Finset Ξ±) : card (powersetCard n s) = Nat.choose (card s) n := (card_pmap _ _ _).trans (Multiset.card_powersetCard n s.1) #align finset.card_powerset_len Finset.card_powersetCard @[simp]
Mathlib/Data/Finset/Powerset.lean
220
225
theorem powersetCard_zero (s : Finset Ξ±) : s.powersetCard 0 = {βˆ…} := by
ext; rw [mem_powersetCard, mem_singleton, card_eq_zero] refine ⟨fun h => h.2, fun h => by rw [h] exact ⟨empty_subset s, rfl⟩⟩
[ " s ∈ powersetCard n t ↔ s βŠ† t ∧ s.card = n", " { val := val✝, nodup := nodup✝ } ∈ powersetCard n t ↔\n { val := val✝, nodup := nodup✝ } βŠ† t ∧ { val := val✝, nodup := nodup✝ }.card = n", " powersetCard 0 s = {βˆ…}", " a✝ ∈ powersetCard 0 s ↔ a✝ ∈ {βˆ…}", " a✝ βŠ† s ∧ a✝ = βˆ… ↔ a✝ = βˆ…", " a✝ βŠ† s ∧ a✝ = βˆ…", "...
import Mathlib.Topology.Connected.Basic open Set Topology universe u v variable {Ξ± : Type u} {Ξ² : Type v} {ΞΉ : Type*} {Ο€ : ΞΉ β†’ Type*} [TopologicalSpace Ξ±] {s t u v : Set Ξ±} section LocallyConnectedSpace class LocallyConnectedSpace (Ξ± : Type*) [TopologicalSpace Ξ±] : Prop where open_connected_basis : βˆ€ x, (𝓝 x).HasBasis (fun s : Set Ξ± => IsOpen s ∧ x ∈ s ∧ IsConnected s) id #align locally_connected_space LocallyConnectedSpace theorem locallyConnectedSpace_iff_open_connected_basis : LocallyConnectedSpace Ξ± ↔ βˆ€ x, (𝓝 x).HasBasis (fun s : Set Ξ± => IsOpen s ∧ x ∈ s ∧ IsConnected s) id := ⟨@LocallyConnectedSpace.open_connected_basis _ _, LocallyConnectedSpace.mk⟩ #align locally_connected_space_iff_open_connected_basis locallyConnectedSpace_iff_open_connected_basis theorem locallyConnectedSpace_iff_open_connected_subsets : LocallyConnectedSpace Ξ± ↔ βˆ€ x, βˆ€ U ∈ 𝓝 x, βˆƒ V : Set Ξ±, V βŠ† U ∧ IsOpen V ∧ x ∈ V ∧ IsConnected V := by simp_rw [locallyConnectedSpace_iff_open_connected_basis] refine forall_congr' fun _ => ?_ constructor Β· intro h U hU rcases h.mem_iff.mp hU with ⟨V, hV, hVU⟩ exact ⟨V, hVU, hV⟩ Β· exact fun h => ⟨fun U => ⟨fun hU => let ⟨V, hVU, hV⟩ := h U hU ⟨V, hV, hVU⟩, fun ⟨V, ⟨hV, hxV, _⟩, hVU⟩ => mem_nhds_iff.mpr ⟨V, hVU, hV, hxV⟩⟩⟩ #align locally_connected_space_iff_open_connected_subsets locallyConnectedSpace_iff_open_connected_subsets instance (priority := 100) DiscreteTopology.toLocallyConnectedSpace (Ξ±) [TopologicalSpace Ξ±] [DiscreteTopology Ξ±] : LocallyConnectedSpace Ξ± := locallyConnectedSpace_iff_open_connected_subsets.2 fun x _U hU => ⟨{x}, singleton_subset_iff.2 <| mem_of_mem_nhds hU, isOpen_discrete _, rfl, isConnected_singleton⟩ #align discrete_topology.to_locally_connected_space DiscreteTopology.toLocallyConnectedSpace theorem connectedComponentIn_mem_nhds [LocallyConnectedSpace Ξ±] {F : Set Ξ±} {x : Ξ±} (h : F ∈ 𝓝 x) : connectedComponentIn F x ∈ 𝓝 x := by rw [(LocallyConnectedSpace.open_connected_basis x).mem_iff] at h rcases h with ⟨s, ⟨h1s, hxs, h2s⟩, hsF⟩ exact mem_nhds_iff.mpr ⟨s, h2s.isPreconnected.subset_connectedComponentIn hxs hsF, h1s, hxs⟩ #align connected_component_in_mem_nhds connectedComponentIn_mem_nhds protected theorem IsOpen.connectedComponentIn [LocallyConnectedSpace Ξ±] {F : Set Ξ±} {x : Ξ±} (hF : IsOpen F) : IsOpen (connectedComponentIn F x) := by rw [isOpen_iff_mem_nhds] intro y hy rw [connectedComponentIn_eq hy] exact connectedComponentIn_mem_nhds (hF.mem_nhds <| connectedComponentIn_subset F x hy) #align is_open.connected_component_in IsOpen.connectedComponentIn theorem isOpen_connectedComponent [LocallyConnectedSpace Ξ±] {x : Ξ±} : IsOpen (connectedComponent x) := by rw [← connectedComponentIn_univ] exact isOpen_univ.connectedComponentIn #align is_open_connected_component isOpen_connectedComponent theorem isClopen_connectedComponent [LocallyConnectedSpace Ξ±] {x : Ξ±} : IsClopen (connectedComponent x) := ⟨isClosed_connectedComponent, isOpen_connectedComponent⟩ #align is_clopen_connected_component isClopen_connectedComponent theorem locallyConnectedSpace_iff_connectedComponentIn_open : LocallyConnectedSpace Ξ± ↔ βˆ€ F : Set Ξ±, IsOpen F β†’ βˆ€ x ∈ F, IsOpen (connectedComponentIn F x) := by constructor Β· intro h exact fun F hF x _ => hF.connectedComponentIn Β· intro h rw [locallyConnectedSpace_iff_open_connected_subsets] refine fun x U hU => ⟨connectedComponentIn (interior U) x, (connectedComponentIn_subset _ _).trans interior_subset, h _ isOpen_interior x ?_, mem_connectedComponentIn ?_, isConnected_connectedComponentIn_iff.mpr ?_⟩ <;> exact mem_interior_iff_mem_nhds.mpr hU #align locally_connected_space_iff_connected_component_in_open locallyConnectedSpace_iff_connectedComponentIn_open theorem locallyConnectedSpace_iff_connected_subsets : LocallyConnectedSpace Ξ± ↔ βˆ€ (x : Ξ±), βˆ€ U ∈ 𝓝 x, βˆƒ V ∈ 𝓝 x, IsPreconnected V ∧ V βŠ† U := by constructor Β· rw [locallyConnectedSpace_iff_open_connected_subsets] intro h x U hxU rcases h x U hxU with ⟨V, hVU, hV₁, hxV, hVβ‚‚βŸ© exact ⟨V, hV₁.mem_nhds hxV, hVβ‚‚.isPreconnected, hVU⟩ Β· rw [locallyConnectedSpace_iff_connectedComponentIn_open] refine fun h U hU x _ => isOpen_iff_mem_nhds.mpr fun y hy => ?_ rw [connectedComponentIn_eq hy] rcases h y U (hU.mem_nhds <| (connectedComponentIn_subset _ _) hy) with ⟨V, hVy, hV, hVU⟩ exact Filter.mem_of_superset hVy (hV.subset_connectedComponentIn (mem_of_mem_nhds hVy) hVU) #align locally_connected_space_iff_connected_subsets locallyConnectedSpace_iff_connected_subsets theorem locallyConnectedSpace_iff_connected_basis : LocallyConnectedSpace Ξ± ↔ βˆ€ x, (𝓝 x).HasBasis (fun s : Set Ξ± => s ∈ 𝓝 x ∧ IsPreconnected s) id := by rw [locallyConnectedSpace_iff_connected_subsets] exact forall_congr' fun x => Filter.hasBasis_self.symm #align locally_connected_space_iff_connected_basis locallyConnectedSpace_iff_connected_basis
Mathlib/Topology/Connected/LocallyConnected.lean
125
132
theorem locallyConnectedSpace_of_connected_bases {ΞΉ : Type*} (b : Ξ± β†’ ΞΉ β†’ Set Ξ±) (p : Ξ± β†’ ΞΉ β†’ Prop) (hbasis : βˆ€ x, (𝓝 x).HasBasis (p x) (b x)) (hconnected : βˆ€ x i, p x i β†’ IsPreconnected (b x i)) : LocallyConnectedSpace Ξ± := by
rw [locallyConnectedSpace_iff_connected_basis] exact fun x => (hbasis x).to_hasBasis (fun i hi => ⟨b x i, ⟨(hbasis x).mem_of_mem hi, hconnected x i hi⟩, subset_rfl⟩) fun s hs => ⟨(hbasis x).index s hs.1, ⟨(hbasis x).property_index hs.1, (hbasis x).set_index_subset hs.1⟩⟩
[ " LocallyConnectedSpace Ξ± ↔ βˆ€ (x : Ξ±), βˆ€ U ∈ 𝓝 x, βˆƒ V βŠ† U, IsOpen V ∧ x ∈ V ∧ IsConnected V", " (βˆ€ (x : Ξ±), (𝓝 x).HasBasis (fun s => IsOpen s ∧ x ∈ s ∧ IsConnected s) id) ↔\n βˆ€ (x : Ξ±), βˆ€ U ∈ 𝓝 x, βˆƒ V βŠ† U, IsOpen V ∧ x ∈ V ∧ IsConnected V", " (𝓝 x✝).HasBasis (fun s => IsOpen s ∧ x✝ ∈ s ∧ IsConnected s) i...
import Mathlib.Analysis.PSeries import Mathlib.Data.Real.Pi.Wallis import Mathlib.Tactic.AdaptationNote #align_import analysis.special_functions.stirling from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" open scoped Topology Real Nat Asymptotics open Finset Filter Nat Real namespace Stirling noncomputable def stirlingSeq (n : β„•) : ℝ := n ! / (√(2 * n : ℝ) * (n / exp 1) ^ n) #align stirling.stirling_seq Stirling.stirlingSeq @[simp] theorem stirlingSeq_zero : stirlingSeq 0 = 0 := by rw [stirlingSeq, cast_zero, mul_zero, Real.sqrt_zero, zero_mul, div_zero] #align stirling.stirling_seq_zero Stirling.stirlingSeq_zero @[simp] theorem stirlingSeq_one : stirlingSeq 1 = exp 1 / √2 := by rw [stirlingSeq, pow_one, factorial_one, cast_one, mul_one, mul_one_div, one_div_div] #align stirling.stirling_seq_one Stirling.stirlingSeq_one theorem log_stirlingSeq_formula (n : β„•) : log (stirlingSeq n) = Real.log n ! - 1 / 2 * Real.log (2 * n) - n * log (n / exp 1) := by cases n Β· simp Β· rw [stirlingSeq, log_div, log_mul, sqrt_eq_rpow, log_rpow, Real.log_pow, tsub_tsub] <;> positivity -- Porting note: generalized from `n.succ` to `n` #align stirling.log_stirling_seq_formula Stirling.log_stirlingSeq_formulaβ‚“
Mathlib/Analysis/SpecialFunctions/Stirling.lean
77
93
theorem log_stirlingSeq_diff_hasSum (m : β„•) : HasSum (fun k : β„• => (1 : ℝ) / (2 * ↑(k + 1) + 1) * ((1 / (2 * ↑(m + 1) + 1)) ^ 2) ^ ↑(k + 1)) (log (stirlingSeq (m + 1)) - log (stirlingSeq (m + 2))) := by
let f (k : β„•) := (1 : ℝ) / (2 * k + 1) * ((1 / (2 * ↑(m + 1) + 1)) ^ 2) ^ k change HasSum (fun k => f (k + 1)) _ rw [hasSum_nat_add_iff] convert (hasSum_log_one_add_inv m.cast_add_one_pos).mul_left ((↑(m + 1) : ℝ) + 1 / 2) using 1 Β· ext k dsimp only [f] rw [← pow_mul, pow_add] push_cast field_simp ring Β· have h : βˆ€ x β‰  (0 : ℝ), 1 + x⁻¹ = (x + 1) / x := fun x hx ↦ by field_simp [hx] simp (disch := positivity) only [log_stirlingSeq_formula, log_div, log_mul, log_exp, factorial_succ, cast_mul, cast_succ, cast_zero, range_one, sum_singleton, h] ring
[ " stirlingSeq 0 = 0", " stirlingSeq 1 = rexp 1 / √2", " (stirlingSeq n).log = (↑n !).log - 1 / 2 * (2 * ↑n).log - ↑n * (↑n / rexp 1).log", " (stirlingSeq 0).log = (↑0!).log - 1 / 2 * (2 * ↑0).log - ↑0 * (↑0 / rexp 1).log", " (stirlingSeq (n✝ + 1)).log = (↑(n✝ + 1)!).log - 1 / 2 * (2 * ↑(n✝ + 1)).log - ↑(n✝ ...
import Mathlib.LinearAlgebra.CliffordAlgebra.Fold import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic #align_import linear_algebra.exterior_algebra.of_alternating from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a" variable {R M N N' : Type*} variable [CommRing R] [AddCommGroup M] [AddCommGroup N] [AddCommGroup N'] variable [Module R M] [Module R N] [Module R N'] -- This instance can't be found where it's needed if we don't remind lean that it exists. instance AlternatingMap.instModuleAddCommGroup {ΞΉ : Type*} : Module R (M [β‹€^ΞΉ]β†’β‚—[R] N) := by infer_instance #align alternating_map.module_add_comm_group AlternatingMap.instModuleAddCommGroup namespace ExteriorAlgebra open CliffordAlgebra hiding ΞΉ def liftAlternating : (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] N := by suffices (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N by refine LinearMap.comprβ‚‚ this ?_ refine (LinearEquiv.toLinearMap ?_).comp (LinearMap.proj 0) exact AlternatingMap.constLinearEquivOfIsEmpty.symm refine CliffordAlgebra.foldl _ ?_ ?_ Β· refine LinearMap.mkβ‚‚ R (fun m f i => (f i.succ).curryLeft m) (fun m₁ mβ‚‚ f => ?_) (fun c m f => ?_) (fun m f₁ fβ‚‚ => ?_) fun c m f => ?_ all_goals ext i : 1 simp only [map_smul, map_add, Pi.add_apply, Pi.smul_apply, AlternatingMap.curryLeft_add, AlternatingMap.curryLeft_smul, map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply] Β· -- when applied twice with the same `m`, this recursive step produces 0 intro m x dsimp only [LinearMap.mkβ‚‚_apply, QuadraticForm.coeFn_zero, Pi.zero_apply] simp_rw [zero_smul] ext i : 1 exact AlternatingMap.curryLeft_same _ _ #align exterior_algebra.lift_alternating ExteriorAlgebra.liftAlternating @[simp] theorem liftAlternating_ΞΉ (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m) = f 1 ![m] := by dsimp [liftAlternating] rw [foldl_ΞΉ, LinearMap.mkβ‚‚_apply, AlternatingMap.curryLeft_apply_apply] congr -- Porting note: In Lean 3, `congr` could use the `[Subsingleton (Fin 0 β†’ M)]` instance to finish -- the proof. Here, the instance can be synthesized but `congr` does not use it so the following -- line is provided. rw [Matrix.zero_empty] #align exterior_algebra.lift_alternating_ΞΉ ExteriorAlgebra.liftAlternating_ΞΉ theorem liftAlternating_ΞΉ_mul (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) (x : ExteriorAlgebra R M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m * x) = liftAlternating (R := R) (M := M) (N := N) (fun i => (f i.succ).curryLeft m) x := by dsimp [liftAlternating] rw [foldl_mul, foldl_ΞΉ] rfl #align exterior_algebra.lift_alternating_ΞΉ_mul ExteriorAlgebra.liftAlternating_ΞΉ_mul @[simp] theorem liftAlternating_one (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) : liftAlternating (R := R) (M := M) (N := N) f (1 : ExteriorAlgebra R M) = f 0 0 := by dsimp [liftAlternating] rw [foldl_one] #align exterior_algebra.lift_alternating_one ExteriorAlgebra.liftAlternating_one @[simp] theorem liftAlternating_algebraMap (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (r : R) : liftAlternating (R := R) (M := M) (N := N) f (algebraMap _ (ExteriorAlgebra R M) r) = r β€’ f 0 0 := by rw [Algebra.algebraMap_eq_smul_one, map_smul, liftAlternating_one] #align exterior_algebra.lift_alternating_algebra_map ExteriorAlgebra.liftAlternating_algebraMap @[simp] theorem liftAlternating_apply_ΞΉMulti {n : β„•} (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (v : Fin n β†’ M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉMulti R n v) = f n v := by rw [ΞΉMulti_apply] -- Porting note: `v` is generalized automatically so it was removed from the next line induction' n with n ih generalizing f Β· -- Porting note: Lean does not automatically synthesize the instance -- `[Subsingleton (Fin 0 β†’ M)]` which is needed for `Subsingleton.elim 0 v` on line 114. letI : Subsingleton (Fin 0 β†’ M) := by infer_instance rw [List.ofFn_zero, List.prod_nil, liftAlternating_one, Subsingleton.elim 0 v] Β· rw [List.ofFn_succ, List.prod_cons, liftAlternating_ΞΉ_mul, ih, AlternatingMap.curryLeft_apply_apply] congr exact Matrix.cons_head_tail _ #align exterior_algebra.lift_alternating_apply_ΞΉ_multi ExteriorAlgebra.liftAlternating_apply_ΞΉMulti @[simp] theorem liftAlternating_comp_ΞΉMulti {n : β„•} (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) : (liftAlternating (R := R) (M := M) (N := N) f).compAlternatingMap (ΞΉMulti R n) = f n := AlternatingMap.ext <| liftAlternating_apply_ΞΉMulti f #align exterior_algebra.lift_alternating_comp_ΞΉ_multi ExteriorAlgebra.liftAlternating_comp_ΞΉMulti @[simp]
Mathlib/LinearAlgebra/ExteriorAlgebra/OfAlternating.lean
125
135
theorem liftAlternating_comp (g : N β†’β‚—[R] N') (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) : (liftAlternating (R := R) (M := M) (N := N') fun i => g.compAlternatingMap (f i)) = g βˆ˜β‚— liftAlternating (R := R) (M := M) (N := N) f := by
ext v rw [LinearMap.comp_apply] induction' v using CliffordAlgebra.left_induction with r x y hx hy x m hx generalizing f Β· rw [liftAlternating_algebraMap, liftAlternating_algebraMap, map_smul, LinearMap.compAlternatingMap_apply] Β· rw [map_add, map_add, map_add, hx, hy] Β· rw [liftAlternating_ΞΉ_mul, liftAlternating_ΞΉ_mul, ← hx] simp_rw [AlternatingMap.curryLeft_compAlternatingMap]
[ " Module R (M [β‹€^ΞΉ]β†’β‚—[R] N)", " ((i : β„•) β†’ M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] N", " ((i : β„•) β†’ M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] N", " M [β‹€^Fin 0]β†’β‚—[R] N ≃ₗ[R] N", " ((i : β„•) β†’ M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] (i : β„•) β†’ M [β‹€^Fin i]β†’β‚—[R] N", " M β†’β‚—[R] ((i : β„•) β†’ M [β‹€^Fin i]β†’β‚—[R]...
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
Mathlib/Data/Matrix/PEquiv.lean
96
99
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]
[ " (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.ZMod.Basic import Mathlib.GroupTheory.Coxeter.Basic namespace CoxeterSystem open List Matrix Function Classical variable {B : Type*} variable {W : Type*} [Group W] variable {M : CoxeterMatrix B} (cs : CoxeterSystem M W) local prefix:100 "s" => cs.simple local prefix:100 "Ο€" => cs.wordProd private theorem exists_word_with_prod (w : W) : βˆƒ n Ο‰, Ο‰.length = n ∧ Ο€ Ο‰ = w := by rcases cs.wordProd_surjective w with βŸ¨Ο‰, rfl⟩ use Ο‰.length, Ο‰ noncomputable def length (w : W) : β„• := Nat.find (cs.exists_word_with_prod w) local prefix:100 "β„“" => cs.length theorem exists_reduced_word (w : W) : βˆƒ Ο‰, Ο‰.length = β„“ w ∧ w = Ο€ Ο‰ := by have := Nat.find_spec (cs.exists_word_with_prod w) tauto theorem length_wordProd_le (Ο‰ : List B) : β„“ (Ο€ Ο‰) ≀ Ο‰.length := Nat.find_min' (cs.exists_word_with_prod (Ο€ Ο‰)) βŸ¨Ο‰, by tauto⟩ @[simp] theorem length_one : β„“ (1 : W) = 0 := Nat.eq_zero_of_le_zero (cs.length_wordProd_le []) @[simp] theorem length_eq_zero_iff {w : W} : β„“ w = 0 ↔ w = 1 := by constructor Β· intro h rcases cs.exists_reduced_word w with βŸ¨Ο‰, hΟ‰, rfl⟩ have : Ο‰ = [] := eq_nil_of_length_eq_zero (hΟ‰.trans h) rw [this, wordProd_nil] Β· rintro rfl exact cs.length_one @[simp]
Mathlib/GroupTheory/Coxeter/Length.lean
91
98
theorem length_inv (w : W) : β„“ (w⁻¹) = β„“ w := by
apply Nat.le_antisymm Β· rcases cs.exists_reduced_word w with βŸ¨Ο‰, hΟ‰, rfl⟩ have := cs.length_wordProd_le (List.reverse Ο‰) rwa [wordProd_reverse, length_reverse, hΟ‰] at this Β· rcases cs.exists_reduced_word w⁻¹ with βŸ¨Ο‰, hΟ‰, h'Ο‰βŸ© have := cs.length_wordProd_le (List.reverse Ο‰) rwa [wordProd_reverse, length_reverse, ← h'Ο‰, hΟ‰, inv_inv] at this
[ " βˆƒ n Ο‰, Ο‰.length = n ∧ cs.wordProd Ο‰ = w", " βˆƒ n Ο‰_1, Ο‰_1.length = n ∧ cs.wordProd Ο‰_1 = cs.wordProd Ο‰", " βˆƒ Ο‰, Ο‰.length = cs.length w ∧ w = cs.wordProd Ο‰", " Ο‰.length = Ο‰.length ∧ cs.wordProd Ο‰ = cs.wordProd Ο‰", " cs.length w = 0 ↔ w = 1", " cs.length w = 0 β†’ w = 1", " w = 1", " cs.wordProd Ο‰ = 1", ...
import Mathlib.Analysis.Convex.Between import Mathlib.Analysis.Convex.Normed import Mathlib.Analysis.Normed.Group.AddTorsor #align_import analysis.convex.side from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f" variable {R V V' P P' : Type*} open AffineEquiv AffineMap namespace AffineSubspace section StrictOrderedCommRing variable [StrictOrderedCommRing R] [AddCommGroup V] [Module R V] [AddTorsor V P] variable [AddCommGroup V'] [Module R V'] [AddTorsor V' P'] def WSameSide (s : AffineSubspace R P) (x y : P) : Prop := βˆƒα΅‰ (p₁ ∈ s) (pβ‚‚ ∈ s), SameRay R (x -α΅₯ p₁) (y -α΅₯ pβ‚‚) #align affine_subspace.w_same_side AffineSubspace.WSameSide def SSameSide (s : AffineSubspace R P) (x y : P) : Prop := s.WSameSide x y ∧ x βˆ‰ s ∧ y βˆ‰ s #align affine_subspace.s_same_side AffineSubspace.SSameSide def WOppSide (s : AffineSubspace R P) (x y : P) : Prop := βˆƒα΅‰ (p₁ ∈ s) (pβ‚‚ ∈ s), SameRay R (x -α΅₯ p₁) (pβ‚‚ -α΅₯ y) #align affine_subspace.w_opp_side AffineSubspace.WOppSide def SOppSide (s : AffineSubspace R P) (x y : P) : Prop := s.WOppSide x y ∧ x βˆ‰ s ∧ y βˆ‰ s #align affine_subspace.s_opp_side AffineSubspace.SOppSide theorem WSameSide.map {s : AffineSubspace R P} {x y : P} (h : s.WSameSide x y) (f : P →ᡃ[R] P') : (s.map f).WSameSide (f x) (f y) := by rcases h with ⟨p₁, hp₁, pβ‚‚, hpβ‚‚, h⟩ refine ⟨f p₁, mem_map_of_mem f hp₁, f pβ‚‚, mem_map_of_mem f hpβ‚‚, ?_⟩ simp_rw [← linearMap_vsub] exact h.map f.linear #align affine_subspace.w_same_side.map AffineSubspace.WSameSide.map theorem _root_.Function.Injective.wSameSide_map_iff {s : AffineSubspace R P} {x y : P} {f : P →ᡃ[R] P'} (hf : Function.Injective f) : (s.map f).WSameSide (f x) (f y) ↔ s.WSameSide x y := by refine ⟨fun h => ?_, fun h => h.map _⟩ rcases h with ⟨fp₁, hfp₁, fpβ‚‚, hfpβ‚‚, h⟩ rw [mem_map] at hfp₁ hfpβ‚‚ rcases hfp₁ with ⟨p₁, hp₁, rfl⟩ rcases hfpβ‚‚ with ⟨pβ‚‚, hpβ‚‚, rfl⟩ refine ⟨p₁, hp₁, pβ‚‚, hpβ‚‚, ?_⟩ simp_rw [← linearMap_vsub, (f.linear_injective_iff.2 hf).sameRay_map_iff] at h exact h #align function.injective.w_same_side_map_iff Function.Injective.wSameSide_map_iff theorem _root_.Function.Injective.sSameSide_map_iff {s : AffineSubspace R P} {x y : P} {f : P →ᡃ[R] P'} (hf : Function.Injective f) : (s.map f).SSameSide (f x) (f y) ↔ s.SSameSide x y := by simp_rw [SSameSide, hf.wSameSide_map_iff, mem_map_iff_mem_of_injective hf] #align function.injective.s_same_side_map_iff Function.Injective.sSameSide_map_iff @[simp] theorem _root_.AffineEquiv.wSameSide_map_iff {s : AffineSubspace R P} {x y : P} (f : P ≃ᡃ[R] P') : (s.map ↑f).WSameSide (f x) (f y) ↔ s.WSameSide x y := (show Function.Injective f.toAffineMap from f.injective).wSameSide_map_iff #align affine_equiv.w_same_side_map_iff AffineEquiv.wSameSide_map_iff @[simp] theorem _root_.AffineEquiv.sSameSide_map_iff {s : AffineSubspace R P} {x y : P} (f : P ≃ᡃ[R] P') : (s.map ↑f).SSameSide (f x) (f y) ↔ s.SSameSide x y := (show Function.Injective f.toAffineMap from f.injective).sSameSide_map_iff #align affine_equiv.s_same_side_map_iff AffineEquiv.sSameSide_map_iff theorem WOppSide.map {s : AffineSubspace R P} {x y : P} (h : s.WOppSide x y) (f : P →ᡃ[R] P') : (s.map f).WOppSide (f x) (f y) := by rcases h with ⟨p₁, hp₁, pβ‚‚, hpβ‚‚, h⟩ refine ⟨f p₁, mem_map_of_mem f hp₁, f pβ‚‚, mem_map_of_mem f hpβ‚‚, ?_⟩ simp_rw [← linearMap_vsub] exact h.map f.linear #align affine_subspace.w_opp_side.map AffineSubspace.WOppSide.map
Mathlib/Analysis/Convex/Side.lean
109
119
theorem _root_.Function.Injective.wOppSide_map_iff {s : AffineSubspace R P} {x y : P} {f : P →ᡃ[R] P'} (hf : Function.Injective f) : (s.map f).WOppSide (f x) (f y) ↔ s.WOppSide x y := by
refine ⟨fun h => ?_, fun h => h.map _⟩ rcases h with ⟨fp₁, hfp₁, fpβ‚‚, hfpβ‚‚, h⟩ rw [mem_map] at hfp₁ hfpβ‚‚ rcases hfp₁ with ⟨p₁, hp₁, rfl⟩ rcases hfpβ‚‚ with ⟨pβ‚‚, hpβ‚‚, rfl⟩ refine ⟨p₁, hp₁, pβ‚‚, hpβ‚‚, ?_⟩ simp_rw [← linearMap_vsub, (f.linear_injective_iff.2 hf).sameRay_map_iff] at h exact h
[ " (AffineSubspace.map f s).WSameSide (f x) (f y)", " SameRay R (f x -α΅₯ f p₁) (f y -α΅₯ f pβ‚‚)", " SameRay R (f.linear (x -α΅₯ p₁)) (f.linear (y -α΅₯ pβ‚‚))", " (map f s).WSameSide (f x) (f y) ↔ s.WSameSide x y", " s.WSameSide x y", " SameRay R (x -α΅₯ p₁) (y -α΅₯ pβ‚‚)", " (map f s).SSameSide (f x) (f y) ↔ s.SSameSide...
import Mathlib.Control.Functor import Mathlib.Tactic.Common #align_import control.bifunctor from "leanprover-community/mathlib"@"dc1525fb3ef6eb4348fb1749c302d8abc303d34a" universe uβ‚€ u₁ uβ‚‚ vβ‚€ v₁ vβ‚‚ open Function class Bifunctor (F : Type uβ‚€ β†’ Type u₁ β†’ Type uβ‚‚) where bimap : βˆ€ {Ξ± Ξ±' Ξ² Ξ²'}, (Ξ± β†’ Ξ±') β†’ (Ξ² β†’ Ξ²') β†’ F Ξ± Ξ² β†’ F Ξ±' Ξ²' #align bifunctor Bifunctor export Bifunctor (bimap) class LawfulBifunctor (F : Type uβ‚€ β†’ Type u₁ β†’ Type uβ‚‚) [Bifunctor F] : Prop where id_bimap : βˆ€ {Ξ± Ξ²} (x : F Ξ± Ξ²), bimap id id x = x bimap_bimap : βˆ€ {Ξ±β‚€ α₁ Ξ±β‚‚ Ξ²β‚€ β₁ Ξ²β‚‚} (f : Ξ±β‚€ β†’ α₁) (f' : α₁ β†’ Ξ±β‚‚) (g : Ξ²β‚€ β†’ β₁) (g' : β₁ β†’ Ξ²β‚‚) (x : F Ξ±β‚€ Ξ²β‚€), bimap f' g' (bimap f g x) = bimap (f' ∘ f) (g' ∘ g) x #align is_lawful_bifunctor LawfulBifunctor export LawfulBifunctor (id_bimap bimap_bimap) attribute [higher_order bimap_id_id] id_bimap #align is_lawful_bifunctor.bimap_id_id LawfulBifunctor.bimap_id_id attribute [higher_order bimap_comp_bimap] bimap_bimap #align is_lawful_bifunctor.bimap_comp_bimap LawfulBifunctor.bimap_comp_bimap export LawfulBifunctor (bimap_id_id bimap_comp_bimap) variable {F : Type uβ‚€ β†’ Type u₁ β†’ Type uβ‚‚} [Bifunctor F] namespace Bifunctor abbrev fst {Ξ± Ξ±' Ξ²} (f : Ξ± β†’ Ξ±') : F Ξ± Ξ² β†’ F Ξ±' Ξ² := bimap f id #align bifunctor.fst Bifunctor.fst abbrev snd {Ξ± Ξ² Ξ²'} (f : Ξ² β†’ Ξ²') : F Ξ± Ξ² β†’ F Ξ± Ξ²' := bimap id f #align bifunctor.snd Bifunctor.snd variable [LawfulBifunctor F] @[higher_order fst_id] theorem id_fst : βˆ€ {Ξ± Ξ²} (x : F Ξ± Ξ²), fst id x = x := @id_bimap _ _ _ #align bifunctor.id_fst Bifunctor.id_fst #align bifunctor.fst_id Bifunctor.fst_id @[higher_order snd_id] theorem id_snd : βˆ€ {Ξ± Ξ²} (x : F Ξ± Ξ²), snd id x = x := @id_bimap _ _ _ #align bifunctor.id_snd Bifunctor.id_snd #align bifunctor.snd_id Bifunctor.snd_id @[higher_order fst_comp_fst]
Mathlib/Control/Bifunctor.lean
86
87
theorem comp_fst {Ξ±β‚€ α₁ Ξ±β‚‚ Ξ²} (f : Ξ±β‚€ β†’ α₁) (f' : α₁ β†’ Ξ±β‚‚) (x : F Ξ±β‚€ Ξ²) : fst f' (fst f x) = fst (f' ∘ f) x := by
simp [fst, bimap_bimap]
[ " fst f' (fst f x) = fst (f' ∘ f) x" ]
import Mathlib.Algebra.MvPolynomial.Rename #align_import data.mv_polynomial.comap from "leanprover-community/mathlib"@"aba31c938d3243cc671be7091b28a1e0814647ee" namespace MvPolynomial variable {Οƒ : Type*} {Ο„ : Type*} {Ο… : Type*} {R : Type*} [CommSemiring R] noncomputable def comap (f : MvPolynomial Οƒ R →ₐ[R] MvPolynomial Ο„ R) : (Ο„ β†’ R) β†’ Οƒ β†’ R := fun x i => aeval x (f (X i)) #align mv_polynomial.comap MvPolynomial.comap @[simp] theorem comap_apply (f : MvPolynomial Οƒ R →ₐ[R] MvPolynomial Ο„ R) (x : Ο„ β†’ R) (i : Οƒ) : comap f x i = aeval x (f (X i)) := rfl #align mv_polynomial.comap_apply MvPolynomial.comap_apply @[simp]
Mathlib/Algebra/MvPolynomial/Comap.lean
48
50
theorem comap_id_apply (x : Οƒ β†’ R) : comap (AlgHom.id R (MvPolynomial Οƒ R)) x = x := by
funext i simp only [comap, AlgHom.id_apply, id, aeval_X]
[ " comap (AlgHom.id R (MvPolynomial Οƒ R)) x = x", " comap (AlgHom.id R (MvPolynomial Οƒ R)) x i = x i" ]
import Mathlib.Algebra.Quaternion import Mathlib.Analysis.InnerProductSpace.Basic import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Topology.Algebra.Algebra #align_import analysis.quaternion from "leanprover-community/mathlib"@"07992a1d1f7a4176c6d3f160209608be4e198566" @[inherit_doc] scoped[Quaternion] notation "ℍ" => Quaternion ℝ open scoped RealInnerProductSpace namespace Quaternion instance : Inner ℝ ℍ := ⟨fun a b => (a * star b).re⟩ theorem inner_self (a : ℍ) : βŸͺa, a⟫ = normSq a := rfl #align quaternion.inner_self Quaternion.inner_self theorem inner_def (a b : ℍ) : βŸͺa, b⟫ = (a * star b).re := rfl #align quaternion.inner_def Quaternion.inner_def noncomputable instance : NormedAddCommGroup ℍ := @InnerProductSpace.Core.toNormedAddCommGroup ℝ ℍ _ _ _ { toInner := inferInstance conj_symm := fun x y => by simp [inner_def, mul_comm] nonneg_re := fun x => normSq_nonneg definite := fun x => normSq_eq_zero.1 add_left := fun x y z => by simp only [inner_def, add_mul, add_re] smul_left := fun x y r => by simp [inner_def] } noncomputable instance : InnerProductSpace ℝ ℍ := InnerProductSpace.ofCore _
Mathlib/Analysis/Quaternion.lean
65
66
theorem normSq_eq_norm_mul_self (a : ℍ) : normSq a = β€–aβ€– * β€–aβ€– := by
rw [← inner_self, real_inner_self_eq_norm_mul_norm]
[ " (starRingEnd ℝ) βŸͺy, x⟫_ℝ = βŸͺx, y⟫_ℝ", " βŸͺx + y, z⟫_ℝ = βŸͺx, z⟫_ℝ + βŸͺy, z⟫_ℝ", " βŸͺr β€’ x, y⟫_ℝ = (starRingEnd ℝ) r * βŸͺx, y⟫_ℝ", " normSq a = β€–aβ€– * β€–aβ€–" ]
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse #align_import analysis.special_functions.complex.arg from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" open Filter Metric Set open scoped ComplexConjugate Real Topology namespace Complex variable {a x z : β„‚} noncomputable def arg (x : β„‚) : ℝ := if 0 ≀ x.re then Real.arcsin (x.im / abs x) else if 0 ≀ x.im then Real.arcsin ((-x).im / abs x) + Ο€ else Real.arcsin ((-x).im / abs x) - Ο€ #align complex.arg Complex.arg theorem sin_arg (x : β„‚) : Real.sin (arg x) = x.im / abs x := by unfold arg; split_ifs <;> simp [sub_eq_add_neg, arg, Real.sin_arcsin (abs_le.1 (abs_im_div_abs_le_one x)).1 (abs_le.1 (abs_im_div_abs_le_one x)).2, Real.sin_add, neg_div, Real.arcsin_neg, Real.sin_neg] #align complex.sin_arg Complex.sin_arg theorem cos_arg {x : β„‚} (hx : x β‰  0) : Real.cos (arg x) = x.re / abs x := by rw [arg] split_ifs with h₁ hβ‚‚ Β· rw [Real.cos_arcsin] field_simp [Real.sqrt_sq, (abs.pos hx).le, *] Β· rw [Real.cos_add_pi, Real.cos_arcsin] field_simp [Real.sqrt_div (sq_nonneg _), Real.sqrt_sq_eq_abs, _root_.abs_of_neg (not_le.1 h₁), *] Β· rw [Real.cos_sub_pi, Real.cos_arcsin] field_simp [Real.sqrt_div (sq_nonneg _), Real.sqrt_sq_eq_abs, _root_.abs_of_neg (not_le.1 h₁), *] #align complex.cos_arg Complex.cos_arg @[simp] theorem abs_mul_exp_arg_mul_I (x : β„‚) : ↑(abs x) * exp (arg x * I) = x := by rcases eq_or_ne x 0 with (rfl | hx) Β· simp Β· have : abs x β‰  0 := abs.ne_zero hx apply Complex.ext <;> field_simp [sin_arg, cos_arg hx, this, mul_comm (abs x)] set_option linter.uppercaseLean3 false in #align complex.abs_mul_exp_arg_mul_I Complex.abs_mul_exp_arg_mul_I @[simp]
Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean
63
64
theorem abs_mul_cos_add_sin_mul_I (x : β„‚) : (abs x * (cos (arg x) + sin (arg x) * I) : β„‚) = x := by
rw [← exp_mul_I, abs_mul_exp_arg_mul_I]
[ " x.arg.sin = x.im / abs x", " (if 0 ≀ x.re then (x.im / abs x).arcsin\n else if 0 ≀ x.im then ((-x).im / abs x).arcsin + Ο€ else ((-x).im / abs x).arcsin - Ο€).sin =\n x.im / abs x", " (x.im / abs x).arcsin.sin = x.im / abs x", " (((-x).im / abs x).arcsin + Ο€).sin = x.im / abs x", " (((-x).im / abs x...
import Mathlib.AlgebraicTopology.DoldKan.FunctorGamma import Mathlib.AlgebraicTopology.DoldKan.SplitSimplicialObject import Mathlib.CategoryTheory.Idempotents.HomologicalComplex #align_import algebraic_topology.dold_kan.gamma_comp_n from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504" noncomputable section open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Idempotents Opposite SimplicialObject Simplicial namespace AlgebraicTopology namespace DoldKan variable {C : Type*} [Category C] [Preadditive C] [HasFiniteCoproducts C] @[simps!] def Ξ“β‚€NondegComplexIso (K : ChainComplex C β„•) : (Ξ“β‚€.splitting K).nondegComplex β‰… K := HomologicalComplex.Hom.isoOfComponents (fun n => Iso.refl _) (by rintro _ n (rfl : n + 1 = _) dsimp simp only [id_comp, comp_id, AlternatingFaceMapComplex.obj_d_eq, Preadditive.sum_comp, Preadditive.comp_sum] rw [Fintype.sum_eq_single (0 : Fin (n + 2))] Β· simp only [Fin.val_zero, pow_zero, one_zsmul] erw [Ξ“β‚€.Obj.mapMono_on_summand_id_assoc, Ξ“β‚€.Obj.Termwise.mapMono_Ξ΄β‚€, Splitting.cofan_inj_Ο€Summand_eq_id, comp_id] Β· intro i hi dsimp simp only [Preadditive.zsmul_comp, Preadditive.comp_zsmul, assoc] erw [Ξ“β‚€.Obj.mapMono_on_summand_id_assoc, Ξ“β‚€.Obj.Termwise.mapMono_eq_zero, zero_comp, zsmul_zero] Β· intro h replace h := congr_arg SimplexCategory.len h change n + 1 = n at h omega Β· simpa only [IsΞ΄β‚€.iff] using hi) #align algebraic_topology.dold_kan.Ξ“β‚€_nondeg_complex_iso AlgebraicTopology.DoldKan.Ξ“β‚€NondegComplexIso def Ξ“β‚€'CompNondegComplexFunctor : Ξ“β‚€' β‹™ Split.nondegComplexFunctor β‰… 𝟭 (ChainComplex C β„•) := NatIso.ofComponents Ξ“β‚€NondegComplexIso #align algebraic_topology.dold_kan.Ξ“β‚€'_comp_nondeg_complex_functor AlgebraicTopology.DoldKan.Ξ“β‚€'CompNondegComplexFunctor def N₁Γ₀ : Ξ“β‚€ β‹™ N₁ β‰… toKaroubi (ChainComplex C β„•) := calc Ξ“β‚€ β‹™ N₁ β‰… Ξ“β‚€' β‹™ Split.forget C β‹™ N₁ := Functor.associator _ _ _ _ β‰… Ξ“β‚€' β‹™ Split.nondegComplexFunctor β‹™ toKaroubi _ := (isoWhiskerLeft Ξ“β‚€' Split.toKaroubiNondegComplexFunctorIsoN₁.symm) _ β‰… (Ξ“β‚€' β‹™ Split.nondegComplexFunctor) β‹™ toKaroubi _ := (Functor.associator _ _ _).symm _ β‰… 𝟭 _ β‹™ toKaroubi (ChainComplex C β„•) := isoWhiskerRight Ξ“β‚€'CompNondegComplexFunctor _ _ β‰… toKaroubi (ChainComplex C β„•) := Functor.leftUnitor _ set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.N₁Γ₀ AlgebraicTopology.DoldKan.N₁Γ₀ theorem N₁Γ₀_app (K : ChainComplex C β„•) : N₁Γ₀.app K = (Ξ“β‚€.splitting K).toKaroubiNondegComplexIsoN₁.symm β‰ͺ≫ (toKaroubi _).mapIso (Ξ“β‚€NondegComplexIso K) := by ext1 dsimp [N₁Γ₀] erw [id_comp, comp_id, comp_id] rfl set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.N₁Γ₀_app AlgebraicTopology.DoldKan.N₁Γ₀_app theorem N₁Γ₀_hom_app (K : ChainComplex C β„•) : N₁Γ₀.hom.app K = (Ξ“β‚€.splitting K).toKaroubiNondegComplexIsoN₁.inv ≫ (toKaroubi _).map (Ξ“β‚€NondegComplexIso K).hom := by change (N₁Γ₀.app K).hom = _ simp only [N₁Γ₀_app] rfl set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.N₁Γ₀_hom_app AlgebraicTopology.DoldKan.N₁Γ₀_hom_app theorem N₁Γ₀_inv_app (K : ChainComplex C β„•) : N₁Γ₀.inv.app K = (toKaroubi _).map (Ξ“β‚€NondegComplexIso K).inv ≫ (Ξ“β‚€.splitting K).toKaroubiNondegComplexIsoN₁.hom := by change (N₁Γ₀.app K).inv = _ simp only [N₁Γ₀_app] rfl set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.N₁Γ₀_inv_app AlgebraicTopology.DoldKan.N₁Γ₀_inv_app @[simp] theorem N₁Γ₀_hom_app_f_f (K : ChainComplex C β„•) (n : β„•) : (N₁Γ₀.hom.app K).f.f n = (Ξ“β‚€.splitting K).toKaroubiNondegComplexIsoN₁.inv.f.f n := by rw [N₁Γ₀_hom_app] apply comp_id set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.N₁Γ₀_hom_app_f_f AlgebraicTopology.DoldKan.N₁Γ₀_hom_app_f_f @[simp]
Mathlib/AlgebraicTopology/DoldKan/GammaCompN.lean
113
116
theorem N₁Γ₀_inv_app_f_f (K : ChainComplex C β„•) (n : β„•) : (N₁Γ₀.inv.app K).f.f n = (Ξ“β‚€.splitting K).toKaroubiNondegComplexIsoN₁.hom.f.f n := by
rw [N₁Γ₀_inv_app] apply id_comp
[ " βˆ€ (i j : β„•),\n (ComplexShape.down β„•).Rel i j β†’\n ((fun n => Iso.refl ((Ξ“β‚€.splitting K).nondegComplex.X n)) i).hom ≫ K.d i j =\n (Ξ“β‚€.splitting K).nondegComplex.d i j ≫ ((fun n => Iso.refl ((Ξ“β‚€.splitting K).nondegComplex.X n)) j).hom", " ((fun n => Iso.refl ((Ξ“β‚€.splitting K).nondegComplex.X n)) (n ...
import Mathlib.CategoryTheory.CofilteredSystem import Mathlib.Combinatorics.SimpleGraph.Connectivity import Mathlib.Data.Finite.Set #align_import combinatorics.simple_graph.ends.defs from "leanprover-community/mathlib"@"b99e2d58a5e6861833fa8de11e51a81144258db4" universe u variable {V : Type u} (G : SimpleGraph V) (K L L' M : Set V) namespace SimpleGraph abbrev ComponentCompl := (G.induce Kᢜ).ConnectedComponent #align simple_graph.component_compl SimpleGraph.ComponentCompl variable {G} {K L M} abbrev componentComplMk (G : SimpleGraph V) {v : V} (vK : v βˆ‰ K) : G.ComponentCompl K := connectedComponentMk (G.induce Kᢜ) ⟨v, vK⟩ #align simple_graph.component_compl_mk SimpleGraph.componentComplMk def ComponentCompl.supp (C : G.ComponentCompl K) : Set V := { v : V | βˆƒ h : v βˆ‰ K, G.componentComplMk h = C } #align simple_graph.component_compl.supp SimpleGraph.ComponentCompl.supp @[ext]
Mathlib/Combinatorics/SimpleGraph/Ends/Defs.lean
44
49
theorem ComponentCompl.supp_injective : Function.Injective (ComponentCompl.supp : G.ComponentCompl K β†’ Set V) := by
refine ConnectedComponent.indβ‚‚ ?_ rintro ⟨v, hv⟩ ⟨w, hw⟩ h simp only [Set.ext_iff, ConnectedComponent.eq, Set.mem_setOf_eq, ComponentCompl.supp] at h ⊒ exact ((h v).mp ⟨hv, Reachable.refl _⟩).choose_spec
[ " Function.Injective supp", " βˆ€ (v w : ↑Kᢜ),\n supp ((induce Kᢜ G).connectedComponentMk v) = supp ((induce Kᢜ G).connectedComponentMk w) β†’\n (induce Kᢜ G).connectedComponentMk v = (induce Kᢜ G).connectedComponentMk w", " (induce Kᢜ G).connectedComponentMk ⟨v, hv⟩ = (induce Kᢜ G).connectedComponentMk ⟨w,...
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set section AddMonoidWithOne variable {Ξ± M : Type*} [AddMonoidWithOne M] [CharZero M] {n : β„•} instance CharZero.NeZero.two : NeZero (2 : M) := ⟨by have : ((2 : β„•) : M) β‰  0 := Nat.cast_ne_zero.2 (by decide) rwa [Nat.cast_two] at this⟩ #align char_zero.ne_zero.two CharZero.NeZero.two section variable {R : Type*} [NonAssocSemiring R] [NoZeroDivisors R] [CharZero R] {a : R} @[simp]
Mathlib/Algebra/CharZero/Lemmas.lean
88
89
theorem add_self_eq_zero {a : R} : a + a = 0 ↔ a = 0 := by
simp only [(two_mul a).symm, mul_eq_zero, two_ne_zero, false_or_iff]
[ " 2 β‰  0", " a + a = 0 ↔ a = 0" ]
import Mathlib.Data.Fintype.Order import Mathlib.Data.Set.Finite import Mathlib.Order.Category.FinPartOrd import Mathlib.Order.Category.LinOrd import Mathlib.CategoryTheory.Limits.Shapes.Images import Mathlib.CategoryTheory.Limits.Shapes.RegularMono import Mathlib.Data.Set.Subsingleton #align_import order.category.NonemptyFinLinOrd from "leanprover-community/mathlib"@"fa4a805d16a9cd9c96e0f8edeb57dc5a07af1a19" universe u v open CategoryTheory CategoryTheory.Limits class NonemptyFiniteLinearOrder (Ξ± : Type*) extends Fintype Ξ±, LinearOrder Ξ± where Nonempty : Nonempty Ξ± := by infer_instance #align nonempty_fin_lin_ord NonemptyFiniteLinearOrder attribute [instance] NonemptyFiniteLinearOrder.Nonempty instance (priority := 100) NonemptyFiniteLinearOrder.toBoundedOrder (Ξ± : Type*) [NonemptyFiniteLinearOrder Ξ±] : BoundedOrder Ξ± := Fintype.toBoundedOrder Ξ± #align nonempty_fin_lin_ord.to_bounded_order NonemptyFiniteLinearOrder.toBoundedOrder instance PUnit.nonemptyFiniteLinearOrder : NonemptyFiniteLinearOrder PUnit where #align punit.nonempty_fin_lin_ord PUnit.nonemptyFiniteLinearOrder instance Fin.nonemptyFiniteLinearOrder (n : β„•) : NonemptyFiniteLinearOrder (Fin (n + 1)) where #align fin.nonempty_fin_lin_ord Fin.nonemptyFiniteLinearOrder instance ULift.nonemptyFiniteLinearOrder (Ξ± : Type u) [NonemptyFiniteLinearOrder Ξ±] : NonemptyFiniteLinearOrder (ULift.{v} Ξ±) := { LinearOrder.lift' Equiv.ulift (Equiv.injective _) with } #align ulift.nonempty_fin_lin_ord ULift.nonemptyFiniteLinearOrder instance (Ξ± : Type*) [NonemptyFiniteLinearOrder Ξ±] : NonemptyFiniteLinearOrder Ξ±α΅’α΅ˆ := { OrderDual.fintype Ξ± with } def NonemptyFinLinOrd := Bundled NonemptyFiniteLinearOrder set_option linter.uppercaseLean3 false in #align NonemptyFinLinOrd NonemptyFinLinOrd namespace NonemptyFinLinOrd instance : BundledHom.ParentProjection @NonemptyFiniteLinearOrder.toLinearOrder := ⟨⟩ deriving instance LargeCategory for NonemptyFinLinOrd -- Porting note: probably see https://github.com/leanprover-community/mathlib4/issues/5020 instance : ConcreteCategory NonemptyFinLinOrd := BundledHom.concreteCategory _ instance : CoeSort NonemptyFinLinOrd Type* := Bundled.coeSort def of (Ξ± : Type*) [NonemptyFiniteLinearOrder Ξ±] : NonemptyFinLinOrd := Bundled.of Ξ± set_option linter.uppercaseLean3 false in #align NonemptyFinLinOrd.of NonemptyFinLinOrd.of @[simp] theorem coe_of (Ξ± : Type*) [NonemptyFiniteLinearOrder Ξ±] : β†₯(of Ξ±) = Ξ± := rfl set_option linter.uppercaseLean3 false in #align NonemptyFinLinOrd.coe_of NonemptyFinLinOrd.coe_of instance : Inhabited NonemptyFinLinOrd := ⟨of PUnit⟩ instance (Ξ± : NonemptyFinLinOrd) : NonemptyFiniteLinearOrder Ξ± := Ξ±.str instance hasForgetToLinOrd : HasForgetβ‚‚ NonemptyFinLinOrd LinOrd := BundledHom.forgetβ‚‚ _ _ set_option linter.uppercaseLean3 false in #align NonemptyFinLinOrd.has_forget_to_LinOrd NonemptyFinLinOrd.hasForgetToLinOrd instance hasForgetToFinPartOrd : HasForgetβ‚‚ NonemptyFinLinOrd FinPartOrd where forgetβ‚‚ := { obj := fun X => FinPartOrd.of X map := @fun X Y => id } set_option linter.uppercaseLean3 false in #align NonemptyFinLinOrd.has_forget_to_FinPartOrd NonemptyFinLinOrd.hasForgetToFinPartOrd @[simps] def Iso.mk {Ξ± Ξ² : NonemptyFinLinOrd.{u}} (e : Ξ± ≃o Ξ²) : Ξ± β‰… Ξ² where hom := (e : OrderHom _ _) inv := (e.symm : OrderHom _ _) hom_inv_id := by ext x exact e.symm_apply_apply x inv_hom_id := by ext x exact e.apply_symm_apply x set_option linter.uppercaseLean3 false in #align NonemptyFinLinOrd.iso.mk NonemptyFinLinOrd.Iso.mk @[simps] def dual : NonemptyFinLinOrd β₯€ NonemptyFinLinOrd where obj X := of Xα΅’α΅ˆ map := OrderHom.dual set_option linter.uppercaseLean3 false in #align NonemptyFinLinOrd.dual NonemptyFinLinOrd.dual @[simps functor inverse] def dualEquiv : NonemptyFinLinOrd β‰Œ NonemptyFinLinOrd where functor := dual inverse := dual unitIso := NatIso.ofComponents fun X => Iso.mk <| OrderIso.dualDual X counitIso := NatIso.ofComponents fun X => Iso.mk <| OrderIso.dualDual X set_option linter.uppercaseLean3 false in #align NonemptyFinLinOrd.dual_equiv NonemptyFinLinOrd.dualEquiv instance {A B : NonemptyFinLinOrd.{u}} : FunLike (A ⟢ B) A B where coe f := ⇑(show OrderHom A B from f) coe_injective' _ _ h := by ext x exact congr_fun h x -- porting note (#10670): this instance was not necessary in mathlib instance {A B : NonemptyFinLinOrd.{u}} : OrderHomClass (A ⟢ B) A B where map_rel f _ _ h := f.monotone h
Mathlib/Order/Category/NonemptyFinLinOrd.lean
150
163
theorem mono_iff_injective {A B : NonemptyFinLinOrd.{u}} (f : A ⟢ B) : Mono f ↔ Function.Injective f := by
refine ⟨?_, ConcreteCategory.mono_of_injective f⟩ intro intro a₁ aβ‚‚ h let X := NonemptyFinLinOrd.of (ULift (Fin 1)) let g₁ : X ⟢ A := ⟨fun _ => a₁, fun _ _ _ => by rfl⟩ let gβ‚‚ : X ⟢ A := ⟨fun _ => aβ‚‚, fun _ _ _ => by rfl⟩ change g₁ (ULift.up (0 : Fin 1)) = gβ‚‚ (ULift.up (0 : Fin 1)) have eq : g₁ ≫ f = gβ‚‚ ≫ f := by ext exact h rw [cancel_mono] at eq rw [eq]
[ " ↑e ≫ ↑e.symm = πŸ™ Ξ±", " (↑e ≫ ↑e.symm) x = (πŸ™ Ξ±) x", " ↑e.symm ≫ ↑e = πŸ™ Ξ²", " (↑e.symm ≫ ↑e) x = (πŸ™ Ξ²) x", " x✝¹ = x✝", " x✝¹ x = x✝ x", " Mono f ↔ Function.Injective ⇑f", " Mono f β†’ Function.Injective ⇑f", " Function.Injective ⇑f", " a₁ = aβ‚‚", " (fun x => a₁) x✝² ≀ (fun x => a₁) x✝¹", " ...
import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.MvPolynomial.Basic #align_import ring_theory.mv_polynomial.tower from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496" variable (R A B : Type*) {Οƒ : Type*} namespace MvPolynomial section CommSemiring variable [CommSemiring R] [CommSemiring A] [CommSemiring B] variable [Algebra R A] [Algebra A B] [Algebra R B] [IsScalarTower R A B] variable {R A}
Mathlib/RingTheory/MvPolynomial/Tower.lean
48
53
theorem aeval_algebraMap_apply (x : Οƒ β†’ A) (p : MvPolynomial Οƒ R) : aeval (algebraMap A B ∘ x) p = algebraMap A B (MvPolynomial.aeval x p) := by
rw [aeval_def, aeval_def, ← coe_evalβ‚‚Hom, ← coe_evalβ‚‚Hom, map_evalβ‚‚Hom, ← IsScalarTower.algebraMap_eq] -- Porting note: added simp only [Function.comp]
[ " (aeval (⇑(algebraMap A B) ∘ x)) p = (algebraMap A B) ((aeval x) p)", " (evalβ‚‚Hom (algebraMap R B) (⇑(algebraMap A B) ∘ x)) p = (evalβ‚‚Hom (algebraMap R B) fun i => (algebraMap A B) (x i)) p" ]
import Mathlib.Algebra.Polynomial.Degree.TrailingDegree import Mathlib.Algebra.Polynomial.EraseLead import Mathlib.Algebra.Polynomial.Eval #align_import data.polynomial.reverse from "leanprover-community/mathlib"@"44de64f183393284a16016dfb2a48ac97382f2bd" namespace Polynomial open Polynomial Finsupp Finset open Polynomial section Semiring variable {R : Type*} [Semiring R] {f : R[X]} def revAtFun (N i : β„•) : β„• := ite (i ≀ N) (N - i) i #align polynomial.rev_at_fun Polynomial.revAtFun theorem revAtFun_invol {N i : β„•} : revAtFun N (revAtFun N i) = i := by unfold revAtFun split_ifs with h j Β· exact tsub_tsub_cancel_of_le h Β· exfalso apply j exact Nat.sub_le N i Β· rfl #align polynomial.rev_at_fun_invol Polynomial.revAtFun_invol theorem revAtFun_inj {N : β„•} : Function.Injective (revAtFun N) := by intro a b hab rw [← @revAtFun_invol N a, hab, revAtFun_invol] #align polynomial.rev_at_fun_inj Polynomial.revAtFun_inj def revAt (N : β„•) : Function.Embedding β„• β„• where toFun i := ite (i ≀ N) (N - i) i inj' := revAtFun_inj #align polynomial.rev_at Polynomial.revAt @[simp] theorem revAtFun_eq (N i : β„•) : revAtFun N i = revAt N i := rfl #align polynomial.rev_at_fun_eq Polynomial.revAtFun_eq @[simp] theorem revAt_invol {N i : β„•} : (revAt N) (revAt N i) = i := revAtFun_invol #align polynomial.rev_at_invol Polynomial.revAt_invol @[simp] theorem revAt_le {N i : β„•} (H : i ≀ N) : revAt N i = N - i := if_pos H #align polynomial.rev_at_le Polynomial.revAt_le lemma revAt_eq_self_of_lt {N i : β„•} (h : N < i) : revAt N i = i := by simp [revAt, Nat.not_le.mpr h]
Mathlib/Algebra/Polynomial/Reverse.lean
82
88
theorem revAt_add {N O n o : β„•} (hn : n ≀ N) (ho : o ≀ O) : revAt (N + O) (n + o) = revAt N n + revAt O o := by
rcases Nat.le.dest hn with ⟨n', rfl⟩ rcases Nat.le.dest ho with ⟨o', rfl⟩ repeat' rw [revAt_le (le_add_right rfl.le)] rw [add_assoc, add_left_comm n' o, ← add_assoc, revAt_le (le_add_right rfl.le)] repeat' rw [add_tsub_cancel_left]
[ " revAtFun N (revAtFun N i) = i", " (if (if i ≀ N then N - i else i) ≀ N then N - if i ≀ N then N - i else i else if i ≀ N then N - i else i) = i", " N - (N - i) = i", " N - i = i", " False", " N - i ≀ N", " i = i", " Function.Injective (revAtFun N)", " a = b", " (revAt N) i = i", " (revAt (N + ...
import Mathlib.Data.Real.Basic import Mathlib.Combinatorics.Pigeonhole import Mathlib.Algebra.Order.EuclideanAbsoluteValue #align_import number_theory.class_number.admissible_absolute_value from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" local infixl:50 " β‰Ί " => EuclideanDomain.r namespace AbsoluteValue variable {R : Type*} [EuclideanDomain R] variable (abv : AbsoluteValue R β„€) structure IsAdmissible extends IsEuclidean abv where protected card : ℝ β†’ β„• exists_partition' : βˆ€ (n : β„•) {Ξ΅ : ℝ} (_ : 0 < Ξ΅) {b : R} (_ : b β‰  0) (A : Fin n β†’ R), βˆƒ t : Fin n β†’ Fin (card Ξ΅), βˆ€ iβ‚€ i₁, t iβ‚€ = t i₁ β†’ (abv (A i₁ % b - A iβ‚€ % b) : ℝ) < abv b β€’ Ξ΅ #align absolute_value.is_admissible AbsoluteValue.IsAdmissible -- Porting note: no docstrings for IsAdmissible attribute [nolint docBlame] IsAdmissible.card namespace IsAdmissible variable {abv} theorem exists_partition {ΞΉ : Type*} [Finite ΞΉ] {Ξ΅ : ℝ} (hΞ΅ : 0 < Ξ΅) {b : R} (hb : b β‰  0) (A : ΞΉ β†’ R) (h : abv.IsAdmissible) : βˆƒ t : ΞΉ β†’ Fin (h.card Ξ΅), βˆ€ iβ‚€ i₁, t iβ‚€ = t i₁ β†’ (abv (A i₁ % b - A iβ‚€ % b) : ℝ) < abv b β€’ Ξ΅ := by rcases Finite.exists_equiv_fin ΞΉ with ⟨n, ⟨e⟩⟩ obtain ⟨t, ht⟩ := h.exists_partition' n hΞ΅ hb (A ∘ e.symm) refine ⟨t ∘ e, fun iβ‚€ i₁ h ↦ ?_⟩ convert (config := {transparency := .default}) ht (e iβ‚€) (e i₁) h <;> simp only [e.symm_apply_apply] #align absolute_value.is_admissible.exists_partition AbsoluteValue.IsAdmissible.exists_partition theorem exists_approx_aux (n : β„•) (h : abv.IsAdmissible) : βˆ€ {Ξ΅ : ℝ} (_hΞ΅ : 0 < Ξ΅) {b : R} (_hb : b β‰  0) (A : Fin (h.card Ξ΅ ^ n).succ β†’ Fin n β†’ R), βˆƒ iβ‚€ i₁, iβ‚€ β‰  i₁ ∧ βˆ€ k, (abv (A i₁ k % b - A iβ‚€ k % b) : ℝ) < abv b β€’ Ξ΅ := by haveI := Classical.decEq R induction' n with n ih Β· intro Ξ΅ _hΞ΅ b _hb A refine ⟨0, 1, ?_, ?_⟩ Β· simp rintro ⟨i, ⟨⟩⟩ intro Ξ΅ hΞ΅ b hb A let M := h.card Ξ΅ -- By the "nicer" pigeonhole principle, we can find a collection `s` -- of more than `M^n` remainders where the first components lie close together: obtain ⟨s, s_inj, hs⟩ : βˆƒ s : Fin (M ^ n).succ β†’ Fin (M ^ n.succ).succ, Function.Injective s ∧ βˆ€ iβ‚€ i₁, (abv (A (s i₁) 0 % b - A (s iβ‚€) 0 % b) : ℝ) < abv b β€’ Ξ΅ := by -- We can partition the `A`s into `M` subsets where -- the first components lie close together: obtain ⟨t, ht⟩ : βˆƒ t : Fin (M ^ n.succ).succ β†’ Fin M, βˆ€ iβ‚€ i₁, t iβ‚€ = t i₁ β†’ (abv (A i₁ 0 % b - A iβ‚€ 0 % b) : ℝ) < abv b β€’ Ξ΅ := h.exists_partition hΞ΅ hb fun x ↦ A x 0 -- Since the `M` subsets contain more than `M * M^n` elements total, -- there must be a subset that contains more than `M^n` elements. obtain ⟨s, hs⟩ := Fintype.exists_lt_card_fiber_of_mul_lt_card (f := t) (by simpa only [Fintype.card_fin, pow_succ'] using Nat.lt_succ_self (M ^ n.succ)) refine ⟨fun i ↦ (Finset.univ.filter fun x ↦ t x = s).toList.get <| i.castLE ?_, fun i j h ↦ ?_, fun iβ‚€ i₁ ↦ ht _ _ ?_⟩ Β· rwa [Finset.length_toList] Β· simpa [(Finset.nodup_toList _).get_inj_iff] using h Β· have : βˆ€ i, t ((Finset.univ.filter fun x ↦ t x = s).toList.get i) = s := fun i ↦ (Finset.mem_filter.mp (Finset.mem_toList.mp (List.get_mem _ i i.2))).2 simp [this] -- Since `s` is large enough, there are two elements of `A ∘ s` -- where the second components lie close together. obtain ⟨kβ‚€, k₁, hk, h⟩ := ih hΞ΅ hb fun x ↦ Fin.tail (A (s x)) refine ⟨s kβ‚€, s k₁, fun h ↦ hk (s_inj h), fun i ↦ Fin.cases ?_ (fun i ↦ ?_) i⟩ Β· exact hs kβ‚€ k₁ Β· exact h i #align absolute_value.is_admissible.exists_approx_aux AbsoluteValue.IsAdmissible.exists_approx_aux
Mathlib/NumberTheory/ClassNumber/AdmissibleAbsoluteValue.lean
117
123
theorem exists_approx {ΞΉ : Type*} [Fintype ΞΉ] {Ξ΅ : ℝ} (hΞ΅ : 0 < Ξ΅) {b : R} (hb : b β‰  0) (h : abv.IsAdmissible) (A : Fin (h.card Ξ΅ ^ Fintype.card ΞΉ).succ β†’ ΞΉ β†’ R) : βˆƒ iβ‚€ i₁, iβ‚€ β‰  i₁ ∧ βˆ€ k, (abv (A i₁ k % b - A iβ‚€ k % b) : ℝ) < abv b β€’ Ξ΅ := by
let e := Fintype.equivFin ΞΉ obtain ⟨iβ‚€, i₁, ne, h⟩ := h.exists_approx_aux (Fintype.card ΞΉ) hΞ΅ hb fun x y ↦ A x (e.symm y) refine ⟨iβ‚€, i₁, ne, fun k ↦ ?_⟩ convert h (e k) <;> simp only [e.symm_apply_apply]
[ " βˆƒ t, βˆ€ (iβ‚€ i₁ : ΞΉ), t iβ‚€ = t i₁ β†’ ↑(abv (A i₁ % b - A iβ‚€ % b)) < abv b β€’ Ξ΅", " ↑(abv (A i₁ % b - A iβ‚€ % b)) < abv b β€’ Ξ΅", " i₁ = e.symm (e i₁)", " iβ‚€ = e.symm (e iβ‚€)", " βˆ€ {Ξ΅ : ℝ},\n 0 < Ξ΅ β†’\n βˆ€ {b : R},\n b β‰  0 β†’\n βˆ€ (A : Fin (h.card Ξ΅ ^ n).succ β†’ Fin n β†’ R),\n βˆƒ iβ‚€ i₁,...
import Mathlib.Analysis.Calculus.FDeriv.Basic #align_import analysis.calculus.fderiv.restrict_scalars from "leanprover-community/mathlib"@"e3fb84046afd187b710170887195d50bada934ee" open Filter Asymptotics ContinuousLinearMap Set Metric open scoped Classical open Topology NNReal Filter Asymptotics ENNReal noncomputable section section RestrictScalars variable (π•œ : Type*) [NontriviallyNormedField π•œ] variable {π•œ' : Type*} [NontriviallyNormedField π•œ'] [NormedAlgebra π•œ π•œ'] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedSpace π•œ' E] variable [IsScalarTower π•œ π•œ' E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedSpace π•œ' F] variable [IsScalarTower π•œ π•œ' F] variable {f : E β†’ F} {f' : E β†’L[π•œ'] F} {s : Set E} {x : E} @[fun_prop] theorem HasStrictFDerivAt.restrictScalars (h : HasStrictFDerivAt f f' x) : HasStrictFDerivAt f (f'.restrictScalars π•œ) x := h #align has_strict_fderiv_at.restrict_scalars HasStrictFDerivAt.restrictScalars theorem HasFDerivAtFilter.restrictScalars {L} (h : HasFDerivAtFilter f f' x L) : HasFDerivAtFilter f (f'.restrictScalars π•œ) x L := .of_isLittleO h.1 #align has_fderiv_at_filter.restrict_scalars HasFDerivAtFilter.restrictScalars @[fun_prop] theorem HasFDerivAt.restrictScalars (h : HasFDerivAt f f' x) : HasFDerivAt f (f'.restrictScalars π•œ) x := .of_isLittleO h.1 #align has_fderiv_at.restrict_scalars HasFDerivAt.restrictScalars @[fun_prop] theorem HasFDerivWithinAt.restrictScalars (h : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt f (f'.restrictScalars π•œ) s x := .of_isLittleO h.1 #align has_fderiv_within_at.restrict_scalars HasFDerivWithinAt.restrictScalars @[fun_prop] theorem DifferentiableAt.restrictScalars (h : DifferentiableAt π•œ' f x) : DifferentiableAt π•œ f x := (h.hasFDerivAt.restrictScalars π•œ).differentiableAt #align differentiable_at.restrict_scalars DifferentiableAt.restrictScalars @[fun_prop] theorem DifferentiableWithinAt.restrictScalars (h : DifferentiableWithinAt π•œ' f s x) : DifferentiableWithinAt π•œ f s x := (h.hasFDerivWithinAt.restrictScalars π•œ).differentiableWithinAt #align differentiable_within_at.restrict_scalars DifferentiableWithinAt.restrictScalars @[fun_prop] theorem DifferentiableOn.restrictScalars (h : DifferentiableOn π•œ' f s) : DifferentiableOn π•œ f s := fun x hx => (h x hx).restrictScalars π•œ #align differentiable_on.restrict_scalars DifferentiableOn.restrictScalars @[fun_prop] theorem Differentiable.restrictScalars (h : Differentiable π•œ' f) : Differentiable π•œ f := fun x => (h x).restrictScalars π•œ #align differentiable.restrict_scalars Differentiable.restrictScalars @[fun_prop] theorem HasFDerivWithinAt.of_restrictScalars {g' : E β†’L[π•œ] F} (h : HasFDerivWithinAt f g' s x) (H : f'.restrictScalars π•œ = g') : HasFDerivWithinAt f f' s x := by rw [← H] at h exact .of_isLittleO h.1 #align has_fderiv_within_at_of_restrict_scalars HasFDerivWithinAt.of_restrictScalars @[fun_prop]
Mathlib/Analysis/Calculus/FDeriv/RestrictScalars.lean
99
102
theorem hasFDerivAt_of_restrictScalars {g' : E β†’L[π•œ] F} (h : HasFDerivAt f g' x) (H : f'.restrictScalars π•œ = g') : HasFDerivAt f f' x := by
rw [← H] at h exact .of_isLittleO h.1
[ " HasFDerivWithinAt f f' s x", " HasFDerivAt f f' x" ]
import Mathlib.LinearAlgebra.TensorProduct.Tower import Mathlib.Algebra.DirectSum.Module #align_import linear_algebra.direct_sum.tensor_product from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d" suppress_compilation universe u v₁ vβ‚‚ w₁ w₁' wβ‚‚ wβ‚‚' section Ring namespace TensorProduct open TensorProduct open DirectSum open LinearMap attribute [local ext] TensorProduct.ext variable (R : Type u) [CommSemiring R] (S) [Semiring S] [Algebra R S] variable {ι₁ : Type v₁} {ΞΉβ‚‚ : Type vβ‚‚} variable [DecidableEq ι₁] [DecidableEq ΞΉβ‚‚] variable (M₁ : ι₁ β†’ Type w₁) (M₁' : Type w₁') (Mβ‚‚ : ΞΉβ‚‚ β†’ Type wβ‚‚) (Mβ‚‚' : Type wβ‚‚') variable [βˆ€ i₁, AddCommMonoid (M₁ i₁)] [AddCommMonoid M₁'] variable [βˆ€ iβ‚‚, AddCommMonoid (Mβ‚‚ iβ‚‚)] [AddCommMonoid Mβ‚‚'] variable [βˆ€ i₁, Module R (M₁ i₁)] [Module R M₁'] [βˆ€ iβ‚‚, Module R (Mβ‚‚ iβ‚‚)] [Module R Mβ‚‚'] variable [βˆ€ i₁, Module S (M₁ i₁)] [βˆ€ i₁, IsScalarTower R S (M₁ i₁)] protected def directSum : ((⨁ i₁, M₁ i₁) βŠ—[R] ⨁ iβ‚‚, Mβ‚‚ iβ‚‚) ≃ₗ[S] ⨁ i : ι₁ Γ— ΞΉβ‚‚, M₁ i.1 βŠ—[R] Mβ‚‚ i.2 := by -- Porting note: entirely rewritten to allow unification to happen one step at a time refine LinearEquiv.ofLinear (R := S) (Rβ‚‚ := S) ?toFun ?invFun ?left ?right Β· refine AlgebraTensorModule.lift ?_ refine DirectSum.toModule S _ _ fun i₁ => ?_ refine LinearMap.flip ?_ refine DirectSum.toModule R _ _ fun iβ‚‚ => LinearMap.flip <| ?_ refine AlgebraTensorModule.curry ?_ exact DirectSum.lof S (ι₁ Γ— ΞΉβ‚‚) (fun i => M₁ i.1 βŠ—[R] Mβ‚‚ i.2) (i₁, iβ‚‚) Β· refine DirectSum.toModule S _ _ fun i => ?_ exact AlgebraTensorModule.map (DirectSum.lof S _ M₁ i.1) (DirectSum.lof R _ Mβ‚‚ i.2) Β· refine DirectSum.linearMap_ext S fun ⟨i₁, iβ‚‚βŸ© => ?_ refine TensorProduct.AlgebraTensorModule.ext fun m₁ mβ‚‚ => ?_ -- Porting note: seems much nicer than the `repeat` lean 3 proof. simp only [coe_comp, Function.comp_apply, toModule_lof, AlgebraTensorModule.map_tmul, AlgebraTensorModule.lift_apply, lift.tmul, coe_restrictScalars, flip_apply, AlgebraTensorModule.curry_apply, curry_apply, id_comp] Β· -- `(_)` prevents typeclass search timing out on problems that can be solved immediately by -- unification apply TensorProduct.AlgebraTensorModule.curry_injective refine DirectSum.linearMap_ext _ fun i₁ => ?_ refine LinearMap.ext fun x₁ => ?_ refine DirectSum.linearMap_ext _ fun iβ‚‚ => ?_ refine LinearMap.ext fun xβ‚‚ => ?_ -- Porting note: seems much nicer than the `repeat` lean 3 proof. simp only [coe_comp, Function.comp_apply, AlgebraTensorModule.curry_apply, curry_apply, coe_restrictScalars, AlgebraTensorModule.lift_apply, lift.tmul, toModule_lof, flip_apply, AlgebraTensorModule.map_tmul, id_coe, id_eq] #align tensor_product.direct_sum TensorProduct.directSum def directSumLeft : (⨁ i₁, M₁ i₁) βŠ—[R] Mβ‚‚' ≃ₗ[R] ⨁ i, M₁ i βŠ—[R] Mβ‚‚' := LinearEquiv.ofLinear (lift <| DirectSum.toModule R _ _ fun i => (mk R _ _).comprβ‚‚ <| DirectSum.lof R ι₁ (fun i => M₁ i βŠ—[R] Mβ‚‚') _) (DirectSum.toModule R _ _ fun i => rTensor _ (DirectSum.lof R ι₁ _ _)) (DirectSum.linearMap_ext R fun i => TensorProduct.ext <| LinearMap.extβ‚‚ fun m₁ mβ‚‚ => by dsimp only [comp_apply, comprβ‚‚_apply, id_apply, mk_apply] simp_rw [DirectSum.toModule_lof, rTensor_tmul, lift.tmul, DirectSum.toModule_lof, comprβ‚‚_apply, mk_apply]) (TensorProduct.ext <| DirectSum.linearMap_ext R fun i => LinearMap.extβ‚‚ fun m₁ mβ‚‚ => by dsimp only [comp_apply, comprβ‚‚_apply, id_apply, mk_apply] simp_rw [lift.tmul, DirectSum.toModule_lof, comprβ‚‚_apply, mk_apply, DirectSum.toModule_lof, rTensor_tmul]) #align tensor_product.direct_sum_left TensorProduct.directSumLeft def directSumRight : (M₁' βŠ—[R] ⨁ i, Mβ‚‚ i) ≃ₗ[R] ⨁ i, M₁' βŠ—[R] Mβ‚‚ i := TensorProduct.comm R _ _ β‰ͺ≫ₗ directSumLeft R Mβ‚‚ M₁' β‰ͺ≫ₗ DFinsupp.mapRange.linearEquiv fun _ => TensorProduct.comm R _ _ #align tensor_product.direct_sum_right TensorProduct.directSumRight variable {M₁ M₁' Mβ‚‚ Mβ‚‚'} @[simp]
Mathlib/LinearAlgebra/DirectSum/TensorProduct.lean
150
153
theorem directSum_lof_tmul_lof (i₁ : ι₁) (m₁ : M₁ i₁) (iβ‚‚ : ΞΉβ‚‚) (mβ‚‚ : Mβ‚‚ iβ‚‚) : TensorProduct.directSum R S M₁ Mβ‚‚ (DirectSum.lof S ι₁ M₁ i₁ m₁ βŠ—β‚œ DirectSum.lof R ΞΉβ‚‚ Mβ‚‚ iβ‚‚ mβ‚‚) = DirectSum.lof S (ι₁ Γ— ΞΉβ‚‚) (fun i => M₁ i.1 βŠ—[R] Mβ‚‚ i.2) (i₁, iβ‚‚) (m₁ βŠ—β‚œ mβ‚‚) := by
simp [TensorProduct.directSum]
[ " ((⨁ (i₁ : ι₁), M₁ i₁) βŠ—[R] ⨁ (iβ‚‚ : ΞΉβ‚‚), Mβ‚‚ iβ‚‚) ≃ₗ[S] ⨁ (i : ι₁ Γ— ΞΉβ‚‚), M₁ i.1 βŠ—[R] Mβ‚‚ i.2", " ((⨁ (i₁ : ι₁), M₁ i₁) βŠ—[R] ⨁ (iβ‚‚ : ΞΉβ‚‚), Mβ‚‚ iβ‚‚) β†’β‚—[S] ⨁ (i : ι₁ Γ— ΞΉβ‚‚), M₁ i.1 βŠ—[R] Mβ‚‚ i.2", " (⨁ (i₁ : ι₁), M₁ i₁) β†’β‚—[S] (⨁ (iβ‚‚ : ΞΉβ‚‚), Mβ‚‚ iβ‚‚) β†’β‚—[R] ⨁ (i : ι₁ Γ— ΞΉβ‚‚), M₁ i.1 βŠ—[R] Mβ‚‚ i.2", " M₁ i₁ β†’β‚—[S] (⨁ (iβ‚‚ : ΞΉβ‚‚), Mβ‚‚...
import Mathlib.Analysis.BoxIntegral.Partition.Additive import Mathlib.MeasureTheory.Measure.Lebesgue.Basic #align_import analysis.box_integral.partition.measure from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" open Set noncomputable section open scoped ENNReal Classical BoxIntegral variable {ΞΉ : Type*} namespace BoxIntegral open MeasureTheory namespace Box variable (I : Box ΞΉ) theorem measure_Icc_lt_top (ΞΌ : Measure (ΞΉ β†’ ℝ)) [IsLocallyFiniteMeasure ΞΌ] : ΞΌ (Box.Icc I) < ∞ := show ΞΌ (Icc I.lower I.upper) < ∞ from I.isCompact_Icc.measure_lt_top #align box_integral.box.measure_Icc_lt_top BoxIntegral.Box.measure_Icc_lt_top theorem measure_coe_lt_top (ΞΌ : Measure (ΞΉ β†’ ℝ)) [IsLocallyFiniteMeasure ΞΌ] : ΞΌ I < ∞ := (measure_mono <| coe_subset_Icc).trans_lt (I.measure_Icc_lt_top ΞΌ) #align box_integral.box.measure_coe_lt_top BoxIntegral.Box.measure_coe_lt_top variable [Fintype ΞΉ]
Mathlib/Analysis/BoxIntegral/Partition/Measure.lean
74
76
theorem coe_ae_eq_Icc : (I : Set (ΞΉ β†’ ℝ)) =ᡐ[volume] Box.Icc I := by
rw [coe_eq_pi] exact Measure.univ_pi_Ioc_ae_eq_Icc
[ " ↑I =αΆ [ae volume] Box.Icc I", " (univ.pi fun i => Ioc (I.lower i) (I.upper i)) =αΆ [ae volume] Box.Icc I" ]
import Mathlib.Algebra.CharP.Invertible import Mathlib.Algebra.Order.Invertible import Mathlib.Algebra.Order.Module.OrderedSMul import Mathlib.Algebra.Order.Group.Instances import Mathlib.LinearAlgebra.AffineSpace.Slope import Mathlib.LinearAlgebra.AffineSpace.Midpoint import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.ordered from "leanprover-community/mathlib"@"78261225eb5cedc61c5c74ecb44e5b385d13b733" open AffineMap variable {k E PE : Type*} section OrderedRing variable [OrderedRing k] [OrderedAddCommGroup E] [Module k E] [OrderedSMul k E] variable {a a' b b' : E} {r r' : k} theorem lineMap_mono_left (ha : a ≀ a') (hr : r ≀ 1) : lineMap a b r ≀ lineMap a' b r := by simp only [lineMap_apply_module] exact add_le_add_right (smul_le_smul_of_nonneg_left ha (sub_nonneg.2 hr)) _ #align line_map_mono_left lineMap_mono_left
Mathlib/LinearAlgebra/AffineSpace/Ordered.lean
57
59
theorem lineMap_strict_mono_left (ha : a < a') (hr : r < 1) : lineMap a b r < lineMap a' b r := by
simp only [lineMap_apply_module] exact add_lt_add_right (smul_lt_smul_of_pos_left ha (sub_pos.2 hr)) _
[ " (lineMap a b) r ≀ (lineMap a' b) r", " (1 - r) β€’ a + r β€’ b ≀ (1 - r) β€’ a' + r β€’ b", " (lineMap a b) r < (lineMap a' b) r", " (1 - r) β€’ a + r β€’ b < (1 - r) β€’ a' + r β€’ b" ]
import Mathlib.Algebra.Category.GroupCat.Abelian import Mathlib.CategoryTheory.Limits.Shapes.Images #align_import algebra.category.Group.images from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open CategoryTheory open CategoryTheory.Limits universe u namespace AddCommGroupCat set_option linter.uppercaseLean3 false -- Note that because `injective_of_mono` is currently only proved in `Type 0`, -- we restrict to the lowest universe here for now. variable {G H : AddCommGroupCat.{0}} (f : G ⟢ H) attribute [local ext] Subtype.ext_val section -- implementation details of `IsImage` for `AddCommGroupCat`; use the API, not these def image : AddCommGroupCat := AddCommGroupCat.of (AddMonoidHom.range f) #align AddCommGroup.image AddCommGroupCat.image def image.ΞΉ : image f ⟢ H := f.range.subtype #align AddCommGroup.image.ΞΉ AddCommGroupCat.image.ΞΉ instance : Mono (image.ΞΉ f) := ConcreteCategory.mono_of_injective (image.ΞΉ f) Subtype.val_injective def factorThruImage : G ⟢ image f := f.rangeRestrict #align AddCommGroup.factor_thru_image AddCommGroupCat.factorThruImage theorem image.fac : factorThruImage f ≫ image.ΞΉ f = f := by ext rfl #align AddCommGroup.image.fac AddCommGroupCat.image.fac attribute [local simp] image.fac variable {f} noncomputable def image.lift (F' : MonoFactorisation f) : image f ⟢ F'.I where toFun := (fun x => F'.e (Classical.indefiniteDescription _ x.2).1 : image f β†’ F'.I) map_zero' := by haveI := F'.m_mono apply injective_of_mono F'.m change (F'.e ≫ F'.m) _ = _ rw [F'.fac, AddMonoidHom.map_zero] exact (Classical.indefiniteDescription (fun y => f y = 0) _).2 map_add' := by intro x y haveI := F'.m_mono apply injective_of_mono F'.m rw [AddMonoidHom.map_add] change (F'.e ≫ F'.m) _ = (F'.e ≫ F'.m) _ + (F'.e ≫ F'.m) _ rw [F'.fac] rw [(Classical.indefiniteDescription (fun z => f z = _) _).2] rw [(Classical.indefiniteDescription (fun z => f z = _) _).2] rw [(Classical.indefiniteDescription (fun z => f z = _) _).2] rfl #align AddCommGroup.image.lift AddCommGroupCat.image.lift
Mathlib/Algebra/Category/GroupCat/Images.lean
87
91
theorem image.lift_fac (F' : MonoFactorisation f) : image.lift F' ≫ F'.m = image.ΞΉ f := by
ext x change (F'.e ≫ F'.m) _ = _ rw [F'.fac, (Classical.indefiniteDescription _ x.2).2] rfl
[ " factorThruImage f ≫ ΞΉ f = f", " (factorThruImage f ≫ ΞΉ f) x✝ = f x✝", " (fun x => F'.e ↑(Classical.indefiniteDescription (fun x_1 => f x_1 = ↑x) β‹―)) 0 = 0", " F'.m ((fun x => F'.e ↑(Classical.indefiniteDescription (fun x_1 => f x_1 = ↑x) β‹―)) 0) = F'.m 0", " (F'.e ≫ F'.m) ↑(Classical.indefiniteDescription ...
import Mathlib.LinearAlgebra.Ray import Mathlib.Analysis.NormedSpace.Real #align_import analysis.normed_space.ray from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" open Real variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] variable {x y : F}
Mathlib/Analysis/NormedSpace/Ray.lean
59
65
theorem norm_injOn_ray_left (hx : x β‰  0) : { y | SameRay ℝ x y }.InjOn norm := by
rintro y hy z hz h rcases hy.exists_nonneg_left hx with ⟨r, hr, rfl⟩ rcases hz.exists_nonneg_left hx with ⟨s, hs, rfl⟩ rw [norm_smul, norm_smul, mul_left_inj' (norm_ne_zero_iff.2 hx), norm_of_nonneg hr, norm_of_nonneg hs] at h rw [h]
[ " Set.InjOn Norm.norm {y | SameRay ℝ x y}", " y = z", " r β€’ x = z", " r β€’ x = s β€’ x" ]
import Mathlib.Order.Interval.Set.OrdConnectedComponent import Mathlib.Topology.Order.Basic #align_import topology.algebra.order.t5 from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514" open Filter Set Function OrderDual Topology Interval variable {X : Type*} [LinearOrder X] [TopologicalSpace X] [OrderTopology X] {a b c : X} {s t : Set X} namespace Set @[simp]
Mathlib/Topology/Order/T5.lean
27
30
theorem ordConnectedComponent_mem_nhds : ordConnectedComponent s a ∈ 𝓝 a ↔ s ∈ 𝓝 a := by
refine ⟨fun h => mem_of_superset h ordConnectedComponent_subset, fun h => ?_⟩ rcases exists_Icc_mem_subset_of_mem_nhds h with ⟨b, c, ha, ha', hs⟩ exact mem_of_superset ha' (subset_ordConnectedComponent ha hs)
[ " s.ordConnectedComponent a ∈ 𝓝 a ↔ s ∈ 𝓝 a", " s.ordConnectedComponent a ∈ 𝓝 a" ]
import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.TensorProduct.Opposite import Mathlib.RingTheory.TensorProduct.Basic variable {R A V : Type*} variable [CommRing R] [CommRing A] [AddCommGroup V] variable [Algebra R A] [Module R V] [Module A V] [IsScalarTower R A V] variable [Invertible (2 : R)] open scoped TensorProduct namespace CliffordAlgebra variable (A) -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def ofBaseChangeAux (Q : QuadraticForm R V) : CliffordAlgebra Q →ₐ[R] CliffordAlgebra (Q.baseChange A) := CliffordAlgebra.lift Q <| by refine ⟨(ΞΉ (Q.baseChange A)).restrictScalars R βˆ˜β‚— TensorProduct.mk R A V 1, fun v => ?_⟩ refine (CliffordAlgebra.ΞΉ_sq_scalar (Q.baseChange A) (1 βŠ—β‚œ v)).trans ?_ rw [QuadraticForm.baseChange_tmul, one_mul, ← Algebra.algebraMap_eq_smul_one, ← IsScalarTower.algebraMap_apply] @[simp] theorem ofBaseChangeAux_ΞΉ (Q : QuadraticForm R V) (v : V) : ofBaseChangeAux A Q (ΞΉ Q v) = ΞΉ (Q.baseChange A) (1 βŠ—β‚œ v) := CliffordAlgebra.lift_ΞΉ_apply _ _ v -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def ofBaseChange (Q : QuadraticForm R V) : A βŠ—[R] CliffordAlgebra Q →ₐ[A] CliffordAlgebra (Q.baseChange A) := Algebra.TensorProduct.lift (Algebra.ofId _ _) (ofBaseChangeAux A Q) fun _a _x => Algebra.commutes _ _ @[simp] theorem ofBaseChange_tmul_ΞΉ (Q : QuadraticForm R V) (z : A) (v : V) : ofBaseChange A Q (z βŠ—β‚œ ΞΉ Q v) = ΞΉ (Q.baseChange A) (z βŠ—β‚œ v) := by show algebraMap _ _ z * ofBaseChangeAux A Q (ΞΉ Q v) = ΞΉ (Q.baseChange A) (z βŠ—β‚œ[R] v) rw [ofBaseChangeAux_ΞΉ, ← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] @[simp] theorem ofBaseChange_tmul_one (Q : QuadraticForm R V) (z : A) : ofBaseChange A Q (z βŠ—β‚œ 1) = algebraMap _ _ z := by show algebraMap _ _ z * ofBaseChangeAux A Q 1 = _ rw [map_one, mul_one] -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def toBaseChange (Q : QuadraticForm R V) : CliffordAlgebra (Q.baseChange A) →ₐ[A] A βŠ—[R] CliffordAlgebra Q := CliffordAlgebra.lift _ <| by refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A β†’β‚—[A] A) (ΞΉ Q), ?_⟩ letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm letI : Invertible (2 : A βŠ—[R] CliffordAlgebra Q) := (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm suffices hpure_tensor : βˆ€ v w, (1 * 1) βŠ—β‚œ[R] (ΞΉ Q v * ΞΉ Q w) + (1 * 1) βŠ—β‚œ[R] (ΞΉ Q w * ΞΉ Q v) = QuadraticForm.polarBilin (Q.baseChange A) (1 βŠ—β‚œ[R] v) (1 βŠ—β‚œ[R] w) βŠ—β‚œ[R] 1 by -- the crux is that by converting to a statement about linear maps instead of quadratic forms, -- we then have access to all the partially-applied `ext` lemmas. rw [CliffordAlgebra.forall_mul_self_eq_iff (isUnit_of_invertible _)] refine TensorProduct.AlgebraTensorModule.curry_injective ?_ ext v w exact hpure_tensor v w intros v w rw [← TensorProduct.tmul_add, CliffordAlgebra.ΞΉ_mul_ΞΉ_add_swap, QuadraticForm.polarBilin_baseChange, LinearMap.BilinForm.baseChange_tmul, one_mul, TensorProduct.smul_tmul, Algebra.algebraMap_eq_smul_one, QuadraticForm.polarBilin_apply_apply] @[simp] theorem toBaseChange_ΞΉ (Q : QuadraticForm R V) (z : A) (v : V) : toBaseChange A Q (ΞΉ (Q.baseChange A) (z βŠ—β‚œ v)) = z βŠ—β‚œ ΞΉ Q v := CliffordAlgebra.lift_ΞΉ_apply _ _ _ theorem toBaseChange_comp_involute (Q : QuadraticForm R V) : (toBaseChange A Q).comp (involute : CliffordAlgebra (Q.baseChange A) →ₐ[A] _) = (Algebra.TensorProduct.map (AlgHom.id _ _) involute).comp (toBaseChange A Q) := by ext v show toBaseChange A Q (involute (ΞΉ (Q.baseChange A) (1 βŠ—β‚œ[R] v))) = (Algebra.TensorProduct.map (AlgHom.id _ _) involute : A βŠ—[R] CliffordAlgebra Q →ₐ[A] _) (toBaseChange A Q (ΞΉ (Q.baseChange A) (1 βŠ—β‚œ[R] v))) rw [toBaseChange_ΞΉ, involute_ΞΉ, map_neg (toBaseChange A Q), toBaseChange_ΞΉ, Algebra.TensorProduct.map_tmul, AlgHom.id_apply, involute_ΞΉ, TensorProduct.tmul_neg] theorem toBaseChange_involute (Q : QuadraticForm R V) (x : CliffordAlgebra (Q.baseChange A)) : toBaseChange A Q (involute x) = TensorProduct.map LinearMap.id (involute.toLinearMap) (toBaseChange A Q x) := DFunLike.congr_fun (toBaseChange_comp_involute A Q) x open MulOpposite
Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean
124
137
theorem toBaseChange_comp_reverseOp (Q : QuadraticForm R V) : (toBaseChange A Q).op.comp reverseOp = ((Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)).toAlgHom.comp <| (Algebra.TensorProduct.map (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q))).comp (toBaseChange A Q)) := by
ext v show op (toBaseChange A Q (reverse (ΞΉ (Q.baseChange A) (1 βŠ—β‚œ[R] v)))) = Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q) (Algebra.TensorProduct.map (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q)) (toBaseChange A Q (ΞΉ (Q.baseChange A) (1 βŠ—β‚œ[R] v)))) rw [toBaseChange_ΞΉ, reverse_ΞΉ, toBaseChange_ΞΉ, Algebra.TensorProduct.map_tmul, Algebra.TensorProduct.opAlgEquiv_tmul, reverseOp_ΞΉ] rfl
[ " { f // βˆ€ (m : V), f m * f m = (algebraMap R (CliffordAlgebra (QuadraticForm.baseChange A Q))) (Q m) }", " (↑R (ΞΉ (QuadraticForm.baseChange A Q)) βˆ˜β‚— (TensorProduct.mk R A V) 1) v *\n (↑R (ΞΉ (QuadraticForm.baseChange A Q)) βˆ˜β‚— (TensorProduct.mk R A V) 1) v =\n (algebraMap R (CliffordAlgebra (QuadraticForm....
import Mathlib.SetTheory.Game.Basic import Mathlib.Tactic.NthRewrite #align_import set_theory.game.impartial from "leanprover-community/mathlib"@"2e0975f6a25dd3fbfb9e41556a77f075f6269748" universe u namespace SetTheory open scoped PGame namespace PGame def ImpartialAux : PGame β†’ Prop | G => (G β‰ˆ -G) ∧ (βˆ€ i, ImpartialAux (G.moveLeft i)) ∧ βˆ€ j, ImpartialAux (G.moveRight j) termination_by G => G -- Porting note: Added `termination_by` #align pgame.impartial_aux SetTheory.PGame.ImpartialAux theorem impartialAux_def {G : PGame} : G.ImpartialAux ↔ (G β‰ˆ -G) ∧ (βˆ€ i, ImpartialAux (G.moveLeft i)) ∧ βˆ€ j, ImpartialAux (G.moveRight j) := by rw [ImpartialAux] #align pgame.impartial_aux_def SetTheory.PGame.impartialAux_def class Impartial (G : PGame) : Prop where out : ImpartialAux G #align pgame.impartial SetTheory.PGame.Impartial theorem impartial_iff_aux {G : PGame} : G.Impartial ↔ G.ImpartialAux := ⟨fun h => h.1, fun h => ⟨h⟩⟩ #align pgame.impartial_iff_aux SetTheory.PGame.impartial_iff_aux theorem impartial_def {G : PGame} : G.Impartial ↔ (G β‰ˆ -G) ∧ (βˆ€ i, Impartial (G.moveLeft i)) ∧ βˆ€ j, Impartial (G.moveRight j) := by simpa only [impartial_iff_aux] using impartialAux_def #align pgame.impartial_def SetTheory.PGame.impartial_def namespace Impartial instance impartial_zero : Impartial 0 := by rw [impartial_def]; dsimp; simp #align pgame.impartial.impartial_zero SetTheory.PGame.Impartial.impartial_zero instance impartial_star : Impartial star := by rw [impartial_def]; simpa using Impartial.impartial_zero #align pgame.impartial.impartial_star SetTheory.PGame.Impartial.impartial_star theorem neg_equiv_self (G : PGame) [h : G.Impartial] : G β‰ˆ -G := (impartial_def.1 h).1 #align pgame.impartial.neg_equiv_self SetTheory.PGame.Impartial.neg_equiv_self -- Porting note: Changed `-⟦G⟧` to `-(⟦G⟧ : Quotient setoid)` @[simp] theorem mk'_neg_equiv_self (G : PGame) [G.Impartial] : -(⟦G⟧ : Quotient setoid) = ⟦G⟧ := Quot.sound (Equiv.symm (neg_equiv_self G)) #align pgame.impartial.mk_neg_equiv_self SetTheory.PGame.Impartial.mk'_neg_equiv_self instance moveLeft_impartial {G : PGame} [h : G.Impartial] (i : G.LeftMoves) : (G.moveLeft i).Impartial := (impartial_def.1 h).2.1 i #align pgame.impartial.move_left_impartial SetTheory.PGame.Impartial.moveLeft_impartial instance moveRight_impartial {G : PGame} [h : G.Impartial] (j : G.RightMoves) : (G.moveRight j).Impartial := (impartial_def.1 h).2.2 j #align pgame.impartial.move_right_impartial SetTheory.PGame.Impartial.moveRight_impartial theorem impartial_congr : βˆ€ {G H : PGame} (_ : G ≑r H) [G.Impartial], H.Impartial | G, H => fun e => by intro h exact impartial_def.2 ⟨Equiv.trans e.symm.equiv (Equiv.trans (neg_equiv_self G) (neg_equiv_neg_iff.2 e.equiv)), fun i => impartial_congr (e.moveLeftSymm i), fun j => impartial_congr (e.moveRightSymm j)⟩ termination_by G H => (G, H) #align pgame.impartial.impartial_congr SetTheory.PGame.Impartial.impartial_congr instance impartial_add : βˆ€ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).Impartial | G, H, _, _ => by rw [impartial_def] refine ⟨Equiv.trans (add_congr (neg_equiv_self G) (neg_equiv_self _)) (Equiv.symm (negAddRelabelling _ _).equiv), fun k => ?_, fun k => ?_⟩ Β· apply leftMoves_add_cases k all_goals intro i; simp only [add_moveLeft_inl, add_moveLeft_inr] apply impartial_add Β· apply rightMoves_add_cases k all_goals intro i; simp only [add_moveRight_inl, add_moveRight_inr] apply impartial_add termination_by G H => (G, H) #align pgame.impartial.impartial_add SetTheory.PGame.Impartial.impartial_add instance impartial_neg : βˆ€ (G : PGame) [G.Impartial], (-G).Impartial | G, _ => by rw [impartial_def] refine ⟨?_, fun i => ?_, fun i => ?_⟩ Β· rw [neg_neg] exact Equiv.symm (neg_equiv_self G) Β· rw [moveLeft_neg'] apply impartial_neg Β· rw [moveRight_neg'] apply impartial_neg termination_by G => G #align pgame.impartial.impartial_neg SetTheory.PGame.Impartial.impartial_neg variable (G : PGame) [Impartial G] theorem nonpos : Β¬0 < G := fun h => by have h' := neg_lt_neg_iff.2 h rw [neg_zero, lt_congr_left (Equiv.symm (neg_equiv_self G))] at h' exact (h.trans h').false #align pgame.impartial.nonpos SetTheory.PGame.Impartial.nonpos theorem nonneg : Β¬G < 0 := fun h => by have h' := neg_lt_neg_iff.2 h rw [neg_zero, lt_congr_right (Equiv.symm (neg_equiv_self G))] at h' exact (h.trans h').false #align pgame.impartial.nonneg SetTheory.PGame.Impartial.nonneg
Mathlib/SetTheory/Game/Impartial.lean
137
142
theorem equiv_or_fuzzy_zero : (G β‰ˆ 0) ∨ G β€– 0 := by
rcases lt_or_equiv_or_gt_or_fuzzy G 0 with (h | h | h | h) Β· exact ((nonneg G) h).elim Β· exact Or.inl h Β· exact ((nonpos G) h).elim Β· exact Or.inr h
[ " G.ImpartialAux ↔\n G β‰ˆ -G ∧ (βˆ€ (i : G.LeftMoves), (G.moveLeft i).ImpartialAux) ∧ βˆ€ (j : G.RightMoves), (G.moveRight j).ImpartialAux", " G.Impartial ↔\n G β‰ˆ -G ∧ (βˆ€ (i : G.LeftMoves), (G.moveLeft i).Impartial) ∧ βˆ€ (j : G.RightMoves), (G.moveRight j).Impartial", " Impartial 0", " 0 β‰ˆ -0 ∧ (βˆ€ (i : LeftMo...
import Mathlib.Data.Int.Bitwise import Mathlib.Data.Int.Order.Lemmas import Mathlib.Data.Set.Function import Mathlib.Order.Interval.Set.Basic #align_import data.int.lemmas from "leanprover-community/mathlib"@"09597669f02422ed388036273d8848119699c22f" open Nat namespace Int theorem le_natCast_sub (m n : β„•) : (m - n : β„€) ≀ ↑(m - n : β„•) := by by_cases h : m β‰₯ n Β· exact le_of_eq (Int.ofNat_sub h).symm Β· simp [le_of_not_ge h, ofNat_le] #align int.le_coe_nat_sub Int.le_natCast_sub -- Porting note (#10618): simp can prove this @[simp] theorem succ_natCast_pos (n : β„•) : 0 < (n : β„€) + 1 := lt_add_one_iff.mpr (by simp) #align int.succ_coe_nat_pos Int.succ_natCast_pos variable {a b : β„€} {n : β„•} theorem natAbs_eq_iff_sq_eq {a b : β„€} : a.natAbs = b.natAbs ↔ a ^ 2 = b ^ 2 := by rw [sq, sq] exact natAbs_eq_iff_mul_self_eq #align int.nat_abs_eq_iff_sq_eq Int.natAbs_eq_iff_sq_eq theorem natAbs_lt_iff_sq_lt {a b : β„€} : a.natAbs < b.natAbs ↔ a ^ 2 < b ^ 2 := by rw [sq, sq] exact natAbs_lt_iff_mul_self_lt #align int.nat_abs_lt_iff_sq_lt Int.natAbs_lt_iff_sq_lt theorem natAbs_le_iff_sq_le {a b : β„€} : a.natAbs ≀ b.natAbs ↔ a ^ 2 ≀ b ^ 2 := by rw [sq, sq] exact natAbs_le_iff_mul_self_le #align int.nat_abs_le_iff_sq_le Int.natAbs_le_iff_sq_le theorem natAbs_inj_of_nonneg_of_nonneg {a b : β„€} (ha : 0 ≀ a) (hb : 0 ≀ b) : natAbs a = natAbs b ↔ a = b := by rw [← sq_eq_sq ha hb, ← natAbs_eq_iff_sq_eq] #align int.nat_abs_inj_of_nonneg_of_nonneg Int.natAbs_inj_of_nonneg_of_nonneg theorem natAbs_inj_of_nonpos_of_nonpos {a b : β„€} (ha : a ≀ 0) (hb : b ≀ 0) : natAbs a = natAbs b ↔ a = b := by simpa only [Int.natAbs_neg, neg_inj] using natAbs_inj_of_nonneg_of_nonneg (neg_nonneg_of_nonpos ha) (neg_nonneg_of_nonpos hb) #align int.nat_abs_inj_of_nonpos_of_nonpos Int.natAbs_inj_of_nonpos_of_nonpos theorem natAbs_inj_of_nonneg_of_nonpos {a b : β„€} (ha : 0 ≀ a) (hb : b ≀ 0) : natAbs a = natAbs b ↔ a = -b := by simpa only [Int.natAbs_neg] using natAbs_inj_of_nonneg_of_nonneg ha (neg_nonneg_of_nonpos hb) #align int.nat_abs_inj_of_nonneg_of_nonpos Int.natAbs_inj_of_nonneg_of_nonpos theorem natAbs_inj_of_nonpos_of_nonneg {a b : β„€} (ha : a ≀ 0) (hb : 0 ≀ b) : natAbs a = natAbs b ↔ -a = b := by simpa only [Int.natAbs_neg] using natAbs_inj_of_nonneg_of_nonneg (neg_nonneg_of_nonpos ha) hb #align int.nat_abs_inj_of_nonpos_of_nonneg Int.natAbs_inj_of_nonpos_of_nonneg
Mathlib/Data/Int/Lemmas.lean
82
86
theorem natAbs_coe_sub_coe_le_of_le {a b n : β„•} (a_le_n : a ≀ n) (b_le_n : b ≀ n) : natAbs (a - b : β„€) ≀ n := by
rw [← Nat.cast_le (Ξ± := β„€), natCast_natAbs] exact abs_sub_le_of_nonneg_of_le (ofNat_nonneg a) (ofNat_le.mpr a_le_n) (ofNat_nonneg b) (ofNat_le.mpr b_le_n)
[ " ↑m - ↑n ≀ ↑(m - n)", " 0 ≀ ↑n", " a.natAbs = b.natAbs ↔ a ^ 2 = b ^ 2", " a.natAbs = b.natAbs ↔ a * a = b * b", " a.natAbs < b.natAbs ↔ a ^ 2 < b ^ 2", " a.natAbs < b.natAbs ↔ a * a < b * b", " a.natAbs ≀ b.natAbs ↔ a ^ 2 ≀ b ^ 2", " a.natAbs ≀ b.natAbs ↔ a * a ≀ b * b", " a.natAbs = b.natAbs ↔ a ...
import Mathlib.Order.Filter.AtTopBot import Mathlib.Order.Filter.Pi #align_import order.filter.cofinite from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1" open Set Function variable {ΞΉ Ξ± Ξ² : Type*} {l : Filter Ξ±} namespace Filter def cofinite : Filter Ξ± := comk Set.Finite finite_empty (fun _t ht _s hsub ↦ ht.subset hsub) fun _ h _ ↦ h.union #align filter.cofinite Filter.cofinite @[simp] theorem mem_cofinite {s : Set Ξ±} : s ∈ @cofinite Ξ± ↔ sᢜ.Finite := Iff.rfl #align filter.mem_cofinite Filter.mem_cofinite @[simp] theorem eventually_cofinite {p : Ξ± β†’ Prop} : (βˆ€αΆ  x in cofinite, p x) ↔ { x | Β¬p x }.Finite := Iff.rfl #align filter.eventually_cofinite Filter.eventually_cofinite theorem hasBasis_cofinite : HasBasis cofinite (fun s : Set Ξ± => s.Finite) compl := ⟨fun s => ⟨fun h => ⟨sᢜ, h, (compl_compl s).subset⟩, fun ⟨_t, htf, hts⟩ => htf.subset <| compl_subset_comm.2 hts⟩⟩ #align filter.has_basis_cofinite Filter.hasBasis_cofinite instance cofinite_neBot [Infinite Ξ±] : NeBot (@cofinite Ξ±) := hasBasis_cofinite.neBot_iff.2 fun hs => hs.infinite_compl.nonempty #align filter.cofinite_ne_bot Filter.cofinite_neBot @[simp] theorem cofinite_eq_bot_iff : @cofinite Ξ± = βŠ₯ ↔ Finite Ξ± := by simp [← empty_mem_iff_bot, finite_univ_iff] @[simp] theorem cofinite_eq_bot [Finite Ξ±] : @cofinite Ξ± = βŠ₯ := cofinite_eq_bot_iff.2 β€Ή_β€Ί theorem frequently_cofinite_iff_infinite {p : Ξ± β†’ Prop} : (βˆƒαΆ  x in cofinite, p x) ↔ Set.Infinite { x | p x } := by simp only [Filter.Frequently, eventually_cofinite, not_not, Set.Infinite] #align filter.frequently_cofinite_iff_infinite Filter.frequently_cofinite_iff_infinite lemma frequently_cofinite_mem_iff_infinite {s : Set Ξ±} : (βˆƒαΆ  x in cofinite, x ∈ s) ↔ s.Infinite := frequently_cofinite_iff_infinite alias ⟨_, _root_.Set.Infinite.frequently_cofinite⟩ := frequently_cofinite_mem_iff_infinite @[simp] lemma cofinite_inf_principal_neBot_iff {s : Set Ξ±} : (cofinite βŠ“ π“Ÿ s).NeBot ↔ s.Infinite := frequently_mem_iff_neBot.symm.trans frequently_cofinite_mem_iff_infinite alias ⟨_, _root_.Set.Infinite.cofinite_inf_principal_neBot⟩ := cofinite_inf_principal_neBot_iff theorem _root_.Set.Finite.compl_mem_cofinite {s : Set Ξ±} (hs : s.Finite) : sᢜ ∈ @cofinite Ξ± := mem_cofinite.2 <| (compl_compl s).symm β–Έ hs #align set.finite.compl_mem_cofinite Set.Finite.compl_mem_cofinite theorem _root_.Set.Finite.eventually_cofinite_nmem {s : Set Ξ±} (hs : s.Finite) : βˆ€αΆ  x in cofinite, x βˆ‰ s := hs.compl_mem_cofinite #align set.finite.eventually_cofinite_nmem Set.Finite.eventually_cofinite_nmem theorem _root_.Finset.eventually_cofinite_nmem (s : Finset Ξ±) : βˆ€αΆ  x in cofinite, x βˆ‰ s := s.finite_toSet.eventually_cofinite_nmem #align finset.eventually_cofinite_nmem Finset.eventually_cofinite_nmem theorem _root_.Set.infinite_iff_frequently_cofinite {s : Set Ξ±} : Set.Infinite s ↔ βˆƒαΆ  x in cofinite, x ∈ s := frequently_cofinite_iff_infinite.symm #align set.infinite_iff_frequently_cofinite Set.infinite_iff_frequently_cofinite theorem eventually_cofinite_ne (x : Ξ±) : βˆ€αΆ  a in cofinite, a β‰  x := (Set.finite_singleton x).eventually_cofinite_nmem #align filter.eventually_cofinite_ne Filter.eventually_cofinite_ne
Mathlib/Order/Filter/Cofinite.lean
101
104
theorem le_cofinite_iff_compl_singleton_mem : l ≀ cofinite ↔ βˆ€ x, {x}ᢜ ∈ l := by
refine ⟨fun h x => h (finite_singleton x).compl_mem_cofinite, fun h s (hs : sᢜ.Finite) => ?_⟩ rw [← compl_compl s, ← biUnion_of_singleton sᢜ, compl_iUnionβ‚‚, Filter.biInter_mem hs] exact fun x _ => h x
[ " cofinite = βŠ₯ ↔ Finite Ξ±", " (βˆƒαΆ  (x : Ξ±) in cofinite, p x) ↔ {x | p x}.Infinite", " l ≀ cofinite ↔ βˆ€ (x : Ξ±), {x}ᢜ ∈ l", " s ∈ l", " βˆ€ i ∈ sᢜ, {i}ᢜ ∈ l" ]
import Mathlib.Data.Finset.Lattice import Mathlib.Order.Hom.Basic import Mathlib.Data.Set.Finite import Mathlib.Order.ConditionallyCompleteLattice.Basic #align_import order.partial_sups from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce" variable {Ξ± : Type*} section SemilatticeSup variable [SemilatticeSup Ξ±] def partialSups (f : β„• β†’ Ξ±) : β„• β†’o Ξ± := ⟨@Nat.rec (fun _ => Ξ±) (f 0) fun (n : β„•) (a : Ξ±) => a βŠ” f (n + 1), monotone_nat_of_le_succ fun _ => le_sup_left⟩ #align partial_sups partialSups @[simp] theorem partialSups_zero (f : β„• β†’ Ξ±) : partialSups f 0 = f 0 := rfl #align partial_sups_zero partialSups_zero @[simp] theorem partialSups_succ (f : β„• β†’ Ξ±) (n : β„•) : partialSups f (n + 1) = partialSups f n βŠ” f (n + 1) := rfl #align partial_sups_succ partialSups_succ lemma partialSups_iff_forall {f : β„• β†’ Ξ±} (p : Ξ± β†’ Prop) (hp : βˆ€ {a b}, p (a βŠ” b) ↔ p a ∧ p b) : βˆ€ {n : β„•}, p (partialSups f n) ↔ βˆ€ k ≀ n, p (f k) | 0 => by simp | (n + 1) => by simp [hp, partialSups_iff_forall, ← Nat.lt_succ_iff, ← Nat.forall_lt_succ] @[simp] lemma partialSups_le_iff {f : β„• β†’ Ξ±} {n : β„•} {a : Ξ±} : partialSups f n ≀ a ↔ βˆ€ k ≀ n, f k ≀ a := partialSups_iff_forall (Β· ≀ a) sup_le_iff theorem le_partialSups_of_le (f : β„• β†’ Ξ±) {m n : β„•} (h : m ≀ n) : f m ≀ partialSups f n := partialSups_le_iff.1 le_rfl m h #align le_partial_sups_of_le le_partialSups_of_le theorem le_partialSups (f : β„• β†’ Ξ±) : f ≀ partialSups f := fun _n => le_partialSups_of_le f le_rfl #align le_partial_sups le_partialSups theorem partialSups_le (f : β„• β†’ Ξ±) (n : β„•) (a : Ξ±) (w : βˆ€ m, m ≀ n β†’ f m ≀ a) : partialSups f n ≀ a := partialSups_le_iff.2 w #align partial_sups_le partialSups_le @[simp] lemma upperBounds_range_partialSups (f : β„• β†’ Ξ±) : upperBounds (Set.range (partialSups f)) = upperBounds (Set.range f) := by ext a simp only [mem_upperBounds, Set.forall_mem_range, partialSups_le_iff] exact ⟨fun h _ ↦ h _ _ le_rfl, fun h _ _ _ ↦ h _⟩ @[simp] theorem bddAbove_range_partialSups {f : β„• β†’ Ξ±} : BddAbove (Set.range (partialSups f)) ↔ BddAbove (Set.range f) := .of_eq <| congr_arg Set.Nonempty <| upperBounds_range_partialSups f #align bdd_above_range_partial_sups bddAbove_range_partialSups
Mathlib/Order/PartialSups.lean
97
101
theorem Monotone.partialSups_eq {f : β„• β†’ Ξ±} (hf : Monotone f) : (partialSups f : β„• β†’ Ξ±) = f := by
ext n induction' n with n ih Β· rfl Β· rw [partialSups_succ, ih, sup_eq_right.2 (hf (Nat.le_succ _))]
[ " p ((partialSups f) 0) ↔ βˆ€ k ≀ 0, p (f k)", " p ((partialSups f) (n + 1)) ↔ βˆ€ k ≀ n + 1, p (f k)", " upperBounds (Set.range ⇑(partialSups f)) = upperBounds (Set.range f)", " a ∈ upperBounds (Set.range ⇑(partialSups f)) ↔ a ∈ upperBounds (Set.range f)", " (βˆ€ (i k : β„•), k ≀ i β†’ f k ≀ a) ↔ βˆ€ (i : β„•), f i ≀ a"...
import Mathlib.Algebra.MonoidAlgebra.Degree import Mathlib.Algebra.Polynomial.Coeff import Mathlib.Algebra.Polynomial.Monomial import Mathlib.Data.Fintype.BigOperators import Mathlib.Data.Nat.WithBot import Mathlib.Data.Nat.Cast.WithTop import Mathlib.Data.Nat.SuccPred #align_import data.polynomial.degree.definitions from "leanprover-community/mathlib"@"808ea4ebfabeb599f21ec4ae87d6dc969597887f" -- Porting note: `Mathlib.Data.Nat.Cast.WithTop` should be imported for `Nat.cast_withBot`. set_option linter.uppercaseLean3 false noncomputable section open Finsupp Finset open Polynomial namespace Polynomial universe u v variable {R : Type u} {S : Type v} {a b c d : R} {n m : β„•} section Semiring variable [Semiring R] {p q r : R[X]} def degree (p : R[X]) : WithBot β„• := p.support.max #align polynomial.degree Polynomial.degree theorem supDegree_eq_degree (p : R[X]) : p.toFinsupp.supDegree WithBot.some = p.degree := max_eq_sup_coe theorem degree_lt_wf : WellFounded fun p q : R[X] => degree p < degree q := InvImage.wf degree wellFounded_lt #align polynomial.degree_lt_wf Polynomial.degree_lt_wf instance : WellFoundedRelation R[X] := ⟨_, degree_lt_wf⟩ def natDegree (p : R[X]) : β„• := (degree p).unbot' 0 #align polynomial.nat_degree Polynomial.natDegree def leadingCoeff (p : R[X]) : R := coeff p (natDegree p) #align polynomial.leading_coeff Polynomial.leadingCoeff def Monic (p : R[X]) := leadingCoeff p = (1 : R) #align polynomial.monic Polynomial.Monic @[nontriviality] theorem monic_of_subsingleton [Subsingleton R] (p : R[X]) : Monic p := Subsingleton.elim _ _ #align polynomial.monic_of_subsingleton Polynomial.monic_of_subsingleton theorem Monic.def : Monic p ↔ leadingCoeff p = 1 := Iff.rfl #align polynomial.monic.def Polynomial.Monic.def instance Monic.decidable [DecidableEq R] : Decidable (Monic p) := by unfold Monic; infer_instance #align polynomial.monic.decidable Polynomial.Monic.decidable @[simp] theorem Monic.leadingCoeff {p : R[X]} (hp : p.Monic) : leadingCoeff p = 1 := hp #align polynomial.monic.leading_coeff Polynomial.Monic.leadingCoeff theorem Monic.coeff_natDegree {p : R[X]} (hp : p.Monic) : p.coeff p.natDegree = 1 := hp #align polynomial.monic.coeff_nat_degree Polynomial.Monic.coeff_natDegree @[simp] theorem degree_zero : degree (0 : R[X]) = βŠ₯ := rfl #align polynomial.degree_zero Polynomial.degree_zero @[simp] theorem natDegree_zero : natDegree (0 : R[X]) = 0 := rfl #align polynomial.nat_degree_zero Polynomial.natDegree_zero @[simp] theorem coeff_natDegree : coeff p (natDegree p) = leadingCoeff p := rfl #align polynomial.coeff_nat_degree Polynomial.coeff_natDegree @[simp] theorem degree_eq_bot : degree p = βŠ₯ ↔ p = 0 := ⟨fun h => support_eq_empty.1 (Finset.max_eq_bot.1 h), fun h => h.symm β–Έ rfl⟩ #align polynomial.degree_eq_bot Polynomial.degree_eq_bot @[nontriviality] theorem degree_of_subsingleton [Subsingleton R] : degree p = βŠ₯ := by rw [Subsingleton.elim p 0, degree_zero] #align polynomial.degree_of_subsingleton Polynomial.degree_of_subsingleton @[nontriviality] theorem natDegree_of_subsingleton [Subsingleton R] : natDegree p = 0 := by rw [Subsingleton.elim p 0, natDegree_zero] #align polynomial.nat_degree_of_subsingleton Polynomial.natDegree_of_subsingleton theorem degree_eq_natDegree (hp : p β‰  0) : degree p = (natDegree p : WithBot β„•) := by let ⟨n, hn⟩ := not_forall.1 (mt Option.eq_none_iff_forall_not_mem.2 (mt degree_eq_bot.1 hp)) have hn : degree p = some n := Classical.not_not.1 hn rw [natDegree, hn]; rfl #align polynomial.degree_eq_nat_degree Polynomial.degree_eq_natDegree theorem supDegree_eq_natDegree (p : R[X]) : p.toFinsupp.supDegree id = p.natDegree := by obtain rfl|h := eq_or_ne p 0 Β· simp apply WithBot.coe_injective rw [← AddMonoidAlgebra.supDegree_withBot_some_comp, Function.comp_id, supDegree_eq_degree, degree_eq_natDegree h, Nat.cast_withBot] rwa [support_toFinsupp, nonempty_iff_ne_empty, Ne, support_eq_empty]
Mathlib/Algebra/Polynomial/Degree/Definitions.lean
146
147
theorem degree_eq_iff_natDegree_eq {p : R[X]} {n : β„•} (hp : p β‰  0) : p.degree = n ↔ p.natDegree = n := by
rw [degree_eq_natDegree hp]; exact WithBot.coe_eq_coe
[ " Decidable p.Monic", " Decidable (p.leadingCoeff = 1)", " p.degree = βŠ₯", " p.natDegree = 0", " p.degree = ↑p.natDegree", " Option.some n = ↑(WithBot.unbot' 0 (Option.some n))", " AddMonoidAlgebra.supDegree id p.toFinsupp = p.natDegree", " AddMonoidAlgebra.supDegree id (toFinsupp 0) = natDegree 0", ...
import Mathlib.Algebra.GroupPower.IterateHom import Mathlib.Algebra.Module.Defs import Mathlib.Algebra.Order.Archimedean import Mathlib.Algebra.Order.Group.Instances import Mathlib.GroupTheory.GroupAction.Pi open Function Set structure AddConstMap (G H : Type*) [Add G] [Add H] (a : G) (b : H) where protected toFun : G β†’ H map_add_const' (x : G) : toFun (x + a) = toFun x + b @[inherit_doc] scoped [AddConstMap] notation:25 G " β†’+c[" a ", " b "] " H => AddConstMap G H a b class AddConstMapClass (F : Type*) (G H : outParam Type*) [Add G] [Add H] (a : outParam G) (b : outParam H) extends DFunLike F G fun _ ↦ H where map_add_const (f : F) (x : G) : f (x + a) = f x + b namespace AddConstMapClass attribute [simp] map_add_const variable {F G H : Type*} {a : G} {b : H} protected theorem semiconj [Add G] [Add H] [AddConstMapClass F G H a b] (f : F) : Semiconj f (Β· + a) (Β· + b) := map_add_const f @[simp] theorem map_add_nsmul [AddMonoid G] [AddMonoid H] [AddConstMapClass F G H a b] (f : F) (x : G) (n : β„•) : f (x + n β€’ a) = f x + n β€’ b := by simpa using (AddConstMapClass.semiconj f).iterate_right n x @[simp]
Mathlib/Algebra/AddConstMap/Basic.lean
78
79
theorem map_add_nat' [AddMonoidWithOne G] [AddMonoid H] [AddConstMapClass F G H 1 b] (f : F) (x : G) (n : β„•) : f (x + n) = f x + n β€’ b := by
simp [← map_add_nsmul]
[ " f (x + n β€’ a) = f x + n β€’ b", " f (x + ↑n) = f x + n β€’ b" ]
import Mathlib.Analysis.Convex.Between import Mathlib.Analysis.Convex.Jensen import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.Normed.Group.Pointwise import Mathlib.Analysis.NormedSpace.AddTorsor #align_import analysis.convex.normed from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f" variable {ΞΉ : Type*} {E P : Type*} open Metric Set open scoped Convex variable [SeminormedAddCommGroup E] [NormedSpace ℝ E] [PseudoMetricSpace P] [NormedAddTorsor E P] variable {s t : Set E} theorem convexOn_norm (hs : Convex ℝ s) : ConvexOn ℝ s norm := ⟨hs, fun x _ y _ a b ha hb _ => calc β€–a β€’ x + b β€’ yβ€– ≀ β€–a β€’ xβ€– + β€–b β€’ yβ€– := norm_add_le _ _ _ = a * β€–xβ€– + b * β€–yβ€– := by rw [norm_smul, norm_smul, Real.norm_of_nonneg ha, Real.norm_of_nonneg hb]⟩ #align convex_on_norm convexOn_norm theorem convexOn_univ_norm : ConvexOn ℝ univ (norm : E β†’ ℝ) := convexOn_norm convex_univ #align convex_on_univ_norm convexOn_univ_norm theorem convexOn_dist (z : E) (hs : Convex ℝ s) : ConvexOn ℝ s fun z' => dist z' z := by simpa [dist_eq_norm, preimage_preimage] using (convexOn_norm (hs.translate (-z))).comp_affineMap (AffineMap.id ℝ E - AffineMap.const ℝ E z) #align convex_on_dist convexOn_dist theorem convexOn_univ_dist (z : E) : ConvexOn ℝ univ fun z' => dist z' z := convexOn_dist z convex_univ #align convex_on_univ_dist convexOn_univ_dist theorem convex_ball (a : E) (r : ℝ) : Convex ℝ (Metric.ball a r) := by simpa only [Metric.ball, sep_univ] using (convexOn_univ_dist a).convex_lt r #align convex_ball convex_ball theorem convex_closedBall (a : E) (r : ℝ) : Convex ℝ (Metric.closedBall a r) := by simpa only [Metric.closedBall, sep_univ] using (convexOn_univ_dist a).convex_le r #align convex_closed_ball convex_closedBall theorem Convex.thickening (hs : Convex ℝ s) (Ξ΄ : ℝ) : Convex ℝ (thickening Ξ΄ s) := by rw [← add_ball_zero] exact hs.add (convex_ball 0 _) #align convex.thickening Convex.thickening theorem Convex.cthickening (hs : Convex ℝ s) (Ξ΄ : ℝ) : Convex ℝ (cthickening Ξ΄ s) := by obtain hΞ΄ | hΞ΄ := le_total 0 Ξ΄ Β· rw [cthickening_eq_iInter_thickening hΞ΄] exact convex_iInterβ‚‚ fun _ _ => hs.thickening _ Β· rw [cthickening_of_nonpos hΞ΄] exact hs.closure #align convex.cthickening Convex.cthickening theorem convexHull_exists_dist_ge {s : Set E} {x : E} (hx : x ∈ convexHull ℝ s) (y : E) : βˆƒ x' ∈ s, dist x y ≀ dist x' y := (convexOn_dist y (convex_convexHull ℝ _)).exists_ge_of_mem_convexHull hx #align convex_hull_exists_dist_ge convexHull_exists_dist_ge
Mathlib/Analysis/Convex/Normed.lean
92
97
theorem convexHull_exists_dist_ge2 {s t : Set E} {x y : E} (hx : x ∈ convexHull ℝ s) (hy : y ∈ convexHull ℝ t) : βˆƒ x' ∈ s, βˆƒ y' ∈ t, dist x y ≀ dist x' y' := by
rcases convexHull_exists_dist_ge hx y with ⟨x', hx', Hx'⟩ rcases convexHull_exists_dist_ge hy x' with ⟨y', hy', Hy'⟩ use x', hx', y', hy' exact le_trans Hx' (dist_comm y x' β–Έ dist_comm y' x' β–Έ Hy')
[ " β€–a β€’ xβ€– + β€–b β€’ yβ€– = a * β€–xβ€– + b * β€–yβ€–", " ConvexOn ℝ s fun z' => dist z' z", " Convex ℝ (ball a r)", " Convex ℝ (closedBall a r)", " Convex ℝ (Metric.thickening Ξ΄ s)", " Convex ℝ (s + ball 0 Ξ΄)", " Convex ℝ (Metric.cthickening Ξ΄ s)", " Convex ℝ (β‹‚ Ξ΅, β‹‚ (_ : Ξ΄ < Ξ΅), Metric.thickening Ξ΅ s)", " Conve...
import Mathlib.Data.Countable.Basic import Mathlib.Data.Fin.VecNotation import Mathlib.Order.Disjointed import Mathlib.MeasureTheory.OuterMeasure.Defs #align_import measure_theory.measure.outer_measure from "leanprover-community/mathlib"@"343e80208d29d2d15f8050b929aa50fe4ce71b55" noncomputable section open Set Function Filter open scoped Classical NNReal Topology ENNReal namespace MeasureTheory section OuterMeasureClass variable {Ξ± ΞΉ F : Type*} [FunLike F (Set Ξ±) ℝβ‰₯0∞] [OuterMeasureClass F Ξ±] {ΞΌ : F} {s t : Set Ξ±} @[simp] theorem measure_empty : ΞΌ βˆ… = 0 := OuterMeasureClass.measure_empty ΞΌ #align measure_theory.measure_empty MeasureTheory.measure_empty @[mono, gcongr] theorem measure_mono (h : s βŠ† t) : ΞΌ s ≀ ΞΌ t := OuterMeasureClass.measure_mono ΞΌ h #align measure_theory.measure_mono MeasureTheory.measure_mono theorem measure_mono_null (h : s βŠ† t) (ht : ΞΌ t = 0) : ΞΌ s = 0 := eq_bot_mono (measure_mono h) ht #align measure_theory.measure_mono_null MeasureTheory.measure_mono_null theorem measure_pos_of_superset (h : s βŠ† t) (hs : ΞΌ s β‰  0) : 0 < ΞΌ t := hs.bot_lt.trans_le (measure_mono h) theorem measure_iUnion_le [Countable ΞΉ] (s : ΞΉ β†’ Set Ξ±) : ΞΌ (⋃ i, s i) ≀ βˆ‘' i, ΞΌ (s i) := by refine rel_iSup_tsum ΞΌ measure_empty (Β· ≀ Β·) (fun t ↦ ?_) _ calc ΞΌ (⋃ i, t i) = ΞΌ (⋃ i, disjointed t i) := by rw [iUnion_disjointed] _ ≀ βˆ‘' i, ΞΌ (disjointed t i) := OuterMeasureClass.measure_iUnion_nat_le _ _ (disjoint_disjointed _) _ ≀ βˆ‘' i, ΞΌ (t i) := by gcongr; apply disjointed_subset #align measure_theory.measure_Union_le MeasureTheory.measure_iUnion_le theorem measure_biUnion_le {I : Set ΞΉ} (ΞΌ : F) (hI : I.Countable) (s : ΞΉ β†’ Set Ξ±) : ΞΌ (⋃ i ∈ I, s i) ≀ βˆ‘' i : I, ΞΌ (s i) := by have := hI.to_subtype rw [biUnion_eq_iUnion] apply measure_iUnion_le #align measure_theory.measure_bUnion_le MeasureTheory.measure_biUnion_le theorem measure_biUnion_finset_le (I : Finset ΞΉ) (s : ΞΉ β†’ Set Ξ±) : ΞΌ (⋃ i ∈ I, s i) ≀ βˆ‘ i ∈ I, ΞΌ (s i) := (measure_biUnion_le ΞΌ I.countable_toSet s).trans_eq <| I.tsum_subtype (ΞΌ <| s Β·) #align measure_theory.measure_bUnion_finset_le MeasureTheory.measure_biUnion_finset_le theorem measure_iUnion_fintype_le [Fintype ΞΉ] (ΞΌ : F) (s : ΞΉ β†’ Set Ξ±) : ΞΌ (⋃ i, s i) ≀ βˆ‘ i, ΞΌ (s i) := by simpa using measure_biUnion_finset_le Finset.univ s #align measure_theory.measure_Union_fintype_le MeasureTheory.measure_iUnion_fintype_le theorem measure_union_le (s t : Set Ξ±) : ΞΌ (s βˆͺ t) ≀ ΞΌ s + ΞΌ t := by simpa [union_eq_iUnion] using measure_iUnion_fintype_le ΞΌ (cond Β· s t) #align measure_theory.measure_union_le MeasureTheory.measure_union_le theorem measure_le_inter_add_diff (ΞΌ : F) (s t : Set Ξ±) : ΞΌ s ≀ ΞΌ (s ∩ t) + ΞΌ (s \ t) := by simpa using measure_union_le (s ∩ t) (s \ t) theorem measure_diff_null (ht : ΞΌ t = 0) : ΞΌ (s \ t) = ΞΌ s := (measure_mono diff_subset).antisymm <| calc ΞΌ s ≀ ΞΌ (s ∩ t) + ΞΌ (s \ t) := measure_le_inter_add_diff _ _ _ _ ≀ ΞΌ t + ΞΌ (s \ t) := by gcongr; apply inter_subset_right _ = ΞΌ (s \ t) := by simp [ht] #align measure_theory.measure_diff_null MeasureTheory.measure_diff_null theorem measure_biUnion_null_iff {I : Set ΞΉ} (hI : I.Countable) {s : ΞΉ β†’ Set Ξ±} : ΞΌ (⋃ i ∈ I, s i) = 0 ↔ βˆ€ i ∈ I, ΞΌ (s i) = 0 := by refine ⟨fun h i hi ↦ measure_mono_null (subset_biUnion_of_mem hi) h, fun h ↦ ?_⟩ have _ := hI.to_subtype simpa [h] using measure_iUnion_le (ΞΌ := ΞΌ) fun x : I ↦ s x #align measure_theory.measure_bUnion_null_iff MeasureTheory.measure_biUnion_null_iff theorem measure_sUnion_null_iff {S : Set (Set Ξ±)} (hS : S.Countable) : ΞΌ (⋃₀ S) = 0 ↔ βˆ€ s ∈ S, ΞΌ s = 0 := by rw [sUnion_eq_biUnion, measure_biUnion_null_iff hS] #align measure_theory.measure_sUnion_null_iff MeasureTheory.measure_sUnion_null_iff @[simp] theorem measure_iUnion_null_iff {ΞΉ : Sort*} [Countable ΞΉ] {s : ΞΉ β†’ Set Ξ±} : ΞΌ (⋃ i, s i) = 0 ↔ βˆ€ i, ΞΌ (s i) = 0 := by rw [← sUnion_range, measure_sUnion_null_iff (countable_range s), forall_mem_range] #align measure_theory.measure_Union_null_iff MeasureTheory.measure_iUnion_null_iff alias ⟨_, measure_iUnion_null⟩ := measure_iUnion_null_iff #align measure_theory.measure_Union_null MeasureTheory.measure_iUnion_null @[simp] theorem measure_union_null_iff : ΞΌ (s βˆͺ t) = 0 ↔ ΞΌ s = 0 ∧ ΞΌ t = 0 := by simp [union_eq_iUnion, and_comm] #align measure_theory.measure_union_null_iff MeasureTheory.measure_union_null_iff
Mathlib/MeasureTheory/OuterMeasure/Basic.lean
129
129
theorem measure_union_null (hs : ΞΌ s = 0) (ht : ΞΌ t = 0) : ΞΌ (s βˆͺ t) = 0 := by
simp [*]
[ " ΞΌ (⋃ i, s i) ≀ βˆ‘' (i : ΞΉ), ΞΌ (s i)", " (fun x x_1 => x ≀ x_1) (ΞΌ (⨆ i, t i)) (βˆ‘' (i : β„•), ΞΌ (t i))", " ΞΌ (⋃ i, t i) = ΞΌ (⋃ i, disjointed t i)", " βˆ‘' (i : β„•), ΞΌ (disjointed t i) ≀ βˆ‘' (i : β„•), ΞΌ (t i)", " disjointed t a✝ βŠ† t a✝", " ΞΌ (⋃ i ∈ I, s i) ≀ βˆ‘' (i : ↑I), ΞΌ (s ↑i)", " ΞΌ (⋃ x, s ↑x) ≀ βˆ‘' (i : ↑I)...
import Mathlib.Algebra.BigOperators.Group.Multiset import Mathlib.Data.PNat.Prime import Mathlib.Data.Nat.Factors import Mathlib.Data.Multiset.Sort #align_import data.pnat.factors from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d" -- Porting note: `deriving` contained Inhabited, CanonicallyOrderedAddCommMonoid, DistribLattice, -- SemilatticeSup, OrderBot, Sub, OrderedSub def PrimeMultiset := Multiset Nat.Primes deriving Inhabited, CanonicallyOrderedAddCommMonoid, DistribLattice, SemilatticeSup, Sub #align prime_multiset PrimeMultiset instance : OrderBot PrimeMultiset where bot_le := by simp only [bot_le, forall_const] instance : OrderedSub PrimeMultiset where tsub_le_iff_right _ _ _ := Multiset.sub_le_iff_le_add namespace PrimeMultiset -- `@[derive]` doesn't work for `meta` instances unsafe instance : Repr PrimeMultiset := by delta PrimeMultiset; infer_instance def ofPrime (p : Nat.Primes) : PrimeMultiset := ({p} : Multiset Nat.Primes) #align prime_multiset.of_prime PrimeMultiset.ofPrime theorem card_ofPrime (p : Nat.Primes) : Multiset.card (ofPrime p) = 1 := rfl #align prime_multiset.card_of_prime PrimeMultiset.card_ofPrime def toNatMultiset : PrimeMultiset β†’ Multiset β„• := fun v => v.map Coe.coe #align prime_multiset.to_nat_multiset PrimeMultiset.toNatMultiset instance coeNat : Coe PrimeMultiset (Multiset β„•) := ⟨toNatMultiset⟩ #align prime_multiset.coe_nat PrimeMultiset.coeNat def coeNatMonoidHom : PrimeMultiset β†’+ Multiset β„• := { Multiset.mapAddMonoidHom Coe.coe with toFun := Coe.coe } #align prime_multiset.coe_nat_monoid_hom PrimeMultiset.coeNatMonoidHom @[simp] theorem coe_coeNatMonoidHom : (coeNatMonoidHom : PrimeMultiset β†’ Multiset β„•) = Coe.coe := rfl #align prime_multiset.coe_coe_nat_monoid_hom PrimeMultiset.coe_coeNatMonoidHom theorem coeNat_injective : Function.Injective (Coe.coe : PrimeMultiset β†’ Multiset β„•) := Multiset.map_injective Nat.Primes.coe_nat_injective #align prime_multiset.coe_nat_injective PrimeMultiset.coeNat_injective theorem coeNat_ofPrime (p : Nat.Primes) : (ofPrime p : Multiset β„•) = {(p : β„•)} := rfl #align prime_multiset.coe_nat_of_prime PrimeMultiset.coeNat_ofPrime theorem coeNat_prime (v : PrimeMultiset) (p : β„•) (h : p ∈ (v : Multiset β„•)) : p.Prime := by rcases Multiset.mem_map.mp h with ⟨⟨_, hp'⟩, ⟨_, h_eq⟩⟩ exact h_eq β–Έ hp' #align prime_multiset.coe_nat_prime PrimeMultiset.coeNat_prime def toPNatMultiset : PrimeMultiset β†’ Multiset β„•+ := fun v => v.map Coe.coe #align prime_multiset.to_pnat_multiset PrimeMultiset.toPNatMultiset instance coePNat : Coe PrimeMultiset (Multiset β„•+) := ⟨toPNatMultiset⟩ #align prime_multiset.coe_pnat PrimeMultiset.coePNat def coePNatMonoidHom : PrimeMultiset β†’+ Multiset β„•+ := { Multiset.mapAddMonoidHom Coe.coe with toFun := Coe.coe } #align prime_multiset.coe_pnat_monoid_hom PrimeMultiset.coePNatMonoidHom @[simp] theorem coe_coePNatMonoidHom : (coePNatMonoidHom : PrimeMultiset β†’ Multiset β„•+) = Coe.coe := rfl #align prime_multiset.coe_coe_pnat_monoid_hom PrimeMultiset.coe_coePNatMonoidHom theorem coePNat_injective : Function.Injective (Coe.coe : PrimeMultiset β†’ Multiset β„•+) := Multiset.map_injective Nat.Primes.coe_pnat_injective #align prime_multiset.coe_pnat_injective PrimeMultiset.coePNat_injective theorem coePNat_ofPrime (p : Nat.Primes) : (ofPrime p : Multiset β„•+) = {(p : β„•+)} := rfl #align prime_multiset.coe_pnat_of_prime PrimeMultiset.coePNat_ofPrime
Mathlib/Data/PNat/Factors.lean
121
123
theorem coePNat_prime (v : PrimeMultiset) (p : β„•+) (h : p ∈ (v : Multiset β„•+)) : p.Prime := by
rcases Multiset.mem_map.mp h with ⟨⟨_, hp'⟩, ⟨_, h_eq⟩⟩ exact h_eq β–Έ hp'
[ " βˆ€ (a : PrimeMultiset), βŠ₯ ≀ a", " Repr PrimeMultiset", " Repr (Multiset Nat.Primes)", " p.Prime" ]
import Mathlib.RepresentationTheory.FdRep import Mathlib.LinearAlgebra.Trace import Mathlib.RepresentationTheory.Invariants #align_import representation_theory.character from "leanprover-community/mathlib"@"55b3f8206b8596db8bb1804d8a92814a0b6670c9" noncomputable section universe u open CategoryTheory LinearMap CategoryTheory.MonoidalCategory Representation FiniteDimensional variable {k : Type u} [Field k] namespace FdRep set_option linter.uppercaseLean3 false -- `FdRep` section Monoid variable {G : Type u} [Monoid G] def character (V : FdRep k G) (g : G) := LinearMap.trace k V (V.ρ g) #align fdRep.character FdRep.character
Mathlib/RepresentationTheory/Character.lean
54
55
theorem char_mul_comm (V : FdRep k G) (g : G) (h : G) : V.character (h * g) = V.character (g * h) := by
simp only [trace_mul_comm, character, map_mul]
[ " V.character (h * g) = V.character (g * h)" ]
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Algebra.Module.Basic import Mathlib.Algebra.Regular.SMul import Mathlib.Data.Finset.Preimage import Mathlib.Data.Rat.BigOperators import Mathlib.GroupTheory.GroupAction.Hom import Mathlib.Data.Set.Subsingleton #align_import data.finsupp.basic from "leanprover-community/mathlib"@"f69db8cecc668e2d5894d7e9bfc491da60db3b9f" noncomputable section open Finset Function variable {Ξ± Ξ² Ξ³ ΞΉ M M' N P G H R S : Type*} namespace Finsupp section Graph variable [Zero M] def graph (f : Ξ± β†’β‚€ M) : Finset (Ξ± Γ— M) := f.support.map ⟨fun a => Prod.mk a (f a), fun _ _ h => (Prod.mk.inj h).1⟩ #align finsupp.graph Finsupp.graph theorem mk_mem_graph_iff {a : Ξ±} {m : M} {f : Ξ± β†’β‚€ M} : (a, m) ∈ f.graph ↔ f a = m ∧ m β‰  0 := by simp_rw [graph, mem_map, mem_support_iff] constructor Β· rintro ⟨b, ha, rfl, -⟩ exact ⟨rfl, ha⟩ Β· rintro ⟨rfl, ha⟩ exact ⟨a, ha, rfl⟩ #align finsupp.mk_mem_graph_iff Finsupp.mk_mem_graph_iff @[simp]
Mathlib/Data/Finsupp/Basic.lean
78
80
theorem mem_graph_iff {c : Ξ± Γ— M} {f : Ξ± β†’β‚€ M} : c ∈ f.graph ↔ f c.1 = c.2 ∧ c.2 β‰  0 := by
cases c exact mk_mem_graph_iff
[ " (a, m) ∈ f.graph ↔ f a = m ∧ m β‰  0", " (βˆƒ a_1, f a_1 β‰  0 ∧ { toFun := fun a => (a, f a), inj' := β‹― } a_1 = (a, m)) ↔ f a = m ∧ m β‰  0", " (βˆƒ a_1, f a_1 β‰  0 ∧ { toFun := fun a => (a, f a), inj' := β‹― } a_1 = (a, m)) β†’ f a = m ∧ m β‰  0", " f a = f a ∧ f a β‰  0", " f a = m ∧ m β‰  0 β†’ βˆƒ a_2, f a_2 β‰  0 ∧ { toFun :=...
import Mathlib.Algebra.MvPolynomial.Rename #align_import data.mv_polynomial.comap from "leanprover-community/mathlib"@"aba31c938d3243cc671be7091b28a1e0814647ee" namespace MvPolynomial variable {Οƒ : Type*} {Ο„ : Type*} {Ο… : Type*} {R : Type*} [CommSemiring R] noncomputable def comap (f : MvPolynomial Οƒ R →ₐ[R] MvPolynomial Ο„ R) : (Ο„ β†’ R) β†’ Οƒ β†’ R := fun x i => aeval x (f (X i)) #align mv_polynomial.comap MvPolynomial.comap @[simp] theorem comap_apply (f : MvPolynomial Οƒ R →ₐ[R] MvPolynomial Ο„ R) (x : Ο„ β†’ R) (i : Οƒ) : comap f x i = aeval x (f (X i)) := rfl #align mv_polynomial.comap_apply MvPolynomial.comap_apply @[simp] theorem comap_id_apply (x : Οƒ β†’ R) : comap (AlgHom.id R (MvPolynomial Οƒ R)) x = x := by funext i simp only [comap, AlgHom.id_apply, id, aeval_X] #align mv_polynomial.comap_id_apply MvPolynomial.comap_id_apply variable (Οƒ R) theorem comap_id : comap (AlgHom.id R (MvPolynomial Οƒ R)) = id := by funext x exact comap_id_apply x #align mv_polynomial.comap_id MvPolynomial.comap_id variable {Οƒ R} theorem comap_comp_apply (f : MvPolynomial Οƒ R →ₐ[R] MvPolynomial Ο„ R) (g : MvPolynomial Ο„ R →ₐ[R] MvPolynomial Ο… R) (x : Ο… β†’ R) : comap (g.comp f) x = comap f (comap g x) := by funext i trans aeval x (aeval (fun i => g (X i)) (f (X i))) Β· apply evalβ‚‚Hom_congr rfl rfl rw [AlgHom.comp_apply] suffices g = aeval fun i => g (X i) by rw [← this] exact aeval_unique g Β· simp only [comap, aeval_eq_evalβ‚‚Hom, map_evalβ‚‚Hom, AlgHom.comp_apply] refine evalβ‚‚Hom_congr ?_ rfl rfl ext r apply aeval_C #align mv_polynomial.comap_comp_apply MvPolynomial.comap_comp_apply theorem comap_comp (f : MvPolynomial Οƒ R →ₐ[R] MvPolynomial Ο„ R) (g : MvPolynomial Ο„ R →ₐ[R] MvPolynomial Ο… R) : comap (g.comp f) = comap f ∘ comap g := by funext x exact comap_comp_apply _ _ _ #align mv_polynomial.comap_comp MvPolynomial.comap_comp
Mathlib/Algebra/MvPolynomial/Comap.lean
83
87
theorem comap_eq_id_of_eq_id (f : MvPolynomial Οƒ R →ₐ[R] MvPolynomial Οƒ R) (hf : βˆ€ Ο†, f Ο† = Ο†) (x : Οƒ β†’ R) : comap f x = x := by
convert comap_id_apply x ext1 Ο† simp [hf, AlgHom.id_apply]
[ " comap (AlgHom.id R (MvPolynomial Οƒ R)) x = x", " comap (AlgHom.id R (MvPolynomial Οƒ R)) x i = x i", " comap (AlgHom.id R (MvPolynomial Οƒ R)) = id", " comap (AlgHom.id R (MvPolynomial Οƒ R)) x = id x", " comap (g.comp f) x = comap f (comap g x)", " comap (g.comp f) x i = comap f (comap g x) i", " comap ...
import Mathlib.MeasureTheory.Covering.DensityTheorem #align_import measure_theory.covering.liminf_limsup from "leanprover-community/mathlib"@"5f6e827d81dfbeb6151d7016586ceeb0099b9655" open Set Filter Metric MeasureTheory TopologicalSpace open scoped NNReal ENNReal Topology variable {Ξ± : Type*} [MetricSpace Ξ±] [SecondCountableTopology Ξ±] [MeasurableSpace Ξ±] [BorelSpace Ξ±] variable (ΞΌ : Measure Ξ±) [IsLocallyFiniteMeasure ΞΌ] [IsUnifLocDoublingMeasure ΞΌ]
Mathlib/MeasureTheory/Covering/LiminfLimsup.lean
41
150
theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : β„• β†’ Prop) {s : β„• β†’ Set Ξ±} (hs : βˆ€ i, IsClosed (s i)) {r₁ rβ‚‚ : β„• β†’ ℝ} (hr : Tendsto r₁ atTop (𝓝[>] 0)) (hrp : 0 ≀ r₁) {M : ℝ} (hM : 0 < M) (hM' : M < 1) (hMr : βˆ€αΆ  i in atTop, M * r₁ i ≀ rβ‚‚ i) : (blimsup (fun i => cthickening (r₁ i) (s i)) atTop p : Set Ξ±) ≀ᡐ[ΞΌ] (blimsup (fun i => cthickening (rβ‚‚ i) (s i)) atTop p : Set Ξ±) := by
/- Sketch of proof: Assume that `p` is identically true for simplicity. Let `Y₁ i = cthickening (r₁ i) (s i)`, define `Yβ‚‚` similarly except using `rβ‚‚`, and let `(Z i) = ⋃_{j β‰₯ i} (Yβ‚‚ j)`. Our goal is equivalent to showing that `ΞΌ ((limsup Y₁) \ (Z i)) = 0` for all `i`. Assume for contradiction that `ΞΌ ((limsup Y₁) \ (Z i)) β‰  0` for some `i` and let `W = (limsup Y₁) \ (Z i)`. Apply Lebesgue's density theorem to obtain a point `d` in `W` of density `1`. Since `d ∈ limsup Y₁`, there is a subsequence of `j ↦ Y₁ j`, indexed by `f 0 < f 1 < ...`, such that `d ∈ Y₁ (f j)` for all `j`. For each `j`, we may thus choose `w j ∈ s (f j)` such that `d ∈ B j`, where `B j = closedBall (w j) (r₁ (f j))`. Note that since `d` has density one, `ΞΌ (W ∩ (B j)) / ΞΌ (B j) β†’ 1`. We obtain our contradiction by showing that there exists `Ξ· < 1` such that `ΞΌ (W ∩ (B j)) / ΞΌ (B j) ≀ Ξ·` for sufficiently large `j`. In fact we claim that `Ξ· = 1 - C⁻¹` is such a value where `C` is the scaling constant of `M⁻¹` for the uniformly locally doubling measure `ΞΌ`. To prove the claim, let `b j = closedBall (w j) (M * r₁ (f j))` and for given `j` consider the sets `b j` and `W ∩ (B j)`. These are both subsets of `B j` and are disjoint for large enough `j` since `M * r₁ j ≀ rβ‚‚ j` and thus `b j βŠ† Z i βŠ† Wᢜ`. We thus have: `ΞΌ (b j) + ΞΌ (W ∩ (B j)) ≀ ΞΌ (B j)`. Combining this with `ΞΌ (B j) ≀ C * ΞΌ (b j)` we obtain the required inequality. -/ set Y₁ : β„• β†’ Set Ξ± := fun i => cthickening (r₁ i) (s i) set Yβ‚‚ : β„• β†’ Set Ξ± := fun i => cthickening (rβ‚‚ i) (s i) let Z : β„• β†’ Set Ξ± := fun i => ⋃ (j) (_ : p j ∧ i ≀ j), Yβ‚‚ j suffices βˆ€ i, ΞΌ (atTop.blimsup Y₁ p \ Z i) = 0 by rwa [ae_le_set, @blimsup_eq_iInf_biSup_of_nat _ _ _ Yβ‚‚, iInf_eq_iInter, diff_iInter, measure_iUnion_null_iff] intros i set W := atTop.blimsup Y₁ p \ Z i by_contra contra obtain ⟨d, hd, hd'⟩ : βˆƒ d, d ∈ W ∧ βˆ€ {ΞΉ : Type _} {l : Filter ΞΉ} (w : ΞΉ β†’ Ξ±) (Ξ΄ : ΞΉ β†’ ℝ), Tendsto Ξ΄ l (𝓝[>] 0) β†’ (βˆ€αΆ  j in l, d ∈ closedBall (w j) (2 * Ξ΄ j)) β†’ Tendsto (fun j => ΞΌ (W ∩ closedBall (w j) (Ξ΄ j)) / ΞΌ (closedBall (w j) (Ξ΄ j))) l (𝓝 1) := Measure.exists_mem_of_measure_ne_zero_of_ae contra (IsUnifLocDoublingMeasure.ae_tendsto_measure_inter_div ΞΌ W 2) replace hd : d ∈ blimsup Y₁ atTop p := ((mem_diff _).mp hd).1 obtain ⟨f : β„• β†’ β„•, hf⟩ := exists_forall_mem_of_hasBasis_mem_blimsup' atTop_basis hd simp only [forall_and] at hf obtain ⟨hfβ‚€ : βˆ€ j, d ∈ cthickening (r₁ (f j)) (s (f j)), hf₁, hfβ‚‚ : βˆ€ j, j ≀ f j⟩ := hf have hf₃ : Tendsto f atTop atTop := tendsto_atTop_atTop.mpr fun j => ⟨f j, fun i hi => (hfβ‚‚ j).trans (hi.trans <| hfβ‚‚ i)⟩ replace hr : Tendsto (r₁ ∘ f) atTop (𝓝[>] 0) := hr.comp hf₃ replace hMr : βˆ€αΆ  j in atTop, M * r₁ (f j) ≀ rβ‚‚ (f j) := hf₃.eventually hMr replace hfβ‚€ : βˆ€ j, βˆƒ w ∈ s (f j), d ∈ closedBall w (2 * r₁ (f j)) := by intro j specialize hrp (f j) rw [Pi.zero_apply] at hrp rcases eq_or_lt_of_le hrp with (hr0 | hrp') Β· specialize hfβ‚€ j rw [← hr0, cthickening_zero, (hs (f j)).closure_eq] at hfβ‚€ exact ⟨d, hfβ‚€, by simp [← hr0]⟩ Β· simpa using mem_iUnionβ‚‚.mp (cthickening_subset_iUnion_closedBall_of_lt (s (f j)) (by positivity) (lt_two_mul_self hrp') (hfβ‚€ j)) choose w hw hw' using hfβ‚€ let C := IsUnifLocDoublingMeasure.scalingConstantOf ΞΌ M⁻¹ have hC : 0 < C := lt_of_lt_of_le zero_lt_one (IsUnifLocDoublingMeasure.one_le_scalingConstantOf ΞΌ M⁻¹) suffices βˆƒ Ξ· < (1 : ℝβ‰₯0), βˆ€αΆ  j in atTop, ΞΌ (W ∩ closedBall (w j) (r₁ (f j))) / ΞΌ (closedBall (w j) (r₁ (f j))) ≀ Ξ· by obtain ⟨η, hΞ·, hΞ·'⟩ := this replace hΞ·' : 1 ≀ Ξ· := by simpa only [ENNReal.one_le_coe_iff] using le_of_tendsto (hd' w (fun j => r₁ (f j)) hr <| eventually_of_forall hw') hΞ·' exact (lt_self_iff_false _).mp (lt_of_lt_of_le hΞ· hΞ·') refine ⟨1 - C⁻¹, tsub_lt_self zero_lt_one (inv_pos.mpr hC), ?_⟩ replace hC : C β‰  0 := ne_of_gt hC let b : β„• β†’ Set Ξ± := fun j => closedBall (w j) (M * r₁ (f j)) let B : β„• β†’ Set Ξ± := fun j => closedBall (w j) (r₁ (f j)) have h₁ : βˆ€ j, b j βŠ† B j := fun j => closedBall_subset_closedBall (mul_le_of_le_one_left (hrp (f j)) hM'.le) have hβ‚‚ : βˆ€ j, W ∩ B j βŠ† B j := fun j => inter_subset_right have h₃ : βˆ€αΆ  j in atTop, Disjoint (b j) (W ∩ B j) := by apply hMr.mp rw [eventually_atTop] refine ⟨i, fun j hj hj' => Disjoint.inf_right (B j) <| Disjoint.inf_right' (blimsup Y₁ atTop p) ?_⟩ change Disjoint (b j) (Z i)ᢜ rw [disjoint_compl_right_iff_subset] refine (closedBall_subset_cthickening (hw j) (M * r₁ (f j))).trans ((cthickening_mono hj' _).trans fun a ha => ?_) simp only [Z, mem_iUnion, exists_prop] exact ⟨f j, ⟨hf₁ j, hj.le.trans (hfβ‚‚ j)⟩, ha⟩ have hβ‚„ : βˆ€αΆ  j in atTop, ΞΌ (B j) ≀ C * ΞΌ (b j) := (hr.eventually (IsUnifLocDoublingMeasure.eventually_measure_le_scaling_constant_mul' ΞΌ M hM)).mono fun j hj => hj (w j) refine (h₃.and hβ‚„).mono fun j hjβ‚€ => ?_ change ΞΌ (W ∩ B j) / ΞΌ (B j) ≀ ↑(1 - C⁻¹) rcases eq_or_ne (ΞΌ (B j)) ∞ with (hB | hB); Β· simp [hB] apply ENNReal.div_le_of_le_mul rw [ENNReal.coe_sub, ENNReal.coe_one, ENNReal.sub_mul fun _ _ => hB, one_mul] replace hB : ↑C⁻¹ * ΞΌ (B j) β‰  ∞ := by refine ENNReal.mul_ne_top ?_ hB rwa [ENNReal.coe_inv hC, Ne, ENNReal.inv_eq_top, ENNReal.coe_eq_zero] obtain ⟨hj₁ : Disjoint (b j) (W ∩ B j), hjβ‚‚ : ΞΌ (B j) ≀ C * ΞΌ (b j)⟩ := hjβ‚€ replace hjβ‚‚ : ↑C⁻¹ * ΞΌ (B j) ≀ ΞΌ (b j) := by rw [ENNReal.coe_inv hC, ← ENNReal.div_eq_inv_mul] exact ENNReal.div_le_of_le_mul' hjβ‚‚ have hj₃ : ↑C⁻¹ * ΞΌ (B j) + ΞΌ (W ∩ B j) ≀ ΞΌ (B j) := by refine le_trans (add_le_add_right hjβ‚‚ _) ?_ rw [← measure_union' hj₁ measurableSet_closedBall] exact measure_mono (union_subset (h₁ j) (hβ‚‚ j)) replace hj₃ := tsub_le_tsub_right hj₃ (↑C⁻¹ * ΞΌ (B j)) rwa [ENNReal.add_sub_cancel_left hB] at hj₃
[ " blimsup (fun i => cthickening (r₁ i) (s i)) atTop p ≀ᢠ[ae ΞΌ] blimsup (fun i => cthickening (rβ‚‚ i) (s i)) atTop p", " blimsup Y₁ atTop p ≀ᢠ[ae ΞΌ] blimsup (fun i => cthickening (rβ‚‚ i) (s i)) atTop p", " blimsup Y₁ atTop p ≀ᢠ[ae ΞΌ] blimsup Yβ‚‚ atTop p", " βˆ€ (i : β„•), ΞΌ (blimsup Y₁ atTop p \\ Z i) = 0", " ΞΌ (bl...
import Mathlib.Order.Antichain import Mathlib.Order.UpperLower.Basic import Mathlib.Order.Interval.Set.Basic import Mathlib.Order.RelIso.Set #align_import order.minimal from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf" open Function Set variable {Ξ± : Type*} (r r₁ rβ‚‚ : Ξ± β†’ Ξ± β†’ Prop) (s t : Set Ξ±) (a b : Ξ±) def maximals : Set Ξ± := { a ∈ s | βˆ€ ⦃b⦄, b ∈ s β†’ r a b β†’ r b a } #align maximals maximals def minimals : Set Ξ± := { a ∈ s | βˆ€ ⦃b⦄, b ∈ s β†’ r b a β†’ r a b } #align minimals minimals theorem maximals_subset : maximals r s βŠ† s := sep_subset _ _ #align maximals_subset maximals_subset theorem minimals_subset : minimals r s βŠ† s := sep_subset _ _ #align minimals_subset minimals_subset @[simp] theorem maximals_empty : maximals r βˆ… = βˆ… := sep_empty _ #align maximals_empty maximals_empty @[simp] theorem minimals_empty : minimals r βˆ… = βˆ… := sep_empty _ #align minimals_empty minimals_empty @[simp] theorem maximals_singleton : maximals r {a} = {a} := (maximals_subset _ _).antisymm <| singleton_subset_iff.2 <| ⟨rfl, by rintro b (rfl : b = a) exact id⟩ #align maximals_singleton maximals_singleton @[simp] theorem minimals_singleton : minimals r {a} = {a} := maximals_singleton _ _ #align minimals_singleton minimals_singleton theorem maximals_swap : maximals (swap r) s = minimals r s := rfl #align maximals_swap maximals_swap theorem minimals_swap : minimals (swap r) s = maximals r s := rfl #align minimals_swap minimals_swap section IsAntisymm variable {r s t a b} [IsAntisymm Ξ± r] theorem eq_of_mem_maximals (ha : a ∈ maximals r s) (hb : b ∈ s) (h : r a b) : a = b := antisymm h <| ha.2 hb h #align eq_of_mem_maximals eq_of_mem_maximals theorem eq_of_mem_minimals (ha : a ∈ minimals r s) (hb : b ∈ s) (h : r b a) : a = b := antisymm (ha.2 hb h) h #align eq_of_mem_minimals eq_of_mem_minimals set_option autoImplicit true theorem mem_maximals_iff : x ∈ maximals r s ↔ x ∈ s ∧ βˆ€ ⦃y⦄, y ∈ s β†’ r x y β†’ x = y := by simp only [maximals, Set.mem_sep_iff, and_congr_right_iff] refine fun _ ↦ ⟨fun h y hys hxy ↦ antisymm hxy (h hys hxy), fun h y hys hxy ↦ ?_⟩ convert hxy <;> rw [h hys hxy] theorem mem_maximals_setOf_iff : x ∈ maximals r (setOf P) ↔ P x ∧ βˆ€ ⦃y⦄, P y β†’ r x y β†’ x = y := mem_maximals_iff theorem mem_minimals_iff : x ∈ minimals r s ↔ x ∈ s ∧ βˆ€ ⦃y⦄, y ∈ s β†’ r y x β†’ x = y := @mem_maximals_iff _ _ _ (IsAntisymm.swap r) _ theorem mem_minimals_setOf_iff : x ∈ minimals r (setOf P) ↔ P x ∧ βˆ€ ⦃y⦄, P y β†’ r y x β†’ x = y := mem_minimals_iff
Mathlib/Order/Minimal.lean
113
115
theorem mem_minimals_iff_forall_lt_not_mem' (rlt : Ξ± β†’ Ξ± β†’ Prop) [IsNonstrictStrictOrder Ξ± r rlt] : x ∈ minimals r s ↔ x ∈ s ∧ βˆ€ ⦃y⦄, rlt y x β†’ y βˆ‰ s := by
simp [minimals, right_iff_left_not_left_of r rlt, not_imp_not, imp.swap (a := _ ∈ _)]
[ " βˆ€ ⦃b : α⦄, b ∈ {a} β†’ r a b β†’ r b a", " r b b β†’ r b b", " x ∈ maximals r s ↔ x ∈ s ∧ βˆ€ ⦃y : α⦄, y ∈ s β†’ r x y β†’ x = y", " x ∈ s β†’ ((βˆ€ ⦃b : α⦄, b ∈ s β†’ r x b β†’ r b x) ↔ βˆ€ ⦃y : α⦄, y ∈ s β†’ r x y β†’ x = y)", " r y x", " y = x", " x = y", " x ∈ minimals r s ↔ x ∈ s ∧ βˆ€ ⦃y : α⦄, rlt y x β†’ y βˆ‰ s" ]
import Mathlib.Algebra.BigOperators.Pi import Mathlib.Algebra.BigOperators.Ring import Mathlib.Algebra.Order.BigOperators.Ring.Finset import Mathlib.Algebra.BigOperators.Fin import Mathlib.Algebra.Group.Submonoid.Membership import Mathlib.Data.Finsupp.Fin import Mathlib.Data.Finsupp.Indicator #align_import algebra.big_operators.finsupp from "leanprover-community/mathlib"@"842328d9df7e96fd90fc424e115679c15fb23a71" noncomputable section open Finset Function variable {Ξ± ΞΉ Ξ³ A B C : Type*} [AddCommMonoid A] [AddCommMonoid B] [AddCommMonoid C] variable {t : ΞΉ β†’ A β†’ C} (h0 : βˆ€ i, t i 0 = 0) (h1 : βˆ€ i x y, t i (x + y) = t i x + t i y) variable {s : Finset Ξ±} {f : Ξ± β†’ ΞΉ β†’β‚€ A} (i : ΞΉ) variable (g : ΞΉ β†’β‚€ A) (k : ΞΉ β†’ A β†’ Ξ³ β†’ B) (x : Ξ³) variable {Ξ² M M' N P G H R S : Type*} namespace Finsupp section SumProd @[to_additive "`sum f g` is the sum of `g a (f a)` over the support of `f`. "] def prod [Zero M] [CommMonoid N] (f : Ξ± β†’β‚€ M) (g : Ξ± β†’ M β†’ N) : N := ∏ a ∈ f.support, g a (f a) #align finsupp.prod Finsupp.prod #align finsupp.sum Finsupp.sum variable [Zero M] [Zero M'] [CommMonoid N] @[to_additive] theorem prod_of_support_subset (f : Ξ± β†’β‚€ M) {s : Finset Ξ±} (hs : f.support βŠ† s) (g : Ξ± β†’ M β†’ N) (h : βˆ€ i ∈ s, g i 0 = 1) : f.prod g = ∏ x ∈ s, g x (f x) := by refine Finset.prod_subset hs fun x hxs hx => h x hxs β–Έ (congr_arg (g x) ?_) exact not_mem_support_iff.1 hx #align finsupp.prod_of_support_subset Finsupp.prod_of_support_subset #align finsupp.sum_of_support_subset Finsupp.sum_of_support_subset @[to_additive] theorem prod_fintype [Fintype Ξ±] (f : Ξ± β†’β‚€ M) (g : Ξ± β†’ M β†’ N) (h : βˆ€ i, g i 0 = 1) : f.prod g = ∏ i, g i (f i) := f.prod_of_support_subset (subset_univ _) g fun x _ => h x #align finsupp.prod_fintype Finsupp.prod_fintype #align finsupp.sum_fintype Finsupp.sum_fintype @[to_additive (attr := simp)] theorem prod_single_index {a : Ξ±} {b : M} {h : Ξ± β†’ M β†’ N} (h_zero : h a 0 = 1) : (single a b).prod h = h a b := calc (single a b).prod h = ∏ x ∈ {a}, h x (single a b x) := prod_of_support_subset _ support_single_subset h fun x hx => (mem_singleton.1 hx).symm β–Έ h_zero _ = h a b := by simp #align finsupp.prod_single_index Finsupp.prod_single_index #align finsupp.sum_single_index Finsupp.sum_single_index @[to_additive] theorem prod_mapRange_index {f : M β†’ M'} {hf : f 0 = 0} {g : Ξ± β†’β‚€ M} {h : Ξ± β†’ M' β†’ N} (h0 : βˆ€ a, h a 0 = 1) : (mapRange f hf g).prod h = g.prod fun a b => h a (f b) := Finset.prod_subset support_mapRange fun _ _ H => by rw [not_mem_support_iff.1 H, h0] #align finsupp.prod_map_range_index Finsupp.prod_mapRange_index #align finsupp.sum_map_range_index Finsupp.sum_mapRange_index @[to_additive (attr := simp)] theorem prod_zero_index {h : Ξ± β†’ M β†’ N} : (0 : Ξ± β†’β‚€ M).prod h = 1 := rfl #align finsupp.prod_zero_index Finsupp.prod_zero_index #align finsupp.sum_zero_index Finsupp.sum_zero_index @[to_additive] theorem prod_comm (f : Ξ± β†’β‚€ M) (g : Ξ² β†’β‚€ M') (h : Ξ± β†’ M β†’ Ξ² β†’ M' β†’ N) : (f.prod fun x v => g.prod fun x' v' => h x v x' v') = g.prod fun x' v' => f.prod fun x v => h x v x' v' := Finset.prod_comm #align finsupp.prod_comm Finsupp.prod_comm #align finsupp.sum_comm Finsupp.sum_comm @[to_additive (attr := simp)] theorem prod_ite_eq [DecidableEq Ξ±] (f : Ξ± β†’β‚€ M) (a : Ξ±) (b : Ξ± β†’ M β†’ N) : (f.prod fun x v => ite (a = x) (b x v) 1) = ite (a ∈ f.support) (b a (f a)) 1 := by dsimp [Finsupp.prod] rw [f.support.prod_ite_eq] #align finsupp.prod_ite_eq Finsupp.prod_ite_eq #align finsupp.sum_ite_eq Finsupp.sum_ite_eq -- @[simp] theorem sum_ite_self_eq [DecidableEq Ξ±] {N : Type*} [AddCommMonoid N] (f : Ξ± β†’β‚€ N) (a : Ξ±) : (f.sum fun x v => ite (a = x) v 0) = f a := by classical convert f.sum_ite_eq a fun _ => id simp [ite_eq_right_iff.2 Eq.symm] #align finsupp.sum_ite_self_eq Finsupp.sum_ite_self_eq -- Porting note: Added this thm to replace the simp in the previous one. Need to add [DecidableEq N] @[simp]
Mathlib/Algebra/BigOperators/Finsupp.lean
124
127
theorem sum_ite_self_eq_aux [DecidableEq Ξ±] {N : Type*} [AddCommMonoid N] (f : Ξ± β†’β‚€ N) (a : Ξ±) : (if a ∈ f.support then f a else 0) = f a := by
simp only [mem_support_iff, ne_eq, ite_eq_left_iff, not_not] exact fun h ↦ h.symm
[ " f.prod g = ∏ x ∈ s, g x (f x)", " f x = 0", " ∏ x ∈ {a}, h x ((single a b) x) = h a b", " h x✝¹ ((mapRange f hf g) x✝¹) = 1", " (f.prod fun x v => if a = x then b x v else 1) = if a ∈ f.support then b a (f a) else 1", " (∏ a_1 ∈ f.support, if a = a_1 then b a_1 (f a_1) else 1) = if a ∈ f.support then b ...
import Mathlib.Analysis.Complex.UpperHalfPlane.Basic import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup import Mathlib.Topology.Instances.Matrix import Mathlib.Topology.Algebra.Module.FiniteDimension #align_import number_theory.modular from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" open Complex hiding abs_two open Matrix hiding mul_smul open Matrix.SpecialLinearGroup UpperHalfPlane ModularGroup noncomputable section local notation "SL(" n ", " R ")" => SpecialLinearGroup (Fin n) R local macro "β†‘β‚˜" t:term:80 : term => `(term| ($t : Matrix (Fin 2) (Fin 2) β„€)) open scoped UpperHalfPlane ComplexConjugate namespace ModularGroup variable {g : SL(2, β„€)} (z : ℍ) section BottomRow
Mathlib/NumberTheory/Modular.lean
85
89
theorem bottom_row_coprime {R : Type*} [CommRing R] (g : SL(2, R)) : IsCoprime ((↑g : Matrix (Fin 2) (Fin 2) R) 1 0) ((↑g : Matrix (Fin 2) (Fin 2) R) 1 1) := by
use -(↑g : Matrix (Fin 2) (Fin 2) R) 0 1, (↑g : Matrix (Fin 2) (Fin 2) R) 0 0 rw [add_comm, neg_mul, ← sub_eq_add_neg, ← det_fin_two] exact g.det_coe
[ " IsCoprime (↑g 1 0) (↑g 1 1)", " -↑g 0 1 * ↑g 1 0 + ↑g 0 0 * ↑g 1 1 = 1", " (↑g).det = 1" ]
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Data.Real.Sqrt import Mathlib.RingTheory.Ideal.QuotientOperations import Mathlib.Topology.MetricSpace.HausdorffDistance #align_import analysis.normed.group.quotient from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" noncomputable section open QuotientAddGroup Metric Set Topology NNReal variable {M N : Type*} [SeminormedAddCommGroup M] [SeminormedAddCommGroup N] noncomputable instance normOnQuotient (S : AddSubgroup M) : Norm (M β§Έ S) where norm x := sInf (norm '' { m | mk' S m = x }) #align norm_on_quotient normOnQuotient theorem AddSubgroup.quotient_norm_eq {S : AddSubgroup M} (x : M β§Έ S) : β€–xβ€– = sInf (norm '' { m : M | (m : M β§Έ S) = x }) := rfl #align add_subgroup.quotient_norm_eq AddSubgroup.quotient_norm_eq theorem QuotientAddGroup.norm_eq_infDist {S : AddSubgroup M} (x : M β§Έ S) : β€–xβ€– = infDist 0 { m : M | (m : M β§Έ S) = x } := by simp only [AddSubgroup.quotient_norm_eq, infDist_eq_iInf, sInf_image', dist_zero_left] theorem QuotientAddGroup.norm_mk {S : AddSubgroup M} (x : M) : β€–(x : M β§Έ S)β€– = infDist x S := by rw [norm_eq_infDist, ← infDist_image (IsometryEquiv.subLeft x).isometry, IsometryEquiv.subLeft_apply, sub_zero, ← IsometryEquiv.preimage_symm] congr 1 with y simp only [mem_preimage, IsometryEquiv.subLeft_symm_apply, mem_setOf_eq, QuotientAddGroup.eq, neg_add, neg_neg, neg_add_cancel_right, SetLike.mem_coe] theorem image_norm_nonempty {S : AddSubgroup M} (x : M β§Έ S) : (norm '' { m | mk' S m = x }).Nonempty := .image _ <| Quot.exists_rep x #align image_norm_nonempty image_norm_nonempty theorem bddBelow_image_norm (s : Set M) : BddBelow (norm '' s) := ⟨0, forall_mem_image.2 fun _ _ ↦ norm_nonneg _⟩ #align bdd_below_image_norm bddBelow_image_norm theorem isGLB_quotient_norm {S : AddSubgroup M} (x : M β§Έ S) : IsGLB (norm '' { m | mk' S m = x }) (β€–xβ€–) := isGLB_csInf (image_norm_nonempty x) (bddBelow_image_norm _) theorem quotient_norm_neg {S : AddSubgroup M} (x : M β§Έ S) : β€–-xβ€– = β€–xβ€– := by simp only [AddSubgroup.quotient_norm_eq] congr 1 with r constructor <;> { rintro ⟨m, hm, rfl⟩; use -m; simpa [neg_eq_iff_eq_neg] using hm } #align quotient_norm_neg quotient_norm_neg
Mathlib/Analysis/Normed/Group/Quotient.lean
147
148
theorem quotient_norm_sub_rev {S : AddSubgroup M} (x y : M β§Έ S) : β€–x - yβ€– = β€–y - xβ€– := by
rw [← neg_sub, quotient_norm_neg]
[ " β€–xβ€– = infDist 0 {m | ↑m = x}", " ‖↑xβ€– = infDist x ↑S", " infDist x (⇑(IsometryEquiv.subLeft x).symm ⁻¹' {m | ↑m = ↑x}) = infDist x ↑S", " y ∈ ⇑(IsometryEquiv.subLeft x).symm ⁻¹' {m | ↑m = ↑x} ↔ y ∈ ↑S", " β€–-xβ€– = β€–xβ€–", " sInf (norm '' {m | ↑m = -x}) = sInf (norm '' {m | ↑m = x})", " r ∈ norm '' {m | ↑m...
import Mathlib.Algebra.CharP.Defs import Mathlib.RingTheory.Multiplicity import Mathlib.RingTheory.PowerSeries.Basic #align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60" noncomputable section open Polynomial open Finset (antidiagonal mem_antidiagonal) namespace PowerSeries open Finsupp (single) variable {R : Type*} section OrderBasic open multiplicity variable [Semiring R] {Ο† : R⟦X⟧} theorem exists_coeff_ne_zero_iff_ne_zero : (βˆƒ n : β„•, coeff R n Ο† β‰  0) ↔ Ο† β‰  0 := by refine not_iff_not.mp ?_ push_neg -- FIXME: the `FunLike.coe` doesn't seem to be picked up in the expression after #8386? simp [PowerSeries.ext_iff, (coeff R _).map_zero] #align power_series.exists_coeff_ne_zero_iff_ne_zero PowerSeries.exists_coeff_ne_zero_iff_ne_zero def order (Ο† : R⟦X⟧) : PartENat := letI := Classical.decEq R letI := Classical.decEq R⟦X⟧ if h : Ο† = 0 then ⊀ else Nat.find (exists_coeff_ne_zero_iff_ne_zero.mpr h) #align power_series.order PowerSeries.order @[simp] theorem order_zero : order (0 : R⟦X⟧) = ⊀ := dif_pos rfl #align power_series.order_zero PowerSeries.order_zero theorem order_finite_iff_ne_zero : (order Ο†).Dom ↔ Ο† β‰  0 := by simp only [order] constructor Β· split_ifs with h <;> intro H Β· simp only [PartENat.top_eq_none, Part.not_none_dom] at H Β· exact h Β· intro h simp [h] #align power_series.order_finite_iff_ne_zero PowerSeries.order_finite_iff_ne_zero theorem coeff_order (h : (order Ο†).Dom) : coeff R (Ο†.order.get h) Ο† β‰  0 := by classical simp only [order, order_finite_iff_ne_zero.mp h, not_false_iff, dif_neg, PartENat.get_natCast'] generalize_proofs h exact Nat.find_spec h #align power_series.coeff_order PowerSeries.coeff_order theorem order_le (n : β„•) (h : coeff R n Ο† β‰  0) : order Ο† ≀ n := by classical rw [order, dif_neg] Β· simp only [PartENat.coe_le_coe] exact Nat.find_le h Β· exact exists_coeff_ne_zero_iff_ne_zero.mp ⟨n, h⟩ #align power_series.order_le PowerSeries.order_le
Mathlib/RingTheory/PowerSeries/Order.lean
99
101
theorem coeff_of_lt_order (n : β„•) (h : ↑n < order Ο†) : coeff R n Ο† = 0 := by
contrapose! h exact order_le _ h
[ " (βˆƒ n, (coeff R n) Ο† β‰  0) ↔ Ο† β‰  0", " (Β¬βˆƒ n, (coeff R n) Ο† β‰  0) ↔ ¬φ β‰  0", " (βˆ€ (n : β„•), (coeff R n) Ο† = 0) ↔ Ο† = 0", " Ο†.order.Dom ↔ Ο† β‰  0", " (if h : Ο† = 0 then ⊀ else ↑(Nat.find β‹―)).Dom ↔ Ο† β‰  0", " (if h : Ο† = 0 then ⊀ else ↑(Nat.find β‹―)).Dom β†’ Ο† β‰  0", " ⊀.Dom β†’ Ο† β‰  0", " (↑(Nat.find β‹―)).Dom β†’ Ο† β‰ ...
import Mathlib.MeasureTheory.Constructions.Prod.Basic import Mathlib.MeasureTheory.Group.Measure #align_import measure_theory.group.prod from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" noncomputable section open Set hiding prod_eq open Function MeasureTheory open Filter hiding map open scoped Classical ENNReal Pointwise MeasureTheory variable (G : Type*) [MeasurableSpace G] variable [Group G] [MeasurableMulβ‚‚ G] variable (ΞΌ Ξ½ : Measure G) [SigmaFinite Ξ½] [SigmaFinite ΞΌ] {s : Set G} @[to_additive "The map `(x, y) ↦ (x, x + y)` as a `MeasurableEquiv`."] protected def MeasurableEquiv.shearMulRight [MeasurableInv G] : G Γ— G ≃ᡐ G Γ— G := { Equiv.prodShear (Equiv.refl _) Equiv.mulLeft with measurable_toFun := measurable_fst.prod_mk measurable_mul measurable_invFun := measurable_fst.prod_mk <| measurable_fst.inv.mul measurable_snd } #align measurable_equiv.shear_mul_right MeasurableEquiv.shearMulRight #align measurable_equiv.shear_add_right MeasurableEquiv.shearAddRight @[to_additive "The map `(x, y) ↦ (x, y - x)` as a `MeasurableEquiv` with as inverse `(x, y) ↦ (x, y + x)`."] protected def MeasurableEquiv.shearDivRight [MeasurableInv G] : G Γ— G ≃ᡐ G Γ— G := { Equiv.prodShear (Equiv.refl _) Equiv.divRight with measurable_toFun := measurable_fst.prod_mk <| measurable_snd.div measurable_fst measurable_invFun := measurable_fst.prod_mk <| measurable_snd.mul measurable_fst } #align measurable_equiv.shear_div_right MeasurableEquiv.shearDivRight #align measurable_equiv.shear_sub_right MeasurableEquiv.shearSubRight variable {G} namespace MeasureTheory open Measure section LeftInvariant @[to_additive measurePreserving_prod_add " The shear mapping `(x, y) ↦ (x, x + y)` preserves the measure `ΞΌ Γ— Ξ½`. "] theorem measurePreserving_prod_mul [IsMulLeftInvariant Ξ½] : MeasurePreserving (fun z : G Γ— G => (z.1, z.1 * z.2)) (ΞΌ.prod Ξ½) (ΞΌ.prod Ξ½) := (MeasurePreserving.id ΞΌ).skew_product measurable_mul <| Filter.eventually_of_forall <| map_mul_left_eq_self Ξ½ #align measure_theory.measure_preserving_prod_mul MeasureTheory.measurePreserving_prod_mul #align measure_theory.measure_preserving_prod_add MeasureTheory.measurePreserving_prod_add @[to_additive measurePreserving_prod_add_swap " The map `(x, y) ↦ (y, y + x)` sends the measure `ΞΌ Γ— Ξ½` to `Ξ½ Γ— ΞΌ`. "] theorem measurePreserving_prod_mul_swap [IsMulLeftInvariant ΞΌ] : MeasurePreserving (fun z : G Γ— G => (z.2, z.2 * z.1)) (ΞΌ.prod Ξ½) (Ξ½.prod ΞΌ) := (measurePreserving_prod_mul Ξ½ ΞΌ).comp measurePreserving_swap #align measure_theory.measure_preserving_prod_mul_swap MeasureTheory.measurePreserving_prod_mul_swap #align measure_theory.measure_preserving_prod_add_swap MeasureTheory.measurePreserving_prod_add_swap @[to_additive]
Mathlib/MeasureTheory/Group/Prod.lean
108
116
theorem measurable_measure_mul_right (hs : MeasurableSet s) : Measurable fun x => μ ((fun y => y * x) ⁻¹' s) := by
suffices Measurable fun y => ΞΌ ((fun x => (x, y)) ⁻¹' ((fun z : G Γ— G => ((1 : G), z.1 * z.2)) ⁻¹' univ Γ—Λ’ s)) by convert this using 1; ext1 x; congr 1 with y : 1; simp apply measurable_measure_prod_mk_right apply measurable_const.prod_mk measurable_mul (MeasurableSet.univ.prod hs) infer_instance
[ " Measurable fun x => ΞΌ ((fun y => y * x) ⁻¹' s)", " (fun x => ΞΌ ((fun y => y * x) ⁻¹' s)) = fun y => ΞΌ ((fun x => (x, y)) ⁻¹' ((fun z => (1, z.1 * z.2)) ⁻¹' univ Γ—Λ’ s))", " ΞΌ ((fun y => y * x) ⁻¹' s) = ΞΌ ((fun x_1 => (x_1, x)) ⁻¹' ((fun z => (1, z.1 * z.2)) ⁻¹' univ Γ—Λ’ s))", " y ∈ (fun y => y * x) ⁻¹' s ↔ y ...
import Mathlib.Data.Finsupp.ToDFinsupp import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.LinearIndependent #align_import linear_algebra.dfinsupp from "leanprover-community/mathlib"@"a148d797a1094ab554ad4183a4ad6f130358ef64" variable {ΞΉ : Type*} {R : Type*} {S : Type*} {M : ΞΉ β†’ Type*} {N : Type*} namespace DFinsupp variable [Semiring R] [βˆ€ i, AddCommMonoid (M i)] [βˆ€ i, Module R (M i)] variable [AddCommMonoid N] [Module R N] section DecidableEq variable [DecidableEq ΞΉ] def lmk (s : Finset ΞΉ) : (βˆ€ i : (↑s : Set ΞΉ), M i) β†’β‚—[R] Ξ β‚€ i, M i where toFun := mk s map_add' _ _ := mk_add map_smul' c x := mk_smul c x #align dfinsupp.lmk DFinsupp.lmk def lsingle (i) : M i β†’β‚—[R] Ξ β‚€ i, M i := { DFinsupp.singleAddHom _ _ with toFun := single i map_smul' := single_smul } #align dfinsupp.lsingle DFinsupp.lsingle theorem lhom_ext ⦃φ ψ : (Ξ β‚€ i, M i) β†’β‚—[R] N⦄ (h : βˆ€ i x, Ο† (single i x) = ψ (single i x)) : Ο† = ψ := LinearMap.toAddMonoidHom_injective <| addHom_ext h #align dfinsupp.lhom_ext DFinsupp.lhom_ext @[ext 1100] theorem lhom_ext' ⦃φ ψ : (Ξ β‚€ i, M i) β†’β‚—[R] N⦄ (h : βˆ€ i, Ο†.comp (lsingle i) = ψ.comp (lsingle i)) : Ο† = ψ := lhom_ext fun i => LinearMap.congr_fun (h i) #align dfinsupp.lhom_ext' DFinsupp.lhom_ext' def lapply (i : ΞΉ) : (Ξ β‚€ i, M i) β†’β‚—[R] M i where toFun f := f i map_add' f g := add_apply f g i map_smul' c f := smul_apply c f i #align dfinsupp.lapply DFinsupp.lapply -- This lemma has always been bad, but the linter only noticed after lean4#2644. @[simp, nolint simpNF] theorem lmk_apply (s : Finset ΞΉ) (x) : (lmk s : _ β†’β‚—[R] Ξ β‚€ i, M i) x = mk s x := rfl #align dfinsupp.lmk_apply DFinsupp.lmk_apply @[simp] theorem lsingle_apply (i : ΞΉ) (x : M i) : (lsingle i : (M i) β†’β‚—[R] _) x = single i x := rfl #align dfinsupp.lsingle_apply DFinsupp.lsingle_apply @[simp] theorem lapply_apply (i : ΞΉ) (f : Ξ β‚€ i, M i) : (lapply i : (Ξ β‚€ i, M i) β†’β‚—[R] _) f = f i := rfl #align dfinsupp.lapply_apply DFinsupp.lapply_apply section mapRange variable {Ξ² β₁ Ξ²β‚‚ : ΞΉ β†’ Type*} variable [βˆ€ i, AddCommMonoid (Ξ² i)] [βˆ€ i, AddCommMonoid (β₁ i)] [βˆ€ i, AddCommMonoid (Ξ²β‚‚ i)] variable [βˆ€ i, Module R (Ξ² i)] [βˆ€ i, Module R (β₁ i)] [βˆ€ i, Module R (Ξ²β‚‚ i)] theorem mapRange_smul (f : βˆ€ i, β₁ i β†’ Ξ²β‚‚ i) (hf : βˆ€ i, f i 0 = 0) (r : R) (hf' : βˆ€ i x, f i (r β€’ x) = r β€’ f i x) (g : Ξ β‚€ i, β₁ i) : mapRange f hf (r β€’ g) = r β€’ mapRange f hf g := by ext simp only [mapRange_apply f, coe_smul, Pi.smul_apply, hf'] #align dfinsupp.map_range_smul DFinsupp.mapRange_smul @[simps! apply] def mapRange.linearMap (f : βˆ€ i, β₁ i β†’β‚—[R] Ξ²β‚‚ i) : (Ξ β‚€ i, β₁ i) β†’β‚—[R] Ξ β‚€ i, Ξ²β‚‚ i := { mapRange.addMonoidHom fun i => (f i).toAddMonoidHom with toFun := mapRange (fun i x => f i x) fun i => (f i).map_zero map_smul' := fun r => mapRange_smul _ (fun i => (f i).map_zero) _ fun i => (f i).map_smul r } #align dfinsupp.map_range.linear_map DFinsupp.mapRange.linearMap @[simp]
Mathlib/LinearAlgebra/DFinsupp.lean
206
209
theorem mapRange.linearMap_id : (mapRange.linearMap fun i => (LinearMap.id : Ξ²β‚‚ i β†’β‚—[R] _)) = LinearMap.id := by
ext simp [linearMap]
[ " mapRange f hf (r β€’ g) = r β€’ mapRange f hf g", " (mapRange f hf (r β€’ g)) i✝ = (r β€’ mapRange f hf g) i✝", " (linearMap fun i => LinearMap.id) = LinearMap.id", " (((linearMap fun i => LinearMap.id) βˆ˜β‚— lsingle i✝¹) x✝) i✝ = ((LinearMap.id βˆ˜β‚— lsingle i✝¹) x✝) i✝" ]
import Mathlib.Topology.Sets.Closeds #align_import topology.noetherian_space from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" variable (Ξ± Ξ² : Type*) [TopologicalSpace Ξ±] [TopologicalSpace Ξ²] namespace TopologicalSpace @[mk_iff] class NoetherianSpace : Prop where wellFounded_opens : WellFounded ((Β· > Β·) : Opens Ξ± β†’ Opens Ξ± β†’ Prop) #align topological_space.noetherian_space TopologicalSpace.NoetherianSpace
Mathlib/Topology/NoetherianSpace.lean
53
56
theorem noetherianSpace_iff_opens : NoetherianSpace Ξ± ↔ βˆ€ s : Opens Ξ±, IsCompact (s : Set Ξ±) := by
rw [noetherianSpace_iff, CompleteLattice.wellFounded_iff_isSupFiniteCompact, CompleteLattice.isSupFiniteCompact_iff_all_elements_compact] exact forall_congr' Opens.isCompactElement_iff
[ " NoetherianSpace Ξ± ↔ βˆ€ (s : Opens Ξ±), IsCompact ↑s", " (βˆ€ (k : Opens Ξ±), CompleteLattice.IsCompactElement k) ↔ βˆ€ (s : Opens Ξ±), IsCompact ↑s" ]
import Mathlib.CategoryTheory.Subobject.Lattice #align_import category_theory.subobject.limits from "leanprover-community/mathlib"@"956af7c76589f444f2e1313911bad16366ea476d" universe v u noncomputable section open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Subobject Opposite variable {C : Type u} [Category.{v} C] {X Y Z : C} namespace CategoryTheory namespace Limits section Kernel variable [HasZeroMorphisms C] (f : X ⟢ Y) [HasKernel f] abbrev kernelSubobject : Subobject X := Subobject.mk (kernel.ΞΉ f) #align category_theory.limits.kernel_subobject CategoryTheory.Limits.kernelSubobject def kernelSubobjectIso : (kernelSubobject f : C) β‰… kernel f := Subobject.underlyingIso (kernel.ΞΉ f) #align category_theory.limits.kernel_subobject_iso CategoryTheory.Limits.kernelSubobjectIso @[reassoc (attr := simp), elementwise (attr := simp)]
Mathlib/CategoryTheory/Subobject/Limits.lean
98
100
theorem kernelSubobject_arrow : (kernelSubobjectIso f).hom ≫ kernel.ΞΉ f = (kernelSubobject f).arrow := by
simp [kernelSubobjectIso]
[ " (kernelSubobjectIso f).hom ≫ kernel.ΞΉ f = (kernelSubobject f).arrow" ]
import Mathlib.Data.Set.Pairwise.Basic import Mathlib.Data.Set.Lattice import Mathlib.Data.SetLike.Basic #align_import order.chain from "leanprover-community/mathlib"@"c227d107bbada5d0d9d20287e3282c0a7f1651a0" open scoped Classical open Set variable {Ξ± Ξ² : Type*} section Chain variable (r : Ξ± β†’ Ξ± β†’ Prop) local infixl:50 " β‰Ί " => r def IsChain (s : Set Ξ±) : Prop := s.Pairwise fun x y => x β‰Ί y ∨ y β‰Ί x #align is_chain IsChain def SuperChain (s t : Set Ξ±) : Prop := IsChain r t ∧ s βŠ‚ t #align super_chain SuperChain def IsMaxChain (s : Set Ξ±) : Prop := IsChain r s ∧ βˆ€ ⦃t⦄, IsChain r t β†’ s βŠ† t β†’ s = t #align is_max_chain IsMaxChain variable {r} {c c₁ cβ‚‚ c₃ s t : Set Ξ±} {a b x y : Ξ±} theorem isChain_empty : IsChain r βˆ… := Set.pairwise_empty _ #align is_chain_empty isChain_empty theorem Set.Subsingleton.isChain (hs : s.Subsingleton) : IsChain r s := hs.pairwise _ #align set.subsingleton.is_chain Set.Subsingleton.isChain theorem IsChain.mono : s βŠ† t β†’ IsChain r t β†’ IsChain r s := Set.Pairwise.mono #align is_chain.mono IsChain.mono theorem IsChain.mono_rel {r' : Ξ± β†’ Ξ± β†’ Prop} (h : IsChain r s) (h_imp : βˆ€ x y, r x y β†’ r' x y) : IsChain r' s := h.mono' fun x y => Or.imp (h_imp x y) (h_imp y x) #align is_chain.mono_rel IsChain.mono_rel theorem IsChain.symm (h : IsChain r s) : IsChain (flip r) s := h.mono' fun _ _ => Or.symm #align is_chain.symm IsChain.symm theorem isChain_of_trichotomous [IsTrichotomous Ξ± r] (s : Set Ξ±) : IsChain r s := fun a _ b _ hab => (trichotomous_of r a b).imp_right fun h => h.resolve_left hab #align is_chain_of_trichotomous isChain_of_trichotomous protected theorem IsChain.insert (hs : IsChain r s) (ha : βˆ€ b ∈ s, a β‰  b β†’ a β‰Ί b ∨ b β‰Ί a) : IsChain r (insert a s) := hs.insert_of_symmetric (fun _ _ => Or.symm) ha #align is_chain.insert IsChain.insert theorem isChain_univ_iff : IsChain r (univ : Set Ξ±) ↔ IsTrichotomous Ξ± r := by refine ⟨fun h => ⟨fun a b => ?_⟩, fun h => @isChain_of_trichotomous _ _ h univ⟩ rw [or_left_comm, or_iff_not_imp_left] exact h trivial trivial #align is_chain_univ_iff isChain_univ_iff theorem IsChain.image (r : Ξ± β†’ Ξ± β†’ Prop) (s : Ξ² β†’ Ξ² β†’ Prop) (f : Ξ± β†’ Ξ²) (h : βˆ€ x y, r x y β†’ s (f x) (f y)) {c : Set Ξ±} (hrc : IsChain r c) : IsChain s (f '' c) := fun _ ⟨_, ha₁, haβ‚‚βŸ© _ ⟨_, hb₁, hbβ‚‚βŸ© => haβ‚‚ β–Έ hbβ‚‚ β–Έ fun hxy => (hrc ha₁ hb₁ <| ne_of_apply_ne f hxy).imp (h _ _) (h _ _) #align is_chain.image IsChain.image
Mathlib/Order/Chain.lean
107
110
theorem Monotone.isChain_range [LinearOrder Ξ±] [Preorder Ξ²] {f : Ξ± β†’ Ξ²} (hf : Monotone f) : IsChain (Β· ≀ Β·) (range f) := by
rw [← image_univ] exact (isChain_of_trichotomous _).image (Β· ≀ Β·) _ _ hf
[ " IsChain r univ ↔ IsTrichotomous Ξ± r", " r a b ∨ a = b ∨ r b a", " Β¬a = b β†’ r a b ∨ r b a", " IsChain (fun x x_1 => x ≀ x_1) (range f)", " IsChain (fun x x_1 => x ≀ x_1) (f '' univ)" ]
import Mathlib.AlgebraicTopology.DoldKan.Normalized #align_import algebraic_topology.dold_kan.homotopy_equivalence from "leanprover-community/mathlib"@"f951e201d416fb50cc7826171d80aa510ec20747" open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Preadditive Simplicial DoldKan noncomputable section namespace AlgebraicTopology namespace DoldKan variable {C : Type*} [Category C] [Preadditive C] (X : SimplicialObject C) noncomputable def homotopyPToId : βˆ€ q : β„•, Homotopy (P q : K[X] ⟢ _) (πŸ™ _) | 0 => Homotopy.refl _ | q + 1 => by refine Homotopy.trans (Homotopy.ofEq ?_) (Homotopy.trans (Homotopy.add (homotopyPToId q) (Homotopy.compLeft (homotopyHΟƒToZero q) (P q))) (Homotopy.ofEq ?_)) Β· simp only [P_succ, comp_add, comp_id] Β· simp only [add_zero, comp_zero] set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.homotopy_P_to_id AlgebraicTopology.DoldKan.homotopyPToId def homotopyQToZero (q : β„•) : Homotopy (Q q : K[X] ⟢ _) 0 := Homotopy.equivSubZero.toFun (homotopyPToId X q).symm set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.homotopy_Q_to_zero AlgebraicTopology.DoldKan.homotopyQToZero
Mathlib/AlgebraicTopology/DoldKan/HomotopyEquivalence.lean
52
58
theorem homotopyPToId_eventually_constant {q n : β„•} (hqn : n < q) : ((homotopyPToId X (q + 1)).hom n (n + 1) : X _[n] ⟢ X _[n + 1]) = (homotopyPToId X q).hom n (n + 1) := by
simp only [homotopyHσToZero, AlternatingFaceMapComplex.obj_X, Nat.add_eq, Homotopy.trans_hom, Homotopy.ofEq_hom, Pi.zero_apply, Homotopy.add_hom, Homotopy.compLeft_hom, add_zero, Homotopy.nullHomotopy'_hom, ComplexShape.down_Rel, hσ'_eq_zero hqn (c_mk (n + 1) n rfl), dite_eq_ite, ite_self, comp_zero, zero_add, homotopyPToId]
[ " Homotopy (P (q + 1)) (πŸ™ K[X])", " P (q + 1) = P q + P q ≫ HΟƒ q", " πŸ™ K[X] + P q ≫ 0 = πŸ™ K[X]", " (homotopyPToId X (q + 1)).hom n (n + 1) = (homotopyPToId X q).hom n (n + 1)" ]
import Mathlib.Algebra.DirectSum.Module import Mathlib.Algebra.Module.Submodule.Basic #align_import algebra.direct_sum.decomposition from "leanprover-community/mathlib"@"4e861f25ba5ceef42ba0712d8ffeb32f38ad6441" variable {ΞΉ R M Οƒ : Type*} open DirectSum namespace DirectSum section AddCommMonoid variable [DecidableEq ΞΉ] [AddCommMonoid M] variable [SetLike Οƒ M] [AddSubmonoidClass Οƒ M] (β„³ : ΞΉ β†’ Οƒ) class Decomposition where decompose' : M β†’ ⨁ i, β„³ i left_inv : Function.LeftInverse (DirectSum.coeAddMonoidHom β„³) decompose' right_inv : Function.RightInverse (DirectSum.coeAddMonoidHom β„³) decompose' #align direct_sum.decomposition DirectSum.Decomposition instance : Subsingleton (Decomposition β„³) := ⟨fun x y ↦ by cases' x with x xl xr cases' y with y yl yr congr exact Function.LeftInverse.eq_rightInverse xr yl⟩ abbrev Decomposition.ofAddHom (decompose : M β†’+ ⨁ i, β„³ i) (h_left_inv : (DirectSum.coeAddMonoidHom β„³).comp decompose = .id _) (h_right_inv : decompose.comp (DirectSum.coeAddMonoidHom β„³) = .id _) : Decomposition β„³ where decompose' := decompose left_inv := DFunLike.congr_fun h_left_inv right_inv := DFunLike.congr_fun h_right_inv noncomputable def IsInternal.chooseDecomposition (h : IsInternal β„³) : DirectSum.Decomposition β„³ where decompose' := (Equiv.ofBijective _ h).symm left_inv := (Equiv.ofBijective _ h).right_inv right_inv := (Equiv.ofBijective _ h).left_inv variable [Decomposition β„³] protected theorem Decomposition.isInternal : DirectSum.IsInternal β„³ := ⟨Decomposition.right_inv.injective, Decomposition.left_inv.surjective⟩ #align direct_sum.decomposition.is_internal DirectSum.Decomposition.isInternal def decompose : M ≃ ⨁ i, β„³ i where toFun := Decomposition.decompose' invFun := DirectSum.coeAddMonoidHom β„³ left_inv := Decomposition.left_inv right_inv := Decomposition.right_inv #align direct_sum.decompose DirectSum.decompose protected theorem Decomposition.inductionOn {p : M β†’ Prop} (h_zero : p 0) (h_homogeneous : βˆ€ {i} (m : β„³ i), p (m : M)) (h_add : βˆ€ m m' : M, p m β†’ p m' β†’ p (m + m')) : βˆ€ m, p m := by let β„³' : ΞΉ β†’ AddSubmonoid M := fun i ↦ (βŸ¨βŸ¨β„³ i, fun x y ↦ AddMemClass.add_mem x y⟩, (ZeroMemClass.zero_mem _)⟩ : AddSubmonoid M) haveI t : DirectSum.Decomposition β„³' := { decompose' := DirectSum.decompose β„³ left_inv := fun _ ↦ (decompose β„³).left_inv _ right_inv := fun _ ↦ (decompose β„³).right_inv _ } have mem : βˆ€ m, m ∈ iSup β„³' := fun _m ↦ (DirectSum.IsInternal.addSubmonoid_iSup_eq_top β„³' (Decomposition.isInternal β„³')).symm β–Έ trivial -- Porting note: needs to use @ even though no implicit argument is provided exact fun m ↦ @AddSubmonoid.iSup_induction _ _ _ β„³' _ _ (mem m) (fun i m h ↦ h_homogeneous ⟨m, h⟩) h_zero h_add -- exact fun m ↦ -- AddSubmonoid.iSup_induction β„³' (mem m) (fun i m h ↦ h_homogeneous ⟨m, h⟩) h_zero h_add #align direct_sum.decomposition.induction_on DirectSum.Decomposition.inductionOn @[simp] theorem Decomposition.decompose'_eq : Decomposition.decompose' = decompose β„³ := rfl #align direct_sum.decomposition.decompose'_eq DirectSum.Decomposition.decompose'_eq @[simp] theorem decompose_symm_of {i : ΞΉ} (x : β„³ i) : (decompose β„³).symm (DirectSum.of _ i x) = x := DirectSum.coeAddMonoidHom_of β„³ _ _ #align direct_sum.decompose_symm_of DirectSum.decompose_symm_of @[simp] theorem decompose_coe {i : ΞΉ} (x : β„³ i) : decompose β„³ (x : M) = DirectSum.of _ i x := by rw [← decompose_symm_of _, Equiv.apply_symm_apply] #align direct_sum.decompose_coe DirectSum.decompose_coe theorem decompose_of_mem {x : M} {i : ΞΉ} (hx : x ∈ β„³ i) : decompose β„³ x = DirectSum.of (fun i ↦ β„³ i) i ⟨x, hx⟩ := decompose_coe _ ⟨x, hx⟩ #align direct_sum.decompose_of_mem DirectSum.decompose_of_mem theorem decompose_of_mem_same {x : M} {i : ΞΉ} (hx : x ∈ β„³ i) : (decompose β„³ x i : M) = x := by rw [decompose_of_mem _ hx, DirectSum.of_eq_same, Subtype.coe_mk] #align direct_sum.decompose_of_mem_same DirectSum.decompose_of_mem_same theorem decompose_of_mem_ne {x : M} {i j : ΞΉ} (hx : x ∈ β„³ i) (hij : i β‰  j) : (decompose β„³ x j : M) = 0 := by rw [decompose_of_mem _ hx, DirectSum.of_eq_of_ne _ _ _ _ hij, ZeroMemClass.coe_zero] #align direct_sum.decompose_of_mem_ne DirectSum.decompose_of_mem_ne
Mathlib/Algebra/DirectSum/Decomposition.lean
145
147
theorem degree_eq_of_mem_mem {x : M} {i j : ΞΉ} (hxi : x ∈ β„³ i) (hxj : x ∈ β„³ j) (hx : x β‰  0) : i = j := by
contrapose! hx; rw [← decompose_of_mem_same β„³ hxj, decompose_of_mem_ne β„³ hxi hx]
[ " x = y", " { decompose' := x, left_inv := xl, right_inv := xr } = y", " { decompose' := x, left_inv := xl, right_inv := xr } = { decompose' := y, left_inv := yl, right_inv := yr }", " βˆ€ (m : M), p m", " (decompose β„³) ↑x = (of (fun i => β†₯(β„³ i)) i) x", " ↑(((decompose β„³) x) i) = x", " ↑(((decompose β„³) x)...
import Mathlib.Topology.Sheaves.PUnit import Mathlib.Topology.Sheaves.Stalks import Mathlib.Topology.Sheaves.Functors #align_import topology.sheaves.skyscraper from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open TopologicalSpace TopCat CategoryTheory CategoryTheory.Limits Opposite universe u v w variable {X : TopCat.{u}} (pβ‚€ : X) [βˆ€ U : Opens X, Decidable (pβ‚€ ∈ U)] section variable {C : Type v} [Category.{w} C] [HasTerminal C] (A : C) @[simps] def skyscraperPresheaf : Presheaf C X where obj U := if pβ‚€ ∈ unop U then A else terminal C map {U V} i := if h : pβ‚€ ∈ unop V then eqToHom <| by dsimp; erw [if_pos h, if_pos (leOfHom i.unop h)] else ((if_neg h).symm.ndrec terminalIsTerminal).from _ map_id U := (em (pβ‚€ ∈ U.unop)).elim (fun h => dif_pos h) fun h => ((if_neg h).symm.ndrec terminalIsTerminal).hom_ext _ _ map_comp {U V W} iVU iWV := by by_cases hW : pβ‚€ ∈ unop W Β· have hV : pβ‚€ ∈ unop V := leOfHom iWV.unop hW simp only [dif_pos hW, dif_pos hV, eqToHom_trans] Β· dsimp; rw [dif_neg hW]; apply ((if_neg hW).symm.ndrec terminalIsTerminal).hom_ext #align skyscraper_presheaf skyscraperPresheaf
Mathlib/Topology/Sheaves/Skyscraper.lean
68
74
theorem skyscraperPresheaf_eq_pushforward [hd : βˆ€ U : Opens (TopCat.of PUnit.{u + 1}), Decidable (PUnit.unit ∈ U)] : skyscraperPresheaf pβ‚€ A = ContinuousMap.const (TopCat.of PUnit) pβ‚€ _* skyscraperPresheaf (X := TopCat.of PUnit) PUnit.unit A := by
convert_to @skyscraperPresheaf X pβ‚€ (fun U => hd <| (Opens.map <| ContinuousMap.const _ pβ‚€).obj U) C _ _ A = _ <;> congr
[ " (fun U => if pβ‚€ ∈ U.unop then A else ⊀_ C) U = (fun U => if pβ‚€ ∈ U.unop then A else ⊀_ C) V", " (if pβ‚€ ∈ U.unop then A else ⊀_ C) = if pβ‚€ ∈ V.unop then A else ⊀_ C", " { obj := fun U => if pβ‚€ ∈ U.unop then A else ⊀_ C,\n map := fun {U V} i =>\n if h : pβ‚€ ∈ V.unop then eqToHom β‹―\n ...
import Mathlib.MeasureTheory.Group.Measure assert_not_exists NormedSpace namespace MeasureTheory open Measure TopologicalSpace open scoped ENNReal variable {G : Type*} [MeasurableSpace G] {ΞΌ : Measure G} {g : G} section MeasurableMul variable [Group G] [MeasurableMul G] @[to_additive "Translating a function by left-addition does not change its Lebesgue integral with respect to a left-invariant measure."] theorem lintegral_mul_left_eq_self [IsMulLeftInvariant ΞΌ] (f : G β†’ ℝβ‰₯0∞) (g : G) : (∫⁻ x, f (g * x) βˆ‚ΞΌ) = ∫⁻ x, f x βˆ‚ΞΌ := by convert (lintegral_map_equiv f <| MeasurableEquiv.mulLeft g).symm simp [map_mul_left_eq_self ΞΌ g] #align measure_theory.lintegral_mul_left_eq_self MeasureTheory.lintegral_mul_left_eq_self #align measure_theory.lintegral_add_left_eq_self MeasureTheory.lintegral_add_left_eq_self @[to_additive "Translating a function by right-addition does not change its Lebesgue integral with respect to a right-invariant measure."]
Mathlib/MeasureTheory/Group/LIntegral.lean
46
49
theorem lintegral_mul_right_eq_self [IsMulRightInvariant ΞΌ] (f : G β†’ ℝβ‰₯0∞) (g : G) : (∫⁻ x, f (x * g) βˆ‚ΞΌ) = ∫⁻ x, f x βˆ‚ΞΌ := by
convert (lintegral_map_equiv f <| MeasurableEquiv.mulRight g).symm using 1 simp [map_mul_right_eq_self ΞΌ g]
[ " ∫⁻ (x : G), f (g * x) βˆ‚ΞΌ = ∫⁻ (x : G), f x βˆ‚ΞΌ", " ΞΌ = map (⇑(MeasurableEquiv.mulLeft g)) ΞΌ", " ∫⁻ (x : G), f (x * g) βˆ‚ΞΌ = ∫⁻ (x : G), f x βˆ‚ΞΌ", " ∫⁻ (x : G), f x βˆ‚ΞΌ = ∫⁻ (a : G), f a βˆ‚map (⇑(MeasurableEquiv.mulRight g)) ΞΌ" ]
import Mathlib.Topology.Instances.ENNReal import Mathlib.MeasureTheory.Measure.Dirac #align_import probability.probability_mass_function.basic from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d" noncomputable section variable {Ξ± Ξ² Ξ³ : Type*} open scoped Classical open NNReal ENNReal MeasureTheory def PMF.{u} (Ξ± : Type u) : Type u := { f : Ξ± β†’ ℝβ‰₯0∞ // HasSum f 1 } #align pmf PMF namespace PMF instance instFunLike : FunLike (PMF Ξ±) Ξ± ℝβ‰₯0∞ where coe p a := p.1 a coe_injective' _ _ h := Subtype.eq h #align pmf.fun_like PMF.instFunLike @[ext] protected theorem ext {p q : PMF Ξ±} (h : βˆ€ x, p x = q x) : p = q := DFunLike.ext p q h #align pmf.ext PMF.ext theorem ext_iff {p q : PMF Ξ±} : p = q ↔ βˆ€ x, p x = q x := DFunLike.ext_iff #align pmf.ext_iff PMF.ext_iff theorem hasSum_coe_one (p : PMF Ξ±) : HasSum p 1 := p.2 #align pmf.has_sum_coe_one PMF.hasSum_coe_one @[simp] theorem tsum_coe (p : PMF Ξ±) : βˆ‘' a, p a = 1 := p.hasSum_coe_one.tsum_eq #align pmf.tsum_coe PMF.tsum_coe theorem tsum_coe_ne_top (p : PMF Ξ±) : βˆ‘' a, p a β‰  ∞ := p.tsum_coe.symm β–Έ ENNReal.one_ne_top #align pmf.tsum_coe_ne_top PMF.tsum_coe_ne_top theorem tsum_coe_indicator_ne_top (p : PMF Ξ±) (s : Set Ξ±) : βˆ‘' a, s.indicator p a β‰  ∞ := ne_of_lt (lt_of_le_of_lt (tsum_le_tsum (fun _ => Set.indicator_apply_le fun _ => le_rfl) ENNReal.summable ENNReal.summable) (lt_of_le_of_ne le_top p.tsum_coe_ne_top)) #align pmf.tsum_coe_indicator_ne_top PMF.tsum_coe_indicator_ne_top @[simp] theorem coe_ne_zero (p : PMF Ξ±) : ⇑p β‰  0 := fun hp => zero_ne_one ((tsum_zero.symm.trans (tsum_congr fun x => symm (congr_fun hp x))).trans p.tsum_coe) #align pmf.coe_ne_zero PMF.coe_ne_zero def support (p : PMF Ξ±) : Set Ξ± := Function.support p #align pmf.support PMF.support @[simp] theorem mem_support_iff (p : PMF Ξ±) (a : Ξ±) : a ∈ p.support ↔ p a β‰  0 := Iff.rfl #align pmf.mem_support_iff PMF.mem_support_iff @[simp] theorem support_nonempty (p : PMF Ξ±) : p.support.Nonempty := Function.support_nonempty_iff.2 p.coe_ne_zero #align pmf.support_nonempty PMF.support_nonempty @[simp] theorem support_countable (p : PMF Ξ±) : p.support.Countable := Summable.countable_support_ennreal (tsum_coe_ne_top p) theorem apply_eq_zero_iff (p : PMF Ξ±) (a : Ξ±) : p a = 0 ↔ a βˆ‰ p.support := by rw [mem_support_iff, Classical.not_not] #align pmf.apply_eq_zero_iff PMF.apply_eq_zero_iff theorem apply_pos_iff (p : PMF Ξ±) (a : Ξ±) : 0 < p a ↔ a ∈ p.support := pos_iff_ne_zero.trans (p.mem_support_iff a).symm #align pmf.apply_pos_iff PMF.apply_pos_iff theorem apply_eq_one_iff (p : PMF Ξ±) (a : Ξ±) : p a = 1 ↔ p.support = {a} := by refine ⟨fun h => Set.Subset.antisymm (fun a' ha' => by_contra fun ha => ?_) fun a' ha' => ha'.symm β–Έ (p.mem_support_iff a).2 fun ha => zero_ne_one <| ha.symm.trans h, fun h => _root_.trans (symm <| tsum_eq_single a fun a' ha' => (p.apply_eq_zero_iff a').2 (h.symm β–Έ ha')) p.tsum_coe⟩ suffices 1 < βˆ‘' a, p a from ne_of_lt this p.tsum_coe.symm have : 0 < βˆ‘' b, ite (b = a) 0 (p b) := lt_of_le_of_ne' zero_le' ((tsum_ne_zero_iff ENNReal.summable).2 ⟨a', ite_ne_left_iff.2 ⟨ha, Ne.symm <| (p.mem_support_iff a').2 ha'⟩⟩) calc 1 = 1 + 0 := (add_zero 1).symm _ < p a + βˆ‘' b, ite (b = a) 0 (p b) := (ENNReal.add_lt_add_of_le_of_lt ENNReal.one_ne_top (le_of_eq h.symm) this) _ = ite (a = a) (p a) 0 + βˆ‘' b, ite (b = a) 0 (p b) := by rw [eq_self_iff_true, if_true] _ = (βˆ‘' b, ite (b = a) (p b) 0) + βˆ‘' b, ite (b = a) 0 (p b) := by congr exact symm (tsum_eq_single a fun b hb => if_neg hb) _ = βˆ‘' b, (ite (b = a) (p b) 0 + ite (b = a) 0 (p b)) := ENNReal.tsum_add.symm _ = βˆ‘' b, p b := tsum_congr fun b => by split_ifs <;> simp only [zero_add, add_zero, le_rfl] #align pmf.apply_eq_one_iff PMF.apply_eq_one_iff
Mathlib/Probability/ProbabilityMassFunction/Basic.lean
136
138
theorem coe_le_one (p : PMF Ξ±) (a : Ξ±) : p a ≀ 1 := by
refine hasSum_le (fun b => ?_) (hasSum_ite_eq a (p a)) (hasSum_coe_one p) split_ifs with h <;> simp only [h, zero_le', le_rfl]
[ " p a = 0 ↔ a βˆ‰ p.support", " p a = 1 ↔ p.support = {a}", " False", " 1 < βˆ‘' (a : Ξ±), p a", " (p a + βˆ‘' (b : Ξ±), if b = a then 0 else p b) = (if a = a then p a else 0) + βˆ‘' (b : Ξ±), if b = a then 0 else p b", " ((if a = a then p a else 0) + βˆ‘' (b : Ξ±), if b = a then 0 else p b) =\n (βˆ‘' (b : Ξ±), if b = ...
import Mathlib.Data.List.Nodup #align_import data.list.duplicate from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" variable {Ξ± : Type*} namespace List inductive Duplicate (x : Ξ±) : List Ξ± β†’ Prop | cons_mem {l : List Ξ±} : x ∈ l β†’ Duplicate x (x :: l) | cons_duplicate {y : Ξ±} {l : List Ξ±} : Duplicate x l β†’ Duplicate x (y :: l) #align list.duplicate List.Duplicate local infixl:50 " ∈+ " => List.Duplicate variable {l : List Ξ±} {x : Ξ±} theorem Mem.duplicate_cons_self (h : x ∈ l) : x ∈+ x :: l := Duplicate.cons_mem h #align list.mem.duplicate_cons_self List.Mem.duplicate_cons_self theorem Duplicate.duplicate_cons (h : x ∈+ l) (y : Ξ±) : x ∈+ y :: l := Duplicate.cons_duplicate h #align list.duplicate.duplicate_cons List.Duplicate.duplicate_cons theorem Duplicate.mem (h : x ∈+ l) : x ∈ l := by induction' h with l' _ y l' _ hm Β· exact mem_cons_self _ _ Β· exact mem_cons_of_mem _ hm #align list.duplicate.mem List.Duplicate.mem theorem Duplicate.mem_cons_self (h : x ∈+ x :: l) : x ∈ l := by cases' h with _ h _ _ h Β· exact h Β· exact h.mem #align list.duplicate.mem_cons_self List.Duplicate.mem_cons_self @[simp] theorem duplicate_cons_self_iff : x ∈+ x :: l ↔ x ∈ l := ⟨Duplicate.mem_cons_self, Mem.duplicate_cons_self⟩ #align list.duplicate_cons_self_iff List.duplicate_cons_self_iff theorem Duplicate.ne_nil (h : x ∈+ l) : l β‰  [] := fun H => (mem_nil_iff x).mp (H β–Έ h.mem) #align list.duplicate.ne_nil List.Duplicate.ne_nil @[simp] theorem not_duplicate_nil (x : Ξ±) : Β¬x ∈+ [] := fun H => H.ne_nil rfl #align list.not_duplicate_nil List.not_duplicate_nil theorem Duplicate.ne_singleton (h : x ∈+ l) (y : Ξ±) : l β‰  [y] := by induction' h with l' h z l' h _ Β· simp [ne_nil_of_mem h] Β· simp [ne_nil_of_mem h.mem] #align list.duplicate.ne_singleton List.Duplicate.ne_singleton @[simp] theorem not_duplicate_singleton (x y : Ξ±) : Β¬x ∈+ [y] := fun H => H.ne_singleton _ rfl #align list.not_duplicate_singleton List.not_duplicate_singleton theorem Duplicate.elim_nil (h : x ∈+ []) : False := not_duplicate_nil x h #align list.duplicate.elim_nil List.Duplicate.elim_nil theorem Duplicate.elim_singleton {y : Ξ±} (h : x ∈+ [y]) : False := not_duplicate_singleton x y h #align list.duplicate.elim_singleton List.Duplicate.elim_singleton theorem duplicate_cons_iff {y : Ξ±} : x ∈+ y :: l ↔ y = x ∧ x ∈ l ∨ x ∈+ l := by refine ⟨fun h => ?_, fun h => ?_⟩ Β· cases' h with _ hm _ _ hm Β· exact Or.inl ⟨rfl, hm⟩ Β· exact Or.inr hm Β· rcases h with (⟨rfl | h⟩ | h) Β· simpa Β· exact h.cons_duplicate #align list.duplicate_cons_iff List.duplicate_cons_iff
Mathlib/Data/List/Duplicate.lean
98
99
theorem Duplicate.of_duplicate_cons {y : Ξ±} (h : x ∈+ y :: l) (hx : x β‰  y) : x ∈+ l := by
simpa [duplicate_cons_iff, hx.symm] using h
[ " x ∈ l", " x ∈ x :: l'", " x ∈ y :: l'", " l β‰  [y]", " x :: l' β‰  [y]", " z :: l' β‰  [y]", " x ∈+ y :: l ↔ y = x ∧ x ∈ l ∨ x ∈+ l", " y = x ∧ x ∈ l ∨ x ∈+ l", " x = x ∧ x ∈ l ∨ x ∈+ l", " x ∈+ y :: l", " x ∈+ x :: l", " x ∈+ l" ]
import Mathlib.Data.Set.Pointwise.Interval import Mathlib.Topology.Algebra.Field import Mathlib.Topology.Algebra.Order.Group #align_import topology.algebra.order.field from "leanprover-community/mathlib"@"9a59dcb7a2d06bf55da57b9030169219980660cd" open Set Filter TopologicalSpace Function open scoped Pointwise Topology open OrderDual (toDual ofDual) theorem TopologicalRing.of_norm {R π•œ : Type*} [NonUnitalNonAssocRing R] [LinearOrderedField π•œ] [TopologicalSpace R] [TopologicalAddGroup R] (norm : R β†’ π•œ) (norm_nonneg : βˆ€ x, 0 ≀ norm x) (norm_mul_le : βˆ€ x y, norm (x * y) ≀ norm x * norm y) (nhds_basis : (𝓝 (0 : R)).HasBasis ((0 : π•œ) < Β·) (fun Ξ΅ ↦ { x | norm x < Ξ΅ })) : TopologicalRing R := by have h0 : βˆ€ f : R β†’ R, βˆ€ c β‰₯ (0 : π•œ), (βˆ€ x, norm (f x) ≀ c * norm x) β†’ Tendsto f (𝓝 0) (𝓝 0) := by refine fun f c c0 hf ↦ (nhds_basis.tendsto_iff nhds_basis).2 fun Ξ΅ Ξ΅0 ↦ ?_ rcases exists_pos_mul_lt Ξ΅0 c with ⟨δ, Ξ΄0, hδ⟩ refine ⟨δ, Ξ΄0, fun x hx ↦ (hf _).trans_lt ?_⟩ exact (mul_le_mul_of_nonneg_left (le_of_lt hx) c0).trans_lt hΞ΄ apply TopologicalRing.of_addGroup_of_nhds_zero case hmul => refine ((nhds_basis.prod nhds_basis).tendsto_iff nhds_basis).2 fun Ξ΅ Ξ΅0 ↦ ?_ refine ⟨(1, Ξ΅), ⟨one_pos, Ξ΅0⟩, fun (x, y) ⟨hx, hy⟩ => ?_⟩ simp only [sub_zero] at * calc norm (x * y) ≀ norm x * norm y := norm_mul_le _ _ _ < Ξ΅ := mul_lt_of_le_one_of_lt_of_nonneg hx.le hy (norm_nonneg _) case hmul_left => exact fun x => h0 _ (norm x) (norm_nonneg _) (norm_mul_le x) case hmul_right => exact fun y => h0 (Β· * y) (norm y) (norm_nonneg y) fun x => (norm_mul_le x y).trans_eq (mul_comm _ _) variable {π•œ Ξ± : Type*} [LinearOrderedField π•œ] [TopologicalSpace π•œ] [OrderTopology π•œ] {l : Filter Ξ±} {f g : Ξ± β†’ π•œ} -- see Note [lower instance priority] instance (priority := 100) LinearOrderedField.topologicalRing : TopologicalRing π•œ := .of_norm abs abs_nonneg (fun _ _ ↦ (abs_mul _ _).le) <| by simpa using nhds_basis_abs_sub_lt (0 : π•œ) theorem Filter.Tendsto.atTop_mul {C : π•œ} (hC : 0 < C) (hf : Tendsto f l atTop) (hg : Tendsto g l (𝓝 C)) : Tendsto (fun x => f x * g x) l atTop := by refine tendsto_atTop_mono' _ ?_ (hf.atTop_mul_const (half_pos hC)) filter_upwards [hg.eventually (lt_mem_nhds (half_lt_self hC)), hf.eventually_ge_atTop 0] with x hg hf using mul_le_mul_of_nonneg_left hg.le hf #align filter.tendsto.at_top_mul Filter.Tendsto.atTop_mul theorem Filter.Tendsto.mul_atTop {C : π•œ} (hC : 0 < C) (hf : Tendsto f l (𝓝 C)) (hg : Tendsto g l atTop) : Tendsto (fun x => f x * g x) l atTop := by simpa only [mul_comm] using hg.atTop_mul hC hf #align filter.tendsto.mul_at_top Filter.Tendsto.mul_atTop theorem Filter.Tendsto.atTop_mul_neg {C : π•œ} (hC : C < 0) (hf : Tendsto f l atTop) (hg : Tendsto g l (𝓝 C)) : Tendsto (fun x => f x * g x) l atBot := by have := hf.atTop_mul (neg_pos.2 hC) hg.neg simpa only [(Β· ∘ Β·), neg_mul_eq_mul_neg, neg_neg] using tendsto_neg_atTop_atBot.comp this #align filter.tendsto.at_top_mul_neg Filter.Tendsto.atTop_mul_neg theorem Filter.Tendsto.neg_mul_atTop {C : π•œ} (hC : C < 0) (hf : Tendsto f l (𝓝 C)) (hg : Tendsto g l atTop) : Tendsto (fun x => f x * g x) l atBot := by simpa only [mul_comm] using hg.atTop_mul_neg hC hf #align filter.tendsto.neg_mul_at_top Filter.Tendsto.neg_mul_atTop
Mathlib/Topology/Algebra/Order/Field.lean
94
97
theorem Filter.Tendsto.atBot_mul {C : π•œ} (hC : 0 < C) (hf : Tendsto f l atBot) (hg : Tendsto g l (𝓝 C)) : Tendsto (fun x => f x * g x) l atBot := by
have := (tendsto_neg_atBot_atTop.comp hf).atTop_mul hC hg simpa [(· ∘ ·)] using tendsto_neg_atTop_atBot.comp this
[ " TopologicalRing R", " βˆ€ (f : R β†’ R), βˆ€ c β‰₯ 0, (βˆ€ (x : R), norm (f x) ≀ c * norm x) β†’ Tendsto f (𝓝 0) (𝓝 0)", " βˆƒ ia, 0 < ia ∧ βˆ€ x ∈ {x | norm x < ia}, f x ∈ {x | norm x < Ξ΅}", " c * norm x < Ξ΅", " βˆ€ (xβ‚€ : R), Tendsto (fun x => x * xβ‚€) (𝓝 0) (𝓝 0)", " Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 0 Γ—Λ’ οΏ½...
import Mathlib.Algebra.BigOperators.Ring.List import Mathlib.Data.Nat.ModEq import Mathlib.Data.Nat.GCD.BigOperators namespace Nat variable {ΞΉ : Type*} lemma modEq_list_prod_iff {a b} {l : List β„•} (co : l.Pairwise Coprime) : a ≑ b [MOD l.prod] ↔ βˆ€ i, a ≑ b [MOD l.get i] := by induction' l with m l ih Β· simp [modEq_one] Β· have : Coprime m l.prod := coprime_list_prod_right_iff.mpr (List.pairwise_cons.mp co).1 simp only [List.prod_cons, ← modEq_and_modEq_iff_modEq_mul this, ih (List.Pairwise.of_cons co), List.length_cons] constructor Β· rintro ⟨h0, hs⟩ i cases i using Fin.cases <;> simp [h0, hs] Β· intro h; exact ⟨h 0, fun i => h i.succ⟩ lemma modEq_list_prod_iff' {a b} {s : ΞΉ β†’ β„•} {l : List ΞΉ} (co : l.Pairwise (Coprime on s)) : a ≑ b [MOD (l.map s).prod] ↔ βˆ€ i ∈ l, a ≑ b [MOD s i] := by induction' l with i l ih Β· simp [modEq_one] Β· have : Coprime (s i) (l.map s).prod := by simp only [coprime_list_prod_right_iff, List.mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ‚‚] intro j hj exact (List.pairwise_cons.mp co).1 j hj simp [← modEq_and_modEq_iff_modEq_mul this, ih (List.Pairwise.of_cons co)] variable (a s : ΞΉ β†’ β„•) def chineseRemainderOfList : (l : List ΞΉ) β†’ l.Pairwise (Coprime on s) β†’ { k // βˆ€ i ∈ l, k ≑ a i [MOD s i] } | [], _ => ⟨0, by simp⟩ | i :: l, co => by have : Coprime (s i) (l.map s).prod := by simp only [coprime_list_prod_right_iff, List.mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ‚‚] intro j hj exact (List.pairwise_cons.mp co).1 j hj have ih := chineseRemainderOfList l co.of_cons have k := chineseRemainder this (a i) ih use k simp only [List.mem_cons, forall_eq_or_imp, k.prop.1, true_and] intro j hj exact ((modEq_list_prod_iff' co.of_cons).mp k.prop.2 j hj).trans (ih.prop j hj) @[simp] theorem chineseRemainderOfList_nil : (chineseRemainderOfList a s [] List.Pairwise.nil : β„•) = 0 := rfl theorem chineseRemainderOfList_lt_prod (l : List ΞΉ) (co : l.Pairwise (Coprime on s)) (hs : βˆ€ i ∈ l, s i β‰  0) : chineseRemainderOfList a s l co < (l.map s).prod := by cases l with | nil => simp | cons i l => simp only [chineseRemainderOfList, List.map_cons, List.prod_cons] have : Coprime (s i) (l.map s).prod := by simp only [coprime_list_prod_right_iff, List.mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ‚‚] intro j hj exact (List.pairwise_cons.mp co).1 j hj refine chineseRemainder_lt_mul this (a i) (chineseRemainderOfList a s l co.of_cons) (hs i (List.mem_cons_self _ l)) ?_ simp only [ne_eq, List.prod_eq_zero_iff, List.mem_map, not_exists, not_and] intro j hj exact hs j (List.mem_cons_of_mem _ hj)
Mathlib/Data/Nat/ChineseRemainder.lean
93
105
theorem chineseRemainderOfList_modEq_unique (l : List ΞΉ) (co : l.Pairwise (Coprime on s)) {z} (hz : βˆ€ i ∈ l, z ≑ a i [MOD s i]) : z ≑ chineseRemainderOfList a s l co [MOD (l.map s).prod] := by
induction' l with i l ih Β· simp [modEq_one] Β· simp only [List.map_cons, List.prod_cons, chineseRemainderOfList] have : Coprime (s i) (l.map s).prod := by simp only [coprime_list_prod_right_iff, List.mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ‚‚] intro j hj exact (List.pairwise_cons.mp co).1 j hj exact chineseRemainder_modEq_unique this (hz i (List.mem_cons_self _ _)) (ih co.of_cons (fun j hj => hz j (List.mem_cons_of_mem _ hj)))
[ " a ≑ b [MOD l.prod] ↔ βˆ€ (i : Fin l.length), a ≑ b [MOD l.get i]", " a ≑ b [MOD [].prod] ↔ βˆ€ (i : Fin [].length), a ≑ b [MOD [].get i]", " a ≑ b [MOD (m :: l).prod] ↔ βˆ€ (i : Fin (m :: l).length), a ≑ b [MOD (m :: l).get i]", " (a ≑ b [MOD m] ∧ βˆ€ (i : Fin l.length), a ≑ b [MOD l.get i]) ↔ βˆ€ (i : Fin l.length.s...
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]
Mathlib/GroupTheory/FreeAbelianGroupFinsupp.lean
54
59
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]
[ " 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.Algebra.Order.Monoid.Unbundled.MinMax import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Finset.Image import Mathlib.Data.Multiset.Fold #align_import data.finset.fold from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" -- TODO: -- assert_not_exists OrderedCommMonoid assert_not_exists MonoidWithZero namespace Finset open Multiset variable {Ξ± Ξ² Ξ³ : Type*} section Fold variable (op : Ξ² β†’ Ξ² β†’ Ξ²) [hc : Std.Commutative op] [ha : Std.Associative op] local notation a " * " b => op a b def fold (b : Ξ²) (f : Ξ± β†’ Ξ²) (s : Finset Ξ±) : Ξ² := (s.1.map f).fold op b #align finset.fold Finset.fold variable {op} {f : Ξ± β†’ Ξ²} {b : Ξ²} {s : Finset Ξ±} {a : Ξ±} @[simp] theorem fold_empty : (βˆ… : Finset Ξ±).fold op b f = b := rfl #align finset.fold_empty Finset.fold_empty @[simp]
Mathlib/Data/Finset/Fold.lean
50
52
theorem fold_cons (h : a βˆ‰ s) : (cons a s h).fold op b f = f a * s.fold op b f := by
dsimp only [fold] rw [cons_val, Multiset.map_cons, fold_cons_left]
[ " fold op b f (cons a s h) = op (f a) (fold op b f s)", " Multiset.fold op b (Multiset.map f (cons a s h).val) = op (f a) (Multiset.fold op b (Multiset.map f s.val))" ]
import Mathlib.Algebra.GradedMonoid import Mathlib.Algebra.Order.Monoid.Canonical.Defs import Mathlib.Algebra.MvPolynomial.Basic #align_import ring_theory.mv_polynomial.weighted_homogeneous from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finset Finsupp AddMonoidAlgebra variable {R M : Type*} [CommSemiring R] namespace MvPolynomial variable {Οƒ : Type*} section AddCommMonoid variable [AddCommMonoid M] def weightedDegree (w : Οƒ β†’ M) : (Οƒ β†’β‚€ β„•) β†’+ M := (Finsupp.total Οƒ M β„• w).toAddMonoidHom #align mv_polynomial.weighted_degree' MvPolynomial.weightedDegree theorem weightedDegree_apply (w : Οƒ β†’ M) (f : Οƒ β†’β‚€ β„•): weightedDegree w f = Finsupp.sum f (fun i c => c β€’ w i) := by rfl section SemilatticeSup variable [SemilatticeSup M] def weightedTotalDegree' (w : Οƒ β†’ M) (p : MvPolynomial Οƒ R) : WithBot M := p.support.sup fun s => weightedDegree w s #align mv_polynomial.weighted_total_degree' MvPolynomial.weightedTotalDegree' theorem weightedTotalDegree'_eq_bot_iff (w : Οƒ β†’ M) (p : MvPolynomial Οƒ R) : weightedTotalDegree' w p = βŠ₯ ↔ p = 0 := by simp only [weightedTotalDegree', Finset.sup_eq_bot_iff, mem_support_iff, WithBot.coe_ne_bot, MvPolynomial.eq_zero_iff] exact forall_congr' fun _ => Classical.not_not #align mv_polynomial.weighted_total_degree'_eq_bot_iff MvPolynomial.weightedTotalDegree'_eq_bot_iff theorem weightedTotalDegree'_zero (w : Οƒ β†’ M) : weightedTotalDegree' w (0 : MvPolynomial Οƒ R) = βŠ₯ := by simp only [weightedTotalDegree', support_zero, Finset.sup_empty] #align mv_polynomial.weighted_total_degree'_zero MvPolynomial.weightedTotalDegree'_zero def IsWeightedHomogeneous (w : Οƒ β†’ M) (Ο† : MvPolynomial Οƒ R) (m : M) : Prop := βˆ€ ⦃d⦄, coeff d Ο† β‰  0 β†’ weightedDegree w d = m #align mv_polynomial.is_weighted_homogeneous MvPolynomial.IsWeightedHomogeneous variable (R) def weightedHomogeneousSubmodule (w : Οƒ β†’ M) (m : M) : Submodule R (MvPolynomial Οƒ R) where carrier := { x | x.IsWeightedHomogeneous w m } smul_mem' r a ha c hc := by rw [coeff_smul] at hc exact ha (right_ne_zero_of_mul hc) zero_mem' d hd := False.elim (hd <| coeff_zero _) add_mem' {a} {b} ha hb c hc := by rw [coeff_add] at hc obtain h | h : coeff c a β‰  0 ∨ coeff c b β‰  0 := by contrapose! hc simp only [hc, add_zero] Β· exact ha h Β· exact hb h #align mv_polynomial.weighted_homogeneous_submodule MvPolynomial.weightedHomogeneousSubmodule @[simp] theorem mem_weightedHomogeneousSubmodule (w : Οƒ β†’ M) (m : M) (p : MvPolynomial Οƒ R) : p ∈ weightedHomogeneousSubmodule R w m ↔ p.IsWeightedHomogeneous w m := Iff.rfl #align mv_polynomial.mem_weighted_homogeneous_submodule MvPolynomial.mem_weightedHomogeneousSubmodule
Mathlib/RingTheory/MvPolynomial/WeightedHomogeneous.lean
168
173
theorem weightedHomogeneousSubmodule_eq_finsupp_supported (w : Οƒ β†’ M) (m : M) : weightedHomogeneousSubmodule R w m = Finsupp.supported R R { d | weightedDegree w d = m } := by
ext x rw [mem_supported, Set.subset_def] simp only [Finsupp.mem_support_iff, mem_coe] rfl
[ " (weightedDegree w) f = f.sum fun i c => c β€’ w i", " weightedTotalDegree' w p = βŠ₯ ↔ p = 0", " (βˆ€ (s : Οƒ β†’β‚€ β„•), coeff s p β‰  0 β†’ False) ↔ βˆ€ (d : Οƒ β†’β‚€ β„•), coeff d p = 0", " weightedTotalDegree' w 0 = βŠ₯", " (weightedDegree w) c = m", " coeff c a β‰  0 ∨ coeff c b β‰  0", " coeff c a + coeff c b = 0", " weigh...
import Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity #align_import number_theory.legendre_symbol.jacobi_symbol from "leanprover-community/mathlib"@"74a27133cf29446a0983779e37c8f829a85368f3" section Jacobi open Nat ZMod -- Since we need the fact that the factors are prime, we use `List.pmap`. def jacobiSym (a : β„€) (b : β„•) : β„€ := (b.factors.pmap (fun p pp => @legendreSym p ⟨pp⟩ a) fun _ pf => prime_of_mem_factors pf).prod #align jacobi_sym jacobiSym -- Notation for the Jacobi symbol. @[inherit_doc] scoped[NumberTheorySymbols] notation "J(" a " | " b ")" => jacobiSym a b -- Porting note: Without the following line, Lean expected `|` on several lines, e.g. line 102. open NumberTheorySymbols namespace jacobiSym
Mathlib/NumberTheory/LegendreSymbol/JacobiSymbol.lean
331
337
theorem value_at (a : β„€) {R : Type*} [CommSemiring R] (Ο‡ : R β†’* β„€) (hp : βˆ€ (p : β„•) (pp : p.Prime), p β‰  2 β†’ @legendreSym p ⟨pp⟩ a = Ο‡ p) {b : β„•} (hb : Odd b) : J(a | b) = Ο‡ b := by
conv_rhs => rw [← prod_factors hb.pos.ne', cast_list_prod, map_list_prod Ο‡] rw [jacobiSym, List.map_map, ← List.pmap_eq_map Nat.Prime _ _ fun _ => prime_of_mem_factors] congr 1; apply List.pmap_congr exact fun p h pp _ => hp p pp (hb.ne_two_of_dvd_nat <| dvd_of_mem_factors h)
[ " J(a | b) = Ο‡ ↑b", "a : β„€\nR : Type u_1\ninst✝ : CommSemiring R\nΟ‡ : R β†’* β„€\nhp : βˆ€ (p : β„•) (pp : p.Prime), p β‰  2 β†’ legendreSym p a = Ο‡ ↑p\nb : β„•\nhb : Odd b\n| Ο‡ ↑b", " J(a | b) = (List.map (⇑χ) (List.map Nat.cast b.factors)).prod", " (List.pmap (fun p pp => legendreSym p a) b.factors β‹―).prod =\n (List.p...
import Mathlib.LinearAlgebra.Dimension.Free import Mathlib.Algebra.Module.Torsion #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u v v' u₁' w w' variable {R S : Type u} {M : Type v} {M' : Type v'} {M₁ : Type v} variable {ΞΉ : Type w} {ΞΉ' : Type w'} {Ξ· : Type u₁'} {Ο† : Ξ· β†’ Type*} open Cardinal Basis Submodule Function Set FiniteDimensional DirectSum variable [Ring R] [CommRing S] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup M₁] variable [Module R M] [Module R M'] [Module R M₁] section Finsupp variable (R M M') variable [StrongRankCondition R] [Module.Free R M] [Module.Free R M'] open Module.Free @[simp] theorem rank_finsupp (ΞΉ : Type w) : Module.rank R (ΞΉ β†’β‚€ M) = Cardinal.lift.{v} #ΞΉ * Cardinal.lift.{w} (Module.rank R M) := by obtain ⟨⟨_, bs⟩⟩ := Module.Free.exists_basis (R := R) (M := M) rw [← bs.mk_eq_rank'', ← (Finsupp.basis fun _ : ΞΉ => bs).mk_eq_rank'', Cardinal.mk_sigma, Cardinal.sum_const] #align rank_finsupp rank_finsupp theorem rank_finsupp' (ΞΉ : Type v) : Module.rank R (ΞΉ β†’β‚€ M) = #ΞΉ * Module.rank R M := by simp [rank_finsupp] #align rank_finsupp' rank_finsupp' -- Porting note, this should not be `@[simp]`, as simp can prove it. -- @[simp] theorem rank_finsupp_self (ΞΉ : Type w) : Module.rank R (ΞΉ β†’β‚€ R) = Cardinal.lift.{u} #ΞΉ := by simp [rank_finsupp] #align rank_finsupp_self rank_finsupp_self theorem rank_finsupp_self' {ΞΉ : Type u} : Module.rank R (ΞΉ β†’β‚€ R) = #ΞΉ := by simp #align rank_finsupp_self' rank_finsupp_self' @[simp] theorem rank_directSum {ΞΉ : Type v} (M : ΞΉ β†’ Type w) [βˆ€ i : ΞΉ, AddCommGroup (M i)] [βˆ€ i : ΞΉ, Module R (M i)] [βˆ€ i : ΞΉ, Module.Free R (M i)] : Module.rank R (⨁ i, M i) = Cardinal.sum fun i => Module.rank R (M i) := by let B i := chooseBasis R (M i) let b : Basis _ R (⨁ i, M i) := DFinsupp.basis fun i => B i simp [← b.mk_eq_rank'', fun i => (B i).mk_eq_rank''] #align rank_direct_sum rank_directSum @[simp] theorem rank_matrix (m : Type v) (n : Type w) [Finite m] [Finite n] : Module.rank R (Matrix m n R) = Cardinal.lift.{max v w u, v} #m * Cardinal.lift.{max v w u, w} #n := by cases nonempty_fintype m cases nonempty_fintype n have h := (Matrix.stdBasis R m n).mk_eq_rank rw [← lift_lift.{max v w u, max v w}, lift_inj] at h simpa using h.symm #align rank_matrix rank_matrix @[simp high] theorem rank_matrix' (m n : Type v) [Finite m] [Finite n] : Module.rank R (Matrix m n R) = Cardinal.lift.{u} (#m * #n) := by rw [rank_matrix, lift_mul, lift_umax.{v, u}] #align rank_matrix' rank_matrix' -- @[simp] -- Porting note (#10618): simp can prove this theorem rank_matrix'' (m n : Type u) [Finite m] [Finite n] : Module.rank R (Matrix m n R) = #m * #n := by simp #align rank_matrix'' rank_matrix'' variable [Module.Finite R M] [Module.Finite R M'] open Fintype section SubalgebraRank open Module variable {F E : Type*} [CommRing F] [Ring E] [Algebra F E] @[simp] theorem Subalgebra.rank_toSubmodule (S : Subalgebra F E) : Module.rank F (Subalgebra.toSubmodule S) = Module.rank F S := rfl #align subalgebra.rank_to_submodule Subalgebra.rank_toSubmodule @[simp] theorem Subalgebra.finrank_toSubmodule (S : Subalgebra F E) : finrank F (Subalgebra.toSubmodule S) = finrank F S := rfl #align subalgebra.finrank_to_submodule Subalgebra.finrank_toSubmodule
Mathlib/LinearAlgebra/Dimension/Constructions.lean
538
541
theorem subalgebra_top_rank_eq_submodule_top_rank : Module.rank F (⊀ : Subalgebra F E) = Module.rank F (⊀ : Submodule F E) := by
rw [← Algebra.top_toSubmodule] rfl
[ " Module.rank R (ΞΉ β†’β‚€ M) = lift.{v, w} #ΞΉ * lift.{w, v} (Module.rank R M)", " Module.rank R (ΞΉ β†’β‚€ M) = #ΞΉ * Module.rank R M", " Module.rank R (ΞΉ β†’β‚€ R) = lift.{u, w} #ΞΉ", " Module.rank R (ΞΉ β†’β‚€ R) = #ΞΉ", " Module.rank R (⨁ (i : ΞΉ), M i) = sum fun i => Module.rank R (M i)", " Module.rank R (Matrix m n R) = l...
import Mathlib.Data.Multiset.Bind import Mathlib.Control.Traversable.Lemmas import Mathlib.Control.Traversable.Instances #align_import data.multiset.functor from "leanprover-community/mathlib"@"1f0096e6caa61e9c849ec2adbd227e960e9dff58" universe u namespace Multiset open List instance functor : Functor Multiset where map := @map @[simp] theorem fmap_def {Ξ±' Ξ²'} {s : Multiset Ξ±'} (f : Ξ±' β†’ Ξ²') : f <$> s = s.map f := rfl #align multiset.fmap_def Multiset.fmap_def instance : LawfulFunctor Multiset where id_map := by simp comp_map := by simp map_const {_ _} := rfl open LawfulTraversable CommApplicative variable {F : Type u β†’ Type u} [Applicative F] [CommApplicative F] variable {Ξ±' Ξ²' : Type u} (f : Ξ±' β†’ F Ξ²') def traverse : Multiset Ξ±' β†’ F (Multiset Ξ²') := by refine Quotient.lift (Functor.map Coe.coe ∘ Traversable.traverse f) ?_ introv p; unfold Function.comp induction p with | nil => rfl | @cons x l₁ lβ‚‚ _ h => have : Multiset.cons <$> f x <*> Coe.coe <$> Traversable.traverse f l₁ = Multiset.cons <$> f x <*> Coe.coe <$> Traversable.traverse f lβ‚‚ := by rw [h] simpa [functor_norm] using this | swap x y l => have : (fun a b (l : List Ξ²') ↦ (↑(a :: b :: l) : Multiset Ξ²')) <$> f y <*> f x = (fun a b l ↦ ↑(a :: b :: l)) <$> f x <*> f y := by rw [CommApplicative.commutative_map] congr funext a b l simpa [flip] using Perm.swap a b l simp [(Β· ∘ Β·), this, functor_norm, Coe.coe] | trans => simp [*] #align multiset.traverse Multiset.traverse instance : Monad Multiset := { Multiset.functor with pure := fun x ↦ {x} bind := @bind } @[simp] theorem pure_def {Ξ±} : (pure : Ξ± β†’ Multiset Ξ±) = singleton := rfl #align multiset.pure_def Multiset.pure_def @[simp] theorem bind_def {Ξ± Ξ²} : (Β· >>= Β·) = @bind Ξ± Ξ² := rfl #align multiset.bind_def Multiset.bind_def instance : LawfulMonad Multiset := LawfulMonad.mk' (bind_pure_comp := fun _ _ ↦ by simp only [pure_def, bind_def, bind_singleton, fmap_def]) (id_map := fun _ ↦ by simp only [fmap_def, id_eq, map_id']) (pure_bind := fun _ _ ↦ by simp only [pure_def, bind_def, singleton_bind]) (bind_assoc := @bind_assoc) open Functor open Traversable LawfulTraversable @[simp] theorem lift_coe {Ξ± Ξ² : Type*} (x : List Ξ±) (f : List Ξ± β†’ Ξ²) (h : βˆ€ a b : List Ξ±, a β‰ˆ b β†’ f a = f b) : Quotient.lift f h (x : Multiset Ξ±) = f x := Quotient.lift_mk _ _ _ #align multiset.lift_coe Multiset.lift_coe @[simp] theorem map_comp_coe {Ξ± Ξ²} (h : Ξ± β†’ Ξ²) : Functor.map h ∘ Coe.coe = (Coe.coe ∘ Functor.map h : List Ξ± β†’ Multiset Ξ²) := by funext; simp only [Function.comp_apply, Coe.coe, fmap_def, map_coe, List.map_eq_map] #align multiset.map_comp_coe Multiset.map_comp_coe theorem id_traverse {Ξ± : Type*} (x : Multiset Ξ±) : traverse (pure : Ξ± β†’ Id Ξ±) x = x := by refine Quotient.inductionOn x ?_ intro simp [traverse, Coe.coe] #align multiset.id_traverse Multiset.id_traverse theorem comp_traverse {G H : Type _ β†’ Type _} [Applicative G] [Applicative H] [CommApplicative G] [CommApplicative H] {Ξ± Ξ² Ξ³ : Type _} (g : Ξ± β†’ G Ξ²) (h : Ξ² β†’ H Ξ³) (x : Multiset Ξ±) : traverse (Comp.mk ∘ Functor.map h ∘ g) x = Comp.mk (Functor.map (traverse h) (traverse g x)) := by refine Quotient.inductionOn x ?_ intro simp only [traverse, quot_mk_to_coe, lift_coe, Coe.coe, Function.comp_apply, Functor.map_map, functor_norm] simp only [Function.comp, lift_coe] #align multiset.comp_traverse Multiset.comp_traverse theorem map_traverse {G : Type* β†’ Type _} [Applicative G] [CommApplicative G] {Ξ± Ξ² Ξ³ : Type _} (g : Ξ± β†’ G Ξ²) (h : Ξ² β†’ Ξ³) (x : Multiset Ξ±) : Functor.map (Functor.map h) (traverse g x) = traverse (Functor.map h ∘ g) x := by refine Quotient.inductionOn x ?_ intro simp only [traverse, quot_mk_to_coe, lift_coe, Function.comp_apply, Functor.map_map, map_comp_coe] rw [LawfulFunctor.comp_map, Traversable.map_traverse'] rfl #align multiset.map_traverse Multiset.map_traverse theorem traverse_map {G : Type* β†’ Type _} [Applicative G] [CommApplicative G] {Ξ± Ξ² Ξ³ : Type _} (g : Ξ± β†’ Ξ²) (h : Ξ² β†’ G Ξ³) (x : Multiset Ξ±) : traverse h (map g x) = traverse (h ∘ g) x := by refine Quotient.inductionOn x ?_ intro simp only [traverse, quot_mk_to_coe, map_coe, lift_coe, Function.comp_apply] rw [← Traversable.traverse_map h g, List.map_eq_map] #align multiset.traverse_map Multiset.traverse_map
Mathlib/Data/Multiset/Functor.lean
137
143
theorem naturality {G H : Type _ β†’ Type _} [Applicative G] [Applicative H] [CommApplicative G] [CommApplicative H] (eta : ApplicativeTransformation G H) {Ξ± Ξ² : Type _} (f : Ξ± β†’ G Ξ²) (x : Multiset Ξ±) : eta (traverse f x) = traverse (@eta _ ∘ f) x := by
refine Quotient.inductionOn x ?_ intro simp only [quot_mk_to_coe, traverse, lift_coe, Function.comp_apply, ApplicativeTransformation.preserves_map, LawfulTraversable.naturality]
[ " βˆ€ {Ξ± : Type ?u.133} (x : Multiset Ξ±), id <$> x = x", " βˆ€ {Ξ± Ξ² Ξ³ : Type ?u.133} (g : Ξ± β†’ Ξ²) (h : Ξ² β†’ Ξ³) (x : Multiset Ξ±), (h ∘ g) <$> x = h <$> g <$> x", " Multiset Ξ±' β†’ F (Multiset Ξ²')", " βˆ€ (a b : List Ξ±'),\n a β‰ˆ b β†’ (Functor.map Coe.coe ∘ Traversable.traverse f) a = (Functor.map Coe.coe ∘ Traversable.t...
import Mathlib.Analysis.NormedSpace.IndicatorFunction import Mathlib.MeasureTheory.Function.EssSup import Mathlib.MeasureTheory.Function.AEEqFun import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic #align_import measure_theory.function.lp_seminorm from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9" noncomputable section set_option linter.uppercaseLean3 false open TopologicalSpace MeasureTheory Filter open scoped NNReal ENNReal Topology variable {Ξ± E F G : Type*} {m m0 : MeasurableSpace Ξ±} {p : ℝβ‰₯0∞} {q : ℝ} {ΞΌ Ξ½ : Measure Ξ±} [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G] namespace MeasureTheory section β„’p section β„’pSpaceDefinition def snorm' {_ : MeasurableSpace Ξ±} (f : Ξ± β†’ F) (q : ℝ) (ΞΌ : Measure Ξ±) : ℝβ‰₯0∞ := (∫⁻ a, (β€–f aβ€–β‚Š : ℝβ‰₯0∞) ^ q βˆ‚ΞΌ) ^ (1 / q) #align measure_theory.snorm' MeasureTheory.snorm' def snormEssSup {_ : MeasurableSpace Ξ±} (f : Ξ± β†’ F) (ΞΌ : Measure Ξ±) := essSup (fun x => (β€–f xβ€–β‚Š : ℝβ‰₯0∞)) ΞΌ #align measure_theory.snorm_ess_sup MeasureTheory.snormEssSup def snorm {_ : MeasurableSpace Ξ±} (f : Ξ± β†’ F) (p : ℝβ‰₯0∞) (ΞΌ : Measure Ξ±) : ℝβ‰₯0∞ := if p = 0 then 0 else if p = ∞ then snormEssSup f ΞΌ else snorm' f (ENNReal.toReal p) ΞΌ #align measure_theory.snorm MeasureTheory.snorm theorem snorm_eq_snorm' (hp_ne_zero : p β‰  0) (hp_ne_top : p β‰  ∞) {f : Ξ± β†’ F} : snorm f p ΞΌ = snorm' f (ENNReal.toReal p) ΞΌ := by simp [snorm, hp_ne_zero, hp_ne_top] #align measure_theory.snorm_eq_snorm' MeasureTheory.snorm_eq_snorm' theorem snorm_eq_lintegral_rpow_nnnorm (hp_ne_zero : p β‰  0) (hp_ne_top : p β‰  ∞) {f : Ξ± β†’ F} : snorm f p ΞΌ = (∫⁻ x, (β€–f xβ€–β‚Š : ℝβ‰₯0∞) ^ p.toReal βˆ‚ΞΌ) ^ (1 / p.toReal) := by rw [snorm_eq_snorm' hp_ne_zero hp_ne_top, snorm'] #align measure_theory.snorm_eq_lintegral_rpow_nnnorm MeasureTheory.snorm_eq_lintegral_rpow_nnnorm theorem snorm_one_eq_lintegral_nnnorm {f : Ξ± β†’ F} : snorm f 1 ΞΌ = ∫⁻ x, β€–f xβ€–β‚Š βˆ‚ΞΌ := by simp_rw [snorm_eq_lintegral_rpow_nnnorm one_ne_zero ENNReal.coe_ne_top, ENNReal.one_toReal, one_div_one, ENNReal.rpow_one] #align measure_theory.snorm_one_eq_lintegral_nnnorm MeasureTheory.snorm_one_eq_lintegral_nnnorm @[simp] theorem snorm_exponent_top {f : Ξ± β†’ F} : snorm f ∞ ΞΌ = snormEssSup f ΞΌ := by simp [snorm] #align measure_theory.snorm_exponent_top MeasureTheory.snorm_exponent_top def Memβ„’p {Ξ±} {_ : MeasurableSpace Ξ±} (f : Ξ± β†’ E) (p : ℝβ‰₯0∞) (ΞΌ : Measure Ξ± := by volume_tac) : Prop := AEStronglyMeasurable f ΞΌ ∧ snorm f p ΞΌ < ∞ #align measure_theory.mem_β„’p MeasureTheory.Memβ„’p theorem Memβ„’p.aestronglyMeasurable {f : Ξ± β†’ E} {p : ℝβ‰₯0∞} (h : Memβ„’p f p ΞΌ) : AEStronglyMeasurable f ΞΌ := h.1 #align measure_theory.mem_β„’p.ae_strongly_measurable MeasureTheory.Memβ„’p.aestronglyMeasurable
Mathlib/MeasureTheory/Function/LpSeminorm/Basic.lean
117
120
theorem lintegral_rpow_nnnorm_eq_rpow_snorm' {f : Ξ± β†’ F} (hq0_lt : 0 < q) : (∫⁻ a, (β€–f aβ€–β‚Š : ℝβ‰₯0∞) ^ q βˆ‚ΞΌ) = snorm' f q ΞΌ ^ q := by
rw [snorm', ← ENNReal.rpow_mul, one_div, inv_mul_cancel, ENNReal.rpow_one] exact (ne_of_lt hq0_lt).symm
[ " snorm f p ΞΌ = snorm' f p.toReal ΞΌ", " snorm f p ΞΌ = (∫⁻ (x : Ξ±), ↑‖f xβ€–β‚Š ^ p.toReal βˆ‚ΞΌ) ^ (1 / p.toReal)", " snorm f 1 ΞΌ = ∫⁻ (x : Ξ±), ↑‖f xβ€–β‚Š βˆ‚ΞΌ", " snorm f ⊀ ΞΌ = snormEssSup f ΞΌ", " ∫⁻ (a : Ξ±), ↑‖f aβ€–β‚Š ^ q βˆ‚ΞΌ = snorm' f q ΞΌ ^ q", " q β‰  0" ]
import Mathlib.Analysis.BoxIntegral.Box.Basic import Mathlib.Analysis.SpecificLimits.Basic #align_import analysis.box_integral.box.subbox_induction from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Set Finset Function Filter Metric Classical Topology Filter ENNReal noncomputable section namespace BoxIntegral namespace Box variable {ΞΉ : Type*} {I J : Box ΞΉ} def splitCenterBox (I : Box ΞΉ) (s : Set ΞΉ) : Box ΞΉ where lower := s.piecewise (fun i ↦ (I.lower i + I.upper i) / 2) I.lower upper := s.piecewise I.upper fun i ↦ (I.lower i + I.upper i) / 2 lower_lt_upper i := by dsimp only [Set.piecewise] split_ifs <;> simp only [left_lt_add_div_two, add_div_two_lt_right, I.lower_lt_upper] #align box_integral.box.split_center_box BoxIntegral.Box.splitCenterBox
Mathlib/Analysis/BoxIntegral/Box/SubboxInduction.lean
53
62
theorem mem_splitCenterBox {s : Set ΞΉ} {y : ΞΉ β†’ ℝ} : y ∈ I.splitCenterBox s ↔ y ∈ I ∧ βˆ€ i, (I.lower i + I.upper i) / 2 < y i ↔ i ∈ s := by
simp only [splitCenterBox, mem_def, ← forall_and] refine forall_congr' fun i ↦ ?_ dsimp only [Set.piecewise] split_ifs with hs <;> simp only [hs, iff_true_iff, iff_false_iff, not_lt] exacts [⟨fun H ↦ ⟨⟨(left_lt_add_div_two.2 (I.lower_lt_upper i)).trans H.1, H.2⟩, H.1⟩, fun H ↦ ⟨H.2, H.1.2⟩⟩, ⟨fun H ↦ ⟨⟨H.1, H.2.trans (add_div_two_lt_right.2 (I.lower_lt_upper i)).le⟩, H.2⟩, fun H ↦ ⟨H.1.1, H.2⟩⟩]
[ " s.piecewise (fun i => (I.lower i + I.upper i) / 2) I.lower i <\n s.piecewise I.upper (fun i => (I.lower i + I.upper i) / 2) i", " (if i ∈ s then (I.lower i + I.upper i) / 2 else I.lower i) < if i ∈ s then I.upper i else (I.lower i + I.upper i) / 2", " (I.lower i + I.upper i) / 2 < I.upper i", " I.lower i...
import Mathlib.CategoryTheory.Preadditive.ProjectiveResolution import Mathlib.Algebra.Homology.HomotopyCategory import Mathlib.Tactic.SuppressCompilation suppress_compilation noncomputable section universe v u namespace CategoryTheory variable {C : Type u} [Category.{v} C] open Category Limits Projective set_option linter.uppercaseLean3 false -- `ProjectiveResolution` namespace ProjectiveResolution section variable [HasZeroObject C] [HasZeroMorphisms C] def liftFZero {Y Z : C} (f : Y ⟢ Z) (P : ProjectiveResolution Y) (Q : ProjectiveResolution Z) : P.complex.X 0 ⟢ Q.complex.X 0 := Projective.factorThru (P.Ο€.f 0 ≫ f) (Q.Ο€.f 0) #align category_theory.ProjectiveResolution.lift_f_zero CategoryTheory.ProjectiveResolution.liftFZero end section Abelian variable [Abelian C] lemma exactβ‚€ {Z : C} (P : ProjectiveResolution Z) : (ShortComplex.mk _ _ P.complex_d_comp_Ο€_f_zero).Exact := ShortComplex.exact_of_g_is_cokernel _ P.isColimitCokernelCofork def liftFOne {Y Z : C} (f : Y ⟢ Z) (P : ProjectiveResolution Y) (Q : ProjectiveResolution Z) : P.complex.X 1 ⟢ Q.complex.X 1 := Q.exactβ‚€.liftFromProjective (P.complex.d 1 0 ≫ liftFZero f P Q) (by simp [liftFZero]) #align category_theory.ProjectiveResolution.lift_f_one CategoryTheory.ProjectiveResolution.liftFOne @[simp] theorem liftFOne_zero_comm {Y Z : C} (f : Y ⟢ Z) (P : ProjectiveResolution Y) (Q : ProjectiveResolution Z) : liftFOne f P Q ≫ Q.complex.d 1 0 = P.complex.d 1 0 ≫ liftFZero f P Q := by apply Q.exactβ‚€.liftFromProjective_comp #align category_theory.ProjectiveResolution.lift_f_one_zero_comm CategoryTheory.ProjectiveResolution.liftFOne_zero_comm def liftFSucc {Y Z : C} (P : ProjectiveResolution Y) (Q : ProjectiveResolution Z) (n : β„•) (g : P.complex.X n ⟢ Q.complex.X n) (g' : P.complex.X (n + 1) ⟢ Q.complex.X (n + 1)) (w : g' ≫ Q.complex.d (n + 1) n = P.complex.d (n + 1) n ≫ g) : Ξ£'g'' : P.complex.X (n + 2) ⟢ Q.complex.X (n + 2), g'' ≫ Q.complex.d (n + 2) (n + 1) = P.complex.d (n + 2) (n + 1) ≫ g' := ⟨(Q.exact_succ n).liftFromProjective (P.complex.d (n + 2) (n + 1) ≫ g') (by simp [w]), (Q.exact_succ n).liftFromProjective_comp _ _⟩ #align category_theory.ProjectiveResolution.lift_f_succ CategoryTheory.ProjectiveResolution.liftFSucc def lift {Y Z : C} (f : Y ⟢ Z) (P : ProjectiveResolution Y) (Q : ProjectiveResolution Z) : P.complex ⟢ Q.complex := ChainComplex.mkHom _ _ (liftFZero f _ _) (liftFOne f _ _) (liftFOne_zero_comm f P Q) fun n ⟨g, g', w⟩ => ⟨(liftFSucc P Q n g g' w).1, (liftFSucc P Q n g g' w).2⟩ #align category_theory.ProjectiveResolution.lift CategoryTheory.ProjectiveResolution.lift @[reassoc (attr := simp)]
Mathlib/CategoryTheory/Abelian/ProjectiveResolution.lean
99
102
theorem lift_commutes {Y Z : C} (f : Y ⟢ Z) (P : ProjectiveResolution Y) (Q : ProjectiveResolution Z) : lift f P Q ≫ Q.Ο€ = P.Ο€ ≫ (ChainComplex.singleβ‚€ C).map f := by
ext simp [lift, liftFZero, liftFOne]
[ " (P.complex.d 1 0 ≫ liftFZero f P Q) ≫ (ShortComplex.mk (Q.complex.d 1 0) (Q.Ο€.f 0) β‹―).g = 0", " liftFOne f P Q ≫ Q.complex.d 1 0 = P.complex.d 1 0 ≫ liftFZero f P Q", " (P.complex.d (n + 2) (n + 1) ≫ g') ≫ (ShortComplex.mk (Q.complex.d (n + 2) (n + 1)) (Q.complex.d (n + 1) n) β‹―).g = 0", " lift f P Q ≫ Q.Ο€ =...
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 CommSemiring variable [CommSemiring R] theorem Monic.C_dvd_iff_isUnit {p : R[X]} (hp : Monic p) {a : R} : C a ∣ p ↔ IsUnit a := ⟨fun h => isUnit_iff_dvd_one.mpr <| hp.coeff_natDegree β–Έ (C_dvd_iff_dvd_coeff _ _).mp h p.natDegree, fun ha => (ha.map C).dvd⟩ theorem degree_pos_of_not_isUnit_of_dvd_monic {a p : R[X]} (ha : Β¬ IsUnit a) (hap : a ∣ p) (hp : Monic p) : 0 < degree a := lt_of_not_ge <| fun h => ha <| by rw [Polynomial.eq_C_of_degree_le_zero h] at hap ⊒ simpa [hp.C_dvd_iff_isUnit, isUnit_C] using hap theorem natDegree_pos_of_not_isUnit_of_dvd_monic {a p : R[X]} (ha : Β¬ IsUnit a) (hap : a ∣ p) (hp : Monic p) : 0 < natDegree a := natDegree_pos_iff_degree_pos.mpr <| degree_pos_of_not_isUnit_of_dvd_monic ha hap hp theorem degree_pos_of_monic_of_not_isUnit {a : R[X]} (hu : Β¬ IsUnit a) (ha : Monic a) : 0 < degree a := degree_pos_of_not_isUnit_of_dvd_monic hu dvd_rfl ha theorem natDegree_pos_of_monic_of_not_isUnit {a : R[X]} (hu : Β¬ IsUnit a) (ha : Monic a) : 0 < natDegree a := natDegree_pos_iff_degree_pos.mpr <| degree_pos_of_monic_of_not_isUnit hu ha theorem eq_zero_of_mul_eq_zero_of_smul (P : R[X]) (h : βˆ€ r : R, r β€’ P = 0 β†’ r = 0) : βˆ€ (Q : R[X]), P * Q = 0 β†’ Q = 0 := by intro Q hQ suffices βˆ€ i, P.coeff i β€’ Q = 0 by rw [← leadingCoeff_eq_zero] apply h simpa [ext_iff, mul_comm Q.leadingCoeff] using fun i ↦ congr_arg (Β·.coeff Q.natDegree) (this i) apply Nat.strong_decreasing_induction Β· use P.natDegree intro i hi rw [coeff_eq_zero_of_natDegree_lt hi, zero_smul] intro l IH obtain _|hl := (natDegree_smul_le (P.coeff l) Q).lt_or_eq Β· apply eq_zero_of_mul_eq_zero_of_smul _ h (P.coeff l β€’ Q) rw [smul_eq_C_mul, mul_left_comm, hQ, mul_zero] suffices P.coeff l * Q.leadingCoeff = 0 by rwa [← leadingCoeff_eq_zero, ← coeff_natDegree, coeff_smul, hl, coeff_natDegree, smul_eq_mul] let m := Q.natDegree suffices (P * Q).coeff (l + m) = P.coeff l * Q.leadingCoeff by rw [← this, hQ, coeff_zero] rw [coeff_mul] apply Finset.sum_eq_single (l, m) _ (by simp) simp only [Finset.mem_antidiagonal, ne_eq, Prod.forall, Prod.mk.injEq, not_and] intro i j hij H obtain hi|rfl|hi := lt_trichotomy i l Β· have hj : m < j := by omega rw [coeff_eq_zero_of_natDegree_lt hj, mul_zero] Β· omega Β· rw [← coeff_C_mul, ← smul_eq_C_mul, IH _ hi, coeff_zero] termination_by Q => Q.natDegree open nonZeroDivisors in
Mathlib/Algebra/Polynomial/RingDivision.lean
401
407
theorem nmem_nonZeroDivisors_iff {P : R[X]} : P βˆ‰ R[X]⁰ ↔ βˆƒ a : R, a β‰  0 ∧ a β€’ P = 0 := by
refine ⟨fun hP ↦ ?_, fun ⟨a, ha, h⟩ h1 ↦ ha <| C_eq_zero.1 <| (h1 _) <| smul_eq_C_mul a β–Έ h⟩ by_contra! h obtain ⟨Q, hQ⟩ := _root_.nmem_nonZeroDivisors_iff.1 hP refine hQ.2 (eq_zero_of_mul_eq_zero_of_smul P (fun a ha ↦ ?_) Q (mul_comm P _ β–Έ hQ.1)) contrapose! ha exact h a ha
[ " IsUnit a", " IsUnit (C (a.coeff 0))", " βˆ€ (Q : R[X]), P * Q = 0 β†’ Q = 0", " Q = 0", " Q.leadingCoeff = 0", " Q.leadingCoeff β€’ P = 0", " βˆ€ (i : β„•), P.coeff i β€’ Q = 0", " βˆƒ n, βˆ€ m > n, P.coeff m β€’ Q = 0", " βˆ€ m > P.natDegree, P.coeff m β€’ Q = 0", " P.coeff i β€’ Q = 0", " βˆ€ (n : β„•), (βˆ€ m > n, P.coe...
import Mathlib.Order.Filter.AtTopBot #align_import order.filter.indicator_function from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1" variable {Ξ± Ξ² M E : Type*} open Set Filter @[to_additive]
Mathlib/Order/Filter/IndicatorFunction.lean
63
66
theorem Monotone.mulIndicator_eventuallyEq_iUnion {ΞΉ} [Preorder ΞΉ] [One Ξ²] (s : ΞΉ β†’ Set Ξ±) (hs : Monotone s) (f : Ξ± β†’ Ξ²) (a : Ξ±) : (fun i => mulIndicator (s i) f a) =αΆ [atTop] fun _ ↦ mulIndicator (⋃ i, s i) f a := by
classical exact hs.piecewise_eventually_eq_iUnion f 1 a
[ " (fun i => (s i).mulIndicator f a) =αΆ [atTop] fun x => (⋃ i, s i).mulIndicator f a" ]
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 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] #align mem_closure_ne_iff_frequently_within mem_closure_ne_iff_frequently_within @[simp] theorem eventually_nhdsWithin_nhdsWithin {a : Ξ±} {s : Set Ξ±} {p : Ξ± β†’ Prop} : (βˆ€αΆ  y in 𝓝[s] a, βˆ€αΆ  x in 𝓝[s] y, p x) ↔ βˆ€αΆ  x in 𝓝[s] a, p x := by refine ⟨fun h => ?_, fun h => (eventually_nhds_nhdsWithin.2 h).filter_mono inf_le_left⟩ simp only [eventually_nhdsWithin_iff] at h ⊒ exact h.mono fun x hx hxs => (hx hxs).self_of_nhds hxs #align eventually_nhds_within_nhds_within eventually_nhdsWithin_nhdsWithin theorem nhdsWithin_eq (a : Ξ±) (s : Set Ξ±) : 𝓝[s] a = β¨… t ∈ { t : Set Ξ± | a ∈ t ∧ IsOpen t }, π“Ÿ (t ∩ s) := ((nhds_basis_opens a).inf_principal s).eq_biInf #align nhds_within_eq nhdsWithin_eq
Mathlib/Topology/ContinuousOn.lean
75
76
theorem nhdsWithin_univ (a : Ξ±) : 𝓝[Set.univ] a = 𝓝 a := by
rw [nhdsWithin, principal_univ, inf_top_eq]
[ " (βˆƒαΆ  (x : Ξ±) in 𝓝 z, x ∈ s ∧ p x) ↔ βˆƒαΆ  (x : Ξ±) in 𝓝 z, p x ∧ x ∈ s", " z ∈ closure (s \\ {z}) ↔ βˆƒαΆ  (x : Ξ±) in 𝓝[β‰ ] z, x ∈ s", " (βˆ€αΆ  (y : Ξ±) in 𝓝[s] a, βˆ€αΆ  (x : Ξ±) in 𝓝[s] y, p x) ↔ βˆ€αΆ  (x : Ξ±) in 𝓝[s] a, p x", " βˆ€αΆ  (x : Ξ±) in 𝓝[s] a, p x", " βˆ€αΆ  (x : Ξ±) in 𝓝 a, x ∈ s β†’ p x", " 𝓝[univ] a = 𝓝 a" ]
import Mathlib.Order.Filter.Basic import Mathlib.Order.Filter.CountableInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality open Set Filter Cardinal universe u variable {ΞΉ : Type u} {Ξ± Ξ² : Type u} {c : Cardinal.{u}} class CardinalInterFilter (l : Filter Ξ±) (c : Cardinal.{u}) : Prop where cardinal_sInter_mem : βˆ€ S : Set (Set Ξ±), (#S < c) β†’ (βˆ€ s ∈ S, s ∈ l) β†’ β‹‚β‚€ S ∈ l variable {l : Filter Ξ±} theorem cardinal_sInter_mem {S : Set (Set Ξ±)} [CardinalInterFilter l c] (hSc : #S < c) : β‹‚β‚€ S ∈ l ↔ βˆ€ s ∈ S, s ∈ l := ⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs), CardinalInterFilter.cardinal_sInter_mem _ hSc⟩ theorem _root_.Filter.cardinalInterFilter_aleph0 (l : Filter Ξ±) : CardinalInterFilter l aleph0 where cardinal_sInter_mem := by simp_all only [aleph_zero, lt_aleph0_iff_subtype_finite, setOf_mem_eq, sInter_mem, implies_true, forall_const] theorem CardinalInterFilter.toCountableInterFilter (l : Filter Ξ±) [CardinalInterFilter l c] (hc : aleph0 < c) : CountableInterFilter l where countable_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_le_of_lt (Set.Countable.le_aleph0 hS) hc) a instance CountableInterFilter.toCardinalInterFilter (l : Filter Ξ±) [CountableInterFilter l] : CardinalInterFilter l (aleph 1) where cardinal_sInter_mem S hS a := CountableInterFilter.countable_sInter_mem S ((countable_iff_lt_aleph_one S).mpr hS) a theorem cardinalInterFilter_aleph_one_iff : CardinalInterFilter l (aleph 1) ↔ CountableInterFilter l := ⟨fun _ ↦ ⟨fun S h a ↦ CardinalInterFilter.cardinal_sInter_mem S ((countable_iff_lt_aleph_one S).1 h) a⟩, fun _ ↦ CountableInterFilter.toCardinalInterFilter l⟩ theorem CardinalInterFilter.of_cardinalInterFilter_of_le (l : Filter Ξ±) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a ≀ c) : CardinalInterFilter l a where cardinal_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_lt_of_le hS hac) a theorem CardinalInterFilter.of_cardinalInterFilter_of_lt (l : Filter Ξ±) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a < c) : CardinalInterFilter l a := CardinalInterFilter.of_cardinalInterFilter_of_le l (hac.le) namespace Filter variable [CardinalInterFilter l c] theorem cardinal_iInter_mem {s : ΞΉ β†’ Set Ξ±} (hic : #ΞΉ < c) : (β‹‚ i, s i) ∈ l ↔ βˆ€ i, s i ∈ l := by rw [← sInter_range _] apply (cardinal_sInter_mem (lt_of_le_of_lt Cardinal.mk_range_le hic)).trans exact forall_mem_range theorem cardinal_bInter_mem {S : Set ΞΉ} (hS : #S < c) {s : βˆ€ i ∈ S, Set Ξ±} : (β‹‚ i, β‹‚ hi : i ∈ S, s i β€Ή_β€Ί) ∈ l ↔ βˆ€ i, βˆ€ hi : i ∈ S, s i β€Ή_β€Ί ∈ l := by rw [biInter_eq_iInter] exact (cardinal_iInter_mem hS).trans Subtype.forall
Mathlib/Order/Filter/CardinalInter.lean
102
105
theorem eventually_cardinal_forall {p : Ξ± β†’ ΞΉ β†’ Prop} (hic : #ΞΉ < c) : (βˆ€αΆ  x in l, βˆ€ i, p x i) ↔ βˆ€ i, βˆ€αΆ  x in l, p x i := by
simp only [Filter.Eventually, setOf_forall] exact cardinal_iInter_mem hic
[ " βˆ€ (S : Set (Set Ξ±)), #↑S < β„΅β‚€ β†’ (βˆ€ s ∈ S, s ∈ l) β†’ β‹‚β‚€ S ∈ l", " β‹‚ i, s i ∈ l ↔ βˆ€ (i : ΞΉ), s i ∈ l", " (β‹‚β‚€ range fun i => s i) ∈ l ↔ βˆ€ (i : ΞΉ), s i ∈ l", " (βˆ€ s_1 ∈ range fun i => s i, s_1 ∈ l) ↔ βˆ€ (i : ΞΉ), s i ∈ l", " β‹‚ i, β‹‚ (hi : i ∈ S), s i hi ∈ l ↔ βˆ€ (i : ΞΉ) (hi : i ∈ S), s i hi ∈ l", " β‹‚ x, s ↑x β‹― ∈...
import Mathlib.SetTheory.Cardinal.Ordinal #align_import set_theory.cardinal.continuum from "leanprover-community/mathlib"@"e08a42b2dd544cf11eba72e5fc7bf199d4349925" namespace Cardinal universe u v open Cardinal def continuum : Cardinal.{u} := 2 ^ β„΅β‚€ #align cardinal.continuum Cardinal.continuum scoped notation "𝔠" => Cardinal.continuum @[simp] theorem two_power_aleph0 : 2 ^ aleph0.{u} = continuum.{u} := rfl #align cardinal.two_power_aleph_0 Cardinal.two_power_aleph0 @[simp] theorem lift_continuum : lift.{v} 𝔠 = 𝔠 := by rw [← two_power_aleph0, lift_two_power, lift_aleph0, two_power_aleph0] #align cardinal.lift_continuum Cardinal.lift_continuum @[simp] theorem continuum_le_lift {c : Cardinal.{u}} : 𝔠 ≀ lift.{v} c ↔ 𝔠 ≀ c := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le] #align cardinal.continuum_le_lift Cardinal.continuum_le_lift @[simp]
Mathlib/SetTheory/Cardinal/Continuum.lean
52
54
theorem lift_le_continuum {c : Cardinal.{u}} : lift.{v} c ≀ 𝔠 ↔ c ≀ 𝔠 := by
-- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le]
[ " lift.{v, u_1} 𝔠 = 𝔠", " 𝔠 ≀ lift.{v, u} c ↔ 𝔠 ≀ c", " lift.{v, u} c ≀ 𝔠 ↔ c ≀ 𝔠" ]
import Mathlib.CategoryTheory.Adjunction.Whiskering import Mathlib.CategoryTheory.Sites.PreservesSheafification #align_import category_theory.sites.adjunction from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" namespace CategoryTheory open GrothendieckTopology CategoryTheory Limits Opposite universe v u variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C) variable {D : Type*} [Category D] variable {E : Type*} [Category E] variable {F : D β₯€ E} {G : E β₯€ D} variable [HasWeakSheafify J D] abbrev sheafForget [ConcreteCategory D] [HasSheafCompose J (forget D)] : Sheaf J D β₯€ SheafOfTypes J := sheafCompose J (forget D) β‹™ (sheafEquivSheafOfTypes J).functor set_option linter.uppercaseLean3 false in #align category_theory.Sheaf_forget CategoryTheory.sheafForget namespace Sheaf noncomputable section @[simps] def composeEquiv [HasSheafCompose J F] (adj : G ⊣ F) (X : Sheaf J E) (Y : Sheaf J D) : ((composeAndSheafify J G).obj X ⟢ Y) ≃ (X ⟢ (sheafCompose J F).obj Y) := let A := adj.whiskerRight Cα΅’α΅– { toFun := fun Ξ· => ⟨A.homEquiv _ _ (toSheafify J _ ≫ Ξ·.val)⟩ invFun := fun Ξ³ => ⟨sheafifyLift J ((A.homEquiv _ _).symm ((sheafToPresheaf _ _).map Ξ³)) Y.2⟩ left_inv := by intro Ξ· ext1 dsimp symm apply sheafifyLift_unique rw [Equiv.symm_apply_apply] right_inv := by intro Ξ³ ext1 dsimp -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [toSheafify_sheafifyLift, Equiv.apply_symm_apply] } set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.compose_equiv CategoryTheory.Sheaf.composeEquiv -- These lemmas have always been bad (#7657), but leanprover/lean4#2644 made `simp` start noticing attribute [nolint simpNF] CategoryTheory.Sheaf.composeEquiv_apply_val CategoryTheory.Sheaf.composeEquiv_symm_apply_val @[simps! unit_app_val counit_app_val] def adjunction [HasSheafCompose J F] (adj : G ⊣ F) : composeAndSheafify J G ⊣ sheafCompose J F := Adjunction.mkOfHomEquiv { homEquiv := composeEquiv J adj homEquiv_naturality_left_symm := fun f g => by ext1 dsimp [composeEquiv] rw [sheafifyMap_sheafifyLift] erw [Adjunction.homEquiv_naturality_left_symm] rw [whiskeringRight_obj_map] rfl homEquiv_naturality_right := fun f g => by ext dsimp [composeEquiv] erw [Adjunction.homEquiv_unit, Adjunction.homEquiv_unit] dsimp simp } set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.adjunction CategoryTheory.Sheaf.adjunction instance [F.IsRightAdjoint] : (sheafCompose J F).IsRightAdjoint := (adjunction J (Adjunction.ofIsRightAdjoint F)).isRightAdjoint instance [G.IsLeftAdjoint] : (composeAndSheafify J G).IsLeftAdjoint := (adjunction J (Adjunction.ofIsLeftAdjoint G)).isLeftAdjoint lemma preservesSheafification_of_adjunction (adj : G ⊣ F) : J.PreservesSheafification G where le P Q f hf := by have := adj.isRightAdjoint rw [MorphismProperty.inverseImage_iff] dsimp intro R hR rw [← ((adj.whiskerRight Cα΅’α΅–).homEquiv P R).comp_bijective] convert (((adj.whiskerRight Cα΅’α΅–).homEquiv Q R).trans (hf.homEquiv (R β‹™ F) ((sheafCompose J F).obj ⟨R, hR⟩).cond)).bijective ext g X dsimp [Adjunction.whiskerRight, Adjunction.mkOfUnitCounit] simp instance [G.IsLeftAdjoint] : J.PreservesSheafification G := preservesSheafification_of_adjunction J (Adjunction.ofIsLeftAdjoint G) section ForgetToType variable [ConcreteCategory D] [HasSheafCompose J (forget D)] abbrev composeAndSheafifyFromTypes (G : Type max v u β₯€ D) : SheafOfTypes J β₯€ Sheaf J D := (sheafEquivSheafOfTypes J).inverse β‹™ composeAndSheafify _ G set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.compose_and_sheafify_from_types CategoryTheory.Sheaf.composeAndSheafifyFromTypes def adjunctionToTypes {G : Type max v u β₯€ D} (adj : G ⊣ forget D) : composeAndSheafifyFromTypes J G ⊣ sheafForget J := (sheafEquivSheafOfTypes J).symm.toAdjunction.comp (adjunction J adj) set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.adjunction_to_types CategoryTheory.Sheaf.adjunctionToTypes @[simp] theorem adjunctionToTypes_unit_app_val {G : Type max v u β₯€ D} (adj : G ⊣ forget D) (Y : SheafOfTypes J) : ((adjunctionToTypes J adj).unit.app Y).val = (adj.whiskerRight _).unit.app ((sheafOfTypesToPresheaf J).obj Y) ≫ whiskerRight (toSheafify J _) (forget D) := by dsimp [adjunctionToTypes, Adjunction.comp] simp rfl set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.adjunction_to_types_unit_app_val CategoryTheory.Sheaf.adjunctionToTypes_unit_app_val @[simp]
Mathlib/CategoryTheory/Sites/Adjunction.lean
148
160
theorem adjunctionToTypes_counit_app_val {G : Type max v u β₯€ D} (adj : G ⊣ forget D) (X : Sheaf J D) : ((adjunctionToTypes J adj).counit.app X).val = sheafifyLift J ((Functor.associator _ _ _).hom ≫ (adj.whiskerRight _).counit.app _) X.2 := by
apply sheafifyLift_unique dsimp only [adjunctionToTypes, Adjunction.comp, NatTrans.comp_app, instCategorySheaf_comp_val, instCategorySheaf_id_val] rw [adjunction_counit_app_val] erw [Category.id_comp, sheafifyMap_sheafifyLift, toSheafify_sheafifyLift] ext dsimp [sheafEquivSheafOfTypes, Equivalence.symm, Equivalence.toAdjunction, NatIso.ofComponents, Adjunction.whiskerRight, Adjunction.mkOfUnitCounit] simp
[ " Function.LeftInverse\n (fun Ξ³ =>\n { val := sheafifyLift J ((A.homEquiv ((sheafToPresheaf J E).obj X) Y.val).symm ((sheafToPresheaf J E).map Ξ³)) β‹― })\n fun Ξ· => { val := (A.homEquiv X.val Y.val) (toSheafify J (((whiskeringRight Cα΅’α΅– E D).obj G).obj X.val) ≫ Ξ·.val) }", " (fun Ξ³ =>\n {\n ...
import Mathlib.Algebra.Order.Ring.Basic import Mathlib.Algebra.Order.Ring.Int import Mathlib.Algebra.Ring.Divisibility.Basic import Mathlib.Data.Nat.Cast.Order #align_import algebra.order.ring.abs from "leanprover-community/mathlib"@"10b4e499f43088dd3bb7b5796184ad5216648ab1" #align_import data.nat.parity from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4" variable {Ξ± : Type*} lemma odd_abs [LinearOrder Ξ±] [Ring Ξ±] {a : Ξ±} : Odd (abs a) ↔ Odd a := by cases' abs_choice a with h h <;> simp only [h, odd_neg] section variable [Ring Ξ±] [LinearOrder Ξ±] {a b : Ξ±} @[simp]
Mathlib/Algebra/Order/Ring/Abs.lean
192
193
theorem abs_dvd (a b : Ξ±) : |a| ∣ b ↔ a ∣ b := by
cases' abs_choice a with h h <;> simp only [h, neg_dvd]
[ " Odd |a| ↔ Odd a", " |a| ∣ b ↔ a ∣ b" ]
import Mathlib.Algebra.IsPrimePow import Mathlib.Data.Nat.Factorization.Basic #align_import data.nat.factorization.prime_pow from "leanprover-community/mathlib"@"6ca1a09bc9aa75824bf97388c9e3b441fc4ccf3f" variable {R : Type*} [CommMonoidWithZero R] (n p : R) (k : β„•) theorem IsPrimePow.minFac_pow_factorization_eq {n : β„•} (hn : IsPrimePow n) : n.minFac ^ n.factorization n.minFac = n := by obtain ⟨p, k, hp, hk, rfl⟩ := hn rw [← Nat.prime_iff] at hp rw [hp.pow_minFac hk.ne', hp.factorization_pow, Finsupp.single_eq_same] #align is_prime_pow.min_fac_pow_factorization_eq IsPrimePow.minFac_pow_factorization_eq theorem isPrimePow_of_minFac_pow_factorization_eq {n : β„•} (h : n.minFac ^ n.factorization n.minFac = n) (hn : n β‰  1) : IsPrimePow n := by rcases eq_or_ne n 0 with (rfl | hn') Β· simp_all refine ⟨_, _, (Nat.minFac_prime hn).prime, ?_, h⟩ simp [pos_iff_ne_zero, ← Finsupp.mem_support_iff, Nat.support_factorization, hn', Nat.minFac_prime hn, Nat.minFac_dvd] #align is_prime_pow_of_min_fac_pow_factorization_eq isPrimePow_of_minFac_pow_factorization_eq theorem isPrimePow_iff_minFac_pow_factorization_eq {n : β„•} (hn : n β‰  1) : IsPrimePow n ↔ n.minFac ^ n.factorization n.minFac = n := ⟨fun h => h.minFac_pow_factorization_eq, fun h => isPrimePow_of_minFac_pow_factorization_eq h hn⟩ #align is_prime_pow_iff_min_fac_pow_factorization_eq isPrimePow_iff_minFac_pow_factorization_eq theorem isPrimePow_iff_factorization_eq_single {n : β„•} : IsPrimePow n ↔ βˆƒ p k : β„•, 0 < k ∧ n.factorization = Finsupp.single p k := by rw [isPrimePow_nat_iff] refine existsβ‚‚_congr fun p k => ?_ constructor Β· rintro ⟨hp, hk, hn⟩ exact ⟨hk, by rw [← hn, Nat.Prime.factorization_pow hp]⟩ Β· rintro ⟨hk, hn⟩ have hn0 : n β‰  0 := by rintro rfl simp_all only [Finsupp.single_eq_zero, eq_comm, Nat.factorization_zero, hk.ne'] rw [Nat.eq_pow_of_factorization_eq_single hn0 hn] exact ⟨Nat.prime_of_mem_primeFactors <| Finsupp.mem_support_iff.2 (by simp [hn, hk.ne'] : n.factorization p β‰  0), hk, rfl⟩ #align is_prime_pow_iff_factorization_eq_single isPrimePow_iff_factorization_eq_single theorem isPrimePow_iff_card_primeFactors_eq_one {n : β„•} : IsPrimePow n ↔ n.primeFactors.card = 1 := by simp_rw [isPrimePow_iff_factorization_eq_single, ← Nat.support_factorization, Finsupp.card_support_eq_one', pos_iff_ne_zero] #align is_prime_pow_iff_card_support_factorization_eq_one isPrimePow_iff_card_primeFactors_eq_one
Mathlib/Data/Nat/Factorization/PrimePow.lean
63
73
theorem IsPrimePow.exists_ord_compl_eq_one {n : β„•} (h : IsPrimePow n) : βˆƒ p : β„•, p.Prime ∧ ord_compl[p] n = 1 := by
rcases eq_or_ne n 0 with (rfl | hn0); Β· cases not_isPrimePow_zero h rcases isPrimePow_iff_factorization_eq_single.mp h with ⟨p, k, hk0, h1⟩ rcases em' p.Prime with (pp | pp) Β· refine absurd ?_ hk0.ne' simp [← Nat.factorization_eq_zero_of_non_prime n pp, h1] refine ⟨p, pp, ?_⟩ refine Nat.eq_of_factorization_eq (Nat.ord_compl_pos p hn0).ne' (by simp) fun q => ?_ rw [Nat.factorization_ord_compl n p, h1] simp
[ " n.minFac ^ n.factorization n.minFac = n", " (p ^ k).minFac ^ (p ^ k).factorization (p ^ k).minFac = p ^ k", " IsPrimePow n", " IsPrimePow 0", " 0 < n.factorization n.minFac", " IsPrimePow n ↔ βˆƒ p k, 0 < k ∧ n.factorization = Finsupp.single p k", " (βˆƒ p k, p.Prime ∧ 0 < k ∧ p ^ k = n) ↔ βˆƒ p k, 0 < k ∧ ...
import Mathlib.GroupTheory.OrderOfElement import Mathlib.Data.Finset.NoncommProd import Mathlib.Data.Fintype.BigOperators import Mathlib.Data.Nat.GCD.BigOperators import Mathlib.Order.SupIndep #align_import group_theory.noncomm_pi_coprod from "leanprover-community/mathlib"@"6f9f36364eae3f42368b04858fd66d6d9ae730d8" section FamilyOfMonoids variable {M : Type*} [Monoid M] -- We have a family of monoids -- The fintype assumption is not always used, but declared here, to keep things in order variable {ΞΉ : Type*} [DecidableEq ΞΉ] [Fintype ΞΉ] variable {N : ΞΉ β†’ Type*} [βˆ€ i, Monoid (N i)] -- And morphisms Ο• into G variable (Ο• : βˆ€ i : ΞΉ, N i β†’* M) -- We assume that the elements of different morphism commute variable (hcomm : Pairwise fun i j => βˆ€ x y, Commute (Ο• i x) (Ο• j y)) -- We use `f` and `g` to denote elements of `Ξ  (i : ΞΉ), N i` variable (f g : βˆ€ i : ΞΉ, N i) namespace MonoidHom @[to_additive "The canonical homomorphism from a family of additive monoids. See also `LinearMap.lsum` for a linear version without the commutativity assumption."] def noncommPiCoprod : (βˆ€ i : ΞΉ, N i) β†’* M where toFun f := Finset.univ.noncommProd (fun i => Ο• i (f i)) fun i _ j _ h => hcomm h _ _ map_one' := by apply (Finset.noncommProd_eq_pow_card _ _ _ _ _).trans (one_pow _) simp map_mul' f g := by classical simp only convert @Finset.noncommProd_mul_distrib _ _ _ _ (fun i => Ο• i (f i)) (fun i => Ο• i (g i)) _ _ _ Β· exact map_mul _ _ _ Β· rintro i - j - h exact hcomm h _ _ #align monoid_hom.noncomm_pi_coprod MonoidHom.noncommPiCoprod #align add_monoid_hom.noncomm_pi_coprod AddMonoidHom.noncommPiCoprod variable {hcomm} @[to_additive (attr := simp)]
Mathlib/GroupTheory/NoncommPiCoprod.lean
125
137
theorem noncommPiCoprod_mulSingle (i : ΞΉ) (y : N i) : noncommPiCoprod Ο• hcomm (Pi.mulSingle i y) = Ο• i y := by
change Finset.univ.noncommProd (fun j => Ο• j (Pi.mulSingle i y j)) (fun _ _ _ _ h => hcomm h _ _) = Ο• i y rw [← Finset.insert_erase (Finset.mem_univ i)] rw [Finset.noncommProd_insert_of_not_mem _ _ _ _ (Finset.not_mem_erase i _)] rw [Pi.mulSingle_eq_same] rw [Finset.noncommProd_eq_pow_card] Β· rw [one_pow] exact mul_one _ Β· intro j hj simp only [Finset.mem_erase] at hj simp [hj]
[ " (fun f => Finset.univ.noncommProd (fun i => (Ο• i) (f i)) β‹―) 1 = 1", " βˆ€ x ∈ Finset.univ, (Ο• x) (1 x) = 1", " { toFun := fun f => Finset.univ.noncommProd (fun i => (Ο• i) (f i)) β‹―, map_one' := β‹― }.toFun (f * g) =\n { toFun := fun f => Finset.univ.noncommProd (fun i => (Ο• i) (f i)) β‹―, map_one' := β‹― }.toFun f ...
import Mathlib.NumberTheory.ZetaValues import Mathlib.NumberTheory.LSeries.RiemannZeta open Complex Real Set open scoped Nat namespace HurwitzZeta variable {k : β„•} {x : ℝ} theorem cosZeta_two_mul_nat (hk : k β‰  0) (hx : x ∈ Icc 0 1) : cosZeta x (2 * k) = (-1) ^ (k + 1) * (2 * Ο€) ^ (2 * k) / 2 / (2 * k)! * ((Polynomial.bernoulli (2 * k)).map (algebraMap β„š β„‚)).eval (x : β„‚) := by rw [← (hasSum_nat_cosZeta x (?_ : 1 < re (2 * k))).tsum_eq] refine Eq.trans ?_ <| (congr_arg ofReal' (hasSum_one_div_nat_pow_mul_cos hk hx).tsum_eq).trans ?_ Β· rw [ofReal_tsum] refine tsum_congr fun n ↦ ?_ rw [mul_comm (1 / _), mul_one_div, ofReal_div, mul_assoc (2 * Ο€), mul_comm x n, ← mul_assoc, ← Nat.cast_ofNat (R := β„‚), ← Nat.cast_mul, cpow_natCast, ofReal_pow, ofReal_natCast] Β· simp only [ofReal_mul, ofReal_div, ofReal_pow, ofReal_natCast, ofReal_ofNat, ofReal_neg, ofReal_one] congr 1 have : (Polynomial.bernoulli (2 * k)).map (algebraMap β„š β„‚) = _ := (Polynomial.map_map (algebraMap β„š ℝ) ofReal _).symm rw [this, ← ofReal_eq_coe, ← ofReal_eq_coe] apply Polynomial.map_aeval_eq_aeval_map simp only [Algebra.id.map_eq_id, RingHomCompTriple.comp_eq] Β· rw [← Nat.cast_ofNat, ← Nat.cast_one, ← Nat.cast_mul, natCast_re, Nat.cast_lt] omega theorem sinZeta_two_mul_nat_add_one (hk : k β‰  0) (hx : x ∈ Icc 0 1) : sinZeta x (2 * k + 1) = (-1) ^ (k + 1) * (2 * Ο€) ^ (2 * k + 1) / 2 / (2 * k + 1)! * ((Polynomial.bernoulli (2 * k + 1)).map (algebraMap β„š β„‚)).eval (x : β„‚) := by rw [← (hasSum_nat_sinZeta x (?_ : 1 < re (2 * k + 1))).tsum_eq] refine Eq.trans ?_ <| (congr_arg ofReal' (hasSum_one_div_nat_pow_mul_sin hk hx).tsum_eq).trans ?_ Β· rw [ofReal_tsum] refine tsum_congr fun n ↦ ?_ rw [mul_comm (1 / _), mul_one_div, ofReal_div, mul_assoc (2 * Ο€), mul_comm x n, ← mul_assoc] congr 1 rw [← Nat.cast_ofNat, ← Nat.cast_mul, ← Nat.cast_add_one, cpow_natCast, ofReal_pow, ofReal_natCast] Β· simp only [ofReal_mul, ofReal_div, ofReal_pow, ofReal_natCast, ofReal_ofNat, ofReal_neg, ofReal_one] congr 1 have : (Polynomial.bernoulli (2 * k + 1)).map (algebraMap β„š β„‚) = _ := (Polynomial.map_map (algebraMap β„š ℝ) ofReal _).symm rw [this, ← ofReal_eq_coe, ← ofReal_eq_coe] apply Polynomial.map_aeval_eq_aeval_map simp only [Algebra.id.map_eq_id, RingHomCompTriple.comp_eq] Β· rw [← Nat.cast_ofNat, ← Nat.cast_one, ← Nat.cast_mul, ← Nat.cast_add_one, natCast_re, Nat.cast_lt, lt_add_iff_pos_left] exact mul_pos two_pos (Nat.pos_of_ne_zero hk) theorem cosZeta_two_mul_nat' (hk : k β‰  0) (hx : x ∈ Icc (0 : ℝ) 1) : cosZeta x (2 * k) = (-1) ^ (k + 1) / (2 * k) / Gammaβ„‚ (2 * k) * ((Polynomial.bernoulli (2 * k)).map (algebraMap β„š β„‚)).eval (x : β„‚) := by rw [cosZeta_two_mul_nat hk hx] congr 1 have : (2 * k)! = (2 * k) * Complex.Gamma (2 * k) := by rw [(by { norm_cast; omega } : 2 * (k : β„‚) = ↑(2 * k - 1) + 1), Complex.Gamma_nat_eq_factorial, ← Nat.cast_add_one, ← Nat.cast_mul, ← Nat.factorial_succ, Nat.sub_add_cancel (by omega)] simp_rw [this, Gammaβ„‚, cpow_neg, ← div_div, div_inv_eq_mul, div_mul_eq_mul_div, div_div, mul_right_comm (2 : β„‚) (k : β„‚)] norm_cast
Mathlib/NumberTheory/LSeries/HurwitzZetaValues.lean
113
124
theorem sinZeta_two_mul_nat_add_one' (hk : k β‰  0) (hx : x ∈ Icc (0 : ℝ) 1) : sinZeta x (2 * k + 1) = (-1) ^ (k + 1) / (2 * k + 1) / Gammaβ„‚ (2 * k + 1) * ((Polynomial.bernoulli (2 * k + 1)).map (algebraMap β„š β„‚)).eval (x : β„‚) := by
rw [sinZeta_two_mul_nat_add_one hk hx] congr 1 have : (2 * k + 1)! = (2 * k + 1) * Complex.Gamma (2 * k + 1) := by rw [(by simp : Complex.Gamma (2 * k + 1) = Complex.Gamma (↑(2 * k) + 1)), Complex.Gamma_nat_eq_factorial, ← Nat.cast_ofNat (R := β„‚), ← Nat.cast_mul, ← Nat.cast_add_one, ← Nat.cast_mul, ← Nat.factorial_succ] simp_rw [this, Gammaβ„‚, cpow_neg, ← div_div, div_inv_eq_mul, div_mul_eq_mul_div, div_div] rw [(by simp : 2 * (k : β„‚) + 1 = ↑(2 * k + 1)), cpow_natCast] ring
[ " cosZeta (↑x) (2 * ↑k) =\n (-1) ^ (k + 1) * (2 * ↑π) ^ (2 * k) / 2 / ↑(2 * k)! *\n Polynomial.eval (↑x) (Polynomial.map (algebraMap β„š β„‚) (Polynomial.bernoulli (2 * k)))", " 1 < (2 * ↑k).re", " βˆ‘' (b : β„•), ↑(2 * Ο€ * x * ↑b).cos / ↑b ^ (2 * ↑k) = ↑(βˆ‘' (b : β„•), 1 / ↑b ^ (2 * k) * (2 * Ο€ * ↑b * x).cos)", ...
import Mathlib.Data.Fin.VecNotation import Mathlib.GroupTheory.Abelianization import Mathlib.GroupTheory.Perm.ViaEmbedding import Mathlib.GroupTheory.Subgroup.Simple import Mathlib.SetTheory.Cardinal.Basic #align_import group_theory.solvable from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" open Subgroup variable {G G' : Type*} [Group G] [Group G'] {f : G β†’* G'} section derivedSeries variable (G) def derivedSeries : β„• β†’ Subgroup G | 0 => ⊀ | n + 1 => ⁅derivedSeries n, derivedSeries n⁆ #align derived_series derivedSeries @[simp] theorem derivedSeries_zero : derivedSeries G 0 = ⊀ := rfl #align derived_series_zero derivedSeries_zero @[simp] theorem derivedSeries_succ (n : β„•) : derivedSeries G (n + 1) = ⁅derivedSeries G n, derivedSeries G n⁆ := rfl #align derived_series_succ derivedSeries_succ -- Porting note: had to provide inductive hypothesis explicitly
Mathlib/GroupTheory/Solvable.lean
56
59
theorem derivedSeries_normal (n : β„•) : (derivedSeries G n).Normal := by
induction' n with n ih · exact (⊀ : Subgroup G).normal_of_characteristic · exact @Subgroup.commutator_normal G _ (derivedSeries G n) (derivedSeries G n) ih ih
[ " (derivedSeries G n).Normal", " (derivedSeries G 0).Normal", " (derivedSeries G (n + 1)).Normal" ]
import Mathlib.Algebra.Order.Field.Basic import Mathlib.Data.Nat.Cast.Order import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Nat.Cast.Order #align_import data.nat.choose.bounds from "leanprover-community/mathlib"@"550b58538991c8977703fdeb7c9d51a5aa27df11" open Nat variable {Ξ± : Type*} [LinearOrderedSemifield Ξ±] namespace Nat
Mathlib/Data/Nat/Choose/Bounds.lean
32
37
theorem choose_le_pow (r n : β„•) : (n.choose r : Ξ±) ≀ (n ^ r : Ξ±) / r ! := by
rw [le_div_iff'] Β· norm_cast rw [← Nat.descFactorial_eq_factorial_mul_choose] exact n.descFactorial_le_pow r exact mod_cast r.factorial_pos
[ " ↑(n.choose r) ≀ ↑n ^ r / ↑r !", " ↑r ! * ↑(n.choose r) ≀ ↑n ^ r", " r ! * n.choose r ≀ n ^ r", " n.descFactorial r ≀ n ^ r", " 0 < ↑r !" ]
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial IntermediateField open Polynomial IntermediateField section AbelRuffini variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E] theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by infer_instance #align gal_zero_is_solvable gal_zero_isSolvable theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by infer_instance #align gal_one_is_solvable gal_one_isSolvable theorem gal_C_isSolvable (x : F) : IsSolvable (C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_C_is_solvable gal_C_isSolvable
Mathlib/FieldTheory/AbelRuffini.lean
49
49
theorem gal_X_isSolvable : IsSolvable (X : F[X]).Gal := by
infer_instance
[ " IsSolvable (Gal 0)", " IsSolvable (Gal 1)", " IsSolvable (C x).Gal", " IsSolvable X.Gal" ]
import Mathlib.Data.List.Infix #align_import data.list.rdrop from "leanprover-community/mathlib"@"26f081a2fb920140ed5bc5cc5344e84bcc7cb2b2" -- Make sure we don't import algebra assert_not_exists Monoid variable {Ξ± : Type*} (p : Ξ± β†’ Bool) (l : List Ξ±) (n : β„•) namespace List def rdrop : List Ξ± := l.take (l.length - n) #align list.rdrop List.rdrop @[simp] theorem rdrop_nil : rdrop ([] : List Ξ±) n = [] := by simp [rdrop] #align list.rdrop_nil List.rdrop_nil @[simp] theorem rdrop_zero : rdrop l 0 = l := by simp [rdrop] #align list.rdrop_zero List.rdrop_zero theorem rdrop_eq_reverse_drop_reverse : l.rdrop n = reverse (l.reverse.drop n) := by rw [rdrop] induction' l using List.reverseRecOn with xs x IH generalizing n Β· simp Β· cases n Β· simp [take_append] Β· simp [take_append_eq_append_take, IH] #align list.rdrop_eq_reverse_drop_reverse List.rdrop_eq_reverse_drop_reverse @[simp] theorem rdrop_concat_succ (x : Ξ±) : rdrop (l ++ [x]) (n + 1) = rdrop l n := by simp [rdrop_eq_reverse_drop_reverse] #align list.rdrop_concat_succ List.rdrop_concat_succ def rtake : List Ξ± := l.drop (l.length - n) #align list.rtake List.rtake @[simp] theorem rtake_nil : rtake ([] : List Ξ±) n = [] := by simp [rtake] #align list.rtake_nil List.rtake_nil @[simp] theorem rtake_zero : rtake l 0 = [] := by simp [rtake] #align list.rtake_zero List.rtake_zero theorem rtake_eq_reverse_take_reverse : l.rtake n = reverse (l.reverse.take n) := by rw [rtake] induction' l using List.reverseRecOn with xs x IH generalizing n Β· simp Β· cases n Β· exact drop_length _ Β· simp [drop_append_eq_append_drop, IH] #align list.rtake_eq_reverse_take_reverse List.rtake_eq_reverse_take_reverse @[simp] theorem rtake_concat_succ (x : Ξ±) : rtake (l ++ [x]) (n + 1) = rtake l n ++ [x] := by simp [rtake_eq_reverse_take_reverse] #align list.rtake_concat_succ List.rtake_concat_succ def rdropWhile : List Ξ± := reverse (l.reverse.dropWhile p) #align list.rdrop_while List.rdropWhile @[simp] theorem rdropWhile_nil : rdropWhile p ([] : List Ξ±) = [] := by simp [rdropWhile, dropWhile] #align list.rdrop_while_nil List.rdropWhile_nil theorem rdropWhile_concat (x : Ξ±) : rdropWhile p (l ++ [x]) = if p x then rdropWhile p l else l ++ [x] := by simp only [rdropWhile, dropWhile, reverse_append, reverse_singleton, singleton_append] split_ifs with h <;> simp [h] #align list.rdrop_while_concat List.rdropWhile_concat @[simp] theorem rdropWhile_concat_pos (x : Ξ±) (h : p x) : rdropWhile p (l ++ [x]) = rdropWhile p l := by rw [rdropWhile_concat, if_pos h] #align list.rdrop_while_concat_pos List.rdropWhile_concat_pos @[simp] theorem rdropWhile_concat_neg (x : Ξ±) (h : Β¬p x) : rdropWhile p (l ++ [x]) = l ++ [x] := by rw [rdropWhile_concat, if_neg h] #align list.rdrop_while_concat_neg List.rdropWhile_concat_neg theorem rdropWhile_singleton (x : Ξ±) : rdropWhile p [x] = if p x then [] else [x] := by rw [← nil_append [x], rdropWhile_concat, rdropWhile_nil] #align list.rdrop_while_singleton List.rdropWhile_singleton theorem rdropWhile_last_not (hl : l.rdropWhile p β‰  []) : Β¬p ((rdropWhile p l).getLast hl) := by simp_rw [rdropWhile] rw [getLast_reverse] exact dropWhile_nthLe_zero_not _ _ _ #align list.rdrop_while_last_not List.rdropWhile_last_not theorem rdropWhile_prefix : l.rdropWhile p <+: l := by rw [← reverse_suffix, rdropWhile, reverse_reverse] exact dropWhile_suffix _ #align list.rdrop_while_prefix List.rdropWhile_prefix variable {p} {l} @[simp] theorem rdropWhile_eq_nil_iff : rdropWhile p l = [] ↔ βˆ€ x ∈ l, p x := by simp [rdropWhile] #align list.rdrop_while_eq_nil_iff List.rdropWhile_eq_nil_iff -- it is in this file because it requires `List.Infix` @[simp] theorem dropWhile_eq_self_iff : dropWhile p l = l ↔ βˆ€ hl : 0 < l.length, Β¬p (l.get ⟨0, hl⟩) := by cases' l with hd tl Β· simp only [dropWhile, true_iff] intro h by_contra rwa [length_nil, lt_self_iff_false] at h Β· rw [dropWhile] refine ⟨fun h => ?_, fun h => ?_⟩ Β· intro _ H rw [get] at H refine (cons_ne_self hd tl) (Sublist.antisymm ?_ (sublist_cons _ _)) rw [← h] simp only [H] exact List.IsSuffix.sublist (dropWhile_suffix p) Β· have := h (by simp only [length, Nat.succ_pos]) rw [get] at this simp_rw [this] #align list.drop_while_eq_self_iff List.dropWhile_eq_self_iff @[simp] theorem rdropWhile_eq_self_iff : rdropWhile p l = l ↔ βˆ€ hl : l β‰  [], Β¬p (l.getLast hl) := by simp only [rdropWhile, reverse_eq_iff, dropWhile_eq_self_iff, getLast_eq_get] refine ⟨fun h hl => ?_, fun h hl => ?_⟩ Β· rw [← length_pos, ← length_reverse] at hl have := h hl rwa [get_reverse'] at this Β· rw [length_reverse, length_pos] at hl have := h hl rwa [get_reverse'] #align list.rdrop_while_eq_self_iff List.rdropWhile_eq_self_iff variable (p) (l)
Mathlib/Data/List/DropRight.lean
179
181
theorem dropWhile_idempotent : dropWhile p (dropWhile p l) = dropWhile p l := by
simp only [dropWhile_eq_self_iff] exact fun h => dropWhile_nthLe_zero_not p l h
[ " [].rdrop n = []", " l.rdrop 0 = l", " l.rdrop n = (drop n l.reverse).reverse", " take (l.length - n) l = (drop n l.reverse).reverse", " take ([].length - n) [] = (drop n [].reverse).reverse", " take ((xs ++ [x]).length - n) (xs ++ [x]) = (drop n (xs ++ [x]).reverse).reverse", " take ((xs ++ [x]).lengt...
import Mathlib.Algebra.Polynomial.FieldDivision import Mathlib.FieldTheory.Minpoly.Basic import Mathlib.RingTheory.Algebraic #align_import field_theory.minpoly.field from "leanprover-community/mathlib"@"cbdf7b565832144d024caa5a550117c6df0204a5" open scoped Classical open Polynomial Set Function minpoly namespace minpoly variable {A B : Type*} variable (A) [Field A] section Ring variable [Ring B] [Algebra A B] (x : B) theorem degree_le_of_ne_zero {p : A[X]} (pnz : p β‰  0) (hp : Polynomial.aeval x p = 0) : degree (minpoly A x) ≀ degree p := calc degree (minpoly A x) ≀ degree (p * C (leadingCoeff p)⁻¹) := min A x (monic_mul_leadingCoeff_inv pnz) (by simp [hp]) _ = degree p := degree_mul_leadingCoeff_inv p pnz #align minpoly.degree_le_of_ne_zero minpoly.degree_le_of_ne_zero theorem ne_zero_of_finite (e : B) [FiniteDimensional A B] : minpoly A e β‰  0 := minpoly.ne_zero <| .of_finite A _ #align minpoly.ne_zero_of_finite_field_extension minpoly.ne_zero_of_finite theorem unique {p : A[X]} (pmonic : p.Monic) (hp : Polynomial.aeval x p = 0) (pmin : βˆ€ q : A[X], q.Monic β†’ Polynomial.aeval x q = 0 β†’ degree p ≀ degree q) : p = minpoly A x := by have hx : IsIntegral A x := ⟨p, pmonic, hp⟩ symm; apply eq_of_sub_eq_zero by_contra hnz apply degree_le_of_ne_zero A x hnz (by simp [hp]) |>.not_lt apply degree_sub_lt _ (minpoly.ne_zero hx) Β· rw [(monic hx).leadingCoeff, pmonic.leadingCoeff] Β· exact le_antisymm (min A x pmonic hp) (pmin (minpoly A x) (monic hx) (aeval A x)) #align minpoly.unique minpoly.unique theorem dvd {p : A[X]} (hp : Polynomial.aeval x p = 0) : minpoly A x ∣ p := by by_cases hp0 : p = 0 Β· simp only [hp0, dvd_zero] have hx : IsIntegral A x := IsAlgebraic.isIntegral ⟨p, hp0, hp⟩ rw [← modByMonic_eq_zero_iff_dvd (monic hx)] by_contra hnz apply degree_le_of_ne_zero A x hnz ((aeval_modByMonic_eq_self_of_root (monic hx) (aeval _ _)).trans hp) |>.not_lt exact degree_modByMonic_lt _ (monic hx) #align minpoly.dvd minpoly.dvd variable {A x} in lemma dvd_iff {p : A[X]} : minpoly A x ∣ p ↔ Polynomial.aeval x p = 0 := ⟨fun ⟨q, hq⟩ ↦ by rw [hq, map_mul, aeval, zero_mul], minpoly.dvd A x⟩ theorem isRadical [IsReduced B] : IsRadical (minpoly A x) := fun n p dvd ↦ by rw [dvd_iff] at dvd ⊒; rw [map_pow] at dvd; exact IsReduced.eq_zero _ ⟨n, dvd⟩
Mathlib/FieldTheory/Minpoly/Field.lean
86
90
theorem dvd_map_of_isScalarTower (A K : Type*) {R : Type*} [CommRing A] [Field K] [CommRing R] [Algebra A K] [Algebra A R] [Algebra K R] [IsScalarTower A K R] (x : R) : minpoly K x ∣ (minpoly A x).map (algebraMap A K) := by
refine minpoly.dvd K x ?_ rw [aeval_map_algebraMap, minpoly.aeval]
[ " (Polynomial.aeval x) (p * C p.leadingCoeff⁻¹) = 0", " p = minpoly A x", " minpoly A x = p", " minpoly A x - p = 0", " False", " (Polynomial.aeval x) (minpoly A x - p) = 0", " (minpoly A x - p).degree < (minpoly A x).degree", " (minpoly A x).leadingCoeff = p.leadingCoeff", " (minpoly A x).degree = ...
import Mathlib.SetTheory.Game.Basic import Mathlib.Tactic.NthRewrite #align_import set_theory.game.impartial from "leanprover-community/mathlib"@"2e0975f6a25dd3fbfb9e41556a77f075f6269748" universe u namespace SetTheory open scoped PGame namespace PGame def ImpartialAux : PGame β†’ Prop | G => (G β‰ˆ -G) ∧ (βˆ€ i, ImpartialAux (G.moveLeft i)) ∧ βˆ€ j, ImpartialAux (G.moveRight j) termination_by G => G -- Porting note: Added `termination_by` #align pgame.impartial_aux SetTheory.PGame.ImpartialAux
Mathlib/SetTheory/Game/Impartial.lean
35
38
theorem impartialAux_def {G : PGame} : G.ImpartialAux ↔ (G β‰ˆ -G) ∧ (βˆ€ i, ImpartialAux (G.moveLeft i)) ∧ βˆ€ j, ImpartialAux (G.moveRight j) := by
rw [ImpartialAux]
[ " G.ImpartialAux ↔\n G β‰ˆ -G ∧ (βˆ€ (i : G.LeftMoves), (G.moveLeft i).ImpartialAux) ∧ βˆ€ (j : G.RightMoves), (G.moveRight j).ImpartialAux" ]
import Mathlib.Data.Finset.Pointwise #align_import combinatorics.additive.e_transform from "leanprover-community/mathlib"@"207c92594599a06e7c134f8d00a030a83e6c7259" open MulOpposite open Pointwise variable {Ξ± : Type*} [DecidableEq Ξ±] namespace Finset section Group variable [Group Ξ±] (e : Ξ±) (x : Finset Ξ± Γ— Finset Ξ±) @[to_additive (attr := simps) "An **e-transform**. Turns `(s, t)` into `(s ∩ s +α΅₯ e, t βˆͺ -e +α΅₯ t)`. This reduces the sum of the two sets."] def mulETransformLeft : Finset Ξ± Γ— Finset Ξ± := (x.1 ∩ op e β€’ x.1, x.2 βˆͺ e⁻¹ β€’ x.2) #align finset.mul_e_transform_left Finset.mulETransformLeft #align finset.add_e_transform_left Finset.addETransformLeft @[to_additive (attr := simps) "An **e-transform**. Turns `(s, t)` into `(s βˆͺ s +α΅₯ e, t ∩ -e +α΅₯ t)`. This reduces the sum of the two sets."] def mulETransformRight : Finset Ξ± Γ— Finset Ξ± := (x.1 βˆͺ op e β€’ x.1, x.2 ∩ e⁻¹ β€’ x.2) #align finset.mul_e_transform_right Finset.mulETransformRight #align finset.add_e_transform_right Finset.addETransformRight @[to_additive (attr := simp)] theorem mulETransformLeft_one : mulETransformLeft 1 x = x := by simp [mulETransformLeft] #align finset.mul_e_transform_left_one Finset.mulETransformLeft_one #align finset.add_e_transform_left_zero Finset.addETransformLeft_zero @[to_additive (attr := simp)] theorem mulETransformRight_one : mulETransformRight 1 x = x := by simp [mulETransformRight] #align finset.mul_e_transform_right_one Finset.mulETransformRight_one #align finset.add_e_transform_right_zero Finset.addETransformRight_zero @[to_additive]
Mathlib/Combinatorics/Additive/ETransform.lean
142
145
theorem mulETransformLeft.fst_mul_snd_subset : (mulETransformLeft e x).1 * (mulETransformLeft e x).2 βŠ† x.1 * x.2 := by
refine inter_mul_union_subset_union.trans (union_subset Subset.rfl ?_) rw [op_smul_finset_mul_eq_mul_smul_finset, smul_inv_smul]
[ " mulETransformLeft 1 x = x", " mulETransformRight 1 x = x", " (mulETransformLeft e x).1 * (mulETransformLeft e x).2 βŠ† x.1 * x.2", " op e β€’ x.1 * e⁻¹ β€’ x.2 βŠ† x.1 * x.2" ]
import Mathlib.Topology.ContinuousFunction.ZeroAtInfty open Topology Filter variable {E F 𝓕 : Type*} variable [SeminormedAddGroup E] [SeminormedAddCommGroup F] variable [FunLike 𝓕 E F] [ZeroAtInftyContinuousMapClass 𝓕 E F]
Mathlib/Analysis/Normed/Group/ZeroAtInfty.lean
24
34
theorem ZeroAtInftyContinuousMapClass.norm_le (f : 𝓕) (Ξ΅ : ℝ) (hΞ΅ : 0 < Ξ΅) : βˆƒ (r : ℝ), βˆ€ (x : E) (_hx : r < β€–xβ€–), β€–f xβ€– < Ξ΅ := by
have h := zero_at_infty f rw [tendsto_zero_iff_norm_tendsto_zero, tendsto_def] at h specialize h (Metric.ball 0 Ξ΅) (Metric.ball_mem_nhds 0 hΞ΅) rcases Metric.closedBall_compl_subset_of_mem_cocompact h 0 with ⟨r, hr⟩ use r intro x hr' suffices x ∈ (fun x ↦ β€–f xβ€–) ⁻¹' Metric.ball 0 Ξ΅ by aesop apply hr aesop
[ " βˆƒ r, βˆ€ (x : E), r < β€–xβ€– β†’ β€–f xβ€– < Ξ΅", " βˆ€ (x : E), r < β€–xβ€– β†’ β€–f xβ€– < Ξ΅", " β€–f xβ€– < Ξ΅", " x ∈ (fun x => β€–f xβ€–) ⁻¹' Metric.ball 0 Ξ΅", " x ∈ (Metric.closedBall 0 r)ᢜ" ]
import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Finset.Image import Mathlib.Data.Multiset.Fold #align_import data.finset.fold from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" -- TODO: -- assert_not_exists OrderedCommMonoid assert_not_exists MonoidWithZero namespace Finset open Multiset variable {Ξ± Ξ² Ξ³ : Type*} section Fold variable (op : Ξ² β†’ Ξ² β†’ Ξ²) [hc : Std.Commutative op] [ha : Std.Associative op] local notation a " * " b => op a b def fold (b : Ξ²) (f : Ξ± β†’ Ξ²) (s : Finset Ξ±) : Ξ² := (s.1.map f).fold op b #align finset.fold Finset.fold variable {op} {f : Ξ± β†’ Ξ²} {b : Ξ²} {s : Finset Ξ±} {a : Ξ±} @[simp] theorem fold_empty : (βˆ… : Finset Ξ±).fold op b f = b := rfl #align finset.fold_empty Finset.fold_empty @[simp] theorem fold_cons (h : a βˆ‰ s) : (cons a s h).fold op b f = f a * s.fold op b f := by dsimp only [fold] rw [cons_val, Multiset.map_cons, fold_cons_left] #align finset.fold_cons Finset.fold_cons @[simp] theorem fold_insert [DecidableEq Ξ±] (h : a βˆ‰ s) : (insert a s).fold op b f = f a * s.fold op b f := by unfold fold rw [insert_val, ndinsert_of_not_mem h, Multiset.map_cons, fold_cons_left] #align finset.fold_insert Finset.fold_insert @[simp] theorem fold_singleton : ({a} : Finset Ξ±).fold op b f = f a * b := rfl #align finset.fold_singleton Finset.fold_singleton @[simp] theorem fold_map {g : Ξ³ β†ͺ Ξ±} {s : Finset Ξ³} : (s.map g).fold op b f = s.fold op b (f ∘ g) := by simp only [fold, map, Multiset.map_map] #align finset.fold_map Finset.fold_map @[simp] theorem fold_image [DecidableEq Ξ±] {g : Ξ³ β†’ Ξ±} {s : Finset Ξ³} (H : βˆ€ x ∈ s, βˆ€ y ∈ s, g x = g y β†’ x = y) : (s.image g).fold op b f = s.fold op b (f ∘ g) := by simp only [fold, image_val_of_injOn H, Multiset.map_map] #align finset.fold_image Finset.fold_image @[congr] theorem fold_congr {g : Ξ± β†’ Ξ²} (H : βˆ€ x ∈ s, f x = g x) : s.fold op b f = s.fold op b g := by rw [fold, fold, map_congr rfl H] #align finset.fold_congr Finset.fold_congr
Mathlib/Data/Finset/Fold.lean
83
85
theorem fold_op_distrib {f g : Ξ± β†’ Ξ²} {b₁ bβ‚‚ : Ξ²} : (s.fold op (b₁ * bβ‚‚) fun x => f x * g x) = s.fold op b₁ f * s.fold op bβ‚‚ g := by
simp only [fold, fold_distrib]
[ " fold op b f (cons a s h) = op (f a) (fold op b f s)", " Multiset.fold op b (Multiset.map f (cons a s h).val) = op (f a) (Multiset.fold op b (Multiset.map f s.val))", " fold op b f (insert a s) = op (f a) (fold op b f s)", " Multiset.fold op b (Multiset.map f (insert a s).val) = op (f a) (Multiset.fold op 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 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β‚‚] #align category_theory.cover_dense.ext CategoryTheory.Functor.IsCoverDense.ext variable {G}
Mathlib/CategoryTheory/Sites/DenseSubsite.lean
133
141
theorem functorPullback_pushforward_covering [Full G] {X : C} (T : K (G.obj X)) : (T.val.functorPullback G).functorPushforward G ∈ K (G.obj X) := by
refine K.superset_covering ?_ (K.bind_covering T.property fun Y f _ => G.is_cover_of_isCoverDense K Y) rintro Y _ ⟨Z, _, f, hf, ⟨W, g, f', ⟨rfl⟩⟩, rfl⟩ use W; use G.preimage (f' ≫ f); use g constructor Β· simpa using T.val.downward_closed hf f' Β· simp
[ " (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...
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce" open Set Filter MeasureTheory MeasurableSpace open scoped Classical Topology NNReal ENNReal MeasureTheory universe u v w x y variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {ΞΉ : Sort y} {s t u : Set Ξ±} namespace Real theorem borel_eq_generateFrom_Ioo_rat : borel ℝ = .generateFrom (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := isTopologicalBasis_Ioo_rat.borel_eq_generateFrom #align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iio (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsLUB (range ((↑) : β„š β†’ ℝ) ∩ Iio a) a := by simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le] rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp)
Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
56
66
theorem borel_eq_generateFrom_Ioi_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ioi (a : ℝ)}) := by
rw [borel_eq_generateFrom_Ioi] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsGLB (range ((↑) : β„š β†’ ℝ) ∩ Ioi a) a := by simp [isGLB_iff_le_iff, mem_lowerBounds, ← le_iff_forall_lt_rat_imp_le] rw [← this.biUnion_Ioi_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Ioi (b : ℝ)) (by simp)
[ " borel ℝ = generateFrom (⋃ a, {Iio ↑a})", " generateFrom (range Iio) = generateFrom (⋃ a, {Iio ↑a})", " βˆ€ t ∈ range Iio, MeasurableSet t", " MeasurableSet (Iio a)", " IsLUB (range Rat.cast ∩ Iio a) a", " MeasurableSet (⋃ y ∈ Rat.cast ⁻¹' Iio a, Iio ↑y)", " Iio ↑b ∈ ⋃ a, {Iio ↑a}", " borel ℝ = generat...
import Mathlib.SetTheory.Cardinal.Finite #align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8" noncomputable section open scoped Classical variable {Ξ± Ξ² Ξ³ : Type*} def Finite.equivFin (Ξ± : Type*) [Finite Ξ±] : Ξ± ≃ Fin (Nat.card Ξ±) := by have := (Finite.exists_equiv_fin Ξ±).choose_spec.some rwa [Nat.card_eq_of_equiv_fin this] #align finite.equiv_fin Finite.equivFin def Finite.equivFinOfCardEq [Finite Ξ±] {n : β„•} (h : Nat.card Ξ± = n) : Ξ± ≃ Fin n := by subst h apply Finite.equivFin #align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq theorem Nat.card_eq (Ξ± : Type*) : Nat.card Ξ± = if h : Finite Ξ± then @Fintype.card Ξ± (Fintype.ofFinite Ξ±) else 0 := by cases finite_or_infinite Ξ± Β· letI := Fintype.ofFinite Ξ± simp only [*, Nat.card_eq_fintype_card, dif_pos] Β· simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false] #align nat.card_eq Nat.card_eq theorem Finite.card_pos_iff [Finite Ξ±] : 0 < Nat.card Ξ± ↔ Nonempty Ξ± := by haveI := Fintype.ofFinite Ξ± rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff] #align finite.card_pos_iff Finite.card_pos_iff theorem Finite.card_pos [Finite Ξ±] [h : Nonempty Ξ±] : 0 < Nat.card Ξ± := Finite.card_pos_iff.mpr h #align finite.card_pos Finite.card_pos namespace Finite theorem cast_card_eq_mk {Ξ± : Type*} [Finite Ξ±] : ↑(Nat.card Ξ±) = Cardinal.mk Ξ± := Cardinal.cast_toNat_of_lt_aleph0 (Cardinal.lt_aleph0_of_finite Ξ±) #align finite.cast_card_eq_mk Finite.cast_card_eq_mk theorem card_eq [Finite Ξ±] [Finite Ξ²] : Nat.card Ξ± = Nat.card Ξ² ↔ Nonempty (Ξ± ≃ Ξ²) := by haveI := Fintype.ofFinite Ξ± haveI := Fintype.ofFinite Ξ² simp only [Nat.card_eq_fintype_card, Fintype.card_eq] #align finite.card_eq Finite.card_eq theorem card_le_one_iff_subsingleton [Finite Ξ±] : Nat.card Ξ± ≀ 1 ↔ Subsingleton Ξ± := by haveI := Fintype.ofFinite Ξ± simp only [Nat.card_eq_fintype_card, Fintype.card_le_one_iff_subsingleton] #align finite.card_le_one_iff_subsingleton Finite.card_le_one_iff_subsingleton
Mathlib/Data/Finite/Card.lean
83
85
theorem one_lt_card_iff_nontrivial [Finite Ξ±] : 1 < Nat.card Ξ± ↔ Nontrivial Ξ± := by
haveI := Fintype.ofFinite Ξ± simp only [Nat.card_eq_fintype_card, Fintype.one_lt_card_iff_nontrivial]
[ " Ξ± ≃ Fin (Nat.card Ξ±)", " Ξ± ≃ Fin n", " Nat.card Ξ± = if h : Finite Ξ± then Fintype.card Ξ± else 0", " 0 < Nat.card Ξ± ↔ Nonempty Ξ±", " Nat.card Ξ± = Nat.card Ξ² ↔ Nonempty (Ξ± ≃ Ξ²)", " Nat.card Ξ± ≀ 1 ↔ Subsingleton Ξ±", " 1 < Nat.card Ξ± ↔ Nontrivial Ξ±" ]
import Mathlib.Algebra.Algebra.Bilinear import Mathlib.RingTheory.Localization.Basic #align_import algebra.module.localized_module from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" section IsLocalizedModule universe u v variable {R : Type*} [CommSemiring R] (S : Submonoid R) variable {M M' M'' : Type*} [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M''] variable {A : Type*} [CommSemiring A] [Algebra R A] [Module A M'] [IsLocalization S A] variable [Module R M] [Module R M'] [Module R M''] [IsScalarTower R A M'] variable (f : M β†’β‚—[R] M') (g : M β†’β‚—[R] M'') @[mk_iff] class IsLocalizedModule : Prop where map_units : βˆ€ x : S, IsUnit (algebraMap R (Module.End R M') x) surj' : βˆ€ y : M', βˆƒ x : M Γ— S, x.2 β€’ y = f x.1 exists_of_eq : βˆ€ {x₁ xβ‚‚}, f x₁ = f xβ‚‚ β†’ βˆƒ c : S, c β€’ x₁ = c β€’ xβ‚‚ #align is_localized_module IsLocalizedModule attribute [nolint docBlame] IsLocalizedModule.map_units IsLocalizedModule.surj' IsLocalizedModule.exists_of_eq -- Porting note: Manually added to make `S` and `f` explicit. lemma IsLocalizedModule.surj [IsLocalizedModule S f] (y : M') : βˆƒ x : M Γ— S, x.2 β€’ y = f x.1 := surj' y -- Porting note: Manually added to make `S` and `f` explicit. lemma IsLocalizedModule.eq_iff_exists [IsLocalizedModule S f] {x₁ xβ‚‚} : f x₁ = f xβ‚‚ ↔ βˆƒ c : S, c β€’ x₁ = c β€’ xβ‚‚ := Iff.intro exists_of_eq fun ⟨c, h⟩ ↦ by apply_fun f at h simp_rw [f.map_smul_of_tower, Submonoid.smul_def, ← Module.algebraMap_end_apply R R] at h exact ((Module.End_isUnit_iff _).mp <| map_units f c).1 h
Mathlib/Algebra/Module/LocalizedModule.lean
574
588
theorem IsLocalizedModule.of_linearEquiv (e : M' ≃ₗ[R] M'') [hf : IsLocalizedModule S f] : IsLocalizedModule S (e βˆ˜β‚— f : M β†’β‚—[R] M'') where map_units s := by
rw [show algebraMap R (Module.End R M'') s = e βˆ˜β‚— (algebraMap R (Module.End R M') s) βˆ˜β‚— e.symm by ext; simp, Module.End_isUnit_iff, LinearMap.coe_comp, LinearMap.coe_comp, LinearEquiv.coe_coe, LinearEquiv.coe_coe, EquivLike.comp_bijective, EquivLike.bijective_comp] exact (Module.End_isUnit_iff _).mp <| hf.map_units s surj' x := by obtain ⟨p, h⟩ := hf.surj' (e.symm x) exact ⟨p, by rw [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply, ← e.congr_arg h, Submonoid.smul_def, Submonoid.smul_def, LinearEquiv.map_smul, LinearEquiv.apply_symm_apply]⟩ exists_of_eq h := by simp_rw [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply, EmbeddingLike.apply_eq_iff_eq] at h exact hf.exists_of_eq h
[ " f x₁ = f xβ‚‚", " IsUnit ((algebraMap R (Module.End R M'')) ↑s)", " (algebraMap R (Module.End R M'')) ↑s = ↑e βˆ˜β‚— (algebraMap R (Module.End R M')) ↑s βˆ˜β‚— ↑e.symm", " ((algebraMap R (Module.End R M'')) ↑s) x✝ = (↑e βˆ˜β‚— (algebraMap R (Module.End R M')) ↑s βˆ˜β‚— ↑e.symm) x✝", " Function.Bijective ⇑((algebraMap R (Mo...
import Mathlib.Algebra.Field.Basic import Mathlib.Algebra.GroupWithZero.Units.Equiv import Mathlib.Algebra.Order.Field.Defs import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Order.Bounds.OrderIso import Mathlib.Tactic.Positivity.Core #align_import algebra.order.field.basic from "leanprover-community/mathlib"@"84771a9f5f0bd5e5d6218811556508ddf476dcbd" open Function OrderDual variable {ΞΉ Ξ± Ξ² : Type*} section LinearOrderedSemifield variable [LinearOrderedSemifield Ξ±] {a b c d e : Ξ±} {m n : β„€} @[simps! (config := { simpRhs := true })] def OrderIso.mulLeftβ‚€ (a : Ξ±) (ha : 0 < a) : Ξ± ≃o Ξ± := { Equiv.mulLeftβ‚€ a ha.ne' with map_rel_iff' := @fun _ _ => mul_le_mul_left ha } #align order_iso.mul_leftβ‚€ OrderIso.mulLeftβ‚€ #align order_iso.mul_leftβ‚€_symm_apply OrderIso.mulLeftβ‚€_symm_apply #align order_iso.mul_leftβ‚€_apply OrderIso.mulLeftβ‚€_apply @[simps! (config := { simpRhs := true })] def OrderIso.mulRightβ‚€ (a : Ξ±) (ha : 0 < a) : Ξ± ≃o Ξ± := { Equiv.mulRightβ‚€ a ha.ne' with map_rel_iff' := @fun _ _ => mul_le_mul_right ha } #align order_iso.mul_rightβ‚€ OrderIso.mulRightβ‚€ #align order_iso.mul_rightβ‚€_symm_apply OrderIso.mulRightβ‚€_symm_apply #align order_iso.mul_rightβ‚€_apply OrderIso.mulRightβ‚€_apply theorem le_div_iff (hc : 0 < c) : a ≀ b / c ↔ a * c ≀ b := ⟨fun h => div_mul_cancelβ‚€ b (ne_of_lt hc).symm β–Έ mul_le_mul_of_nonneg_right h hc.le, fun h => calc a = a * c * (1 / c) := mul_mul_div a (ne_of_lt hc).symm _ ≀ b * (1 / c) := mul_le_mul_of_nonneg_right h (one_div_pos.2 hc).le _ = b / c := (div_eq_mul_one_div b c).symm ⟩ #align le_div_iff le_div_iff theorem le_div_iff' (hc : 0 < c) : a ≀ b / c ↔ c * a ≀ b := by rw [mul_comm, le_div_iff hc] #align le_div_iff' le_div_iff' theorem div_le_iff (hb : 0 < b) : a / b ≀ c ↔ a ≀ c * b := ⟨fun h => calc a = a / b * b := by rw [div_mul_cancelβ‚€ _ (ne_of_lt hb).symm] _ ≀ c * b := mul_le_mul_of_nonneg_right h hb.le , fun h => calc a / b = a * (1 / b) := div_eq_mul_one_div a b _ ≀ c * b * (1 / b) := mul_le_mul_of_nonneg_right h (one_div_pos.2 hb).le _ = c * b / b := (div_eq_mul_one_div (c * b) b).symm _ = c := by refine (div_eq_iff (ne_of_gt hb)).mpr rfl ⟩ #align div_le_iff div_le_iff theorem div_le_iff' (hb : 0 < b) : a / b ≀ c ↔ a ≀ b * c := by rw [mul_comm, div_le_iff hb] #align div_le_iff' div_le_iff' lemma div_le_commβ‚€ (hb : 0 < b) (hc : 0 < c) : a / b ≀ c ↔ a / c ≀ b := by rw [div_le_iff hb, div_le_iff' hc] theorem lt_div_iff (hc : 0 < c) : a < b / c ↔ a * c < b := lt_iff_lt_of_le_iff_le <| div_le_iff hc #align lt_div_iff lt_div_iff
Mathlib/Algebra/Order/Field/Basic.lean
86
86
theorem lt_div_iff' (hc : 0 < c) : a < b / c ↔ c * a < b := by
rw [mul_comm, lt_div_iff hc]
[ " a ≀ b / c ↔ c * a ≀ b", " a = a / b * b", " c * b / b = c", " a / b ≀ c ↔ a ≀ b * c", " a / b ≀ c ↔ a / c ≀ b", " a < b / c ↔ c * a < b" ]
import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.IsConnected import Mathlib.CategoryTheory.Limits.Final import Mathlib.CategoryTheory.Conj universe w v u namespace CategoryTheory.Limits.Types variable (C : Type u) [Category.{v} C] def constPUnitFunctor : C β₯€ Type w := (Functor.const C).obj PUnit.{w + 1} @[simps] def pUnitCocone : Cocone (constPUnitFunctor.{w} C) where pt := PUnit ΞΉ := { app := fun X => id } noncomputable def isColimitPUnitCocone [IsConnected C] : IsColimit (pUnitCocone.{w} C) where desc s := s.ΞΉ.app Classical.ofNonempty fac s j := by ext ⟨⟩ apply constant_of_preserves_morphisms (s.ΞΉ.app Β· PUnit.unit) intros X Y f exact congrFun (s.ΞΉ.naturality f).symm PUnit.unit uniq s m h := by ext ⟨⟩ simp [← h Classical.ofNonempty] instance instHasColimitConstPUnitFunctor [IsConnected C] : HasColimit (constPUnitFunctor.{w} C) := ⟨_, isColimitPUnitCocone _⟩ instance instSubsingletonColimitPUnit [IsPreconnected C] [HasColimit (constPUnitFunctor.{w} C)] : Subsingleton (colimit (constPUnitFunctor.{w} C)) where allEq a b := by obtain ⟨c, ⟨⟩, rfl⟩ := jointly_surjective' a obtain ⟨d, ⟨⟩, rfl⟩ := jointly_surjective' b apply constant_of_preserves_morphisms (colimit.ΞΉ (constPUnitFunctor C) Β· PUnit.unit) exact fun c d f => colimit_sound f rfl noncomputable def colimitConstPUnitIsoPUnit [IsConnected C] : colimit (constPUnitFunctor.{w} C) β‰… PUnit.{w + 1} := IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) (isColimitPUnitCocone.{w} C)
Mathlib/CategoryTheory/Limits/IsConnected.lean
87
93
theorem zigzag_of_eqvGen_quot_rel (F : C β₯€ Type w) (c d : Ξ£ j, F.obj j) (h : EqvGen (Quot.Rel F) c d) : Zigzag c.1 d.1 := by
induction h with | rel _ _ h => exact Zigzag.of_hom <| Exists.choose h | refl _ => exact Zigzag.refl _ | symm _ _ _ ih => exact zigzag_symmetric ih | trans _ _ _ _ _ ih₁ ihβ‚‚ => exact ih₁.trans ihβ‚‚
[ " (pUnitCocone C).ΞΉ.app j ≫ (fun s => s.ΞΉ.app Classical.ofNonempty) s = s.ΞΉ.app j", " ((pUnitCocone C).ΞΉ.app j ≫ (fun s => s.ΞΉ.app Classical.ofNonempty) s) PUnit.unit = s.ΞΉ.app j PUnit.unit", " βˆ€ (j₁ jβ‚‚ : C), (j₁ ⟢ jβ‚‚) β†’ s.ΞΉ.app j₁ PUnit.unit = s.ΞΉ.app jβ‚‚ PUnit.unit", " s.ΞΉ.app X PUnit.unit = s.ΞΉ.app Y PUnit....
import Mathlib.Combinatorics.SetFamily.Shadow #align_import combinatorics.set_family.compression.uv from "leanprover-community/mathlib"@"6f8ab7de1c4b78a68ab8cf7dd83d549eb78a68a1" open Finset variable {Ξ± : Type*}
Mathlib/Combinatorics/SetFamily/Compression/UV.lean
57
64
theorem sup_sdiff_injOn [GeneralizedBooleanAlgebra Ξ±] (u v : Ξ±) : { x | Disjoint u x ∧ v ≀ x }.InjOn fun x => (x βŠ” u) \ v := by
rintro a ha b hb hab have h : ((a βŠ” u) \ v) \ u βŠ” v = ((b βŠ” u) \ v) \ u βŠ” v := by dsimp at hab rw [hab] rwa [sdiff_sdiff_comm, ha.1.symm.sup_sdiff_cancel_right, sdiff_sdiff_comm, hb.1.symm.sup_sdiff_cancel_right, sdiff_sup_cancel ha.2, sdiff_sup_cancel hb.2] at h
[ " Set.InjOn (fun x => (x βŠ” u) \\ v) {x | Disjoint u x ∧ v ≀ x}", " a = b", " ((a βŠ” u) \\ v) \\ u βŠ” v = ((b βŠ” u) \\ v) \\ u βŠ” v" ]
import Mathlib.Algebra.Order.Ring.Int import Mathlib.Data.Nat.SuccPred #align_import data.int.succ_pred from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Function Order namespace Int -- so that Lean reads `Int.succ` through `SuccOrder.succ` @[instance] abbrev instSuccOrder : SuccOrder β„€ := { SuccOrder.ofSuccLeIff succ fun {_ _} => Iff.rfl with succ := succ } -- so that Lean reads `Int.pred` through `PredOrder.pred` @[instance] abbrev instPredOrder : PredOrder β„€ where pred := pred pred_le _ := (sub_one_lt_of_le le_rfl).le min_of_le_pred ha := ((sub_one_lt_of_le le_rfl).not_le ha).elim le_pred_of_lt {_ _} := le_sub_one_of_lt le_of_pred_lt {_ _} := le_of_sub_one_lt @[simp] theorem succ_eq_succ : Order.succ = succ := rfl #align int.succ_eq_succ Int.succ_eq_succ @[simp] theorem pred_eq_pred : Order.pred = pred := rfl #align int.pred_eq_pred Int.pred_eq_pred theorem pos_iff_one_le {a : β„€} : 0 < a ↔ 1 ≀ a := Order.succ_le_iff.symm #align int.pos_iff_one_le Int.pos_iff_one_le theorem succ_iterate (a : β„€) : βˆ€ n, succ^[n] a = a + n | 0 => (add_zero a).symm | n + 1 => by rw [Function.iterate_succ', Int.ofNat_succ, ← add_assoc] exact congr_arg _ (succ_iterate a n) #align int.succ_iterate Int.succ_iterate theorem pred_iterate (a : β„€) : βˆ€ n, pred^[n] a = a - n | 0 => (sub_zero a).symm | n + 1 => by rw [Function.iterate_succ', Int.ofNat_succ, ← sub_sub] exact congr_arg _ (pred_iterate a n) #align int.pred_iterate Int.pred_iterate instance : IsSuccArchimedean β„€ := ⟨fun {a b} h => ⟨(b - a).toNat, by rw [succ_eq_succ, succ_iterate, toNat_sub_of_le h, ← add_sub_assoc, add_sub_cancel_left]⟩⟩ instance : IsPredArchimedean β„€ := ⟨fun {a b} h => ⟨(b - a).toNat, by rw [pred_eq_pred, pred_iterate, toNat_sub_of_le h, sub_sub_cancel]⟩⟩ protected theorem covBy_iff_succ_eq {m n : β„€} : m β‹– n ↔ m + 1 = n := succ_eq_iff_covBy.symm #align int.covby_iff_succ_eq Int.covBy_iff_succ_eq @[simp]
Mathlib/Data/Int/SuccPred.lean
79
79
theorem sub_one_covBy (z : β„€) : z - 1 β‹– z := by
rw [Int.covBy_iff_succ_eq, sub_add_cancel]
[ " succ^[n + 1] a = a + ↑(n + 1)", " (succ ∘ succ^[n]) a = a + ↑n + 1", " pred^[n + 1] a = a - ↑(n + 1)", " (pred ∘ pred^[n]) a = a - ↑n - 1", " Order.succ^[(b - a).toNat] a = b", " Order.pred^[(b - a).toNat] b = a", " z - 1 β‹– z" ]
import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer import Mathlib.CategoryTheory.Limits.Constructions.EpiMono import Mathlib.CategoryTheory.Limits.Preserves.Limits import Mathlib.CategoryTheory.Limits.Shapes.Types #align_import category_theory.glue_data from "leanprover-community/mathlib"@"14b69e9f3c16630440a2cbd46f1ddad0d561dee7" noncomputable section open CategoryTheory.Limits namespace CategoryTheory universe v u₁ uβ‚‚ variable (C : Type u₁) [Category.{v} C] {C' : Type uβ‚‚} [Category.{v} C'] -- Porting note(#5171): linter not ported yet -- @[nolint has_nonempty_instance] structure GlueData where J : Type v U : J β†’ C V : J Γ— J β†’ C f : βˆ€ i j, V (i, j) ⟢ U i f_mono : βˆ€ i j, Mono (f i j) := by infer_instance f_hasPullback : βˆ€ i j k, HasPullback (f i j) (f i k) := by infer_instance f_id : βˆ€ i, IsIso (f i i) := by infer_instance t : βˆ€ i j, V (i, j) ⟢ V (j, i) t_id : βˆ€ i, t i i = πŸ™ _ t' : βˆ€ i j k, pullback (f i j) (f i k) ⟢ pullback (f j k) (f j i) t_fac : βˆ€ i j k, t' i j k ≫ pullback.snd = pullback.fst ≫ t i j cocycle : βˆ€ i j k, t' i j k ≫ t' j k i ≫ t' k i j = πŸ™ _ #align category_theory.glue_data CategoryTheory.GlueData attribute [simp] GlueData.t_id attribute [instance] GlueData.f_id GlueData.f_mono GlueData.f_hasPullback attribute [reassoc] GlueData.t_fac GlueData.cocycle namespace GlueData variable {C} variable (D : GlueData C) @[simp] theorem t'_iij (i j : D.J) : D.t' i i j = (pullbackSymmetry _ _).hom := by have eq₁ := D.t_fac i i j have eqβ‚‚ := (IsIso.eq_comp_inv (D.f i i)).mpr (@pullback.condition _ _ _ _ _ _ (D.f i j) _) rw [D.t_id, Category.comp_id, eqβ‚‚] at eq₁ have eq₃ := (IsIso.eq_comp_inv (D.f i i)).mp eq₁ rw [Category.assoc, ← pullback.condition, ← Category.assoc] at eq₃ exact Mono.right_cancellation _ _ ((Mono.right_cancellation _ _ eq₃).trans (pullbackSymmetry_hom_comp_fst _ _).symm) #align category_theory.glue_data.t'_iij CategoryTheory.GlueData.t'_iij theorem t'_jii (i j : D.J) : D.t' j i i = pullback.fst ≫ D.t j i ≫ inv pullback.snd := by rw [← Category.assoc, ← D.t_fac] simp #align category_theory.glue_data.t'_jii CategoryTheory.GlueData.t'_jii theorem t'_iji (i j : D.J) : D.t' i j i = pullback.fst ≫ D.t i j ≫ inv pullback.snd := by rw [← Category.assoc, ← D.t_fac] simp #align category_theory.glue_data.t'_iji CategoryTheory.GlueData.t'_iji @[reassoc, elementwise (attr := simp)]
Mathlib/CategoryTheory/GlueData.lean
99
105
theorem t_inv (i j : D.J) : D.t i j ≫ D.t j i = πŸ™ _ := by
have eq : (pullbackSymmetry (D.f i i) (D.f i j)).hom = pullback.snd ≫ inv pullback.fst := by simp have := D.cocycle i j i rw [D.t'_iij, D.t'_jii, D.t'_iji, fst_eq_snd_of_mono_eq, eq] at this simp only [Category.assoc, IsIso.inv_hom_id_assoc] at this rw [← IsIso.eq_inv_comp, ← Category.assoc, IsIso.comp_inv_eq] at this simpa using this
[ " D.t' i i j = (pullbackSymmetry (D.f i i) (D.f i j)).hom", " D.t' j i i = pullback.fst ≫ D.t j i ≫ inv pullback.snd", " D.t' j i i = (D.t' j i i ≫ pullback.snd) ≫ inv pullback.snd", " D.t' i j i = pullback.fst ≫ D.t i j ≫ inv pullback.snd", " D.t' i j i = (D.t' i j i ≫ pullback.snd) ≫ inv pullback.snd", ...
import Mathlib.MeasureTheory.PiSystem import Mathlib.Order.OmegaCompletePartialOrder import Mathlib.Topology.Constructions import Mathlib.MeasureTheory.MeasurableSpace.Basic open Set namespace MeasureTheory variable {ΞΉ : Type _} {Ξ± : ΞΉ β†’ Type _} section cylinder def cylinder (s : Finset ΞΉ) (S : Set (βˆ€ i : s, Ξ± i)) : Set (βˆ€ i, Ξ± i) := (fun (f : βˆ€ i, Ξ± i) (i : s) ↦ f i) ⁻¹' S @[simp] theorem mem_cylinder (s : Finset ΞΉ) (S : Set (βˆ€ i : s, Ξ± i)) (f : βˆ€ i, Ξ± i) : f ∈ cylinder s S ↔ (fun i : s ↦ f i) ∈ S := mem_preimage @[simp]
Mathlib/MeasureTheory/Constructions/Cylinders.lean
161
162
theorem cylinder_empty (s : Finset ΞΉ) : cylinder s (βˆ… : Set (βˆ€ i : s, Ξ± i)) = βˆ… := by
rw [cylinder, preimage_empty]
[ " cylinder s βˆ… = βˆ…" ]
import Mathlib.CategoryTheory.Closed.Cartesian import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts import Mathlib.CategoryTheory.Adjunction.FullyFaithful #align_import category_theory.closed.functor from "leanprover-community/mathlib"@"cea27692b3fdeb328a2ddba6aabf181754543184" noncomputable section namespace CategoryTheory open Category Limits CartesianClosed universe v u u' variable {C : Type u} [Category.{v} C] variable {D : Type u'} [Category.{v} D] variable [HasFiniteProducts C] [HasFiniteProducts D] variable (F : C β₯€ D) {L : D β₯€ C} def frobeniusMorphism (h : L ⊣ F) (A : C) : prod.functor.obj (F.obj A) β‹™ L ⟢ L β‹™ prod.functor.obj A := prodComparisonNatTrans L (F.obj A) ≫ whiskerLeft _ (prod.functor.map (h.counit.app _)) #align category_theory.frobenius_morphism CategoryTheory.frobeniusMorphism instance frobeniusMorphism_iso_of_preserves_binary_products (h : L ⊣ F) (A : C) [PreservesLimitsOfShape (Discrete WalkingPair) L] [F.Full] [F.Faithful] : IsIso (frobeniusMorphism F h A) := suffices βˆ€ (X : D), IsIso ((frobeniusMorphism F h A).app X) from NatIso.isIso_of_isIso_app _ fun B ↦ by dsimp [frobeniusMorphism]; infer_instance #align category_theory.frobenius_morphism_iso_of_preserves_binary_products CategoryTheory.frobeniusMorphism_iso_of_preserves_binary_products variable [CartesianClosed C] [CartesianClosed D] variable [PreservesLimitsOfShape (Discrete WalkingPair) F] def expComparison (A : C) : exp A β‹™ F ⟢ F β‹™ exp (F.obj A) := transferNatTrans (exp.adjunction A) (exp.adjunction (F.obj A)) (prodComparisonNatIso F A).inv #align category_theory.exp_comparison CategoryTheory.expComparison theorem expComparison_ev (A B : C) : Limits.prod.map (πŸ™ (F.obj A)) ((expComparison F A).app B) ≫ (exp.ev (F.obj A)).app (F.obj B) = inv (prodComparison F _ _) ≫ F.map ((exp.ev _).app _) := by convert transferNatTrans_counit _ _ (prodComparisonNatIso F A).inv B using 2 apply IsIso.inv_eq_of_hom_inv_id -- Porting note: was `ext` simp only [Limits.prodComparisonNatIso_inv, asIso_inv, NatIso.isIso_inv_app, IsIso.hom_inv_id] #align category_theory.exp_comparison_ev CategoryTheory.expComparison_ev theorem coev_expComparison (A B : C) : F.map ((exp.coev A).app B) ≫ (expComparison F A).app (A β¨― B) = (exp.coev _).app (F.obj B) ≫ (exp (F.obj A)).map (inv (prodComparison F A B)) := by convert unit_transferNatTrans _ _ (prodComparisonNatIso F A).inv B using 3 apply IsIso.inv_eq_of_hom_inv_id -- Porting note: was `ext` dsimp simp #align category_theory.coev_exp_comparison CategoryTheory.coev_expComparison theorem uncurry_expComparison (A B : C) : CartesianClosed.uncurry ((expComparison F A).app B) = inv (prodComparison F _ _) ≫ F.map ((exp.ev _).app _) := by rw [uncurry_eq, expComparison_ev] #align category_theory.uncurry_exp_comparison CategoryTheory.uncurry_expComparison theorem expComparison_whiskerLeft {A A' : C} (f : A' ⟢ A) : expComparison F A ≫ whiskerLeft _ (pre (F.map f)) = whiskerRight (pre f) _ ≫ expComparison F A' := by ext B dsimp apply uncurry_injective rw [uncurry_natural_left, uncurry_natural_left, uncurry_expComparison, uncurry_pre, prod.map_swap_assoc, ← F.map_id, expComparison_ev, ← F.map_id, ← prodComparison_inv_natural_assoc, ← prodComparison_inv_natural_assoc, ← F.map_comp, ← F.map_comp, prod_map_pre_app_comp_ev] #align category_theory.exp_comparison_whisker_left CategoryTheory.expComparison_whiskerLeft class CartesianClosedFunctor : Prop where comparison_iso : βˆ€ A, IsIso (expComparison F A) #align category_theory.cartesian_closed_functor CategoryTheory.CartesianClosedFunctor attribute [instance] CartesianClosedFunctor.comparison_iso theorem frobeniusMorphism_mate (h : L ⊣ F) (A : C) : transferNatTransSelf (h.comp (exp.adjunction A)) ((exp.adjunction (F.obj A)).comp h) (frobeniusMorphism F h A) = expComparison F A := by rw [← Equiv.eq_symm_apply] ext B : 2 dsimp [frobeniusMorphism, transferNatTransSelf, transferNatTrans, Adjunction.comp] simp only [id_comp, comp_id] rw [← L.map_comp_assoc, prod.map_id_comp, assoc] -- Porting note: need to use `erw` here. -- https://github.com/leanprover-community/mathlib4/issues/5164 erw [expComparison_ev] rw [prod.map_id_comp, assoc, ← F.map_id, ← prodComparison_inv_natural_assoc, ← F.map_comp] -- Porting note: need to use `erw` here. -- https://github.com/leanprover-community/mathlib4/issues/5164 erw [exp.ev_coev] rw [F.map_id (A β¨― L.obj B), comp_id] ext Β· rw [assoc, assoc, ← h.counit_naturality, ← L.map_comp_assoc, assoc, inv_prodComparison_map_fst] simp Β· rw [assoc, assoc, ← h.counit_naturality, ← L.map_comp_assoc, assoc, inv_prodComparison_map_snd] simp #align category_theory.frobenius_morphism_mate CategoryTheory.frobeniusMorphism_mate theorem frobeniusMorphism_iso_of_expComparison_iso (h : L ⊣ F) (A : C) [i : IsIso (expComparison F A)] : IsIso (frobeniusMorphism F h A) := by rw [← frobeniusMorphism_mate F h] at i exact @transferNatTransSelf_of_iso _ _ _ _ _ _ _ _ _ _ _ i #align category_theory.frobenius_morphism_iso_of_exp_comparison_iso CategoryTheory.frobeniusMorphism_iso_of_expComparison_iso
Mathlib/CategoryTheory/Closed/Functor.lean
166
168
theorem expComparison_iso_of_frobeniusMorphism_iso (h : L ⊣ F) (A : C) [i : IsIso (frobeniusMorphism F h A)] : IsIso (expComparison F A) := by
rw [← frobeniusMorphism_mate F h]; infer_instance
[ " IsIso ((frobeniusMorphism F h A).app B)", " IsIso (prodComparison L (F.obj A) B ≫ prod.map (h.counit.app A) (πŸ™ (L.obj B)))", " prod.map (πŸ™ (F.obj A)) ((expComparison F A).app B) ≫ (exp.ev (F.obj A)).app (F.obj B) =\n inv (prodComparison F A (A ⟹ B)) ≫ F.map ((exp.ev A).app B)", " inv (prodComparison F ...
import Mathlib.Algebra.Group.Subgroup.Pointwise import Mathlib.Data.ZMod.Basic import Mathlib.GroupTheory.GroupAction.ConjAct import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup #align_import number_theory.modular_forms.congruence_subgroups from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5" local notation "SL(" n ", " R ")" => Matrix.SpecialLinearGroup (Fin n) R attribute [-instance] Matrix.SpecialLinearGroup.instCoeFun local notation:1024 "β†‘β‚˜" A:1024 => ((A : SL(2, β„€)) : Matrix (Fin 2) (Fin 2) β„€) open Matrix.SpecialLinearGroup Matrix variable (N : β„•) local notation "SLMOD(" N ")" => @Matrix.SpecialLinearGroup.map (Fin 2) _ _ _ _ _ _ (Int.castRingHom (ZMod N)) set_option linter.uppercaseLean3 false @[simp] theorem SL_reduction_mod_hom_val (N : β„•) (Ξ³ : SL(2, β„€)) : βˆ€ i j : Fin 2, (SLMOD(N) Ξ³ : Matrix (Fin 2) (Fin 2) (ZMod N)) i j = ((β†‘β‚˜Ξ³ i j : β„€) : ZMod N) := fun _ _ => rfl #align SL_reduction_mod_hom_val SL_reduction_mod_hom_val def Gamma (N : β„•) : Subgroup SL(2, β„€) := SLMOD(N).ker #align Gamma Gamma theorem Gamma_mem' (N : β„•) (Ξ³ : SL(2, β„€)) : Ξ³ ∈ Gamma N ↔ SLMOD(N) Ξ³ = 1 := Iff.rfl #align Gamma_mem' Gamma_mem' @[simp] theorem Gamma_mem (N : β„•) (Ξ³ : SL(2, β„€)) : Ξ³ ∈ Gamma N ↔ ((β†‘β‚˜Ξ³ 0 0 : β„€) : ZMod N) = 1 ∧ ((β†‘β‚˜Ξ³ 0 1 : β„€) : ZMod N) = 0 ∧ ((β†‘β‚˜Ξ³ 1 0 : β„€) : ZMod N) = 0 ∧ ((β†‘β‚˜Ξ³ 1 1 : β„€) : ZMod N) = 1 := by rw [Gamma_mem'] constructor Β· intro h simp [← SL_reduction_mod_hom_val N Ξ³, h] Β· intro h ext i j rw [SL_reduction_mod_hom_val N Ξ³] fin_cases i <;> fin_cases j <;> simp only [h] exacts [h.1, h.2.1, h.2.2.1, h.2.2.2] #align Gamma_mem Gamma_mem theorem Gamma_normal (N : β„•) : Subgroup.Normal (Gamma N) := SLMOD(N).normal_ker #align Gamma_normal Gamma_normal
Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean
73
75
theorem Gamma_one_top : Gamma 1 = ⊀ := by
ext simp [eq_iff_true_of_subsingleton]
[ " Ξ³ ∈ Gamma N ↔ ↑(↑γ 0 0) = 1 ∧ ↑(↑γ 0 1) = 0 ∧ ↑(↑γ 1 0) = 0 ∧ ↑(↑γ 1 1) = 1", " (SpecialLinearGroup.map (Int.castRingHom (ZMod N))) Ξ³ = 1 ↔\n ↑(↑γ 0 0) = 1 ∧ ↑(↑γ 0 1) = 0 ∧ ↑(↑γ 1 0) = 0 ∧ ↑(↑γ 1 1) = 1", " (SpecialLinearGroup.map (Int.castRingHom (ZMod N))) Ξ³ = 1 β†’\n ↑(↑γ 0 0) = 1 ∧ ↑(↑γ 0 1) = 0 ∧ ↑(...
import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Localization.Ideal import Mathlib.RingTheory.Noetherian #align_import ring_theory.localization.submodule from "leanprover-community/mathlib"@"1ebb20602a8caef435ce47f6373e1aa40851a177" variable {R : Type*} [CommRing R] (M : Submonoid R) (S : Type*) [CommRing S] variable [Algebra R S] {P : Type*} [CommRing P] namespace IsLocalization -- This was previously a `hasCoe` instance, but if `S = R` then this will loop. -- It could be a `hasCoeT` instance, but we keep it explicit here to avoid slowing down -- the rest of the library. def coeSubmodule (I : Ideal R) : Submodule R S := Submodule.map (Algebra.linearMap R S) I #align is_localization.coe_submodule IsLocalization.coeSubmodule theorem mem_coeSubmodule (I : Ideal R) {x : S} : x ∈ coeSubmodule S I ↔ βˆƒ y : R, y ∈ I ∧ algebraMap R S y = x := Iff.rfl #align is_localization.mem_coe_submodule IsLocalization.mem_coeSubmodule theorem coeSubmodule_mono {I J : Ideal R} (h : I ≀ J) : coeSubmodule S I ≀ coeSubmodule S J := Submodule.map_mono h #align is_localization.coe_submodule_mono IsLocalization.coeSubmodule_mono @[simp] theorem coeSubmodule_bot : coeSubmodule S (βŠ₯ : Ideal R) = βŠ₯ := by rw [coeSubmodule, Submodule.map_bot] #align is_localization.coe_submodule_bot IsLocalization.coeSubmodule_bot @[simp] theorem coeSubmodule_top : coeSubmodule S (⊀ : Ideal R) = 1 := by rw [coeSubmodule, Submodule.map_top, Submodule.one_eq_range] #align is_localization.coe_submodule_top IsLocalization.coeSubmodule_top @[simp] theorem coeSubmodule_sup (I J : Ideal R) : coeSubmodule S (I βŠ” J) = coeSubmodule S I βŠ” coeSubmodule S J := Submodule.map_sup _ _ _ #align is_localization.coe_submodule_sup IsLocalization.coeSubmodule_sup @[simp] theorem coeSubmodule_mul (I J : Ideal R) : coeSubmodule S (I * J) = coeSubmodule S I * coeSubmodule S J := Submodule.map_mul _ _ (Algebra.ofId R S) #align is_localization.coe_submodule_mul IsLocalization.coeSubmodule_mul theorem coeSubmodule_fg (hS : Function.Injective (algebraMap R S)) (I : Ideal R) : Submodule.FG (coeSubmodule S I) ↔ Submodule.FG I := ⟨Submodule.fg_of_fg_map _ (LinearMap.ker_eq_bot.mpr hS), Submodule.FG.map _⟩ #align is_localization.coe_submodule_fg IsLocalization.coeSubmodule_fg @[simp] theorem coeSubmodule_span (s : Set R) : coeSubmodule S (Ideal.span s) = Submodule.span R (algebraMap R S '' s) := by rw [IsLocalization.coeSubmodule, Ideal.span, Submodule.map_span] rfl #align is_localization.coe_submodule_span IsLocalization.coeSubmodule_span -- @[simp] -- Porting note (#10618): simp can prove this theorem coeSubmodule_span_singleton (x : R) : coeSubmodule S (Ideal.span {x}) = Submodule.span R {(algebraMap R S) x} := by rw [coeSubmodule_span, Set.image_singleton] #align is_localization.coe_submodule_span_singleton IsLocalization.coeSubmodule_span_singleton variable {g : R β†’+* P} variable {T : Submonoid P} (hy : M ≀ T.comap g) {Q : Type*} [CommRing Q] variable [Algebra P Q] [IsLocalization T Q] variable [IsLocalization M S] section theorem isNoetherianRing (h : IsNoetherianRing R) : IsNoetherianRing S := by rw [isNoetherianRing_iff, isNoetherian_iff_wellFounded] at h ⊒ exact OrderEmbedding.wellFounded (IsLocalization.orderEmbedding M S).dual h #align is_localization.is_noetherian_ring IsLocalization.isNoetherianRing end variable {S M} @[mono] theorem coeSubmodule_le_coeSubmodule (h : M ≀ nonZeroDivisors R) {I J : Ideal R} : coeSubmodule S I ≀ coeSubmodule S J ↔ I ≀ J := -- Note: #8386 had to specify the value of `f` here: Submodule.map_le_map_iff_of_injective (f := Algebra.linearMap R S) (IsLocalization.injective _ h) _ _ #align is_localization.coe_submodule_le_coe_submodule IsLocalization.coeSubmodule_le_coeSubmodule @[mono] theorem coeSubmodule_strictMono (h : M ≀ nonZeroDivisors R) : StrictMono (coeSubmodule S : Ideal R β†’ Submodule R S) := strictMono_of_le_iff_le fun _ _ => (coeSubmodule_le_coeSubmodule h).symm #align is_localization.coe_submodule_strict_mono IsLocalization.coeSubmodule_strictMono variable (S) theorem coeSubmodule_injective (h : M ≀ nonZeroDivisors R) : Function.Injective (coeSubmodule S : Ideal R β†’ Submodule R S) := injective_of_le_imp_le _ fun hl => (coeSubmodule_le_coeSubmodule h).mp hl #align is_localization.coe_submodule_injective IsLocalization.coeSubmodule_injective
Mathlib/RingTheory/Localization/Submodule.lean
125
133
theorem coeSubmodule_isPrincipal {I : Ideal R} (h : M ≀ nonZeroDivisors R) : (coeSubmodule S I).IsPrincipal ↔ I.IsPrincipal := by
constructor <;> rintro ⟨⟨x, hx⟩⟩ Β· have x_mem : x ∈ coeSubmodule S I := hx.symm β–Έ Submodule.mem_span_singleton_self x obtain ⟨x, _, rfl⟩ := (mem_coeSubmodule _ _).mp x_mem refine ⟨⟨x, coeSubmodule_injective S h ?_⟩⟩ rw [Ideal.submodule_span_eq, hx, coeSubmodule_span_singleton] Β· refine ⟨⟨algebraMap R S x, ?_⟩⟩ rw [hx, Ideal.submodule_span_eq, coeSubmodule_span_singleton]
[ " coeSubmodule S βŠ₯ = βŠ₯", " coeSubmodule S ⊀ = 1", " coeSubmodule S (Ideal.span s) = Submodule.span R (⇑(algebraMap R S) '' s)", " Submodule.span R (⇑(Algebra.linearMap R S) '' s) = Submodule.span R (⇑(algebraMap R S) '' s)", " coeSubmodule S (Ideal.span {x}) = Submodule.span R {(algebraMap R S) x}", " IsN...