Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
goals
listlengths
0
224
goals_before
listlengths
0
220
import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.LinearAlgebra.AffineSpace.Ordered import Mathlib.Topology.ContinuousFunction.Basic import Mathlib.Topology.GDelta import Mathlib.Analysis.NormedSpace.FunctionSeries import Mathlib.Analysis.SpecificLimits.Basic #align_import topology.urysohns_lemma from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" variable {X : Type*} [TopologicalSpace X] open Set Filter TopologicalSpace Topology Filter open scoped Pointwise namespace Urysohns set_option linter.uppercaseLean3 false structure CU {X : Type*} [TopologicalSpace X] (P : Set X β†’ Prop) where protected C : Set X protected U : Set X protected P_C : P C protected closed_C : IsClosed C protected open_U : IsOpen U protected subset : C βŠ† U protected hP : βˆ€ {c u : Set X}, IsClosed c β†’ P c β†’ IsOpen u β†’ c βŠ† u β†’ βˆƒ v, IsOpen v ∧ c βŠ† v ∧ closure v βŠ† u ∧ P (closure v) #align urysohns.CU Urysohns.CU namespace CU variable {P : Set X β†’ Prop} @[simps C] def left (c : CU P) : CU P where C := c.C U := (c.hP c.closed_C c.P_C c.open_U c.subset).choose closed_C := c.closed_C P_C := c.P_C open_U := (c.hP c.closed_C c.P_C c.open_U c.subset).choose_spec.1 subset := (c.hP c.closed_C c.P_C c.open_U c.subset).choose_spec.2.1 hP := c.hP #align urysohns.CU.left Urysohns.CU.left @[simps U] def right (c : CU P) : CU P where C := closure (c.hP c.closed_C c.P_C c.open_U c.subset).choose U := c.U closed_C := isClosed_closure P_C := (c.hP c.closed_C c.P_C c.open_U c.subset).choose_spec.2.2.2 open_U := c.open_U subset := (c.hP c.closed_C c.P_C c.open_U c.subset).choose_spec.2.2.1 hP := c.hP #align urysohns.CU.right Urysohns.CU.right theorem left_U_subset_right_C (c : CU P) : c.left.U βŠ† c.right.C := subset_closure #align urysohns.CU.left_U_subset_right_C Urysohns.CU.left_U_subset_right_C theorem left_U_subset (c : CU P) : c.left.U βŠ† c.U := Subset.trans c.left_U_subset_right_C c.right.subset #align urysohns.CU.left_U_subset Urysohns.CU.left_U_subset theorem subset_right_C (c : CU P) : c.C βŠ† c.right.C := Subset.trans c.left.subset c.left_U_subset_right_C #align urysohns.CU.subset_right_C Urysohns.CU.subset_right_C noncomputable def approx : β„• β†’ CU P β†’ X β†’ ℝ | 0, c, x => indicator c.Uᢜ 1 x | n + 1, c, x => midpoint ℝ (approx n c.left x) (approx n c.right x) #align urysohns.CU.approx Urysohns.CU.approx theorem approx_of_mem_C (c : CU P) (n : β„•) {x : X} (hx : x ∈ c.C) : c.approx n x = 0 := by induction' n with n ihn generalizing c Β· exact indicator_of_not_mem (fun (hU : x ∈ c.Uᢜ) => hU <| c.subset hx) _ Β· simp only [approx] rw [ihn, ihn, midpoint_self] exacts [c.subset_right_C hx, hx] #align urysohns.CU.approx_of_mem_C Urysohns.CU.approx_of_mem_C theorem approx_of_nmem_U (c : CU P) (n : β„•) {x : X} (hx : x βˆ‰ c.U) : c.approx n x = 1 := by induction' n with n ihn generalizing c Β· rw [← mem_compl_iff] at hx exact indicator_of_mem hx _ Β· simp only [approx] rw [ihn, ihn, midpoint_self] exacts [hx, fun hU => hx <| c.left_U_subset hU] #align urysohns.CU.approx_of_nmem_U Urysohns.CU.approx_of_nmem_U theorem approx_nonneg (c : CU P) (n : β„•) (x : X) : 0 ≀ c.approx n x := by induction' n with n ihn generalizing c Β· exact indicator_nonneg (fun _ _ => zero_le_one) _ Β· simp only [approx, midpoint_eq_smul_add, invOf_eq_inv] refine mul_nonneg (inv_nonneg.2 zero_le_two) (add_nonneg ?_ ?_) <;> apply ihn #align urysohns.CU.approx_nonneg Urysohns.CU.approx_nonneg
Mathlib/Topology/UrysohnsLemma.lean
185
192
theorem approx_le_one (c : CU P) (n : β„•) (x : X) : c.approx n x ≀ 1 := by
induction' n with n ihn generalizing c Β· exact indicator_apply_le' (fun _ => le_rfl) fun _ => zero_le_one Β· simp only [approx, midpoint_eq_smul_add, invOf_eq_inv, smul_eq_mul, ← div_eq_inv_mul] have := add_le_add (ihn (left c)) (ihn (right c)) set_option tactic.skipAssignedInstances false in norm_num at this exact Iff.mpr (div_le_one zero_lt_two) this
[ " approx n c x = 0", " approx 0 c x = 0", " approx (n + 1) c x = 0", " midpoint ℝ (approx n c.left x) (approx n c.right x) = 0", " x ∈ c.left.C", " approx n c x = 1", " approx 0 c x = 1", " approx (n + 1) c x = 1", " midpoint ℝ (approx n c.left x) (approx n c.right x) = 1", " x βˆ‰ c.left.U", " 0 ...
[ " approx n c x = 0", " approx 0 c x = 0", " approx (n + 1) c x = 0", " midpoint ℝ (approx n c.left x) (approx n c.right x) = 0", " x ∈ c.left.C", " approx n c x = 1", " approx 0 c x = 1", " approx (n + 1) c x = 1", " midpoint ℝ (approx n c.left x) (approx n c.right x) = 1", " x βˆ‰ c.left.U", " 0 ...
import Mathlib.Data.Real.Irrational import Mathlib.Data.Nat.Fib.Basic import Mathlib.Data.Fin.VecNotation import Mathlib.Algebra.LinearRecurrence import Mathlib.Tactic.NormNum.NatFib import Mathlib.Tactic.NormNum.Prime #align_import data.real.golden_ratio from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" noncomputable section open Polynomial abbrev goldenRatio : ℝ := (1 + √5) / 2 #align golden_ratio goldenRatio abbrev goldenConj : ℝ := (1 - √5) / 2 #align golden_conj goldenConj @[inherit_doc goldenRatio] scoped[goldenRatio] notation "Ο†" => goldenRatio @[inherit_doc goldenConj] scoped[goldenRatio] notation "ψ" => goldenConj open Real goldenRatio theorem inv_gold : φ⁻¹ = -ψ := by have : 1 + √5 β‰  0 := ne_of_gt (add_pos (by norm_num) <| Real.sqrt_pos.mpr (by norm_num)) field_simp [sub_mul, mul_add] norm_num #align inv_gold inv_gold theorem inv_goldConj : ψ⁻¹ = -Ο† := by rw [inv_eq_iff_eq_inv, ← neg_inv, ← neg_eq_iff_eq_neg] exact inv_gold.symm #align inv_gold_conj inv_goldConj @[simp] theorem gold_mul_goldConj : Ο† * ψ = -1 := by field_simp rw [← sq_sub_sq] norm_num #align gold_mul_gold_conj gold_mul_goldConj @[simp] theorem goldConj_mul_gold : ψ * Ο† = -1 := by rw [mul_comm] exact gold_mul_goldConj #align gold_conj_mul_gold goldConj_mul_gold @[simp] theorem gold_add_goldConj : Ο† + ψ = 1 := by rw [goldenRatio, goldenConj] ring #align gold_add_gold_conj gold_add_goldConj theorem one_sub_goldConj : 1 - Ο† = ψ := by linarith [gold_add_goldConj] #align one_sub_gold_conj one_sub_goldConj theorem one_sub_gold : 1 - ψ = Ο† := by linarith [gold_add_goldConj] #align one_sub_gold one_sub_gold @[simp] theorem gold_sub_goldConj : Ο† - ψ = √5 := by ring #align gold_sub_gold_conj gold_sub_goldConj theorem gold_pow_sub_gold_pow (n : β„•) : Ο† ^ (n + 2) - Ο† ^ (n + 1) = Ο† ^ n := by rw [goldenRatio]; ring_nf; norm_num; ring @[simp 1200] theorem gold_sq : Ο† ^ 2 = Ο† + 1 := by rw [goldenRatio, ← sub_eq_zero] ring_nf rw [Real.sq_sqrt] <;> norm_num #align gold_sq gold_sq @[simp 1200] theorem goldConj_sq : ψ ^ 2 = ψ + 1 := by rw [goldenConj, ← sub_eq_zero] ring_nf rw [Real.sq_sqrt] <;> norm_num #align gold_conj_sq goldConj_sq theorem gold_pos : 0 < Ο† := mul_pos (by apply add_pos <;> norm_num) <| inv_pos.2 zero_lt_two #align gold_pos gold_pos theorem gold_ne_zero : Ο† β‰  0 := ne_of_gt gold_pos #align gold_ne_zero gold_ne_zero theorem one_lt_gold : 1 < Ο† := by refine lt_of_mul_lt_mul_left ?_ (le_of_lt gold_pos) simp [← sq, gold_pos, zero_lt_one, - div_pow] -- Porting note: Added `- div_pow` #align one_lt_gold one_lt_gold theorem gold_lt_two : Ο† < 2 := by calc (1 + sqrt 5) / 2 < (1 + 3) / 2 := by gcongr; rw [sqrt_lt'] <;> norm_num _ = 2 := by norm_num
Mathlib/Data/Real/GoldenRatio.lean
121
122
theorem goldConj_neg : ψ < 0 := by
linarith [one_sub_goldConj, one_lt_gold]
[ " φ⁻¹ = -ψ", " 0 < 1", " 0 < 5", " 2 * 2 = 5 - 1", " ψ⁻¹ = -Ο†", " -ψ = φ⁻¹", " Ο† * ψ = -1", " (1 + √5) * (1 - √5) = -(2 * 2)", " 1 ^ 2 - √5 ^ 2 = -(2 * 2)", " ψ * Ο† = -1", " Ο† + ψ = 1", " (1 + √5) / 2 + (1 - √5) / 2 = 1", " 1 - Ο† = ψ", " 1 - ψ = Ο†", " Ο† - ψ = √5", " Ο† ^ (n + 2) - Ο† ^ (...
[ " φ⁻¹ = -ψ", " 0 < 1", " 0 < 5", " 2 * 2 = 5 - 1", " ψ⁻¹ = -Ο†", " -ψ = φ⁻¹", " Ο† * ψ = -1", " (1 + √5) * (1 - √5) = -(2 * 2)", " 1 ^ 2 - √5 ^ 2 = -(2 * 2)", " ψ * Ο† = -1", " Ο† + ψ = 1", " (1 + √5) / 2 + (1 - √5) / 2 = 1", " 1 - Ο† = ψ", " 1 - ψ = Ο†", " Ο† - ψ = √5", " Ο† ^ (n + 2) - Ο† ^ (...
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
Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean
33
37
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]
[ " 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.Geometry.Manifold.ChartedSpace #align_import geometry.manifold.local_invariant_properties from "leanprover-community/mathlib"@"431589bce478b2229eba14b14a283250428217db" noncomputable section open scoped Classical open Manifold Topology open Set Filter TopologicalSpace variable {H M H' M' X : Type*} variable [TopologicalSpace H] [TopologicalSpace M] [ChartedSpace H M] variable [TopologicalSpace H'] [TopologicalSpace M'] [ChartedSpace H' M'] variable [TopologicalSpace X] namespace StructureGroupoid variable (G : StructureGroupoid H) (G' : StructureGroupoid H') structure LocalInvariantProp (P : (H β†’ H') β†’ Set H β†’ H β†’ Prop) : Prop where is_local : βˆ€ {s x u} {f : H β†’ H'}, IsOpen u β†’ x ∈ u β†’ (P f s x ↔ P f (s ∩ u) x) right_invariance' : βˆ€ {s x f} {e : PartialHomeomorph H H}, e ∈ G β†’ x ∈ e.source β†’ P f s x β†’ P (f ∘ e.symm) (e.symm ⁻¹' s) (e x) congr_of_forall : βˆ€ {s x} {f g : H β†’ H'}, (βˆ€ y ∈ s, f y = g y) β†’ f x = g x β†’ P f s x β†’ P g s x left_invariance' : βˆ€ {s x f} {e' : PartialHomeomorph H' H'}, e' ∈ G' β†’ s βŠ† f ⁻¹' e'.source β†’ f x ∈ e'.source β†’ P f s x β†’ P (e' ∘ f) s x #align structure_groupoid.local_invariant_prop StructureGroupoid.LocalInvariantProp variable {G G'} {P : (H β†’ H') β†’ Set H β†’ H β†’ Prop} {s t u : Set H} {x : H} variable (hG : G.LocalInvariantProp G' P) section LocalStructomorph variable (G) open PartialHomeomorph def IsLocalStructomorphWithinAt (f : H β†’ H) (s : Set H) (x : H) : Prop := x ∈ s β†’ βˆƒ e : PartialHomeomorph H H, e ∈ G ∧ EqOn f e.toFun (s ∩ e.source) ∧ x ∈ e.source #align structure_groupoid.is_local_structomorph_within_at StructureGroupoid.IsLocalStructomorphWithinAt theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] : LocalInvariantProp G G (IsLocalStructomorphWithinAt G) := { is_local := by intro s x u f hu hux constructor Β· rintro h hx rcases h hx.1 with ⟨e, heG, hef, hex⟩ have : s ∩ u ∩ e.source βŠ† s ∩ e.source := by mfld_set_tac exact ⟨e, heG, hef.mono this, hex⟩ Β· rintro h hx rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩ refine ⟨e.restr (interior u), ?_, ?_, ?_⟩ Β· exact closedUnderRestriction' heG isOpen_interior Β· have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := by mfld_set_tac simpa only [this, interior_interior, hu.interior_eq, mfld_simps] using hef Β· simp only [*, interior_interior, hu.interior_eq, mfld_simps] right_invariance' := by intro s x f e' he'G he'x h hx have hxs : x ∈ s := by simpa only [e'.left_inv he'x, mfld_simps] using hx rcases h hxs with ⟨e, heG, hef, hex⟩ refine ⟨e'.symm.trans e, G.trans (G.symm he'G) heG, ?_, ?_⟩ Β· intro y hy simp only [mfld_simps] at hy simp only [hef ⟨hy.1, hy.2.2⟩, mfld_simps] Β· simp only [hex, he'x, mfld_simps] congr_of_forall := by intro s x f g hfgs _ h hx rcases h hx with ⟨e, heG, hef, hex⟩ refine ⟨e, heG, ?_, hex⟩ intro y hy rw [← hef hy, hfgs y hy.1] left_invariance' := by intro s x f e' he'G _ hfx h hx rcases h hx with ⟨e, heG, hef, hex⟩ refine ⟨e.trans e', G.trans heG he'G, ?_, ?_⟩ Β· intro y hy simp only [mfld_simps] at hy simp only [hef ⟨hy.1, hy.2.1⟩, mfld_simps] Β· simpa only [hex, hef ⟨hx, hex⟩, mfld_simps] using hfx } #align structure_groupoid.is_local_structomorph_within_at_local_invariant_prop StructureGroupoid.isLocalStructomorphWithinAt_localInvariantProp
Mathlib/Geometry/Manifold/LocalInvariantProperties.lean
648
666
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff {G : StructureGroupoid H} [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H} (hx : x ∈ f.source βˆͺ sᢜ) : G.IsLocalStructomorphWithinAt (⇑f) s x ↔ x ∈ s β†’ βˆƒ e : PartialHomeomorph H H, e ∈ G ∧ e.source βŠ† f.source ∧ EqOn f (⇑e) (s ∩ e.source) ∧ x ∈ e.source := by
constructor · intro hf h2x obtain ⟨e, he, hfe, hxe⟩ := hf h2x refine ⟨e.restr f.source, closedUnderRestriction' he f.open_source, ?_, ?_, hxe, ?_⟩ · simp_rw [PartialHomeomorph.restr_source] exact inter_subset_right.trans interior_subset · intro x' hx' exact hfe ⟨hx'.1, hx'.2.1⟩ · rw [f.open_source.interior_eq] exact Or.resolve_right hx (not_not.mpr h2x) · intro hf hx obtain ⟨e, he, _, hfe, hxe⟩ := hf hx exact ⟨e, he, hfe, hxe⟩
[ " βˆ€ {s : Set H} {x : H} {u : Set H} {f : H β†’ H},\n IsOpen u β†’ x ∈ u β†’ (G.IsLocalStructomorphWithinAt f s x ↔ G.IsLocalStructomorphWithinAt f (s ∩ u) x)", " G.IsLocalStructomorphWithinAt f s x ↔ G.IsLocalStructomorphWithinAt f (s ∩ u) x", " G.IsLocalStructomorphWithinAt f s x β†’ G.IsLocalStructomorphWithinAt f...
[ " βˆ€ {s : Set H} {x : H} {u : Set H} {f : H β†’ H},\n IsOpen u β†’ x ∈ u β†’ (G.IsLocalStructomorphWithinAt f s x ↔ G.IsLocalStructomorphWithinAt f (s ∩ u) x)", " G.IsLocalStructomorphWithinAt f s x ↔ G.IsLocalStructomorphWithinAt f (s ∩ u) x", " G.IsLocalStructomorphWithinAt f s x β†’ G.IsLocalStructomorphWithinAt f...
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]
Mathlib/RingTheory/Localization/Submodule.lean
75
78
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
[ " 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 βŠ₯ = βŠ₯", " coeSubmodule S ⊀ = 1" ]
import Mathlib.Combinatorics.Quiver.Basic import Mathlib.Combinatorics.Quiver.Path #align_import combinatorics.quiver.cast from "leanprover-community/mathlib"@"fc2ed6f838ce7c9b7c7171e58d78eaf7b438fb0e" universe v v₁ vβ‚‚ u u₁ uβ‚‚ variable {U : Type*} [Quiver.{u + 1} U] namespace Quiver def Hom.cast {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u ⟢ v) : u' ⟢ v' := Eq.ndrec (motive := (Β· ⟢ v')) (Eq.ndrec e hv) hu #align quiver.hom.cast Quiver.Hom.cast theorem Hom.cast_eq_cast {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u ⟢ v) : e.cast hu hv = _root_.cast (by {rw [hu, hv]}) e := by subst_vars rfl #align quiver.hom.cast_eq_cast Quiver.Hom.cast_eq_cast @[simp] theorem Hom.cast_rfl_rfl {u v : U} (e : u ⟢ v) : e.cast rfl rfl = e := rfl #align quiver.hom.cast_rfl_rfl Quiver.Hom.cast_rfl_rfl @[simp] theorem Hom.cast_cast {u v u' v' u'' v'' : U} (e : u ⟢ v) (hu : u = u') (hv : v = v') (hu' : u' = u'') (hv' : v' = v'') : (e.cast hu hv).cast hu' hv' = e.cast (hu.trans hu') (hv.trans hv') := by subst_vars rfl #align quiver.hom.cast_cast Quiver.Hom.cast_cast theorem Hom.cast_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u ⟢ v) : HEq (e.cast hu hv) e := by subst_vars rfl #align quiver.hom.cast_heq Quiver.Hom.cast_heq theorem Hom.cast_eq_iff_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u ⟢ v) (e' : u' ⟢ v') : e.cast hu hv = e' ↔ HEq e e' := by rw [Hom.cast_eq_cast] exact _root_.cast_eq_iff_heq #align quiver.hom.cast_eq_iff_heq Quiver.Hom.cast_eq_iff_heq theorem Hom.eq_cast_iff_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u ⟢ v) (e' : u' ⟢ v') : e' = e.cast hu hv ↔ HEq e' e := by rw [eq_comm, Hom.cast_eq_iff_heq] exact ⟨HEq.symm, HEq.symm⟩ #align quiver.hom.eq_cast_iff_heq Quiver.Hom.eq_cast_iff_heq open Path def Path.cast {u v u' v' : U} (hu : u = u') (hv : v = v') (p : Path u v) : Path u' v' := Eq.ndrec (motive := (Path Β· v')) (Eq.ndrec p hv) hu #align quiver.path.cast Quiver.Path.cast
Mathlib/Combinatorics/Quiver/Cast.lean
87
90
theorem Path.cast_eq_cast {u v u' v' : U} (hu : u = u') (hv : v = v') (p : Path u v) : p.cast hu hv = _root_.cast (by rw [hu, hv]) p := by
subst_vars rfl
[ " (u ⟢ v) = (u' ⟢ v')", " cast hu hv e = _root_.cast β‹― e", " cast β‹― β‹― e = _root_.cast β‹― e", " cast hu' hv' (cast hu hv e) = cast β‹― β‹― e", " cast β‹― β‹― (cast β‹― β‹― e) = cast β‹― β‹― e", " HEq (cast hu hv e) e", " HEq (cast β‹― β‹― e) e", " cast hu hv e = e' ↔ HEq e e'", " _root_.cast β‹― e = e' ↔ HEq e e'", " e' ...
[ " (u ⟢ v) = (u' ⟢ v')", " cast hu hv e = _root_.cast β‹― e", " cast β‹― β‹― e = _root_.cast β‹― e", " cast hu' hv' (cast hu hv e) = cast β‹― β‹― e", " cast β‹― β‹― (cast β‹― β‹― e) = cast β‹― β‹― e", " HEq (cast hu hv e) e", " HEq (cast β‹― β‹― e) e", " cast hu hv e = e' ↔ HEq e e'", " _root_.cast β‹― e = e' ↔ HEq e e'", " e' ...
import Mathlib.Analysis.RCLike.Lemmas import Mathlib.MeasureTheory.Function.StronglyMeasurable.Inner import Mathlib.MeasureTheory.Integral.SetIntegral #align_import measure_theory.function.l2_space from "leanprover-community/mathlib"@"83a66c8775fa14ee5180c85cab98e970956401ad" set_option linter.uppercaseLean3 false noncomputable section open TopologicalSpace MeasureTheory MeasureTheory.Lp Filter open scoped NNReal ENNReal MeasureTheory namespace MeasureTheory section variable {Ξ± F : Type*} {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} [NormedAddCommGroup F] theorem Memβ„’p.integrable_sq {f : Ξ± β†’ ℝ} (h : Memβ„’p f 2 ΞΌ) : Integrable (fun x => f x ^ 2) ΞΌ := by simpa [← memβ„’p_one_iff_integrable] using h.norm_rpow two_ne_zero ENNReal.two_ne_top #align measure_theory.mem_β„’p.integrable_sq MeasureTheory.Memβ„’p.integrable_sq theorem memβ„’p_two_iff_integrable_sq_norm {f : Ξ± β†’ F} (hf : AEStronglyMeasurable f ΞΌ) : Memβ„’p f 2 ΞΌ ↔ Integrable (fun x => β€–f xβ€– ^ 2) ΞΌ := by rw [← memβ„’p_one_iff_integrable] convert (memβ„’p_norm_rpow_iff hf two_ne_zero ENNReal.two_ne_top).symm Β· simp Β· rw [div_eq_mul_inv, ENNReal.mul_inv_cancel two_ne_zero ENNReal.two_ne_top] #align measure_theory.mem_β„’p_two_iff_integrable_sq_norm MeasureTheory.memβ„’p_two_iff_integrable_sq_norm theorem memβ„’p_two_iff_integrable_sq {f : Ξ± β†’ ℝ} (hf : AEStronglyMeasurable f ΞΌ) : Memβ„’p f 2 ΞΌ ↔ Integrable (fun x => f x ^ 2) ΞΌ := by convert memβ„’p_two_iff_integrable_sq_norm hf using 3 simp #align measure_theory.mem_β„’p_two_iff_integrable_sq MeasureTheory.memβ„’p_two_iff_integrable_sq end namespace L2 variable {Ξ± E F π•œ : Type*} [RCLike π•œ] [MeasurableSpace Ξ±] {ΞΌ : Measure Ξ±} [NormedAddCommGroup E] [InnerProductSpace π•œ E] [NormedAddCommGroup F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y theorem snorm_rpow_two_norm_lt_top (f : Lp F 2 ΞΌ) : snorm (fun x => β€–f xβ€– ^ (2 : ℝ)) 1 ΞΌ < ∞ := by have h_two : ENNReal.ofReal (2 : ℝ) = 2 := by simp [zero_le_one] rw [snorm_norm_rpow f zero_lt_two, one_mul, h_two] exact ENNReal.rpow_lt_top_of_nonneg zero_le_two (Lp.snorm_ne_top f) #align measure_theory.L2.snorm_rpow_two_norm_lt_top MeasureTheory.L2.snorm_rpow_two_norm_lt_top theorem snorm_inner_lt_top (f g : Ξ± β†’β‚‚[ΞΌ] E) : snorm (fun x : Ξ± => βŸͺf x, g x⟫) 1 ΞΌ < ∞ := by have h : βˆ€ x, β€–βŸͺf x, g xβŸ«β€– ≀ β€–β€–f xβ€– ^ (2 : ℝ) + β€–g xβ€– ^ (2 : ℝ)β€– := by intro x rw [← @Nat.cast_two ℝ, Real.rpow_natCast, Real.rpow_natCast] calc β€–βŸͺf x, g xβŸ«β€– ≀ β€–f xβ€– * β€–g xβ€– := norm_inner_le_norm _ _ _ ≀ 2 * β€–f xβ€– * β€–g xβ€– := (mul_le_mul_of_nonneg_right (le_mul_of_one_le_left (norm_nonneg _) one_le_two) (norm_nonneg _)) -- TODO(kmill): the type ascription is getting around an elaboration error _ ≀ β€–(β€–f xβ€– ^ 2 + β€–g xβ€– ^ 2 : ℝ)β€– := (two_mul_le_add_sq _ _).trans (le_abs_self _) refine (snorm_mono_ae (ae_of_all _ h)).trans_lt ((snorm_add_le ?_ ?_ le_rfl).trans_lt ?_) Β· exact ((Lp.aestronglyMeasurable f).norm.aemeasurable.pow_const _).aestronglyMeasurable Β· exact ((Lp.aestronglyMeasurable g).norm.aemeasurable.pow_const _).aestronglyMeasurable rw [ENNReal.add_lt_top] exact ⟨snorm_rpow_two_norm_lt_top f, snorm_rpow_two_norm_lt_top g⟩ #align measure_theory.L2.snorm_inner_lt_top MeasureTheory.L2.snorm_inner_lt_top section InnerProductSpace open scoped ComplexConjugate instance : Inner π•œ (Ξ± β†’β‚‚[ΞΌ] E) := ⟨fun f g => ∫ a, βŸͺf a, g a⟫ βˆ‚ΞΌβŸ© theorem inner_def (f g : Ξ± β†’β‚‚[ΞΌ] E) : βŸͺf, g⟫ = ∫ a : Ξ±, βŸͺf a, g a⟫ βˆ‚ΞΌ := rfl #align measure_theory.L2.inner_def MeasureTheory.L2.inner_def
Mathlib/MeasureTheory/Function/L2Space.lean
154
167
theorem integral_inner_eq_sq_snorm (f : Ξ± β†’β‚‚[ΞΌ] E) : ∫ a, βŸͺf a, f a⟫ βˆ‚ΞΌ = ENNReal.toReal (∫⁻ a, (β€–f aβ€–β‚Š : ℝβ‰₯0∞) ^ (2 : ℝ) βˆ‚ΞΌ) := by
simp_rw [inner_self_eq_norm_sq_to_K] norm_cast rw [integral_eq_lintegral_of_nonneg_ae] rotate_left Β· exact Filter.eventually_of_forall fun x => sq_nonneg _ Β· exact ((Lp.aestronglyMeasurable f).norm.aemeasurable.pow_const _).aestronglyMeasurable congr ext1 x have h_two : (2 : ℝ) = ((2 : β„•) : ℝ) := by simp rw [← Real.rpow_natCast _ 2, ← h_two, ← ENNReal.ofReal_rpow_of_nonneg (norm_nonneg _) zero_le_two, ofReal_norm_eq_coe_nnnorm] norm_cast
[ " Integrable (fun x => f x ^ 2) ΞΌ", " Memβ„’p f 2 ΞΌ ↔ Integrable (fun x => β€–f xβ€– ^ 2) ΞΌ", " Memβ„’p f 2 ΞΌ ↔ Memβ„’p (fun x => β€–f xβ€– ^ 2) 1 ΞΌ", " β€–f xβœβ€– ^ 2 = β€–f xβœβ€– ^ ENNReal.toReal 2", " 1 = 2 / 2", " Memβ„’p f 2 ΞΌ ↔ Integrable (fun x => f x ^ 2) ΞΌ", " f x✝ ^ 2 = β€–f xβœβ€– ^ 2", " snorm (fun x => ‖↑↑f xβ€– ^ 2) 1...
[ " Integrable (fun x => f x ^ 2) ΞΌ", " Memβ„’p f 2 ΞΌ ↔ Integrable (fun x => β€–f xβ€– ^ 2) ΞΌ", " Memβ„’p f 2 ΞΌ ↔ Memβ„’p (fun x => β€–f xβ€– ^ 2) 1 ΞΌ", " β€–f xβœβ€– ^ 2 = β€–f xβœβ€– ^ ENNReal.toReal 2", " 1 = 2 / 2", " Memβ„’p f 2 ΞΌ ↔ Integrable (fun x => f x ^ 2) ΞΌ", " f x✝ ^ 2 = β€–f xβœβ€– ^ 2", " snorm (fun x => ‖↑↑f xβ€– ^ 2) 1...
import Mathlib.Algebra.Lie.Nilpotent import Mathlib.Algebra.Lie.Normalizer #align_import algebra.lie.cartan_subalgebra from "leanprover-community/mathlib"@"938fead7abdc0cbbca8eba7a1052865a169dc102" universe u v w w₁ wβ‚‚ variable {R : Type u} {L : Type v} variable [CommRing R] [LieRing L] [LieAlgebra R L] (H : LieSubalgebra R L) def LieSubmodule.IsUcsLimit {M : Type*} [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M] (N : LieSubmodule R L M) : Prop := βˆƒ k, βˆ€ l, k ≀ l β†’ (βŠ₯ : LieSubmodule R L M).ucs l = N #align lie_submodule.is_ucs_limit LieSubmodule.IsUcsLimit namespace LieSubalgebra class IsCartanSubalgebra : Prop where nilpotent : LieAlgebra.IsNilpotent R H self_normalizing : H.normalizer = H #align lie_subalgebra.is_cartan_subalgebra LieSubalgebra.IsCartanSubalgebra instance [H.IsCartanSubalgebra] : LieAlgebra.IsNilpotent R H := IsCartanSubalgebra.nilpotent @[simp] theorem normalizer_eq_self_of_isCartanSubalgebra (H : LieSubalgebra R L) [H.IsCartanSubalgebra] : H.toLieSubmodule.normalizer = H.toLieSubmodule := by rw [← LieSubmodule.coe_toSubmodule_eq_iff, coe_normalizer_eq_normalizer, IsCartanSubalgebra.self_normalizing, coe_toLieSubmodule] #align lie_subalgebra.normalizer_eq_self_of_is_cartan_subalgebra LieSubalgebra.normalizer_eq_self_of_isCartanSubalgebra @[simp]
Mathlib/Algebra/Lie/CartanSubalgebra.lean
65
69
theorem ucs_eq_self_of_isCartanSubalgebra (H : LieSubalgebra R L) [H.IsCartanSubalgebra] (k : β„•) : H.toLieSubmodule.ucs k = H.toLieSubmodule := by
induction' k with k ih Β· simp Β· simp [ih]
[ " H.toLieSubmodule.normalizer = H.toLieSubmodule", " LieSubmodule.ucs k H.toLieSubmodule = H.toLieSubmodule", " LieSubmodule.ucs 0 H.toLieSubmodule = H.toLieSubmodule", " LieSubmodule.ucs (k + 1) H.toLieSubmodule = H.toLieSubmodule" ]
[ " H.toLieSubmodule.normalizer = H.toLieSubmodule" ]
import Mathlib.RingTheory.Valuation.Basic import Mathlib.NumberTheory.Padics.PadicNorm import Mathlib.Analysis.Normed.Field.Basic #align_import number_theory.padics.padic_numbers from "leanprover-community/mathlib"@"b9b2114f7711fec1c1e055d507f082f8ceb2c3b7" noncomputable section open scoped Classical open Nat multiplicity padicNorm CauSeq CauSeq.Completion Metric abbrev PadicSeq (p : β„•) := CauSeq _ (padicNorm p) #align padic_seq PadicSeq namespace PadicSeq section variable {p : β„•} [Fact p.Prime] theorem stationary {f : CauSeq β„š (padicNorm p)} (hf : Β¬f β‰ˆ 0) : βˆƒ N, βˆ€ m n, N ≀ m β†’ N ≀ n β†’ padicNorm p (f n) = padicNorm p (f m) := have : βˆƒ Ξ΅ > 0, βˆƒ N1, βˆ€ j β‰₯ N1, Ξ΅ ≀ padicNorm p (f j) := CauSeq.abv_pos_of_not_limZero <| not_limZero_of_not_congr_zero hf let ⟨Ρ, hΞ΅, N1, hN1⟩ := this let ⟨N2, hN2⟩ := CauSeq.cauchyβ‚‚ f hΞ΅ ⟨max N1 N2, fun n m hn hm ↦ by have : padicNorm p (f n - f m) < Ξ΅ := hN2 _ (max_le_iff.1 hn).2 _ (max_le_iff.1 hm).2 have : padicNorm p (f n - f m) < padicNorm p (f n) := lt_of_lt_of_le this <| hN1 _ (max_le_iff.1 hn).1 have : padicNorm p (f n - f m) < max (padicNorm p (f n)) (padicNorm p (f m)) := lt_max_iff.2 (Or.inl this) by_contra hne rw [← padicNorm.neg (f m)] at hne have hnam := add_eq_max_of_ne hne rw [padicNorm.neg, max_comm] at hnam rw [← hnam, sub_eq_add_neg, add_comm] at this apply _root_.lt_irrefl _ this⟩ #align padic_seq.stationary PadicSeq.stationary def stationaryPoint {f : PadicSeq p} (hf : Β¬f β‰ˆ 0) : β„• := Classical.choose <| stationary hf #align padic_seq.stationary_point PadicSeq.stationaryPoint theorem stationaryPoint_spec {f : PadicSeq p} (hf : Β¬f β‰ˆ 0) : βˆ€ {m n}, stationaryPoint hf ≀ m β†’ stationaryPoint hf ≀ n β†’ padicNorm p (f n) = padicNorm p (f m) := @(Classical.choose_spec <| stationary hf) #align padic_seq.stationary_point_spec PadicSeq.stationaryPoint_spec def norm (f : PadicSeq p) : β„š := if hf : f β‰ˆ 0 then 0 else padicNorm p (f (stationaryPoint hf)) #align padic_seq.norm PadicSeq.norm theorem norm_zero_iff (f : PadicSeq p) : f.norm = 0 ↔ f β‰ˆ 0 := by constructor Β· intro h by_contra hf unfold norm at h split_ifs at h Β· contradiction apply hf intro Ξ΅ hΞ΅ exists stationaryPoint hf intro j hj have heq := stationaryPoint_spec hf le_rfl hj simpa [h, heq] Β· intro h simp [norm, h] #align padic_seq.norm_zero_iff PadicSeq.norm_zero_iff end section Valuation open CauSeq variable {p : β„•} [Fact p.Prime] def valuation (f : PadicSeq p) : β„€ := if hf : f β‰ˆ 0 then 0 else padicValRat p (f (stationaryPoint hf)) #align padic_seq.valuation PadicSeq.valuation theorem norm_eq_pow_val {f : PadicSeq p} (hf : Β¬f β‰ˆ 0) : f.norm = (p : β„š) ^ (-f.valuation : β„€) := by rw [norm, valuation, dif_neg hf, dif_neg hf, padicNorm, if_neg] intro H apply CauSeq.not_limZero_of_not_congr_zero hf intro Ξ΅ hΞ΅ use stationaryPoint hf intro n hn rw [stationaryPoint_spec hf le_rfl hn] simpa [H] using hΞ΅ #align padic_seq.norm_eq_pow_val PadicSeq.norm_eq_pow_val
Mathlib/NumberTheory/Padics/PadicNumbers.lean
234
238
theorem val_eq_iff_norm_eq {f g : PadicSeq p} (hf : Β¬f β‰ˆ 0) (hg : Β¬g β‰ˆ 0) : f.valuation = g.valuation ↔ f.norm = g.norm := by
rw [norm_eq_pow_val hf, norm_eq_pow_val hg, ← neg_inj, zpow_inj] Β· exact mod_cast (Fact.out : p.Prime).pos Β· exact mod_cast (Fact.out : p.Prime).ne_one
[ " padicNorm p (↑f m) = padicNorm p (↑f n)", " False", " f.norm = 0 ↔ f β‰ˆ 0", " f.norm = 0 β†’ f β‰ˆ 0", " f β‰ˆ 0", " βˆƒ i, βˆ€ j β‰₯ i, padicNorm p (↑(f - 0) j) < Ξ΅", " βˆ€ j β‰₯ stationaryPoint hf, padicNorm p (↑(f - 0) j) < Ξ΅", " padicNorm p (↑(f - 0) j) < Ξ΅", " f β‰ˆ 0 β†’ f.norm = 0", " f.norm = 0", " f.norm ...
[ " padicNorm p (↑f m) = padicNorm p (↑f n)", " False", " f.norm = 0 ↔ f β‰ˆ 0", " f.norm = 0 β†’ f β‰ˆ 0", " f β‰ˆ 0", " βˆƒ i, βˆ€ j β‰₯ i, padicNorm p (↑(f - 0) j) < Ξ΅", " βˆ€ j β‰₯ stationaryPoint hf, padicNorm p (↑(f - 0) j) < Ξ΅", " padicNorm p (↑(f - 0) j) < Ξ΅", " f β‰ˆ 0 β†’ f.norm = 0", " f.norm = 0", " f.norm ...
import Mathlib.MeasureTheory.Integral.IntervalIntegral #align_import measure_theory.integral.layercake from "leanprover-community/mathlib"@"08a4542bec7242a5c60f179e4e49de8c0d677b1b" noncomputable section open scoped ENNReal MeasureTheory Topology open Set MeasureTheory Filter Measure namespace MeasureTheory section variable {Ξ± R : Type*} [MeasurableSpace Ξ±] (ΞΌ : Measure Ξ±) [LinearOrder R]
Mathlib/MeasureTheory/Integral/Layercake.lean
73
82
theorem countable_meas_le_ne_meas_lt (g : Ξ± β†’ R) : {t : R | ΞΌ {a : Ξ± | t ≀ g a} β‰  ΞΌ {a : Ξ± | t < g a}}.Countable := by
-- the target set is contained in the set of points where the function `t ↦ ΞΌ {a : Ξ± | t ≀ g a}` -- jumps down on the right of `t`. This jump set is countable for any function. let F : R β†’ ℝβ‰₯0∞ := fun t ↦ ΞΌ {a : Ξ± | t ≀ g a} apply (countable_image_gt_image_Ioi F).mono intro t ht have : ΞΌ {a | t < g a} < ΞΌ {a | t ≀ g a} := lt_of_le_of_ne (measure_mono (fun a ha ↦ le_of_lt ha)) (Ne.symm ht) exact ⟨μ {a | t < g a}, this, fun s hs ↦ measure_mono (fun a ha ↦ hs.trans_le ha)⟩
[ " {t | ΞΌ {a | t ≀ g a} β‰  ΞΌ {a | t < g a}}.Countable", " {t | ΞΌ {a | t ≀ g a} β‰  ΞΌ {a | t < g a}} βŠ† {x | βˆƒ z < F x, βˆ€ (y : R), x < y β†’ F y ≀ z}", " t ∈ {x | βˆƒ z < F x, βˆ€ (y : R), x < y β†’ F y ≀ z}" ]
[]
import Mathlib.LinearAlgebra.Span import Mathlib.LinearAlgebra.BilinearMap #align_import algebra.module.submodule.bilinear from "leanprover-community/mathlib"@"6010cf523816335f7bae7f8584cb2edaace73940" universe uΞΉ u v open Set open Pointwise namespace Submodule variable {ΞΉ : Sort uΞΉ} {R M N P : Type*} variable [CommSemiring R] [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] variable [Module R M] [Module R N] [Module R P] def mapβ‚‚ (f : M β†’β‚—[R] N β†’β‚—[R] P) (p : Submodule R M) (q : Submodule R N) : Submodule R P := ⨆ s : p, q.map (f s) #align submodule.mapβ‚‚ Submodule.mapβ‚‚ theorem apply_mem_mapβ‚‚ (f : M β†’β‚—[R] N β†’β‚—[R] P) {m : M} {n : N} {p : Submodule R M} {q : Submodule R N} (hm : m ∈ p) (hn : n ∈ q) : f m n ∈ mapβ‚‚ f p q := (le_iSup _ ⟨m, hm⟩ : _ ≀ mapβ‚‚ f p q) ⟨n, hn, by rfl⟩ #align submodule.apply_mem_mapβ‚‚ Submodule.apply_mem_mapβ‚‚ theorem mapβ‚‚_le {f : M β†’β‚—[R] N β†’β‚—[R] P} {p : Submodule R M} {q : Submodule R N} {r : Submodule R P} : mapβ‚‚ f p q ≀ r ↔ βˆ€ m ∈ p, βˆ€ n ∈ q, f m n ∈ r := ⟨fun H _m hm _n hn => H <| apply_mem_mapβ‚‚ _ hm hn, fun H => iSup_le fun ⟨m, hm⟩ => map_le_iff_le_comap.2 fun n hn => H m hm n hn⟩ #align submodule.mapβ‚‚_le Submodule.mapβ‚‚_le variable (R)
Mathlib/Algebra/Module/Submodule/Bilinear.lean
59
73
theorem mapβ‚‚_span_span (f : M β†’β‚—[R] N β†’β‚—[R] P) (s : Set M) (t : Set N) : mapβ‚‚ f (span R s) (span R t) = span R (Set.image2 (fun m n => f m n) s t) := by
apply le_antisymm Β· rw [mapβ‚‚_le] apply @span_induction' R M _ _ _ s intro a ha apply @span_induction' R N _ _ _ t intro b hb exact subset_span ⟨_, β€Ή_β€Ί, _, β€Ή_β€Ί, rfl⟩ all_goals intros; simp only [*, add_mem, smul_mem, zero_mem, _root_.map_zero, map_add, LinearMap.zero_apply, LinearMap.add_apply, LinearMap.smul_apply, map_smul] Β· rw [span_le, image2_subset_iff] intro a ha b hb exact apply_mem_mapβ‚‚ _ (subset_span ha) (subset_span hb)
[ " (f β†‘βŸ¨m, hm⟩) n = (f m) n", " mapβ‚‚ f (span R s) (span R t) = span R (image2 (fun m n => (f m) n) s t)", " mapβ‚‚ f (span R s) (span R t) ≀ span R (image2 (fun m n => (f m) n) s t)", " βˆ€ m ∈ span R s, βˆ€ n ∈ span R t, (f m) n ∈ span R (image2 (fun m n => (f m) n) s t)", " βˆ€ (a : R),\n βˆ€ x ∈ span R s,\n ...
[ " (f β†‘βŸ¨m, hm⟩) n = (f m) n" ]
import Mathlib.Algebra.Order.Monoid.Defs import Mathlib.Algebra.Order.Sub.Defs import Mathlib.Util.AssertExists #align_import algebra.order.group.defs from "leanprover-community/mathlib"@"b599f4e4e5cf1fbcb4194503671d3d9e569c1fce" open Function universe u variable {Ξ± : Type u} class OrderedAddCommGroup (Ξ± : Type u) extends AddCommGroup Ξ±, PartialOrder Ξ± where protected add_le_add_left : βˆ€ a b : Ξ±, a ≀ b β†’ βˆ€ c : Ξ±, c + a ≀ c + b #align ordered_add_comm_group OrderedAddCommGroup class OrderedCommGroup (Ξ± : Type u) extends CommGroup Ξ±, PartialOrder Ξ± where protected mul_le_mul_left : βˆ€ a b : Ξ±, a ≀ b β†’ βˆ€ c : Ξ±, c * a ≀ c * b #align ordered_comm_group OrderedCommGroup attribute [to_additive] OrderedCommGroup @[to_additive] instance OrderedCommGroup.to_covariantClass_left_le (Ξ± : Type u) [OrderedCommGroup Ξ±] : CovariantClass Ξ± Ξ± (Β· * Β·) (Β· ≀ Β·) where elim a b c bc := OrderedCommGroup.mul_le_mul_left b c bc a #align ordered_comm_group.to_covariant_class_left_le OrderedCommGroup.to_covariantClass_left_le #align ordered_add_comm_group.to_covariant_class_left_le OrderedAddCommGroup.to_covariantClass_left_le -- See note [lower instance priority] @[to_additive OrderedAddCommGroup.toOrderedCancelAddCommMonoid] instance (priority := 100) OrderedCommGroup.toOrderedCancelCommMonoid [OrderedCommGroup Ξ±] : OrderedCancelCommMonoid Ξ± := { β€ΉOrderedCommGroup Ξ±β€Ί with le_of_mul_le_mul_left := fun a b c ↦ le_of_mul_le_mul_left' } #align ordered_comm_group.to_ordered_cancel_comm_monoid OrderedCommGroup.toOrderedCancelCommMonoid #align ordered_add_comm_group.to_ordered_cancel_add_comm_monoid OrderedAddCommGroup.toOrderedCancelAddCommMonoid example (Ξ± : Type u) [OrderedAddCommGroup Ξ±] : CovariantClass Ξ± Ξ± (swap (Β· + Β·)) (Β· < Β·) := IsRightCancelAdd.covariant_swap_add_lt_of_covariant_swap_add_le Ξ± -- Porting note: this instance is not used, -- and causes timeouts after lean4#2210. -- It was introduced in https://github.com/leanprover-community/mathlib/pull/17564 -- but without the motivation clearly explained. @[to_additive "A choice-free shortcut instance."] theorem OrderedCommGroup.to_contravariantClass_left_le (Ξ± : Type u) [OrderedCommGroup Ξ±] : ContravariantClass Ξ± Ξ± (Β· * Β·) (Β· ≀ Β·) where elim a b c bc := by simpa using mul_le_mul_left' bc a⁻¹ #align ordered_comm_group.to_contravariant_class_left_le OrderedCommGroup.to_contravariantClass_left_le #align ordered_add_comm_group.to_contravariant_class_left_le OrderedAddCommGroup.to_contravariantClass_left_le -- Porting note: this instance is not used, -- and causes timeouts after lean4#2210. -- See further explanation on `OrderedCommGroup.to_contravariantClass_left_le`. @[to_additive "A choice-free shortcut instance."] theorem OrderedCommGroup.to_contravariantClass_right_le (Ξ± : Type u) [OrderedCommGroup Ξ±] : ContravariantClass Ξ± Ξ± (swap (Β· * Β·)) (Β· ≀ Β·) where elim a b c bc := by simpa using mul_le_mul_right' bc a⁻¹ #align ordered_comm_group.to_contravariant_class_right_le OrderedCommGroup.to_contravariantClass_right_le #align ordered_add_comm_group.to_contravariant_class_right_le OrderedAddCommGroup.to_contravariantClass_right_le section Group variable [Group Ξ±] section TypeclassesLeftLT variable [LT Ξ±] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· < Β·)] {a b c : Ξ±} @[to_additive (attr := simp) Left.neg_pos_iff "Uses `left` co(ntra)variant."] theorem Left.one_lt_inv_iff : 1 < a⁻¹ ↔ a < 1 := by rw [← mul_lt_mul_iff_left a, mul_inv_self, mul_one] #align left.one_lt_inv_iff Left.one_lt_inv_iff #align left.neg_pos_iff Left.neg_pos_iff @[to_additive (attr := simp) "Uses `left` co(ntra)variant."] theorem Left.inv_lt_one_iff : a⁻¹ < 1 ↔ 1 < a := by rw [← mul_lt_mul_iff_left a, mul_inv_self, mul_one] #align left.inv_lt_one_iff Left.inv_lt_one_iff #align left.neg_neg_iff Left.neg_neg_iff @[to_additive (attr := simp)] theorem lt_inv_mul_iff_mul_lt : b < a⁻¹ * c ↔ a * b < c := by rw [← mul_lt_mul_iff_left a] simp #align lt_inv_mul_iff_mul_lt lt_inv_mul_iff_mul_lt #align lt_neg_add_iff_add_lt lt_neg_add_iff_add_lt @[to_additive (attr := simp)]
Mathlib/Algebra/Order/Group/Defs.lean
178
179
theorem inv_mul_lt_iff_lt_mul : b⁻¹ * a < c ↔ a < b * c := by
rw [← mul_lt_mul_iff_left b, mul_inv_cancel_left]
[ " b ≀ c", " 1 < a⁻¹ ↔ a < 1", " a⁻¹ < 1 ↔ 1 < a", " b < a⁻¹ * c ↔ a * b < c", " a * b < a * (a⁻¹ * c) ↔ a * b < c", " b⁻¹ * a < c ↔ a < b * c" ]
[ " b ≀ c", " 1 < a⁻¹ ↔ a < 1", " a⁻¹ < 1 ↔ 1 < a", " b < a⁻¹ * c ↔ a * b < c", " a * b < a * (a⁻¹ * c) ↔ a * b < c" ]
import Mathlib.Algebra.PUnitInstances import Mathlib.Tactic.Abel import Mathlib.Tactic.Ring import Mathlib.Order.Hom.Lattice #align_import algebra.ring.boolean_ring from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" open scoped symmDiff variable {Ξ± Ξ² Ξ³ : Type*} class BooleanRing (Ξ±) extends Ring Ξ± where mul_self : βˆ€ a : Ξ±, a * a = a #align boolean_ring BooleanRing section BooleanRing variable [BooleanRing Ξ±] (a b : Ξ±) instance : Std.IdempotentOp (Ξ± := Ξ±) (Β· * Β·) := ⟨BooleanRing.mul_self⟩ @[simp] theorem mul_self : a * a = a := BooleanRing.mul_self _ #align mul_self mul_self @[simp] theorem add_self : a + a = 0 := by have : a + a = a + a + (a + a) := calc a + a = (a + a) * (a + a) := by rw [mul_self] _ = a * a + a * a + (a * a + a * a) := by rw [add_mul, mul_add] _ = a + a + (a + a) := by rw [mul_self] rwa [self_eq_add_left] at this #align add_self add_self @[simp] theorem neg_eq : -a = a := calc -a = -a + 0 := by rw [add_zero] _ = -a + -a + a := by rw [← neg_add_self, add_assoc] _ = a := by rw [add_self, zero_add] #align neg_eq neg_eq theorem add_eq_zero' : a + b = 0 ↔ a = b := calc a + b = 0 ↔ a = -b := add_eq_zero_iff_eq_neg _ ↔ a = b := by rw [neg_eq] #align add_eq_zero' add_eq_zero' @[simp] theorem mul_add_mul : a * b + b * a = 0 := by have : a + b = a + b + (a * b + b * a) := calc a + b = (a + b) * (a + b) := by rw [mul_self] _ = a * a + a * b + (b * a + b * b) := by rw [add_mul, mul_add, mul_add] _ = a + a * b + (b * a + b) := by simp only [mul_self] _ = a + b + (a * b + b * a) := by abel rwa [self_eq_add_right] at this #align mul_add_mul mul_add_mul @[simp] theorem sub_eq_add : a - b = a + b := by rw [sub_eq_add_neg, add_right_inj, neg_eq] #align sub_eq_add sub_eq_add @[simp]
Mathlib/Algebra/Ring/BooleanRing.lean
105
105
theorem mul_one_add_self : a * (1 + a) = 0 := by
rw [mul_add, mul_one, mul_self, add_self]
[ " a + a = 0", " a + a = (a + a) * (a + a)", " (a + a) * (a + a) = a * a + a * a + (a * a + a * a)", " a * a + a * a + (a * a + a * a) = a + a + (a + a)", " -a = -a + 0", " -a + 0 = -a + -a + a", " -a + -a + a = a", " a = -b ↔ a = b", " a * b + b * a = 0", " a + b = (a + b) * (a + b)", " (a + b) ...
[ " a + a = 0", " a + a = (a + a) * (a + a)", " (a + a) * (a + a) = a * a + a * a + (a * a + a * a)", " a * a + a * a + (a * a + a * a) = a + a + (a + a)", " -a = -a + 0", " -a + 0 = -a + -a + a", " -a + -a + a = a", " a = -b ↔ a = b", " a * b + b * a = 0", " a + b = (a + b) * (a + b)", " (a + b) ...
import Mathlib.Data.Fintype.Option import Mathlib.Topology.Separation import Mathlib.Topology.Sets.Opens #align_import topology.alexandroff from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" open Set Filter Topology variable {X : Type*} def OnePoint (X : Type*) := Option X #align alexandroff OnePoint instance [Repr X] : Repr (OnePoint X) := ⟨fun o _ => match o with | none => "∞" | some a => "↑" ++ repr a⟩ namespace OnePoint @[match_pattern] def infty : OnePoint X := none #align alexandroff.infty OnePoint.infty @[inherit_doc] scoped notation "∞" => OnePoint.infty @[coe, match_pattern] def some : X β†’ OnePoint X := Option.some instance : CoeTC X (OnePoint X) := ⟨some⟩ instance : Inhabited (OnePoint X) := ⟨∞⟩ instance [Fintype X] : Fintype (OnePoint X) := inferInstanceAs (Fintype (Option X)) instance infinite [Infinite X] : Infinite (OnePoint X) := inferInstanceAs (Infinite (Option X)) #align alexandroff.infinite OnePoint.infinite theorem coe_injective : Function.Injective ((↑) : X β†’ OnePoint X) := Option.some_injective X #align alexandroff.coe_injective OnePoint.coe_injective @[norm_cast] theorem coe_eq_coe {x y : X} : (x : OnePoint X) = y ↔ x = y := coe_injective.eq_iff #align alexandroff.coe_eq_coe OnePoint.coe_eq_coe @[simp] theorem coe_ne_infty (x : X) : (x : OnePoint X) β‰  ∞ := nofun #align alexandroff.coe_ne_infty OnePoint.coe_ne_infty @[simp] theorem infty_ne_coe (x : X) : ∞ β‰  (x : OnePoint X) := nofun #align alexandroff.infty_ne_coe OnePoint.infty_ne_coe @[elab_as_elim] protected def rec {C : OnePoint X β†’ Sort*} (h₁ : C ∞) (hβ‚‚ : βˆ€ x : X, C x) : βˆ€ z : OnePoint X, C z | ∞ => h₁ | (x : X) => hβ‚‚ x #align alexandroff.rec OnePoint.rec theorem isCompl_range_coe_infty : IsCompl (range ((↑) : X β†’ OnePoint X)) {∞} := isCompl_range_some_none X #align alexandroff.is_compl_range_coe_infty OnePoint.isCompl_range_coe_infty -- Porting note: moved @[simp] to a new lemma theorem range_coe_union_infty : range ((↑) : X β†’ OnePoint X) βˆͺ {∞} = univ := range_some_union_none X #align alexandroff.range_coe_union_infty OnePoint.range_coe_union_infty @[simp] theorem insert_infty_range_coe : insert ∞ (range (@some X)) = univ := insert_none_range_some _ @[simp] theorem range_coe_inter_infty : range ((↑) : X β†’ OnePoint X) ∩ {∞} = βˆ… := range_some_inter_none X #align alexandroff.range_coe_inter_infty OnePoint.range_coe_inter_infty @[simp] theorem compl_range_coe : (range ((↑) : X β†’ OnePoint X))ᢜ = {∞} := compl_range_some X #align alexandroff.compl_range_coe OnePoint.compl_range_coe theorem compl_infty : ({∞}ᢜ : Set (OnePoint X)) = range ((↑) : X β†’ OnePoint X) := (@isCompl_range_coe_infty X).symm.compl_eq #align alexandroff.compl_infty OnePoint.compl_infty theorem compl_image_coe (s : Set X) : ((↑) '' s : Set (OnePoint X))ᢜ = (↑) '' sᢜ βˆͺ {∞} := by rw [coe_injective.compl_image_eq, compl_range_coe] #align alexandroff.compl_image_coe OnePoint.compl_image_coe
Mathlib/Topology/Compactification/OnePoint.lean
144
145
theorem ne_infty_iff_exists {x : OnePoint X} : x β‰  ∞ ↔ βˆƒ y : X, (y : OnePoint X) = x := by
induction x using OnePoint.rec <;> simp
[ " (some '' s)ᢜ = some '' sᢜ βˆͺ {∞}", " x β‰  ∞ ↔ βˆƒ y, ↑y = x", " ∞ β‰  ∞ ↔ βˆƒ y, ↑y = ∞", " ↑x✝ β‰  ∞ ↔ βˆƒ y, ↑y = ↑x✝" ]
[ " (some '' s)ᢜ = some '' sᢜ βˆͺ {∞}" ]
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Combinatorics.SimpleGraph.Maps open Finset namespace SimpleGraph variable {V : Type*} [DecidableEq V] (G : SimpleGraph V) (s t : V) section ReplaceVertex def replaceVertex : SimpleGraph V where Adj v w := if v = t then if w = t then False else G.Adj s w else if w = t then G.Adj v s else G.Adj v w symm v w := by dsimp only; split_ifs <;> simp [adj_comm] lemma not_adj_replaceVertex_same : Β¬(G.replaceVertex s t).Adj s t := by simp [replaceVertex] @[simp] lemma replaceVertex_self : G.replaceVertex s s = G := by ext; unfold replaceVertex; aesop (add simp or_iff_not_imp_left) variable {t} lemma adj_replaceVertex_iff_of_ne_left {w : V} (hw : w β‰  t) : (G.replaceVertex s t).Adj s w ↔ G.Adj s w := by simp [replaceVertex, hw] lemma adj_replaceVertex_iff_of_ne_right {w : V} (hw : w β‰  t) : (G.replaceVertex s t).Adj t w ↔ G.Adj s w := by simp [replaceVertex, hw] lemma adj_replaceVertex_iff_of_ne {v w : V} (hv : v β‰  t) (hw : w β‰  t) : (G.replaceVertex s t).Adj v w ↔ G.Adj v w := by simp [replaceVertex, hv, hw] variable {s} theorem edgeSet_replaceVertex_of_not_adj (hn : Β¬G.Adj s t) : (G.replaceVertex s t).edgeSet = G.edgeSet \ G.incidenceSet t βˆͺ (s(Β·, t)) '' (G.neighborSet s) := by ext e; refine e.inductionOn ?_ simp only [replaceVertex, mem_edgeSet, Set.mem_union, Set.mem_diff, mk'_mem_incidenceSet_iff] intros; split_ifs; exacts [by simp_all, by aesop, by rw [adj_comm]; aesop, by aesop]
Mathlib/Combinatorics/SimpleGraph/Operations.lean
82
86
theorem edgeSet_replaceVertex_of_adj (ha : G.Adj s t) : (G.replaceVertex s t).edgeSet = (G.edgeSet \ G.incidenceSet t βˆͺ (s(Β·, t)) '' (G.neighborSet s)) \ {s(t, t)} := by
ext e; refine e.inductionOn ?_ simp only [replaceVertex, mem_edgeSet, Set.mem_union, Set.mem_diff, mk'_mem_incidenceSet_iff] intros; split_ifs; exacts [by simp_all, by aesop, by rw [adj_comm]; aesop, by aesop]
[ " (fun v w => if v = t then if w = t then False else G.Adj s w else if w = t then G.Adj v s else G.Adj v w) v w β†’\n (fun v w => if v = t then if w = t then False else G.Adj s w else if w = t then G.Adj v s else G.Adj v w) w v", " (if v = t then if w = t then False else G.Adj s w else if w = t then G.Adj v s el...
[ " (fun v w => if v = t then if w = t then False else G.Adj s w else if w = t then G.Adj v s else G.Adj v w) v w β†’\n (fun v w => if v = t then if w = t then False else G.Adj s w else if w = t then G.Adj v s else G.Adj v w) w v", " (if v = t then if w = t then False else G.Adj s w else if w = t then G.Adj v s el...
import Mathlib.Algebra.ContinuedFractions.Basic import Mathlib.Algebra.GroupWithZero.Basic #align_import algebra.continued_fractions.translations from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad" namespace GeneralizedContinuedFraction section WithDivisionRing variable {K : Type*} {g : GeneralizedContinuedFraction K} {n : β„•} [DivisionRing K] theorem nth_cont_eq_succ_nth_cont_aux : g.continuants n = g.continuantsAux (n + 1) := rfl #align generalized_continued_fraction.nth_cont_eq_succ_nth_cont_aux GeneralizedContinuedFraction.nth_cont_eq_succ_nth_cont_aux theorem num_eq_conts_a : g.numerators n = (g.continuants n).a := rfl #align generalized_continued_fraction.num_eq_conts_a GeneralizedContinuedFraction.num_eq_conts_a theorem denom_eq_conts_b : g.denominators n = (g.continuants n).b := rfl #align generalized_continued_fraction.denom_eq_conts_b GeneralizedContinuedFraction.denom_eq_conts_b theorem convergent_eq_num_div_denom : g.convergents n = g.numerators n / g.denominators n := rfl #align generalized_continued_fraction.convergent_eq_num_div_denom GeneralizedContinuedFraction.convergent_eq_num_div_denom theorem convergent_eq_conts_a_div_conts_b : g.convergents n = (g.continuants n).a / (g.continuants n).b := rfl #align generalized_continued_fraction.convergent_eq_conts_a_div_conts_b GeneralizedContinuedFraction.convergent_eq_conts_a_div_conts_b theorem exists_conts_a_of_num {A : K} (nth_num_eq : g.numerators n = A) : βˆƒ conts, g.continuants n = conts ∧ conts.a = A := by simpa #align generalized_continued_fraction.exists_conts_a_of_num GeneralizedContinuedFraction.exists_conts_a_of_num theorem exists_conts_b_of_denom {B : K} (nth_denom_eq : g.denominators n = B) : βˆƒ conts, g.continuants n = conts ∧ conts.b = B := by simpa #align generalized_continued_fraction.exists_conts_b_of_denom GeneralizedContinuedFraction.exists_conts_b_of_denom @[simp] theorem zeroth_continuant_aux_eq_one_zero : g.continuantsAux 0 = ⟨1, 0⟩ := rfl #align generalized_continued_fraction.zeroth_continuant_aux_eq_one_zero GeneralizedContinuedFraction.zeroth_continuant_aux_eq_one_zero @[simp] theorem first_continuant_aux_eq_h_one : g.continuantsAux 1 = ⟨g.h, 1⟩ := rfl #align generalized_continued_fraction.first_continuant_aux_eq_h_one GeneralizedContinuedFraction.first_continuant_aux_eq_h_one @[simp] theorem zeroth_continuant_eq_h_one : g.continuants 0 = ⟨g.h, 1⟩ := rfl #align generalized_continued_fraction.zeroth_continuant_eq_h_one GeneralizedContinuedFraction.zeroth_continuant_eq_h_one @[simp] theorem zeroth_numerator_eq_h : g.numerators 0 = g.h := rfl #align generalized_continued_fraction.zeroth_numerator_eq_h GeneralizedContinuedFraction.zeroth_numerator_eq_h @[simp] theorem zeroth_denominator_eq_one : g.denominators 0 = 1 := rfl #align generalized_continued_fraction.zeroth_denominator_eq_one GeneralizedContinuedFraction.zeroth_denominator_eq_one @[simp] theorem zeroth_convergent_eq_h : g.convergents 0 = g.h := by simp [convergent_eq_num_div_denom, num_eq_conts_a, denom_eq_conts_b, div_one] #align generalized_continued_fraction.zeroth_convergent_eq_h GeneralizedContinuedFraction.zeroth_convergent_eq_h theorem second_continuant_aux_eq {gp : Pair K} (zeroth_s_eq : g.s.get? 0 = some gp) : g.continuantsAux 2 = ⟨gp.b * g.h + gp.a, gp.b⟩ := by simp [zeroth_s_eq, continuantsAux, nextContinuants, nextDenominator, nextNumerator] #align generalized_continued_fraction.second_continuant_aux_eq GeneralizedContinuedFraction.second_continuant_aux_eq theorem first_continuant_eq {gp : Pair K} (zeroth_s_eq : g.s.get? 0 = some gp) : g.continuants 1 = ⟨gp.b * g.h + gp.a, gp.b⟩ := by simp [nth_cont_eq_succ_nth_cont_aux] -- Porting note (#10959): simp used to work here, but now it can't figure out that 1 + 1 = 2 convert second_continuant_aux_eq zeroth_s_eq #align generalized_continued_fraction.first_continuant_eq GeneralizedContinuedFraction.first_continuant_eq theorem first_numerator_eq {gp : Pair K} (zeroth_s_eq : g.s.get? 0 = some gp) : g.numerators 1 = gp.b * g.h + gp.a := by simp [num_eq_conts_a, first_continuant_eq zeroth_s_eq] #align generalized_continued_fraction.first_numerator_eq GeneralizedContinuedFraction.first_numerator_eq theorem first_denominator_eq {gp : Pair K} (zeroth_s_eq : g.s.get? 0 = some gp) : g.denominators 1 = gp.b := by simp [denom_eq_conts_b, first_continuant_eq zeroth_s_eq] #align generalized_continued_fraction.first_denominator_eq GeneralizedContinuedFraction.first_denominator_eq @[simp] theorem zeroth_convergent'_aux_eq_zero {s : Stream'.Seq <| Pair K} : convergents'Aux s 0 = (0 : K) := rfl #align generalized_continued_fraction.zeroth_convergent'_aux_eq_zero GeneralizedContinuedFraction.zeroth_convergent'_aux_eq_zero @[simp] theorem zeroth_convergent'_eq_h : g.convergents' 0 = g.h := by simp [convergents'] #align generalized_continued_fraction.zeroth_convergent'_eq_h GeneralizedContinuedFraction.zeroth_convergent'_eq_h
Mathlib/Algebra/ContinuedFractions/Translations.lean
180
181
theorem convergents'Aux_succ_none {s : Stream'.Seq (Pair K)} (h : s.head = none) (n : β„•) : convergents'Aux s (n + 1) = 0 := by
simp [convergents'Aux, h, convergents'Aux.match_1]
[ " βˆƒ conts, g.continuants n = conts ∧ conts.a = A", " βˆƒ conts, g.continuants n = conts ∧ conts.b = B", " g.convergents 0 = g.h", " g.continuantsAux 2 = { a := gp.b * g.h + gp.a, b := gp.b }", " g.continuants 1 = { a := gp.b * g.h + gp.a, b := gp.b }", " g.numerators 1 = gp.b * g.h + gp.a", " g.denominato...
[ " βˆƒ conts, g.continuants n = conts ∧ conts.a = A", " βˆƒ conts, g.continuants n = conts ∧ conts.b = B", " g.convergents 0 = g.h", " g.continuantsAux 2 = { a := gp.b * g.h + gp.a, b := gp.b }", " g.continuants 1 = { a := gp.b * g.h + gp.a, b := gp.b }", " g.numerators 1 = gp.b * g.h + gp.a", " g.denominato...
import Mathlib.Analysis.Asymptotics.Asymptotics import Mathlib.Analysis.Asymptotics.Theta import Mathlib.Analysis.Normed.Order.Basic #align_import analysis.asymptotics.asymptotic_equivalent from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" namespace Asymptotics open Filter Function open Topology section NormedAddCommGroup variable {Ξ± Ξ² : Type*} [NormedAddCommGroup Ξ²] def IsEquivalent (l : Filter Ξ±) (u v : Ξ± β†’ Ξ²) := (u - v) =o[l] v #align asymptotics.is_equivalent Asymptotics.IsEquivalent @[inherit_doc] scoped notation:50 u " ~[" l:50 "] " v:50 => Asymptotics.IsEquivalent l u v variable {u v w : Ξ± β†’ Ξ²} {l : Filter Ξ±} theorem IsEquivalent.isLittleO (h : u ~[l] v) : (u - v) =o[l] v := h #align asymptotics.is_equivalent.is_o Asymptotics.IsEquivalent.isLittleO nonrec theorem IsEquivalent.isBigO (h : u ~[l] v) : u =O[l] v := (IsBigO.congr_of_sub h.isBigO.symm).mp (isBigO_refl _ _) set_option linter.uppercaseLean3 false in #align asymptotics.is_equivalent.is_O Asymptotics.IsEquivalent.isBigO theorem IsEquivalent.isBigO_symm (h : u ~[l] v) : v =O[l] u := by convert h.isLittleO.right_isBigO_add simp set_option linter.uppercaseLean3 false in #align asymptotics.is_equivalent.is_O_symm Asymptotics.IsEquivalent.isBigO_symm theorem IsEquivalent.isTheta (h : u ~[l] v) : u =Θ[l] v := ⟨h.isBigO, h.isBigO_symm⟩ theorem IsEquivalent.isTheta_symm (h : u ~[l] v) : v =Θ[l] u := ⟨h.isBigO_symm, h.isBigO⟩ @[refl] theorem IsEquivalent.refl : u ~[l] u := by rw [IsEquivalent, sub_self] exact isLittleO_zero _ _ #align asymptotics.is_equivalent.refl Asymptotics.IsEquivalent.refl @[symm] theorem IsEquivalent.symm (h : u ~[l] v) : v ~[l] u := (h.isLittleO.trans_isBigO h.isBigO_symm).symm #align asymptotics.is_equivalent.symm Asymptotics.IsEquivalent.symm @[trans] theorem IsEquivalent.trans {l : Filter Ξ±} {u v w : Ξ± β†’ Ξ²} (huv : u ~[l] v) (hvw : v ~[l] w) : u ~[l] w := (huv.isLittleO.trans_isBigO hvw.isBigO).triangle hvw.isLittleO #align asymptotics.is_equivalent.trans Asymptotics.IsEquivalent.trans theorem IsEquivalent.congr_left {u v w : Ξ± β†’ Ξ²} {l : Filter Ξ±} (huv : u ~[l] v) (huw : u =αΆ [l] w) : w ~[l] v := huv.congr' (huw.sub (EventuallyEq.refl _ _)) (EventuallyEq.refl _ _) #align asymptotics.is_equivalent.congr_left Asymptotics.IsEquivalent.congr_left theorem IsEquivalent.congr_right {u v w : Ξ± β†’ Ξ²} {l : Filter Ξ±} (huv : u ~[l] v) (hvw : v =αΆ [l] w) : u ~[l] w := (huv.symm.congr_left hvw).symm #align asymptotics.is_equivalent.congr_right Asymptotics.IsEquivalent.congr_right
Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean
128
130
theorem isEquivalent_zero_iff_eventually_zero : u ~[l] 0 ↔ u =αΆ [l] 0 := by
rw [IsEquivalent, sub_zero] exact isLittleO_zero_right_iff
[ " v =O[l] u", " u x✝ = (u - v) x✝ + v x✝", " u ~[l] u", " 0 =o[l] u", " u ~[l] 0 ↔ u =αΆ [l] 0", " u =o[l] 0 ↔ u =αΆ [l] 0" ]
[ " v =O[l] u", " u x✝ = (u - v) x✝ + v x✝", " u ~[l] u", " 0 =o[l] u" ]
import Mathlib.Algebra.MvPolynomial.Equiv import Mathlib.Algebra.Polynomial.Eval #align_import data.mv_polynomial.polynomial from "leanprover-community/mathlib"@"0b89934139d3be96f9dab477f10c20f9f93da580" namespace MvPolynomial variable {R S Οƒ : Type*}
Mathlib/Algebra/MvPolynomial/Polynomial.lean
19
28
theorem polynomial_eval_evalβ‚‚ [CommSemiring R] [CommSemiring S] {x : S} (f : R β†’+* Polynomial S) (g : Οƒ β†’ Polynomial S) (p : MvPolynomial Οƒ R) : Polynomial.eval x (evalβ‚‚ f g p) = evalβ‚‚ ((Polynomial.evalRingHom x).comp f) (fun s => Polynomial.eval x (g s)) p := by
apply induction_on p Β· simp Β· intro p q hp hq simp [hp, hq] Β· intro p n hp simp [hp]
[ " Polynomial.eval x (evalβ‚‚ f g p) = evalβ‚‚ ((Polynomial.evalRingHom x).comp f) (fun s => Polynomial.eval x (g s)) p", " βˆ€ (a : R),\n Polynomial.eval x (evalβ‚‚ f g (C a)) =\n evalβ‚‚ ((Polynomial.evalRingHom x).comp f) (fun s => Polynomial.eval x (g s)) (C a)", " βˆ€ (p q : MvPolynomial Οƒ R),\n Polynomial.e...
[]
import Mathlib.Data.Matrix.Kronecker import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.LinearAlgebra.TensorProduct.Basis #align_import linear_algebra.tensor_product.matrix from "leanprover-community/mathlib"@"f784cc6142443d9ee623a20788c282112c322081" variable {R : Type*} {M N P M' N' : Type*} {ΞΉ ΞΊ Ο„ ΞΉ' ΞΊ' : Type*} variable [DecidableEq ΞΉ] [DecidableEq ΞΊ] [DecidableEq Ο„] variable [Fintype ΞΉ] [Fintype ΞΊ] [Fintype Ο„] [Finite ΞΉ'] [Finite ΞΊ'] variable [CommRing R] variable [AddCommGroup M] [AddCommGroup N] [AddCommGroup P] variable [AddCommGroup M'] [AddCommGroup N'] variable [Module R M] [Module R N] [Module R P] [Module R M'] [Module R N'] variable (bM : Basis ΞΉ R M) (bN : Basis ΞΊ R N) (bP : Basis Ο„ R P) variable (bM' : Basis ΞΉ' R M') (bN' : Basis ΞΊ' R N') open Kronecker open Matrix LinearMap theorem TensorProduct.toMatrix_map (f : M β†’β‚—[R] M') (g : N β†’β‚—[R] N') : toMatrix (bM.tensorProduct bN) (bM'.tensorProduct bN') (TensorProduct.map f g) = toMatrix bM bM' f βŠ—β‚– toMatrix bN bN' g := by ext ⟨i, j⟩ ⟨i', j'⟩ simp_rw [Matrix.kroneckerMap_apply, toMatrix_apply, Basis.tensorProduct_apply, TensorProduct.map_tmul, Basis.tensorProduct_repr_tmul_apply] #align tensor_product.to_matrix_map TensorProduct.toMatrix_map
Mathlib/LinearAlgebra/TensorProduct/Matrix.lean
49
53
theorem Matrix.toLin_kronecker (A : Matrix ΞΉ' ΞΉ R) (B : Matrix ΞΊ' ΞΊ R) : toLin (bM.tensorProduct bN) (bM'.tensorProduct bN') (A βŠ—β‚– B) = TensorProduct.map (toLin bM bM' A) (toLin bN bN' B) := by
rw [← LinearEquiv.eq_symm_apply, toLin_symm, TensorProduct.toMatrix_map, toMatrix_toLin, toMatrix_toLin]
[ " (toMatrix (bM.tensorProduct bN) (bM'.tensorProduct bN')) (map f g) =\n kroneckerMap (fun x x_1 => x * x_1) ((toMatrix bM bM') f) ((toMatrix bN bN') g)", " (toMatrix (bM.tensorProduct bN) (bM'.tensorProduct bN')) (map f g) (i, j) (i', j') =\n kroneckerMap (fun x x_1 => x * x_1) ((toMatrix bM bM') f) ((toMa...
[ " (toMatrix (bM.tensorProduct bN) (bM'.tensorProduct bN')) (map f g) =\n kroneckerMap (fun x x_1 => x * x_1) ((toMatrix bM bM') f) ((toMatrix bN bN') g)", " (toMatrix (bM.tensorProduct bN) (bM'.tensorProduct bN')) (map f g) (i, j) (i', j') =\n kroneckerMap (fun x x_1 => x * x_1) ((toMatrix bM bM') f) ((toMa...
import Mathlib.Algebra.Algebra.Defs import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Basic import Mathlib.RingTheory.Localization.Basic import Mathlib.SetTheory.Game.Birthday import Mathlib.SetTheory.Surreal.Basic #align_import set_theory.surreal.dyadic from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u namespace SetTheory namespace PGame def powHalf : β„• β†’ PGame | 0 => 1 | n + 1 => ⟨PUnit, PUnit, 0, fun _ => powHalf n⟩ #align pgame.pow_half SetTheory.PGame.powHalf @[simp] theorem powHalf_zero : powHalf 0 = 1 := rfl #align pgame.pow_half_zero SetTheory.PGame.powHalf_zero
Mathlib/SetTheory/Surreal/Dyadic.lean
52
52
theorem powHalf_leftMoves (n) : (powHalf n).LeftMoves = PUnit := by
cases n <;> rfl
[ " (powHalf n).LeftMoves = PUnit.{u_1 + 1}", " (powHalf 0).LeftMoves = PUnit.{u_1 + 1}", " (powHalf (n✝ + 1)).LeftMoves = PUnit.{u_1 + 1}" ]
[]
import Mathlib.Algebra.Ring.Idempotents import Mathlib.Analysis.Normed.Group.Basic import Mathlib.Order.Basic import Mathlib.Tactic.NoncommRing #align_import analysis.normed_space.M_structure from "leanprover-community/mathlib"@"d11893b411025250c8e61ff2f12ccbd7ee35ab15" variable (X : Type*) [NormedAddCommGroup X] variable {M : Type*} [Ring M] [Module M X] -- Porting note: Mathlib3 uses names with uppercase 'L' for L-projections set_option linter.uppercaseLean3 false structure IsLprojection (P : M) : Prop where proj : IsIdempotentElem P Lnorm : βˆ€ x : X, β€–xβ€– = β€–P β€’ xβ€– + β€–(1 - P) β€’ xβ€– #align is_Lprojection IsLprojection structure IsMprojection (P : M) : Prop where proj : IsIdempotentElem P Mnorm : βˆ€ x : X, β€–xβ€– = max β€–P β€’ xβ€– β€–(1 - P) β€’ xβ€– #align is_Mprojection IsMprojection variable {X} namespace IsLprojection -- Porting note: The literature always uses uppercase 'L' for L-projections theorem Lcomplement {P : M} (h : IsLprojection X P) : IsLprojection X (1 - P) := ⟨h.proj.one_sub, fun x => by rw [add_comm, sub_sub_cancel] exact h.Lnorm x⟩ #align is_Lprojection.Lcomplement IsLprojection.Lcomplement theorem Lcomplement_iff (P : M) : IsLprojection X P ↔ IsLprojection X (1 - P) := ⟨Lcomplement, fun h => sub_sub_cancel 1 P β–Έ h.Lcomplement⟩ #align is_Lprojection.Lcomplement_iff IsLprojection.Lcomplement_iff
Mathlib/Analysis/NormedSpace/MStructure.lean
105
144
theorem commute [FaithfulSMul M X] {P Q : M} (h₁ : IsLprojection X P) (hβ‚‚ : IsLprojection X Q) : Commute P Q := by
have PR_eq_RPR : βˆ€ R : M, IsLprojection X R β†’ P * R = R * P * R := fun R h₃ => by -- Porting note: Needed to fix function, which changes indent of following lines refine @eq_of_smul_eq_smul _ X _ _ _ _ fun x => by rw [← norm_sub_eq_zero_iff] have e1 : β€–R β€’ xβ€– β‰₯ β€–R β€’ xβ€– + 2 β€’ β€–(P * R) β€’ x - (R * P * R) β€’ xβ€– := calc β€–R β€’ xβ€– = β€–R β€’ P β€’ R β€’ xβ€– + β€–(1 - R) β€’ P β€’ R β€’ xβ€– + (β€–(R * R) β€’ x - R β€’ P β€’ R β€’ xβ€– + β€–(1 - R) β€’ (1 - P) β€’ R β€’ xβ€–) := by rw [h₁.Lnorm, h₃.Lnorm, h₃.Lnorm ((1 - P) β€’ R β€’ x), sub_smul 1 P, one_smul, smul_sub, mul_smul] _ = β€–R β€’ P β€’ R β€’ xβ€– + β€–(1 - R) β€’ P β€’ R β€’ xβ€– + (β€–R β€’ x - R β€’ P β€’ R β€’ xβ€– + β€–((1 - R) * R) β€’ x - (1 - R) β€’ P β€’ R β€’ xβ€–) := by rw [h₃.proj.eq, sub_smul 1 P, one_smul, smul_sub, mul_smul] _ = β€–R β€’ P β€’ R β€’ xβ€– + β€–(1 - R) β€’ P β€’ R β€’ xβ€– + (β€–R β€’ x - R β€’ P β€’ R β€’ xβ€– + β€–(1 - R) β€’ P β€’ R β€’ xβ€–) := by rw [sub_mul, h₃.proj.eq, one_mul, sub_self, zero_smul, zero_sub, norm_neg] _ = β€–R β€’ P β€’ R β€’ xβ€– + β€–R β€’ x - R β€’ P β€’ R β€’ xβ€– + 2 β€’ β€–(1 - R) β€’ P β€’ R β€’ xβ€– := by abel _ β‰₯ β€–R β€’ xβ€– + 2 β€’ β€–(P * R) β€’ x - (R * P * R) β€’ xβ€– := by rw [GE.ge] have := add_le_add_right (norm_le_insert' (R β€’ x) (R β€’ P β€’ R β€’ x)) (2 β€’ β€–(1 - R) β€’ P β€’ R β€’ xβ€–) simpa only [mul_smul, sub_smul, one_smul] using this rw [GE.ge] at e1 -- Porting note: Bump index in nth_rewrite nth_rewrite 2 [← add_zero β€–R β€’ xβ€–] at e1 rw [add_le_add_iff_left, two_smul, ← two_mul] at e1 rw [le_antisymm_iff] refine ⟨?_, norm_nonneg _⟩ rwa [← mul_zero (2 : ℝ), mul_le_mul_left (show (0 : ℝ) < 2 by norm_num)] at e1 have QP_eq_QPQ : Q * P = Q * P * Q := by have e1 : P * (1 - Q) = P * (1 - Q) - (Q * P - Q * P * Q) := calc P * (1 - Q) = (1 - Q) * P * (1 - Q) := by rw [PR_eq_RPR (1 - Q) hβ‚‚.Lcomplement] _ = P * (1 - Q) - (Q * P - Q * P * Q) := by noncomm_ring rwa [eq_sub_iff_add_eq, add_right_eq_self, sub_eq_zero] at e1 show P * Q = Q * P rw [QP_eq_QPQ, PR_eq_RPR Q hβ‚‚]
[ " β€–xβ€– = β€–(1 - P) β€’ xβ€– + β€–(1 - (1 - P)) β€’ xβ€–", " β€–xβ€– = β€–P β€’ xβ€– + β€–(1 - P) β€’ xβ€–", " Commute P Q", " P * R = R * P * R", " (P * R) β€’ x = (R * P * R) β€’ x", " β€–(P * R) β€’ x - (R * P * R) β€’ xβ€– = 0", " β€–R β€’ xβ€– = β€–R β€’ P β€’ R β€’ xβ€– + β€–(1 - R) β€’ P β€’ R β€’ xβ€– + (β€–(R * R) β€’ x - R β€’ P β€’ R β€’ xβ€– + β€–(1 - R) β€’ (1 - P) β€’ R β€’ ...
[ " β€–xβ€– = β€–(1 - P) β€’ xβ€– + β€–(1 - (1 - P)) β€’ xβ€–", " β€–xβ€– = β€–P β€’ xβ€– + β€–(1 - P) β€’ xβ€–" ]
import Mathlib.Data.Vector.Basic import Mathlib.Data.Vector.Snoc set_option autoImplicit true namespace Vector section Fold section Unary variable (xs : Vector Ξ± n) (f₁ : Ξ² β†’ σ₁ β†’ σ₁ Γ— Ξ³) (fβ‚‚ : Ξ± β†’ Οƒβ‚‚ β†’ Οƒβ‚‚ Γ— Ξ²) @[simp] theorem mapAccumr_mapAccumr : mapAccumr f₁ (mapAccumr fβ‚‚ xs sβ‚‚).snd s₁ = let m := (mapAccumr (fun x s => let rβ‚‚ := fβ‚‚ x s.snd let r₁ := f₁ rβ‚‚.snd s.fst ((r₁.fst, rβ‚‚.fst), r₁.snd) ) xs (s₁, sβ‚‚)) (m.fst.fst, m.snd) := by induction xs using Vector.revInductionOn generalizing s₁ sβ‚‚ <;> simp_all @[simp]
Mathlib/Data/Vector/MapLemmas.lean
38
40
theorem mapAccumr_map (fβ‚‚ : Ξ± β†’ Ξ²) : (mapAccumr f₁ (map fβ‚‚ xs) s) = (mapAccumr (fun x s => f₁ (fβ‚‚ x) s) xs s) := by
induction xs using Vector.revInductionOn generalizing s <;> simp_all
[ " mapAccumr f₁ (mapAccumr fβ‚‚ xs sβ‚‚).2 s₁ =\n let m :=\n mapAccumr\n (fun x s =>\n let rβ‚‚ := fβ‚‚ x s.2;\n let r₁ := f₁ rβ‚‚.2 s.1;\n ((r₁.1, rβ‚‚.1), r₁.2))\n xs (s₁, sβ‚‚);\n (m.1.1, m.2)", " mapAccumr f₁ (mapAccumr fβ‚‚ nil sβ‚‚).2 s₁ =\n let m :=\n mapAccumr\n ...
[ " mapAccumr f₁ (mapAccumr fβ‚‚ xs sβ‚‚).2 s₁ =\n let m :=\n mapAccumr\n (fun x s =>\n let rβ‚‚ := fβ‚‚ x s.2;\n let r₁ := f₁ rβ‚‚.2 s.1;\n ((r₁.1, rβ‚‚.1), r₁.2))\n xs (s₁, sβ‚‚);\n (m.1.1, m.2)", " mapAccumr f₁ (mapAccumr fβ‚‚ nil sβ‚‚).2 s₁ =\n let m :=\n mapAccumr\n ...
import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Order.Interval.Set.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" open scoped Classical open Set variable {ΞΉ : Sort*} {Ξ± : Type*} (s : Set Ξ±) section InfSet variable [Preorder Ξ±] [InfSet Ξ±] noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set Ξ±) ∈ s then ⟨sInf ((↑) '' t : Set Ξ±), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set Ξ±) ∈ s then ⟨sInf ((↑) '' t : Set Ξ±), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set Ξ±) ∈ s) : sInf ((↑) '' t : Set Ξ±) = (@sInf s _ t : Ξ±) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (βˆ… : Set s) = default := by simp [sInf]
Mathlib/Order/CompleteLatticeIntervals.lean
106
108
theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : Β¬BddBelow t) : sInf t = default := by
simp [sInf, ht]
[ " sInf (Subtype.val '' t) = ↑(sInf t)", " sInf βˆ… = default", " sInf t = default" ]
[ " sInf (Subtype.val '' t) = ↑(sInf t)", " sInf βˆ… = default" ]
import Mathlib.CategoryTheory.Balanced import Mathlib.CategoryTheory.Limits.EssentiallySmall import Mathlib.CategoryTheory.Limits.Opposites import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms import Mathlib.CategoryTheory.Subobject.Lattice import Mathlib.CategoryTheory.Subobject.WellPowered import Mathlib.Data.Set.Opposite import Mathlib.Data.Set.Subsingleton #align_import category_theory.generator from "leanprover-community/mathlib"@"f187f1074fa1857c94589cc653c786cadc4c35ff" universe w v₁ vβ‚‚ u₁ uβ‚‚ open CategoryTheory.Limits Opposite namespace CategoryTheory variable {C : Type u₁} [Category.{v₁} C] {D : Type uβ‚‚} [Category.{vβ‚‚} D] def IsSeparating (𝒒 : Set C) : Prop := βˆ€ ⦃X Y : C⦄ (f g : X ⟢ Y), (βˆ€ G ∈ 𝒒, βˆ€ (h : G ⟢ X), h ≫ f = h ≫ g) β†’ f = g #align category_theory.is_separating CategoryTheory.IsSeparating def IsCoseparating (𝒒 : Set C) : Prop := βˆ€ ⦃X Y : C⦄ (f g : X ⟢ Y), (βˆ€ G ∈ 𝒒, βˆ€ (h : Y ⟢ G), f ≫ h = g ≫ h) β†’ f = g #align category_theory.is_coseparating CategoryTheory.IsCoseparating def IsDetecting (𝒒 : Set C) : Prop := βˆ€ ⦃X Y : C⦄ (f : X ⟢ Y), (βˆ€ G ∈ 𝒒, βˆ€ (h : G ⟢ Y), βˆƒ! h' : G ⟢ X, h' ≫ f = h) β†’ IsIso f #align category_theory.is_detecting CategoryTheory.IsDetecting def IsCodetecting (𝒒 : Set C) : Prop := βˆ€ ⦃X Y : C⦄ (f : X ⟢ Y), (βˆ€ G ∈ 𝒒, βˆ€ (h : X ⟢ G), βˆƒ! h' : Y ⟢ G, f ≫ h' = h) β†’ IsIso f #align category_theory.is_codetecting CategoryTheory.IsCodetecting section Dual theorem isSeparating_op_iff (𝒒 : Set C) : IsSeparating 𝒒.op ↔ IsCoseparating 𝒒 := by refine ⟨fun h𝒒 X Y f g hfg => ?_, fun h𝒒 X Y f g hfg => ?_⟩ Β· refine Quiver.Hom.op_inj (h𝒒 _ _ fun G hG h => Quiver.Hom.unop_inj ?_) simpa only [unop_comp, Quiver.Hom.unop_op] using hfg _ (Set.mem_op.1 hG) _ Β· refine Quiver.Hom.unop_inj (h𝒒 _ _ fun G hG h => Quiver.Hom.op_inj ?_) simpa only [op_comp, Quiver.Hom.op_unop] using hfg _ (Set.op_mem_op.2 hG) _ #align category_theory.is_separating_op_iff CategoryTheory.isSeparating_op_iff theorem isCoseparating_op_iff (𝒒 : Set C) : IsCoseparating 𝒒.op ↔ IsSeparating 𝒒 := by refine ⟨fun h𝒒 X Y f g hfg => ?_, fun h𝒒 X Y f g hfg => ?_⟩ Β· refine Quiver.Hom.op_inj (h𝒒 _ _ fun G hG h => Quiver.Hom.unop_inj ?_) simpa only [unop_comp, Quiver.Hom.unop_op] using hfg _ (Set.mem_op.1 hG) _ Β· refine Quiver.Hom.unop_inj (h𝒒 _ _ fun G hG h => Quiver.Hom.op_inj ?_) simpa only [op_comp, Quiver.Hom.op_unop] using hfg _ (Set.op_mem_op.2 hG) _ #align category_theory.is_coseparating_op_iff CategoryTheory.isCoseparating_op_iff theorem isCoseparating_unop_iff (𝒒 : Set Cα΅’α΅–) : IsCoseparating 𝒒.unop ↔ IsSeparating 𝒒 := by rw [← isSeparating_op_iff, Set.unop_op] #align category_theory.is_coseparating_unop_iff CategoryTheory.isCoseparating_unop_iff theorem isSeparating_unop_iff (𝒒 : Set Cα΅’α΅–) : IsSeparating 𝒒.unop ↔ IsCoseparating 𝒒 := by rw [← isCoseparating_op_iff, Set.unop_op] #align category_theory.is_separating_unop_iff CategoryTheory.isSeparating_unop_iff
Mathlib/CategoryTheory/Generator.lean
117
126
theorem isDetecting_op_iff (𝒒 : Set C) : IsDetecting 𝒒.op ↔ IsCodetecting 𝒒 := by
refine ⟨fun h𝒒 X Y f hf => ?_, fun h𝒒 X Y f hf => ?_⟩ Β· refine (isIso_op_iff _).1 (h𝒒 _ fun G hG h => ?_) obtain ⟨t, ht, ht'⟩ := hf (unop G) (Set.mem_op.1 hG) h.unop exact ⟨t.op, Quiver.Hom.unop_inj ht, fun y hy => Quiver.Hom.unop_inj (ht' _ (Quiver.Hom.op_inj hy))⟩ Β· refine (isIso_unop_iff _).1 (h𝒒 _ fun G hG h => ?_) obtain ⟨t, ht, ht'⟩ := hf (op G) (Set.op_mem_op.2 hG) h.op refine ⟨t.unop, Quiver.Hom.op_inj ht, fun y hy => Quiver.Hom.op_inj (ht' _ ?_)⟩ exact Quiver.Hom.unop_inj (by simpa only using hy)
[ " IsSeparating 𝒒.op ↔ IsCoseparating 𝒒", " f = g", " (h ≫ f.op).unop = (h ≫ g.op).unop", " (f.unop ≫ h).op = (g.unop ≫ h).op", " IsCoseparating 𝒒.op ↔ IsSeparating 𝒒", " (f.op ≫ h).unop = (g.op ≫ h).unop", " (h ≫ f.unop).op = (h ≫ g.unop).op", " IsCoseparating 𝒒.unop ↔ IsSeparating 𝒒", " IsSep...
[ " IsSeparating 𝒒.op ↔ IsCoseparating 𝒒", " f = g", " (h ≫ f.op).unop = (h ≫ g.op).unop", " (f.unop ≫ h).op = (g.unop ≫ h).op", " IsCoseparating 𝒒.op ↔ IsSeparating 𝒒", " (f.op ≫ h).unop = (g.op ≫ h).unop", " (h ≫ f.unop).op = (h ≫ g.unop).op", " IsCoseparating 𝒒.unop ↔ IsSeparating 𝒒", " IsSep...
import Mathlib.Analysis.SpecialFunctions.Complex.Arg import Mathlib.Analysis.SpecialFunctions.Log.Basic #align_import analysis.special_functions.complex.log from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section namespace Complex open Set Filter Bornology open scoped Real Topology ComplexConjugate -- Porting note: @[pp_nodot] does not exist in mathlib4 noncomputable def log (x : β„‚) : β„‚ := x.abs.log + arg x * I #align complex.log Complex.log theorem log_re (x : β„‚) : x.log.re = x.abs.log := by simp [log] #align complex.log_re Complex.log_re theorem log_im (x : β„‚) : x.log.im = x.arg := by simp [log] #align complex.log_im Complex.log_im theorem neg_pi_lt_log_im (x : β„‚) : -Ο€ < (log x).im := by simp only [log_im, neg_pi_lt_arg] #align complex.neg_pi_lt_log_im Complex.neg_pi_lt_log_im theorem log_im_le_pi (x : β„‚) : (log x).im ≀ Ο€ := by simp only [log_im, arg_le_pi] #align complex.log_im_le_pi Complex.log_im_le_pi theorem exp_log {x : β„‚} (hx : x β‰  0) : exp (log x) = x := by rw [log, exp_add_mul_I, ← ofReal_sin, sin_arg, ← ofReal_cos, cos_arg hx, ← ofReal_exp, Real.exp_log (abs.pos hx), mul_add, ofReal_div, ofReal_div, mul_div_cancelβ‚€ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), ← mul_assoc, mul_div_cancelβ‚€ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), re_add_im] #align complex.exp_log Complex.exp_log @[simp] theorem range_exp : Set.range exp = {0}ᢜ := Set.ext fun x => ⟨by rintro ⟨x, rfl⟩ exact exp_ne_zero x, fun hx => ⟨log x, exp_log hx⟩⟩ #align complex.range_exp Complex.range_exp theorem log_exp {x : β„‚} (hx₁ : -Ο€ < x.im) (hxβ‚‚ : x.im ≀ Ο€) : log (exp x) = x := by rw [log, abs_exp, Real.log_exp, exp_eq_exp_re_mul_sin_add_cos, ← ofReal_exp, arg_mul_cos_add_sin_mul_I (Real.exp_pos _) ⟨hx₁, hxβ‚‚βŸ©, re_add_im] #align complex.log_exp Complex.log_exp theorem exp_inj_of_neg_pi_lt_of_le_pi {x y : β„‚} (hx₁ : -Ο€ < x.im) (hxβ‚‚ : x.im ≀ Ο€) (hy₁ : -Ο€ < y.im) (hyβ‚‚ : y.im ≀ Ο€) (hxy : exp x = exp y) : x = y := by rw [← log_exp hx₁ hxβ‚‚, ← log_exp hy₁ hyβ‚‚, hxy] #align complex.exp_inj_of_neg_pi_lt_of_le_pi Complex.exp_inj_of_neg_pi_lt_of_le_pi theorem ofReal_log {x : ℝ} (hx : 0 ≀ x) : (x.log : β„‚) = log x := Complex.ext (by rw [log_re, ofReal_re, abs_of_nonneg hx]) (by rw [ofReal_im, log_im, arg_ofReal_of_nonneg hx]) #align complex.of_real_log Complex.ofReal_log @[simp, norm_cast] lemma natCast_log {n : β„•} : Real.log n = log n := ofReal_natCast n β–Έ ofReal_log n.cast_nonneg @[simp] lemma ofNat_log {n : β„•} [n.AtLeastTwo] : Real.log (no_index (OfNat.ofNat n)) = log (OfNat.ofNat n) := natCast_log theorem log_ofReal_re (x : ℝ) : (log (x : β„‚)).re = Real.log x := by simp [log_re] #align complex.log_of_real_re Complex.log_ofReal_re theorem log_ofReal_mul {r : ℝ} (hr : 0 < r) {x : β„‚} (hx : x β‰  0) : log (r * x) = Real.log r + log x := by replace hx := Complex.abs.ne_zero_iff.mpr hx simp_rw [log, map_mul, abs_ofReal, arg_real_mul _ hr, abs_of_pos hr, Real.log_mul hr.ne' hx, ofReal_add, add_assoc] #align complex.log_of_real_mul Complex.log_ofReal_mul theorem log_mul_ofReal (r : ℝ) (hr : 0 < r) (x : β„‚) (hx : x β‰  0) : log (x * r) = Real.log r + log x := by rw [mul_comm, log_ofReal_mul hr hx] #align complex.log_mul_of_real Complex.log_mul_ofReal lemma log_mul_eq_add_log_iff {x y : β„‚} (hxβ‚€ : x β‰  0) (hyβ‚€ : y β‰  0) : log (x * y) = log x + log y ↔ arg x + arg y ∈ Set.Ioc (-Ο€) Ο€ := by refine ext_iff.trans <| Iff.trans ?_ <| arg_mul_eq_add_arg_iff hxβ‚€ hyβ‚€ simp_rw [add_re, add_im, log_re, log_im, AbsoluteValue.map_mul, Real.log_mul (abs.ne_zero hxβ‚€) (abs.ne_zero hyβ‚€), true_and] alias ⟨_, log_mul⟩ := log_mul_eq_add_log_iff @[simp] theorem log_zero : log 0 = 0 := by simp [log] #align complex.log_zero Complex.log_zero @[simp] theorem log_one : log 1 = 0 := by simp [log] #align complex.log_one Complex.log_one theorem log_neg_one : log (-1) = Ο€ * I := by simp [log] #align complex.log_neg_one Complex.log_neg_one theorem log_I : log I = Ο€ / 2 * I := by simp [log] set_option linter.uppercaseLean3 false in #align complex.log_I Complex.log_I
Mathlib/Analysis/SpecialFunctions/Complex/Log.lean
120
120
theorem log_neg_I : log (-I) = -(Ο€ / 2) * I := by
simp [log]
[ " x.log.re = (abs x).log", " x.log.im = x.arg", " -Ο€ < x.log.im", " x.log.im ≀ Ο€", " cexp x.log = x", " x ∈ Set.range cexp β†’ x ∈ {0}ᢜ", " cexp x ∈ {0}ᢜ", " (cexp x).log = x", " x = y", " (↑x.log).re = (↑x).log.re", " (↑x.log).im = (↑x).log.im", " (↑x).log.re = x.log", " (↑r * x).log = ↑r.log...
[ " x.log.re = (abs x).log", " x.log.im = x.arg", " -Ο€ < x.log.im", " x.log.im ≀ Ο€", " cexp x.log = x", " x ∈ Set.range cexp β†’ x ∈ {0}ᢜ", " cexp x ∈ {0}ᢜ", " (cexp x).log = x", " x = y", " (↑x.log).re = (↑x).log.re", " (↑x.log).im = (↑x).log.im", " (↑x).log.re = x.log", " (↑r * x).log = ↑r.log...
import Mathlib.Analysis.Asymptotics.Asymptotics import Mathlib.Analysis.Asymptotics.Theta import Mathlib.Analysis.Normed.Order.Basic #align_import analysis.asymptotics.asymptotic_equivalent from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" namespace Asymptotics open Filter Function open Topology section NormedAddCommGroup variable {Ξ± Ξ² : Type*} [NormedAddCommGroup Ξ²] def IsEquivalent (l : Filter Ξ±) (u v : Ξ± β†’ Ξ²) := (u - v) =o[l] v #align asymptotics.is_equivalent Asymptotics.IsEquivalent @[inherit_doc] scoped notation:50 u " ~[" l:50 "] " v:50 => Asymptotics.IsEquivalent l u v variable {u v w : Ξ± β†’ Ξ²} {l : Filter Ξ±} theorem IsEquivalent.isLittleO (h : u ~[l] v) : (u - v) =o[l] v := h #align asymptotics.is_equivalent.is_o Asymptotics.IsEquivalent.isLittleO nonrec theorem IsEquivalent.isBigO (h : u ~[l] v) : u =O[l] v := (IsBigO.congr_of_sub h.isBigO.symm).mp (isBigO_refl _ _) set_option linter.uppercaseLean3 false in #align asymptotics.is_equivalent.is_O Asymptotics.IsEquivalent.isBigO theorem IsEquivalent.isBigO_symm (h : u ~[l] v) : v =O[l] u := by convert h.isLittleO.right_isBigO_add simp set_option linter.uppercaseLean3 false in #align asymptotics.is_equivalent.is_O_symm Asymptotics.IsEquivalent.isBigO_symm theorem IsEquivalent.isTheta (h : u ~[l] v) : u =Θ[l] v := ⟨h.isBigO, h.isBigO_symm⟩ theorem IsEquivalent.isTheta_symm (h : u ~[l] v) : v =Θ[l] u := ⟨h.isBigO_symm, h.isBigO⟩ @[refl] theorem IsEquivalent.refl : u ~[l] u := by rw [IsEquivalent, sub_self] exact isLittleO_zero _ _ #align asymptotics.is_equivalent.refl Asymptotics.IsEquivalent.refl @[symm] theorem IsEquivalent.symm (h : u ~[l] v) : v ~[l] u := (h.isLittleO.trans_isBigO h.isBigO_symm).symm #align asymptotics.is_equivalent.symm Asymptotics.IsEquivalent.symm @[trans] theorem IsEquivalent.trans {l : Filter Ξ±} {u v w : Ξ± β†’ Ξ²} (huv : u ~[l] v) (hvw : v ~[l] w) : u ~[l] w := (huv.isLittleO.trans_isBigO hvw.isBigO).triangle hvw.isLittleO #align asymptotics.is_equivalent.trans Asymptotics.IsEquivalent.trans theorem IsEquivalent.congr_left {u v w : Ξ± β†’ Ξ²} {l : Filter Ξ±} (huv : u ~[l] v) (huw : u =αΆ [l] w) : w ~[l] v := huv.congr' (huw.sub (EventuallyEq.refl _ _)) (EventuallyEq.refl _ _) #align asymptotics.is_equivalent.congr_left Asymptotics.IsEquivalent.congr_left theorem IsEquivalent.congr_right {u v w : Ξ± β†’ Ξ²} {l : Filter Ξ±} (huv : u ~[l] v) (hvw : v =αΆ [l] w) : u ~[l] w := (huv.symm.congr_left hvw).symm #align asymptotics.is_equivalent.congr_right Asymptotics.IsEquivalent.congr_right theorem isEquivalent_zero_iff_eventually_zero : u ~[l] 0 ↔ u =αΆ [l] 0 := by rw [IsEquivalent, sub_zero] exact isLittleO_zero_right_iff #align asymptotics.is_equivalent_zero_iff_eventually_zero Asymptotics.isEquivalent_zero_iff_eventually_zero theorem isEquivalent_zero_iff_isBigO_zero : u ~[l] 0 ↔ u =O[l] (0 : Ξ± β†’ Ξ²) := by refine ⟨IsEquivalent.isBigO, fun h ↦ ?_⟩ rw [isEquivalent_zero_iff_eventually_zero, eventuallyEq_iff_exists_mem] exact ⟨{ x : Ξ± | u x = 0 }, isBigO_zero_right_iff.mp h, fun x hx ↦ hx⟩ set_option linter.uppercaseLean3 false in #align asymptotics.is_equivalent_zero_iff_is_O_zero Asymptotics.isEquivalent_zero_iff_isBigO_zero theorem isEquivalent_const_iff_tendsto {c : Ξ²} (h : c β‰  0) : u ~[l] const _ c ↔ Tendsto u l (𝓝 c) := by simp (config := { unfoldPartialApp := true }) only [IsEquivalent, const, isLittleO_const_iff h] constructor <;> intro h Β· have := h.sub (tendsto_const_nhds (x := -c)) simp only [Pi.sub_apply, sub_neg_eq_add, sub_add_cancel, zero_add] at this exact this Β· have := h.sub (tendsto_const_nhds (x := c)) rwa [sub_self] at this #align asymptotics.is_equivalent_const_iff_tendsto Asymptotics.isEquivalent_const_iff_tendsto
Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean
151
154
theorem IsEquivalent.tendsto_const {c : Ξ²} (hu : u ~[l] const _ c) : Tendsto u l (𝓝 c) := by
rcases em <| c = 0 with rfl | h Β· exact (tendsto_congr' <| isEquivalent_zero_iff_eventually_zero.mp hu).mpr tendsto_const_nhds Β· exact (isEquivalent_const_iff_tendsto h).mp hu
[ " v =O[l] u", " u x✝ = (u - v) x✝ + v x✝", " u ~[l] u", " 0 =o[l] u", " u ~[l] 0 ↔ u =αΆ [l] 0", " u =o[l] 0 ↔ u =αΆ [l] 0", " u ~[l] 0 ↔ u =O[l] 0", " u ~[l] 0", " βˆƒ s ∈ l, Set.EqOn u 0 s", " u ~[l] const Ξ± c ↔ Tendsto u l (𝓝 c)", " Tendsto (u - fun x => c) l (𝓝 0) ↔ Tendsto u l (𝓝 c)", " Tend...
[ " v =O[l] u", " u x✝ = (u - v) x✝ + v x✝", " u ~[l] u", " 0 =o[l] u", " u ~[l] 0 ↔ u =αΆ [l] 0", " u =o[l] 0 ↔ u =αΆ [l] 0", " u ~[l] 0 ↔ u =O[l] 0", " u ~[l] 0", " βˆƒ s ∈ l, Set.EqOn u 0 s", " u ~[l] const Ξ± c ↔ Tendsto u l (𝓝 c)", " Tendsto (u - fun x => c) l (𝓝 0) ↔ Tendsto u l (𝓝 c)", " Tend...
import Mathlib.Data.Matrix.Invertible import Mathlib.LinearAlgebra.Matrix.Adjugate import Mathlib.LinearAlgebra.FiniteDimensional #align_import linear_algebra.matrix.nonsingular_inverse from "leanprover-community/mathlib"@"722b3b152ddd5e0cf21c0a29787c76596cb6b422" namespace Matrix universe u u' v variable {l : Type*} {m : Type u} {n : Type u'} {Ξ± : Type v} open Matrix Equiv Equiv.Perm Finset section Invertible variable [Fintype n] [DecidableEq n] [CommRing Ξ±] variable (A : Matrix n n Ξ±) (B : Matrix n n Ξ±) def invertibleOfDetInvertible [Invertible A.det] : Invertible A where invOf := β…Ÿ A.det β€’ A.adjugate mul_invOf_self := by rw [mul_smul_comm, mul_adjugate, smul_smul, invOf_mul_self, one_smul] invOf_mul_self := by rw [smul_mul_assoc, adjugate_mul, smul_smul, invOf_mul_self, one_smul] #align matrix.invertible_of_det_invertible Matrix.invertibleOfDetInvertible theorem invOf_eq [Invertible A.det] [Invertible A] : β…Ÿ A = β…Ÿ A.det β€’ A.adjugate := by letI := invertibleOfDetInvertible A convert (rfl : β…Ÿ A = _) #align matrix.inv_of_eq Matrix.invOf_eq def detInvertibleOfLeftInverse (h : B * A = 1) : Invertible A.det where invOf := B.det mul_invOf_self := by rw [mul_comm, ← det_mul, h, det_one] invOf_mul_self := by rw [← det_mul, h, det_one] #align matrix.det_invertible_of_left_inverse Matrix.detInvertibleOfLeftInverse def detInvertibleOfRightInverse (h : A * B = 1) : Invertible A.det where invOf := B.det mul_invOf_self := by rw [← det_mul, h, det_one] invOf_mul_self := by rw [mul_comm, ← det_mul, h, det_one] #align matrix.det_invertible_of_right_inverse Matrix.detInvertibleOfRightInverse def detInvertibleOfInvertible [Invertible A] : Invertible A.det := detInvertibleOfLeftInverse A (β…Ÿ A) (invOf_mul_self _) #align matrix.det_invertible_of_invertible Matrix.detInvertibleOfInvertible theorem det_invOf [Invertible A] [Invertible A.det] : (β…Ÿ A).det = β…Ÿ A.det := by letI := detInvertibleOfInvertible A convert (rfl : _ = β…Ÿ A.det) #align matrix.det_inv_of Matrix.det_invOf @[simps] def invertibleEquivDetInvertible : Invertible A ≃ Invertible A.det where toFun := @detInvertibleOfInvertible _ _ _ _ _ A invFun := @invertibleOfDetInvertible _ _ _ _ _ A left_inv _ := Subsingleton.elim _ _ right_inv _ := Subsingleton.elim _ _ #align matrix.invertible_equiv_det_invertible Matrix.invertibleEquivDetInvertible variable {A B}
Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean
120
129
theorem mul_eq_one_comm : A * B = 1 ↔ B * A = 1 := suffices βˆ€ A B : Matrix n n Ξ±, A * B = 1 β†’ B * A = 1 from ⟨this A B, this B A⟩ fun A B h => by letI : Invertible B.det := detInvertibleOfLeftInverse _ _ h letI : Invertible B := invertibleOfDetInvertible B calc B * A = B * A * (B * β…Ÿ B) := by
rw [mul_invOf_self, Matrix.mul_one] _ = B * (A * B * β…Ÿ B) := by simp only [Matrix.mul_assoc] _ = B * β…Ÿ B := by rw [h, Matrix.one_mul] _ = 1 := mul_invOf_self B
[ " β…ŸA.det β€’ A.adjugate * A = 1", " A * β…ŸA.det β€’ A.adjugate = 1", " β…ŸA = β…ŸA.det β€’ A.adjugate", " B.det * A.det = 1", " A.det * B.det = 1", " (β…ŸA).det = β…ŸA.det", " B * A = 1", " B * A = B * A * (B * β…ŸB)", " B * A * (B * β…ŸB) = B * (A * B * β…ŸB)", " B * (A * B * β…ŸB) = B * β…ŸB" ]
[ " β…ŸA.det β€’ A.adjugate * A = 1", " A * β…ŸA.det β€’ A.adjugate = 1", " β…ŸA = β…ŸA.det β€’ A.adjugate", " B.det * A.det = 1", " A.det * B.det = 1", " (β…ŸA).det = β…ŸA.det" ]
import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots import Mathlib.FieldTheory.Finite.Trace import Mathlib.Algebra.Group.AddChar import Mathlib.Data.ZMod.Units import Mathlib.Analysis.Complex.Polynomial #align_import number_theory.legendre_symbol.add_character from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" universe u v namespace AddChar section Additive -- The domain and target of our additive characters. Now we restrict to a ring in the domain. variable {R : Type u} [CommRing R] {R' : Type v} [CommMonoid R'] lemma val_mem_rootsOfUnity (Ο† : AddChar R R') (a : R) (h : 0 < ringChar R) : (Ο†.val_isUnit a).unit ∈ rootsOfUnity (ringChar R).toPNat' R' := by simp only [mem_rootsOfUnity', IsUnit.unit_spec, Nat.toPNat'_coe, h, ↓reduceIte, ← map_nsmul_eq_pow, nsmul_eq_mul, CharP.cast_eq_zero, zero_mul, map_zero_eq_one] def IsPrimitive (ψ : AddChar R R') : Prop := βˆ€ a : R, a β‰  0 β†’ IsNontrivial (mulShift ψ a) #align add_char.is_primitive AddChar.IsPrimitive lemma IsPrimitive.compMulHom_of_isPrimitive {R'' : Type*} [CommMonoid R''] {Ο† : AddChar R R'} {f : R' β†’* R''} (hΟ† : Ο†.IsPrimitive) (hf : Function.Injective f) : (f.compAddChar Ο†).IsPrimitive := by intro a a_ne_zero obtain ⟨r, ne_one⟩ := hΟ† a a_ne_zero rw [mulShift_apply] at ne_one simp only [IsNontrivial, mulShift_apply, f.coe_compAddChar, Function.comp_apply] exact ⟨r, fun H ↦ ne_one <| hf <| f.map_one β–Έ H⟩ theorem to_mulShift_inj_of_isPrimitive {ψ : AddChar R R'} (hψ : IsPrimitive ψ) : Function.Injective ψ.mulShift := by intro a b h apply_fun fun x => x * mulShift ψ (-b) at h simp only [mulShift_mul, mulShift_zero, add_right_neg] at h have hβ‚‚ := hψ (a + -b) rw [h, isNontrivial_iff_ne_trivial, ← sub_eq_add_neg, sub_ne_zero] at hβ‚‚ exact not_not.mp fun h => hβ‚‚ h rfl #align add_char.to_mul_shift_inj_of_is_primitive AddChar.to_mulShift_inj_of_isPrimitive -- `AddCommGroup.equiv_direct_sum_zmod_of_fintype` -- gives the structure theorem for finite abelian groups. -- This could be used to show that the map above is a bijection. -- We leave this for a later occasion. theorem IsNontrivial.isPrimitive {F : Type u} [Field F] {ψ : AddChar F R'} (hψ : IsNontrivial ψ) : IsPrimitive ψ := by intro a ha cases' hψ with x h use a⁻¹ * x rwa [mulShift_apply, mul_inv_cancel_leftβ‚€ ha] #align add_char.is_nontrivial.is_primitive AddChar.IsNontrivial.isPrimitive lemma not_isPrimitive_mulShift [Finite R] (e : AddChar R R') {r : R} (hr : Β¬ IsUnit r) : Β¬ IsPrimitive (e.mulShift r) := by simp only [IsPrimitive, not_forall] simp only [isUnit_iff_mem_nonZeroDivisors_of_finite, mem_nonZeroDivisors_iff, not_forall] at hr rcases hr with ⟨x, h, h'⟩ exact ⟨x, h', by simp only [mulShift_mulShift, mul_comm r, h, mulShift_zero, not_ne_iff, isNontrivial_iff_ne_trivial]⟩ -- Porting note(#5171): this linter isn't ported yet. -- can't prove that they always exist (referring to providing an `Inhabited` instance) -- @[nolint has_nonempty_instance] structure PrimitiveAddChar (R : Type u) [CommRing R] (R' : Type v) [Field R'] where n : β„•+ char : AddChar R (CyclotomicField n R') prim : IsPrimitive char #align add_char.primitive_add_char AddChar.PrimitiveAddChar #align add_char.primitive_add_char.n AddChar.PrimitiveAddChar.n #align add_char.primitive_add_char.char AddChar.PrimitiveAddChar.char #align add_char.primitive_add_char.prim AddChar.PrimitiveAddChar.prim section ZModChar variable {C : Type v} [CommMonoid C] theorem zmod_char_isNontrivial_iff (n : β„•+) (ψ : AddChar (ZMod n) C) : IsNontrivial ψ ↔ ψ 1 β‰  1 := by refine ⟨?_, fun h => ⟨1, h⟩⟩ contrapose! rintro h₁ ⟨a, ha⟩ have ha₁ : a = a.val β€’ (1 : ZMod ↑n) := by rw [nsmul_eq_mul, mul_one]; exact (ZMod.natCast_zmod_val a).symm rw [ha₁, map_nsmul_eq_pow, h₁, one_pow] at ha exact ha rfl #align add_char.zmod_char_is_nontrivial_iff AddChar.zmod_char_isNontrivial_iff
Mathlib/NumberTheory/LegendreSymbol/AddCharacter.lean
189
192
theorem IsPrimitive.zmod_char_eq_one_iff (n : β„•+) {ψ : AddChar (ZMod n) C} (hψ : IsPrimitive ψ) (a : ZMod n) : ψ a = 1 ↔ a = 0 := by
refine ⟨fun h => not_imp_comm.mp (hψ a) ?_, fun ha => by rw [ha, map_zero_eq_one]⟩ rw [zmod_char_isNontrivial_iff n (mulShift ψ a), mulShift_apply, mul_one, h, Classical.not_not]
[ " β‹―.unit ∈ rootsOfUnity (ringChar R).toPNat' R'", " (f.compAddChar Ο†).IsPrimitive", " ((f.compAddChar Ο†).mulShift a).IsNontrivial", " βˆƒ a_1, f (Ο† (a * a_1)) β‰  1", " Function.Injective ψ.mulShift", " a = b", " ψ.IsPrimitive", " (ψ.mulShift a).IsNontrivial", " (ψ.mulShift a) (a⁻¹ * x) β‰  1", " Β¬(e.mu...
[ " β‹―.unit ∈ rootsOfUnity (ringChar R).toPNat' R'", " (f.compAddChar Ο†).IsPrimitive", " ((f.compAddChar Ο†).mulShift a).IsNontrivial", " βˆƒ a_1, f (Ο† (a * a_1)) β‰  1", " Function.Injective ψ.mulShift", " a = b", " ψ.IsPrimitive", " (ψ.mulShift a).IsNontrivial", " (ψ.mulShift a) (a⁻¹ * x) β‰  1", " Β¬(e.mu...
import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPreregular import Mathlib.Topology.Category.CompHaus.EffectiveEpi import Mathlib.Topology.Category.Profinite.Limits import Mathlib.Topology.Category.Stonean.Basic universe u attribute [local instance] CategoryTheory.ConcreteCategory.instFunLike open CategoryTheory Limits namespace Profinite noncomputable def struct {B X : Profinite.{u}} (Ο€ : X ⟢ B) (hΟ€ : Function.Surjective Ο€) : EffectiveEpiStruct Ο€ where desc e h := (QuotientMap.of_surjective_continuous hΟ€ Ο€.continuous).lift e fun a b hab ↦ DFunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩ (by ext; exact hab)) a fac e h := ((QuotientMap.of_surjective_continuous hΟ€ Ο€.continuous).lift_comp e fun a b hab ↦ DFunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩ (by ext; exact hab)) a) uniq e h g hm := by suffices g = (QuotientMap.of_surjective_continuous hΟ€ Ο€.continuous).liftEquiv ⟨e, fun a b hab ↦ DFunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩ (by ext; exact hab)) a⟩ by assumption rw [← Equiv.symm_apply_eq (QuotientMap.of_surjective_continuous hΟ€ Ο€.continuous).liftEquiv] ext simp only [QuotientMap.liftEquiv_symm_apply_coe, ContinuousMap.comp_apply, ← hm] rfl open List in theorem effectiveEpi_tfae {B X : Profinite.{u}} (Ο€ : X ⟢ B) : TFAE [ EffectiveEpi Ο€ , Epi Ο€ , Function.Surjective Ο€ ] := by tfae_have 1 β†’ 2 Β· intro; infer_instance tfae_have 2 ↔ 3 Β· exact epi_iff_surjective Ο€ tfae_have 3 β†’ 1 Β· exact fun hΟ€ ↦ ⟨⟨struct Ο€ hΟ€βŸ©βŸ© tfae_finish instance : profiniteToCompHaus.PreservesEffectiveEpis where preserves f h := ((CompHaus.effectiveEpi_tfae _).out 0 2).mpr (((Profinite.effectiveEpi_tfae _).out 0 2).mp h) instance : profiniteToCompHaus.ReflectsEffectiveEpis where reflects f h := ((Profinite.effectiveEpi_tfae f).out 0 2).mpr (((CompHaus.effectiveEpi_tfae _).out 0 2).mp h) noncomputable def profiniteToCompHausEffectivePresentation (X : CompHaus) : profiniteToCompHaus.EffectivePresentation X where p := Stonean.toProfinite.obj X.presentation f := CompHaus.presentation.Ο€ X effectiveEpi := ((CompHaus.effectiveEpi_tfae _).out 0 1).mpr (inferInstance : Epi _) instance : profiniteToCompHaus.EffectivelyEnough where presentation X := ⟨profiniteToCompHausEffectivePresentation X⟩ instance : Preregular Profinite.{u} := profiniteToCompHaus.reflects_preregular example : Precoherent Profinite.{u} := inferInstance -- TODO: prove this for `Type*` open List in
Mathlib/Topology/Category/Profinite/EffectiveEpi.lean
110
128
theorem effectiveEpiFamily_tfae {Ξ± : Type} [Finite Ξ±] {B : Profinite.{u}} (X : Ξ± β†’ Profinite.{u}) (Ο€ : (a : Ξ±) β†’ (X a ⟢ B)) : TFAE [ EffectiveEpiFamily X Ο€ , Epi (Sigma.desc Ο€) , βˆ€ b : B, βˆƒ (a : Ξ±) (x : X a), Ο€ a x = b ] := by
tfae_have 2 β†’ 1 Β· intro simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc Ο€)).out 0 1] tfae_have 1 β†’ 2 Β· intro; infer_instance tfae_have 3 ↔ 1 Β· erw [((CompHaus.effectiveEpiFamily_tfae (fun a ↦ profiniteToCompHaus.obj (X a)) (fun a ↦ profiniteToCompHaus.map (Ο€ a))).out 2 0 : )] exact ⟨fun h ↦ profiniteToCompHaus.finite_effectiveEpiFamily_of_map _ _ h, fun _ ↦ inferInstance⟩ tfae_finish
[ " { toFun := fun x => a, continuous_toFun := β‹― } ≫ Ο€ = { toFun := fun x => b, continuous_toFun := β‹― } ≫ Ο€", " ({ toFun := fun x => a, continuous_toFun := β‹― } ≫ Ο€) x✝ = ({ toFun := fun x => b, continuous_toFun := β‹― } ≫ Ο€) x✝", " g = (fun {W} e h => β‹―.lift e β‹―) e β‹―", " g = β‹―.liftEquiv ⟨e, β‹―βŸ©", " β‹―.liftEquiv.s...
[ " { toFun := fun x => a, continuous_toFun := β‹― } ≫ Ο€ = { toFun := fun x => b, continuous_toFun := β‹― } ≫ Ο€", " ({ toFun := fun x => a, continuous_toFun := β‹― } ≫ Ο€) x✝ = ({ toFun := fun x => b, continuous_toFun := β‹― } ≫ Ο€) x✝", " g = (fun {W} e h => β‹―.lift e β‹―) e β‹―", " g = β‹―.liftEquiv ⟨e, β‹―βŸ©", " β‹―.liftEquiv.s...
import Mathlib.Algebra.EuclideanDomain.Defs import Mathlib.Algebra.Ring.Divisibility.Basic import Mathlib.Algebra.Ring.Regular import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Algebra.Ring.Basic #align_import algebra.euclidean_domain.basic from "leanprover-community/mathlib"@"bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6" universe u namespace EuclideanDomain variable {R : Type u} variable [EuclideanDomain R] local infixl:50 " β‰Ί " => EuclideanDomain.R -- See note [lower instance priority] instance (priority := 100) toMulDivCancelClass : MulDivCancelClass R where mul_div_cancel a b hb := by refine (eq_of_sub_eq_zero ?_).symm by_contra h have := mul_right_not_lt b h rw [sub_mul, mul_comm (_ / _), sub_eq_iff_eq_add'.2 (div_add_mod (a * b) b).symm] at this exact this (mod_lt _ hb) #align euclidean_domain.mul_div_cancel_left mul_div_cancel_leftβ‚€ #align euclidean_domain.mul_div_cancel mul_div_cancel_rightβ‚€ @[simp] theorem mod_eq_zero {a b : R} : a % b = 0 ↔ b ∣ a := ⟨fun h => by rw [← div_add_mod a b, h, add_zero] exact dvd_mul_right _ _, fun ⟨c, e⟩ => by rw [e, ← add_left_cancel_iff, div_add_mod, add_zero] haveI := Classical.dec by_cases b0 : b = 0 Β· simp only [b0, zero_mul] Β· rw [mul_div_cancel_leftβ‚€ _ b0]⟩ #align euclidean_domain.mod_eq_zero EuclideanDomain.mod_eq_zero @[simp] theorem mod_self (a : R) : a % a = 0 := mod_eq_zero.2 dvd_rfl #align euclidean_domain.mod_self EuclideanDomain.mod_self theorem dvd_mod_iff {a b c : R} (h : c ∣ b) : c ∣ a % b ↔ c ∣ a := by rw [← dvd_add_right (h.mul_right _), div_add_mod] #align euclidean_domain.dvd_mod_iff EuclideanDomain.dvd_mod_iff @[simp] theorem mod_one (a : R) : a % 1 = 0 := mod_eq_zero.2 (one_dvd _) #align euclidean_domain.mod_one EuclideanDomain.mod_one @[simp] theorem zero_mod (b : R) : 0 % b = 0 := mod_eq_zero.2 (dvd_zero _) #align euclidean_domain.zero_mod EuclideanDomain.zero_mod @[simp] theorem zero_div {a : R} : 0 / a = 0 := by_cases (fun a0 : a = 0 => a0.symm β–Έ div_zero 0) fun a0 => by simpa only [zero_mul] using mul_div_cancel_rightβ‚€ 0 a0 #align euclidean_domain.zero_div EuclideanDomain.zero_div @[simp]
Mathlib/Algebra/EuclideanDomain/Basic.lean
84
85
theorem div_self {a : R} (a0 : a β‰  0) : a / a = 1 := by
simpa only [one_mul] using mul_div_cancel_rightβ‚€ 1 a0
[ " a * b / b = a", " a - a * b / b = 0", " False", " b ∣ a", " b ∣ b * (a / b)", " a % b = 0", " b * c = b * (b * c / b)", " c ∣ a % b ↔ c ∣ a", " 0 / a = 0", " a / a = 1" ]
[ " a * b / b = a", " a - a * b / b = 0", " False", " b ∣ a", " b ∣ b * (a / b)", " a % b = 0", " b * c = b * (b * c / b)", " c ∣ a % b ↔ c ∣ a", " 0 / a = 0" ]
import Mathlib.Data.Set.Image import Mathlib.Data.List.GetD #align_import data.set.list from "leanprover-community/mathlib"@"2ec920d35348cb2d13ac0e1a2ad9df0fdf1a76b4" open List variable {Ξ± Ξ² : Type*} (l : List Ξ±) namespace Set theorem range_list_map (f : Ξ± β†’ Ξ²) : range (map f) = { l | βˆ€ x ∈ l, x ∈ range f } := by refine antisymm (range_subset_iff.2 fun l => forall_mem_map_iff.2 fun y _ => mem_range_self _) fun l hl => ?_ induction' l with a l ihl; Β· exact ⟨[], rfl⟩ rcases ihl fun x hx => hl x <| subset_cons _ _ hx with ⟨l, rfl⟩ rcases hl a (mem_cons_self _ _) with ⟨a, rfl⟩ exact ⟨a :: l, map_cons _ _ _⟩ #align set.range_list_map Set.range_list_map theorem range_list_map_coe (s : Set Ξ±) : range (map ((↑) : s β†’ Ξ±)) = { l | βˆ€ x ∈ l, x ∈ s } := by rw [range_list_map, Subtype.range_coe] #align set.range_list_map_coe Set.range_list_map_coe @[simp]
Mathlib/Data/Set/List.lean
38
40
theorem range_list_get : range l.get = { x | x ∈ l } := by
ext x rw [mem_setOf_eq, mem_iff_get, mem_range]
[ " range (map f) = {l | βˆ€ x ∈ l, x ∈ range f}", " l ∈ range (map f)", " [] ∈ range (map f)", " a :: l ∈ range (map f)", " a :: map f l ∈ range (map f)", " f a :: map f l ∈ range (map f)", " range (map Subtype.val) = {l | βˆ€ x ∈ l, x ∈ s}", " range l.get = {x | x ∈ l}", " x ∈ range l.get ↔ x ∈ {x | x ∈...
[ " range (map f) = {l | βˆ€ x ∈ l, x ∈ range f}", " l ∈ range (map f)", " [] ∈ range (map f)", " a :: l ∈ range (map f)", " a :: map f l ∈ range (map f)", " f a :: map f l ∈ range (map f)", " range (map Subtype.val) = {l | βˆ€ x ∈ l, x ∈ s}" ]
import Mathlib.Analysis.Normed.Group.Quotient import Mathlib.Topology.Instances.AddCircle #align_import analysis.normed.group.add_circle from "leanprover-community/mathlib"@"084f76e20c88eae536222583331abd9468b08e1c" noncomputable section open Set open Int hiding mem_zmultiples_iff open AddSubgroup namespace AddCircle variable (p : ℝ) instance : NormedAddCommGroup (AddCircle p) := AddSubgroup.normedAddCommGroupQuotient _ @[simp]
Mathlib/Analysis/Normed/Group/AddCircle.lean
44
68
theorem norm_coe_mul (x : ℝ) (t : ℝ) : β€–(↑(t * x) : AddCircle (t * p))β€– = |t| * β€–(x : AddCircle p)β€– := by
have aux : βˆ€ {a b c : ℝ}, a ∈ zmultiples b β†’ c * a ∈ zmultiples (c * b) := fun {a b c} h => by simp only [mem_zmultiples_iff] at h ⊒ obtain ⟨n, rfl⟩ := h exact ⟨n, (mul_smul_comm n c b).symm⟩ rcases eq_or_ne t 0 with (rfl | ht); Β· simp have ht' : |t| β‰  0 := (not_congr abs_eq_zero).mpr ht simp only [quotient_norm_eq, Real.norm_eq_abs] conv_rhs => rw [← smul_eq_mul, ← Real.sInf_smul_of_nonneg (abs_nonneg t)] simp only [QuotientAddGroup.mk'_apply, QuotientAddGroup.eq_iff_sub_mem] congr 1 ext z rw [mem_smul_set_iff_inv_smul_memβ‚€ ht'] show (βˆƒ y, y - t * x ∈ zmultiples (t * p) ∧ |y| = z) ↔ βˆƒ w, w - x ∈ zmultiples p ∧ |w| = |t|⁻¹ * z constructor Β· rintro ⟨y, hy, rfl⟩ refine ⟨t⁻¹ * y, ?_, by rw [abs_mul, abs_inv]⟩ rw [← inv_mul_cancel_leftβ‚€ ht x, ← inv_mul_cancel_leftβ‚€ ht p, ← mul_sub] exact aux hy Β· rintro ⟨w, hw, hw'⟩ refine ⟨t * w, ?_, by rw [← (eq_inv_mul_iff_mul_eqβ‚€ ht').mp hw', abs_mul]⟩ rw [← mul_sub] exact aux hw
[ " ‖↑(t * x)β€– = |t| * ‖↑xβ€–", " c * a ∈ zmultiples (c * b)", " βˆƒ k, k β€’ (c * b) = c * a", " βˆƒ k, k β€’ (c * b) = c * n β€’ b", " ‖↑(0 * x)β€– = |0| * ‖↑xβ€–", " sInf ((fun a => |a|) '' {m | ↑m = ↑(t * x)}) = |t| * sInf ((fun a => |a|) '' {m | ↑m = ↑x})", "p x t : ℝ\naux : βˆ€ {a b c : ℝ}, a ∈ zmultiples b β†’ c * a ∈...
[]
import Mathlib.Data.Set.Function import Mathlib.Order.Interval.Set.OrdConnected #align_import data.set.intervals.proj_Icc from "leanprover-community/mathlib"@"4e24c4bfcff371c71f7ba22050308aa17815626c" variable {Ξ± Ξ² : Type*} [LinearOrder Ξ±] open Function namespace Set def projIci (a x : Ξ±) : Ici a := ⟨max a x, le_max_left _ _⟩ #align set.proj_Ici Set.projIci def projIic (b x : Ξ±) : Iic b := ⟨min b x, min_le_left _ _⟩ #align set.proj_Iic Set.projIic def projIcc (a b : Ξ±) (h : a ≀ b) (x : Ξ±) : Icc a b := ⟨max a (min b x), le_max_left _ _, max_le h (min_le_left _ _)⟩ #align set.proj_Icc Set.projIcc variable {a b : Ξ±} (h : a ≀ b) {x : Ξ±} @[norm_cast] theorem coe_projIci (a x : Ξ±) : (projIci a x : Ξ±) = max a x := rfl #align set.coe_proj_Ici Set.coe_projIci @[norm_cast] theorem coe_projIic (b x : Ξ±) : (projIic b x : Ξ±) = min b x := rfl #align set.coe_proj_Iic Set.coe_projIic @[norm_cast] theorem coe_projIcc (a b : Ξ±) (h : a ≀ b) (x : Ξ±) : (projIcc a b h x : Ξ±) = max a (min b x) := rfl #align set.coe_proj_Icc Set.coe_projIcc theorem projIci_of_le (hx : x ≀ a) : projIci a x = ⟨a, le_rfl⟩ := Subtype.ext <| max_eq_left hx #align set.proj_Ici_of_le Set.projIci_of_le theorem projIic_of_le (hx : b ≀ x) : projIic b x = ⟨b, le_rfl⟩ := Subtype.ext <| min_eq_left hx #align set.proj_Iic_of_le Set.projIic_of_le theorem projIcc_of_le_left (hx : x ≀ a) : projIcc a b h x = ⟨a, left_mem_Icc.2 h⟩ := by simp [projIcc, hx, hx.trans h] #align set.proj_Icc_of_le_left Set.projIcc_of_le_left theorem projIcc_of_right_le (hx : b ≀ x) : projIcc a b h x = ⟨b, right_mem_Icc.2 h⟩ := by simp [projIcc, hx, h] #align set.proj_Icc_of_right_le Set.projIcc_of_right_le @[simp] theorem projIci_self (a : Ξ±) : projIci a a = ⟨a, le_rfl⟩ := projIci_of_le le_rfl #align set.proj_Ici_self Set.projIci_self @[simp] theorem projIic_self (b : Ξ±) : projIic b b = ⟨b, le_rfl⟩ := projIic_of_le le_rfl #align set.proj_Iic_self Set.projIic_self @[simp] theorem projIcc_left : projIcc a b h a = ⟨a, left_mem_Icc.2 h⟩ := projIcc_of_le_left h le_rfl #align set.proj_Icc_left Set.projIcc_left @[simp] theorem projIcc_right : projIcc a b h b = ⟨b, right_mem_Icc.2 h⟩ := projIcc_of_right_le h le_rfl #align set.proj_Icc_right Set.projIcc_right
Mathlib/Order/Interval/Set/ProjIcc.lean
99
99
theorem projIci_eq_self : projIci a x = ⟨a, le_rfl⟩ ↔ x ≀ a := by
simp [projIci, Subtype.ext_iff]
[ " projIcc a b h x = ⟨a, β‹―βŸ©", " projIcc a b h x = ⟨b, β‹―βŸ©", " projIci a x = ⟨a, β‹―βŸ© ↔ x ≀ a" ]
[ " projIcc a b h x = ⟨a, β‹―βŸ©", " projIcc a b h x = ⟨b, β‹―βŸ©" ]
import Mathlib.Analysis.Complex.UpperHalfPlane.Topology import Mathlib.Analysis.SpecialFunctions.Arsinh import Mathlib.Geometry.Euclidean.Inversion.Basic #align_import analysis.complex.upper_half_plane.metric from "leanprover-community/mathlib"@"caa58cbf5bfb7f81ccbaca4e8b8ac4bc2b39cc1c" noncomputable section open scoped UpperHalfPlane ComplexConjugate NNReal Topology MatrixGroups open Set Metric Filter Real variable {z w : ℍ} {r R : ℝ} namespace UpperHalfPlane instance : Dist ℍ := ⟨fun z w => 2 * arsinh (dist (z : β„‚) w / (2 * √(z.im * w.im)))⟩ theorem dist_eq (z w : ℍ) : dist z w = 2 * arsinh (dist (z : β„‚) w / (2 * √(z.im * w.im))) := rfl #align upper_half_plane.dist_eq UpperHalfPlane.dist_eq theorem sinh_half_dist (z w : ℍ) : sinh (dist z w / 2) = dist (z : β„‚) w / (2 * √(z.im * w.im)) := by rw [dist_eq, mul_div_cancel_leftβ‚€ (arsinh _) two_ne_zero, sinh_arsinh] #align upper_half_plane.sinh_half_dist UpperHalfPlane.sinh_half_dist theorem cosh_half_dist (z w : ℍ) : cosh (dist z w / 2) = dist (z : β„‚) (conj (w : β„‚)) / (2 * √(z.im * w.im)) := by rw [← sq_eq_sq, cosh_sq', sinh_half_dist, div_pow, div_pow, one_add_div, mul_pow, sq_sqrt] Β· congr 1 simp only [Complex.dist_eq, Complex.sq_abs, Complex.normSq_sub, Complex.normSq_conj, Complex.conj_conj, Complex.mul_re, Complex.conj_re, Complex.conj_im, coe_im] ring all_goals positivity #align upper_half_plane.cosh_half_dist UpperHalfPlane.cosh_half_dist theorem tanh_half_dist (z w : ℍ) : tanh (dist z w / 2) = dist (z : β„‚) w / dist (z : β„‚) (conj ↑w) := by rw [tanh_eq_sinh_div_cosh, sinh_half_dist, cosh_half_dist, div_div_div_comm, div_self, div_one] positivity #align upper_half_plane.tanh_half_dist UpperHalfPlane.tanh_half_dist theorem exp_half_dist (z w : ℍ) : exp (dist z w / 2) = (dist (z : β„‚) w + dist (z : β„‚) (conj ↑w)) / (2 * √(z.im * w.im)) := by rw [← sinh_add_cosh, sinh_half_dist, cosh_half_dist, add_div] #align upper_half_plane.exp_half_dist UpperHalfPlane.exp_half_dist theorem cosh_dist (z w : ℍ) : cosh (dist z w) = 1 + dist (z : β„‚) w ^ 2 / (2 * z.im * w.im) := by rw [dist_eq, cosh_two_mul, cosh_sq', add_assoc, ← two_mul, sinh_arsinh, div_pow, mul_pow, sq_sqrt, sq (2 : ℝ), mul_assoc, ← mul_div_assoc, mul_assoc, mul_div_mul_left] <;> positivity #align upper_half_plane.cosh_dist UpperHalfPlane.cosh_dist
Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean
76
84
theorem sinh_half_dist_add_dist (a b c : ℍ) : sinh ((dist a b + dist b c) / 2) = (dist (a : β„‚) b * dist (c : β„‚) (conj ↑b) + dist (b : β„‚) c * dist (a : β„‚) (conj ↑b)) / (2 * √(a.im * c.im) * dist (b : β„‚) (conj ↑b)) := by
simp only [add_div _ _ (2 : ℝ), sinh_add, sinh_half_dist, cosh_half_dist, div_mul_div_comm] rw [← add_div, Complex.dist_self_conj, coe_im, abs_of_pos b.im_pos, mul_comm (dist (b : β„‚) _), dist_comm (b : β„‚), Complex.dist_conj_comm, mul_mul_mul_comm, mul_mul_mul_comm _ _ _ b.im] congr 2 rw [sqrt_mul, sqrt_mul, sqrt_mul, mul_comm (√a.im), mul_mul_mul_comm, mul_self_sqrt, mul_comm] <;> exact (im_pos _).le
[ " (dist z w / 2).sinh = dist ↑z ↑w / (2 * √(z.im * w.im))", " (dist z w / 2).cosh = dist (↑z) ((starRingEnd β„‚) ↑w) / (2 * √(z.im * w.im))", " (2 ^ 2 * (z.im * w.im) + dist ↑z ↑w ^ 2) / (2 ^ 2 * (z.im * w.im)) =\n dist (↑z) ((starRingEnd β„‚) ↑w) ^ 2 / (2 ^ 2 * (z.im * w.im))", " 2 ^ 2 * (z.im * w.im) + dist ...
[ " (dist z w / 2).sinh = dist ↑z ↑w / (2 * √(z.im * w.im))", " (dist z w / 2).cosh = dist (↑z) ((starRingEnd β„‚) ↑w) / (2 * √(z.im * w.im))", " (2 ^ 2 * (z.im * w.im) + dist ↑z ↑w ^ 2) / (2 ^ 2 * (z.im * w.im)) =\n dist (↑z) ((starRingEnd β„‚) ↑w) ^ 2 / (2 ^ 2 * (z.im * w.im))", " 2 ^ 2 * (z.im * w.im) + dist ...
import Mathlib.Analysis.Calculus.TangentCone import Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics #align_import analysis.calculus.fderiv.basic from "leanprover-community/mathlib"@"41bef4ae1254365bc190aee63b947674d2977f01" open Filter Asymptotics ContinuousLinearMap Set Metric open scoped Classical open Topology NNReal Filter Asymptotics ENNReal noncomputable section section variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π•œ G] variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace π•œ G'] @[mk_iff hasFDerivAtFilter_iff_isLittleO] structure HasFDerivAtFilter (f : E β†’ F) (f' : E β†’L[π•œ] F) (x : E) (L : Filter E) : Prop where of_isLittleO :: isLittleO : (fun x' => f x' - f x - f' (x' - x)) =o[L] fun x' => x' - x #align has_fderiv_at_filter HasFDerivAtFilter @[fun_prop] def HasFDerivWithinAt (f : E β†’ F) (f' : E β†’L[π•œ] F) (s : Set E) (x : E) := HasFDerivAtFilter f f' x (𝓝[s] x) #align has_fderiv_within_at HasFDerivWithinAt @[fun_prop] def HasFDerivAt (f : E β†’ F) (f' : E β†’L[π•œ] F) (x : E) := HasFDerivAtFilter f f' x (𝓝 x) #align has_fderiv_at HasFDerivAt @[fun_prop] def HasStrictFDerivAt (f : E β†’ F) (f' : E β†’L[π•œ] F) (x : E) := (fun p : E Γ— E => f p.1 - f p.2 - f' (p.1 - p.2)) =o[𝓝 (x, x)] fun p : E Γ— E => p.1 - p.2 #align has_strict_fderiv_at HasStrictFDerivAt variable (π•œ) @[fun_prop] def DifferentiableWithinAt (f : E β†’ F) (s : Set E) (x : E) := βˆƒ f' : E β†’L[π•œ] F, HasFDerivWithinAt f f' s x #align differentiable_within_at DifferentiableWithinAt @[fun_prop] def DifferentiableAt (f : E β†’ F) (x : E) := βˆƒ f' : E β†’L[π•œ] F, HasFDerivAt f f' x #align differentiable_at DifferentiableAt irreducible_def fderivWithin (f : E β†’ F) (s : Set E) (x : E) : E β†’L[π•œ] F := if 𝓝[s \ {x}] x = βŠ₯ then 0 else if h : βˆƒ f', HasFDerivWithinAt f f' s x then Classical.choose h else 0 #align fderiv_within fderivWithin irreducible_def fderiv (f : E β†’ F) (x : E) : E β†’L[π•œ] F := if h : βˆƒ f', HasFDerivAt f f' x then Classical.choose h else 0 #align fderiv fderiv @[fun_prop] def DifferentiableOn (f : E β†’ F) (s : Set E) := βˆ€ x ∈ s, DifferentiableWithinAt π•œ f s x #align differentiable_on DifferentiableOn @[fun_prop] def Differentiable (f : E β†’ F) := βˆ€ x, DifferentiableAt π•œ f x #align differentiable Differentiable variable {π•œ} variable {f fβ‚€ f₁ g : E β†’ F} variable {f' fβ‚€' f₁' g' : E β†’L[π•œ] F} variable (e : E β†’L[π•œ] F) variable {x : E} variable {s t : Set E} variable {L L₁ Lβ‚‚ : Filter E}
Mathlib/Analysis/Calculus/FDeriv/Basic.lean
216
217
theorem fderivWithin_zero_of_isolated (h : 𝓝[s \ {x}] x = βŠ₯) : fderivWithin π•œ f s x = 0 := by
rw [fderivWithin, if_pos h]
[ " fderivWithin π•œ f s x = 0" ]
[]
import Mathlib.Algebra.Field.Defs import Mathlib.Algebra.GroupWithZero.Units.Lemmas import Mathlib.Algebra.Ring.Commute import Mathlib.Algebra.Ring.Invertible import Mathlib.Order.Synonym #align_import algebra.field.basic from "leanprover-community/mathlib"@"05101c3df9d9cfe9430edc205860c79b6d660102" open Function OrderDual Set universe u variable {Ξ± Ξ² K : Type*} section DivisionMonoid variable [DivisionMonoid K] [HasDistribNeg K] {a b : K} theorem one_div_neg_one_eq_neg_one : (1 : K) / -1 = -1 := have : -1 * -1 = (1 : K) := by rw [neg_mul_neg, one_mul] Eq.symm (eq_one_div_of_mul_eq_one_right this) #align one_div_neg_one_eq_neg_one one_div_neg_one_eq_neg_one theorem one_div_neg_eq_neg_one_div (a : K) : 1 / -a = -(1 / a) := calc 1 / -a = 1 / (-1 * a) := by rw [neg_eq_neg_one_mul] _ = 1 / a * (1 / -1) := by rw [one_div_mul_one_div_rev] _ = 1 / a * -1 := by rw [one_div_neg_one_eq_neg_one] _ = -(1 / a) := by rw [mul_neg, mul_one] #align one_div_neg_eq_neg_one_div one_div_neg_eq_neg_one_div theorem div_neg_eq_neg_div (a b : K) : b / -a = -(b / a) := calc b / -a = b * (1 / -a) := by rw [← inv_eq_one_div, division_def] _ = b * -(1 / a) := by rw [one_div_neg_eq_neg_one_div] _ = -(b * (1 / a)) := by rw [neg_mul_eq_mul_neg] _ = -(b / a) := by rw [mul_one_div] #align div_neg_eq_neg_div div_neg_eq_neg_div theorem neg_div (a b : K) : -b / a = -(b / a) := by rw [neg_eq_neg_one_mul, mul_div_assoc, ← neg_eq_neg_one_mul] #align neg_div neg_div @[field_simps] theorem neg_div' (a b : K) : -(b / a) = -b / a := by simp [neg_div] #align neg_div' neg_div' @[simp]
Mathlib/Algebra/Field/Basic.lean
126
126
theorem neg_div_neg_eq (a b : K) : -a / -b = a / b := by
rw [div_neg_eq_neg_div, neg_div, neg_neg]
[ " -1 * -1 = 1", " 1 / -a = 1 / (-1 * a)", " 1 / (-1 * a) = 1 / a * (1 / -1)", " 1 / a * (1 / -1) = 1 / a * -1", " 1 / a * -1 = -(1 / a)", " b / -a = b * (1 / -a)", " b * (1 / -a) = b * -(1 / a)", " b * -(1 / a) = -(b * (1 / a))", " -(b * (1 / a)) = -(b / a)", " -b / a = -(b / a)", " -(b / a) = -...
[ " -1 * -1 = 1", " 1 / -a = 1 / (-1 * a)", " 1 / (-1 * a) = 1 / a * (1 / -1)", " 1 / a * (1 / -1) = 1 / a * -1", " 1 / a * -1 = -(1 / a)", " b / -a = b * (1 / -a)", " b * (1 / -a) = b * -(1 / a)", " b * -(1 / a) = -(b * (1 / a))", " -(b * (1 / a)) = -(b / a)", " -b / a = -(b / a)", " -(b / a) = -...
import Mathlib.Algebra.Polynomial.Monic #align_import algebra.polynomial.big_operators from "leanprover-community/mathlib"@"47adfab39a11a072db552f47594bf8ed2cf8a722" open Finset open Multiset open Polynomial universe u w variable {R : Type u} {ΞΉ : Type w} namespace Polynomial variable (s : Finset ΞΉ) section CommRing variable [CommRing R] open Monic -- Eventually this can be generalized with Vieta's formulas -- plus the connection between roots and factorization. theorem multiset_prod_X_sub_C_nextCoeff (t : Multiset R) : nextCoeff (t.map fun x => X - C x).prod = -t.sum := by rw [nextCoeff_multiset_prod] Β· simp only [nextCoeff_X_sub_C] exact t.sum_hom (-AddMonoidHom.id R) Β· intros apply monic_X_sub_C set_option linter.uppercaseLean3 false in #align polynomial.multiset_prod_X_sub_C_next_coeff Polynomial.multiset_prod_X_sub_C_nextCoeff
Mathlib/Algebra/Polynomial/BigOperators.lean
263
265
theorem prod_X_sub_C_nextCoeff {s : Finset ΞΉ} (f : ΞΉ β†’ R) : nextCoeff (∏ i ∈ s, (X - C (f i))) = -βˆ‘ i ∈ s, f i := by
simpa using multiset_prod_X_sub_C_nextCoeff (s.1.map f)
[ " (Multiset.map (fun x => X - C x) t).prod.nextCoeff = -t.sum", " (Multiset.map (fun i => (X - C i).nextCoeff) t).sum = -t.sum", " (Multiset.map (fun x => -x) t).sum = -t.sum", " βˆ€ i ∈ t, (X - C i).Monic", " (X - C i✝).Monic", " (∏ i ∈ s, (X - C (f i))).nextCoeff = -βˆ‘ i ∈ s, f i" ]
[ " (Multiset.map (fun x => X - C x) t).prod.nextCoeff = -t.sum", " (Multiset.map (fun i => (X - C i).nextCoeff) t).sum = -t.sum", " (Multiset.map (fun x => -x) t).sum = -t.sum", " βˆ€ i ∈ t, (X - C i).Monic", " (X - C i✝).Monic" ]
import Mathlib.RingTheory.Polynomial.Cyclotomic.Basic import Mathlib.RingTheory.RootsOfUnity.Minpoly #align_import ring_theory.polynomial.cyclotomic.roots from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f" namespace Polynomial variable {R : Type*} [CommRing R] {n : β„•}
Mathlib/RingTheory/Polynomial/Cyclotomic/Roots.lean
40
49
theorem isRoot_of_unity_of_root_cyclotomic {ΞΆ : R} {i : β„•} (hi : i ∈ n.divisors) (h : (cyclotomic i R).IsRoot ΞΆ) : ΞΆ ^ n = 1 := by
rcases n.eq_zero_or_pos with (rfl | hn) Β· exact pow_zero _ have := congr_arg (eval ΞΆ) (prod_cyclotomic_eq_X_pow_sub_one hn R).symm rw [eval_sub, eval_pow, eval_X, eval_one] at this convert eq_add_of_sub_eq' this convert (add_zero (M := R) _).symm apply eval_eq_zero_of_dvd_of_eval_eq_zero _ h exact Finset.dvd_prod_of_mem _ hi
[ " ΢ ^ n = 1", " ΢ ^ 0 = 1", " 1 = 1 + eval ΢ (∏ i ∈ n.divisors, cyclotomic i R)", " eval ΢ (∏ i ∈ n.divisors, cyclotomic i R) = 0", " cyclotomic i R ∣ ∏ i ∈ n.divisors, cyclotomic i R" ]
[]
import Mathlib.Algebra.Order.Monoid.Unbundled.Pow import Mathlib.Data.Finset.Fold import Mathlib.Data.Finset.Option import Mathlib.Data.Finset.Pi import Mathlib.Data.Finset.Prod import Mathlib.Data.Multiset.Lattice import Mathlib.Data.Set.Lattice import Mathlib.Order.Hom.Lattice import Mathlib.Order.Nat #align_import data.finset.lattice from "leanprover-community/mathlib"@"442a83d738cb208d3600056c489be16900ba701d" -- TODO: -- assert_not_exists OrderedCommMonoid assert_not_exists MonoidWithZero open Function Multiset OrderDual variable {F Ξ± Ξ² Ξ³ ΞΉ ΞΊ : Type*} namespace Finset section Sup -- TODO: define with just `[Bot Ξ±]` where some lemmas hold without requiring `[OrderBot Ξ±]` variable [SemilatticeSup Ξ±] [OrderBot Ξ±] def sup (s : Finset Ξ²) (f : Ξ² β†’ Ξ±) : Ξ± := s.fold (Β· βŠ” Β·) βŠ₯ f #align finset.sup Finset.sup variable {s s₁ sβ‚‚ : Finset Ξ²} {f g : Ξ² β†’ Ξ±} {a : Ξ±} theorem sup_def : s.sup f = (s.1.map f).sup := rfl #align finset.sup_def Finset.sup_def @[simp] theorem sup_empty : (βˆ… : Finset Ξ²).sup f = βŠ₯ := fold_empty #align finset.sup_empty Finset.sup_empty @[simp] theorem sup_cons {b : Ξ²} (h : b βˆ‰ s) : (cons b s h).sup f = f b βŠ” s.sup f := fold_cons h #align finset.sup_cons Finset.sup_cons @[simp] theorem sup_insert [DecidableEq Ξ²] {b : Ξ²} : (insert b s : Finset Ξ²).sup f = f b βŠ” s.sup f := fold_insert_idem #align finset.sup_insert Finset.sup_insert @[simp] theorem sup_image [DecidableEq Ξ²] (s : Finset Ξ³) (f : Ξ³ β†’ Ξ²) (g : Ξ² β†’ Ξ±) : (s.image f).sup g = s.sup (g ∘ f) := fold_image_idem #align finset.sup_image Finset.sup_image @[simp] theorem sup_map (s : Finset Ξ³) (f : Ξ³ β†ͺ Ξ²) (g : Ξ² β†’ Ξ±) : (s.map f).sup g = s.sup (g ∘ f) := fold_map #align finset.sup_map Finset.sup_map @[simp] theorem sup_singleton {b : Ξ²} : ({b} : Finset Ξ²).sup f = f b := Multiset.sup_singleton #align finset.sup_singleton Finset.sup_singleton theorem sup_sup : s.sup (f βŠ” g) = s.sup f βŠ” s.sup g := by induction s using Finset.cons_induction with | empty => rw [sup_empty, sup_empty, sup_empty, bot_sup_eq] | cons _ _ _ ih => rw [sup_cons, sup_cons, sup_cons, ih] exact sup_sup_sup_comm _ _ _ _ #align finset.sup_sup Finset.sup_sup
Mathlib/Data/Finset/Lattice.lean
90
93
theorem sup_congr {f g : Ξ² β†’ Ξ±} (hs : s₁ = sβ‚‚) (hfg : βˆ€ a ∈ sβ‚‚, f a = g a) : s₁.sup f = sβ‚‚.sup g := by
subst hs exact Finset.fold_congr hfg
[ " s.sup (f βŠ” g) = s.sup f βŠ” s.sup g", " βˆ….sup (f βŠ” g) = βˆ….sup f βŠ” βˆ….sup g", " (cons a✝ s✝ h✝).sup (f βŠ” g) = (cons a✝ s✝ h✝).sup f βŠ” (cons a✝ s✝ h✝).sup g", " (f βŠ” g) a✝ βŠ” (s✝.sup f βŠ” s✝.sup g) = f a✝ βŠ” s✝.sup f βŠ” (g a✝ βŠ” s✝.sup g)", " s₁.sup f = sβ‚‚.sup g", " s₁.sup f = s₁.sup g" ]
[ " s.sup (f βŠ” g) = s.sup f βŠ” s.sup g", " βˆ….sup (f βŠ” g) = βˆ….sup f βŠ” βˆ….sup g", " (cons a✝ s✝ h✝).sup (f βŠ” g) = (cons a✝ s✝ h✝).sup f βŠ” (cons a✝ s✝ h✝).sup g", " (f βŠ” g) a✝ βŠ” (s✝.sup f βŠ” s✝.sup g) = f a✝ βŠ” s✝.sup f βŠ” (g a✝ βŠ” s✝.sup g)" ]
import Mathlib.Data.Complex.Exponential import Mathlib.Analysis.SpecialFunctions.Log.Deriv #align_import data.complex.exponential_bounds from "leanprover-community/mathlib"@"402f8982dddc1864bd703da2d6e2ee304a866973" namespace Real open IsAbsoluteValue Finset CauSeq Complex theorem exp_one_near_10 : |exp 1 - 2244083 / 825552| ≀ 1 / 10 ^ 10 := by apply exp_approx_start iterate 13 refine exp_1_approx_succ_eq (by norm_num1; rfl) (by norm_cast) ?_ norm_num1 refine exp_approx_end' _ (by norm_num1; rfl) _ (by norm_cast) (by simp) ?_ rw [_root_.abs_one, abs_of_pos] <;> norm_num1 #align real.exp_one_near_10 Real.exp_one_near_10 theorem exp_one_near_20 : |exp 1 - 363916618873 / 133877442384| ≀ 1 / 10 ^ 20 := by apply exp_approx_start iterate 21 refine exp_1_approx_succ_eq (by norm_num1; rfl) (by norm_cast) ?_ norm_num1 refine exp_approx_end' _ (by norm_num1; rfl) _ (by norm_cast) (by simp) ?_ rw [_root_.abs_one, abs_of_pos] <;> norm_num1 #align real.exp_one_near_20 Real.exp_one_near_20 theorem exp_one_gt_d9 : 2.7182818283 < exp 1 := lt_of_lt_of_le (by norm_num) (sub_le_comm.1 (abs_sub_le_iff.1 exp_one_near_10).2) #align real.exp_one_gt_d9 Real.exp_one_gt_d9 theorem exp_one_lt_d9 : exp 1 < 2.7182818286 := lt_of_le_of_lt (sub_le_iff_le_add.1 (abs_sub_le_iff.1 exp_one_near_10).1) (by norm_num) #align real.exp_one_lt_d9 Real.exp_one_lt_d9 theorem exp_neg_one_gt_d9 : 0.36787944116 < exp (-1) := by rw [exp_neg, lt_inv _ (exp_pos _)] Β· refine lt_of_le_of_lt (sub_le_iff_le_add.1 (abs_sub_le_iff.1 exp_one_near_10).1) ?_ norm_num Β· norm_num #align real.exp_neg_one_gt_d9 Real.exp_neg_one_gt_d9
Mathlib/Data/Complex/ExponentialBounds.lean
51
55
theorem exp_neg_one_lt_d9 : exp (-1) < 0.3678794412 := by
rw [exp_neg, inv_lt (exp_pos _)] Β· refine lt_of_lt_of_le ?_ (sub_le_comm.1 (abs_sub_le_iff.1 exp_one_near_10).2) norm_num Β· norm_num
[ " |rexp 1 - 2244083 / 825552| ≀ 1 / 10 ^ 10", " |rexp 1 - expNear 0 1 (2244083 / 825552)| ≀ |1| ^ 0 / ↑(Nat.factorial 0) * (1 / 10 ^ 10)", " 0 + 1 = ?m.532", " 1 = ?m.532", " ↑1 = ?m.543", " |rexp 1 - expNear 1 1 ((2244083 / 825552 - 1) * 1)| ≀ |1| ^ 1 / ↑(Nat.factorial 1) * (1 / 10 ^ 10 * 1)", " 1 + 1 ...
[ " |rexp 1 - 2244083 / 825552| ≀ 1 / 10 ^ 10", " |rexp 1 - expNear 0 1 (2244083 / 825552)| ≀ |1| ^ 0 / ↑(Nat.factorial 0) * (1 / 10 ^ 10)", " 0 + 1 = ?m.532", " 1 = ?m.532", " ↑1 = ?m.543", " |rexp 1 - expNear 1 1 ((2244083 / 825552 - 1) * 1)| ≀ |1| ^ 1 / ↑(Nat.factorial 1) * (1 / 10 ^ 10 * 1)", " 1 + 1 ...
import Mathlib.Algebra.EuclideanDomain.Basic import Mathlib.RingTheory.PrincipalIdealDomain import Mathlib.Algebra.GCDMonoid.Nat #align_import ring_theory.int.basic from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802" theorem Int.Prime.dvd_mul {m n : β„€} {p : β„•} (hp : Nat.Prime p) (h : (p : β„€) ∣ m * n) : p ∣ m.natAbs ∨ p ∣ n.natAbs := by rwa [← hp.dvd_mul, ← Int.natAbs_mul, ← Int.natCast_dvd] #align int.prime.dvd_mul Int.Prime.dvd_mul theorem Int.Prime.dvd_mul' {m n : β„€} {p : β„•} (hp : Nat.Prime p) (h : (p : β„€) ∣ m * n) : (p : β„€) ∣ m ∨ (p : β„€) ∣ n := by rw [Int.natCast_dvd, Int.natCast_dvd] exact Int.Prime.dvd_mul hp h #align int.prime.dvd_mul' Int.Prime.dvd_mul' theorem Int.Prime.dvd_pow {n : β„€} {k p : β„•} (hp : Nat.Prime p) (h : (p : β„€) ∣ n ^ k) : p ∣ n.natAbs := by rw [Int.natCast_dvd, Int.natAbs_pow] at h exact hp.dvd_of_dvd_pow h #align int.prime.dvd_pow Int.Prime.dvd_pow theorem Int.Prime.dvd_pow' {n : β„€} {k p : β„•} (hp : Nat.Prime p) (h : (p : β„€) ∣ n ^ k) : (p : β„€) ∣ n := by rw [Int.natCast_dvd] exact Int.Prime.dvd_pow hp h #align int.prime.dvd_pow' Int.Prime.dvd_pow' theorem prime_two_or_dvd_of_dvd_two_mul_pow_self_two {m : β„€} {p : β„•} (hp : Nat.Prime p) (h : (p : β„€) ∣ 2 * m ^ 2) : p = 2 ∨ p ∣ Int.natAbs m := by cases' Int.Prime.dvd_mul hp h with hp2 hpp Β· apply Or.intro_left exact le_antisymm (Nat.le_of_dvd zero_lt_two hp2) (Nat.Prime.two_le hp) Β· apply Or.intro_right rw [sq, Int.natAbs_mul] at hpp exact or_self_iff.mp ((Nat.Prime.dvd_mul hp).mp hpp) #align prime_two_or_dvd_of_dvd_two_mul_pow_self_two prime_two_or_dvd_of_dvd_two_mul_pow_self_two theorem Int.exists_prime_and_dvd {n : β„€} (hn : n.natAbs β‰  1) : βˆƒ p, Prime p ∧ p ∣ n := by obtain ⟨p, pp, pd⟩ := Nat.exists_prime_and_dvd hn exact ⟨p, Nat.prime_iff_prime_int.mp pp, Int.natCast_dvd.mpr pd⟩ #align int.exists_prime_and_dvd Int.exists_prime_and_dvd theorem Int.prime_iff_natAbs_prime {k : β„€} : Prime k ↔ Nat.Prime k.natAbs := (Int.associated_natAbs k).prime_iff.trans Nat.prime_iff_prime_int.symm #align int.prime_iff_nat_abs_prime Int.prime_iff_natAbs_prime namespace Int theorem zmultiples_natAbs (a : β„€) : AddSubgroup.zmultiples (a.natAbs : β„€) = AddSubgroup.zmultiples a := le_antisymm (AddSubgroup.zmultiples_le_of_mem (mem_zmultiples_iff.mpr (dvd_natAbs.mpr dvd_rfl))) (AddSubgroup.zmultiples_le_of_mem (mem_zmultiples_iff.mpr (natAbs_dvd.mpr dvd_rfl))) #align int.zmultiples_nat_abs Int.zmultiples_natAbs theorem span_natAbs (a : β„€) : Ideal.span ({(a.natAbs : β„€)} : Set β„€) = Ideal.span {a} := by rw [Ideal.span_singleton_eq_span_singleton] exact (associated_natAbs _).symm #align int.span_nat_abs Int.span_natAbs section bit set_option linter.deprecated false
Mathlib/RingTheory/Int/Basic.lean
147
152
theorem eq_pow_of_mul_eq_pow_bit1_left {a b c : β„€} (hab : IsCoprime a b) {k : β„•} (h : a * b = c ^ bit1 k) : βˆƒ d, a = d ^ bit1 k := by
obtain ⟨d, hd⟩ := exists_associated_pow_of_mul_eq_pow' hab h replace hd := hd.symm rw [associated_iff_natAbs, natAbs_eq_natAbs_iff, ← neg_pow_bit1] at hd obtain rfl | rfl := hd <;> exact ⟨_, rfl⟩
[ " p ∣ m.natAbs ∨ p ∣ n.natAbs", " ↑p ∣ m ∨ ↑p ∣ n", " p ∣ n.natAbs", " ↑p ∣ n", " p = 2 ∨ p ∣ m.natAbs", " p = 2", " p ∣ m.natAbs", " βˆƒ p, Prime p ∧ p ∣ n", " Ideal.span {↑a.natAbs} = Ideal.span {a}", " Associated (↑a.natAbs) a", " βˆƒ d, a = d ^ bit1 k", " βˆƒ d_1, d ^ bit1 k = d_1 ^ bit1 k", "...
[ " p ∣ m.natAbs ∨ p ∣ n.natAbs", " ↑p ∣ m ∨ ↑p ∣ n", " p ∣ n.natAbs", " ↑p ∣ n", " p = 2 ∨ p ∣ m.natAbs", " p = 2", " p ∣ m.natAbs", " βˆƒ p, Prime p ∧ p ∣ n", " Ideal.span {↑a.natAbs} = Ideal.span {a}", " Associated (↑a.natAbs) a" ]
import Mathlib.Algebra.Order.Ring.Nat #align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b" namespace Nat def dist (n m : β„•) := n - m + (m - n) #align nat.dist Nat.dist -- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't present yet. #noalign nat.dist.def theorem dist_comm (n m : β„•) : dist n m = dist m n := by simp [dist, add_comm] #align nat.dist_comm Nat.dist_comm @[simp] theorem dist_self (n : β„•) : dist n n = 0 := by simp [dist, tsub_self] #align nat.dist_self Nat.dist_self theorem eq_of_dist_eq_zero {n m : β„•} (h : dist n m = 0) : n = m := have : n - m = 0 := Nat.eq_zero_of_add_eq_zero_right h have : n ≀ m := tsub_eq_zero_iff_le.mp this have : m - n = 0 := Nat.eq_zero_of_add_eq_zero_left h have : m ≀ n := tsub_eq_zero_iff_le.mp this le_antisymm β€Ήn ≀ mβ€Ί β€Ήm ≀ nβ€Ί #align nat.eq_of_dist_eq_zero Nat.eq_of_dist_eq_zero theorem dist_eq_zero {n m : β„•} (h : n = m) : dist n m = 0 := by rw [h, dist_self] #align nat.dist_eq_zero Nat.dist_eq_zero theorem dist_eq_sub_of_le {n m : β„•} (h : n ≀ m) : dist n m = m - n := by rw [dist, tsub_eq_zero_iff_le.mpr h, zero_add] #align nat.dist_eq_sub_of_le Nat.dist_eq_sub_of_le theorem dist_eq_sub_of_le_right {n m : β„•} (h : m ≀ n) : dist n m = n - m := by rw [dist_comm]; apply dist_eq_sub_of_le h #align nat.dist_eq_sub_of_le_right Nat.dist_eq_sub_of_le_right theorem dist_tri_left (n m : β„•) : m ≀ dist n m + n := le_trans le_tsub_add (add_le_add_right (Nat.le_add_left _ _) _) #align nat.dist_tri_left Nat.dist_tri_left theorem dist_tri_right (n m : β„•) : m ≀ n + dist n m := by rw [add_comm]; apply dist_tri_left #align nat.dist_tri_right Nat.dist_tri_right theorem dist_tri_left' (n m : β„•) : n ≀ dist n m + m := by rw [dist_comm]; apply dist_tri_left #align nat.dist_tri_left' Nat.dist_tri_left' theorem dist_tri_right' (n m : β„•) : n ≀ m + dist n m := by rw [dist_comm]; apply dist_tri_right #align nat.dist_tri_right' Nat.dist_tri_right' theorem dist_zero_right (n : β„•) : dist n 0 = n := Eq.trans (dist_eq_sub_of_le_right (zero_le n)) (tsub_zero n) #align nat.dist_zero_right Nat.dist_zero_right theorem dist_zero_left (n : β„•) : dist 0 n = n := Eq.trans (dist_eq_sub_of_le (zero_le n)) (tsub_zero n) #align nat.dist_zero_left Nat.dist_zero_left
Mathlib/Data/Nat/Dist.lean
74
78
theorem dist_add_add_right (n k m : β„•) : dist (n + k) (m + k) = dist n m := calc dist (n + k) (m + k) = n + k - (m + k) + (m + k - (n + k)) := rfl _ = n - m + (m + k - (n + k)) := by
rw [@add_tsub_add_eq_tsub_right] _ = n - m + (m - n) := by rw [@add_tsub_add_eq_tsub_right]
[ " n.dist m = m.dist n", " n.dist n = 0", " n.dist m = 0", " n.dist m = m - n", " n.dist m = n - m", " m.dist n = n - m", " m ≀ n + n.dist m", " m ≀ n.dist m + n", " n ≀ n.dist m + m", " n ≀ m.dist n + m", " n ≀ m + n.dist m", " n ≀ m + m.dist n", " n + k - (m + k) + (m + k - (n + k)) = n - m...
[ " n.dist m = m.dist n", " n.dist n = 0", " n.dist m = 0", " n.dist m = m - n", " n.dist m = n - m", " m.dist n = n - m", " m ≀ n + n.dist m", " m ≀ n.dist m + n", " n ≀ n.dist m + m", " n ≀ m.dist n + m", " n ≀ m + n.dist m", " n ≀ m + m.dist n" ]
import Mathlib.ModelTheory.Quotients import Mathlib.Order.Filter.Germ import Mathlib.Order.Filter.Ultrafilter #align_import model_theory.ultraproducts from "leanprover-community/mathlib"@"f1ae620609496a37534c2ab3640b641d5be8b6f0" universe u v variable {Ξ± : Type*} (M : Ξ± β†’ Type*) (u : Ultrafilter Ξ±) open FirstOrder Filter open Filter namespace FirstOrder namespace Language open Structure variable {L : Language.{u, v}} [βˆ€ a, L.Structure (M a)] namespace Ultraproduct instance setoidPrestructure : L.Prestructure ((u : Filter Ξ±).productSetoid M) := { (u : Filter Ξ±).productSetoid M with toStructure := { funMap := fun {n} f x a => funMap f fun i => x i a RelMap := fun {n} r x => βˆ€αΆ  a : Ξ± in u, RelMap r fun i => x i a } fun_equiv := fun {n} f x y xy => by refine mem_of_superset (iInter_mem.2 xy) fun a ha => ?_ simp only [Set.mem_iInter, Set.mem_setOf_eq] at ha simp only [Set.mem_setOf_eq, ha] rel_equiv := fun {n} r x y xy => by rw [← iff_eq_eq] refine ⟨fun hx => ?_, fun hy => ?_⟩ Β· refine mem_of_superset (inter_mem hx (iInter_mem.2 xy)) ?_ rintro a ⟨ha1, ha2⟩ simp only [Set.mem_iInter, Set.mem_setOf_eq] at * rw [← funext ha2] exact ha1 Β· refine mem_of_superset (inter_mem hy (iInter_mem.2 xy)) ?_ rintro a ⟨ha1, ha2⟩ simp only [Set.mem_iInter, Set.mem_setOf_eq] at * rw [funext ha2] exact ha1 } #align first_order.language.ultraproduct.setoid_prestructure FirstOrder.Language.Ultraproduct.setoidPrestructure variable {M} {u} instance Β«structureΒ» : L.Structure ((u : Filter Ξ±).Product M) := Language.quotientStructure set_option linter.uppercaseLean3 false in #align first_order.language.ultraproduct.Structure FirstOrder.Language.Ultraproduct.structure theorem funMap_cast {n : β„•} (f : L.Functions n) (x : Fin n β†’ βˆ€ a, M a) : (funMap f fun i => (x i : (u : Filter Ξ±).Product M)) = (fun a => funMap f fun i => x i a : (u : Filter Ξ±).Product M) := by apply funMap_quotient_mk' #align first_order.language.ultraproduct.fun_map_cast FirstOrder.Language.Ultraproduct.funMap_cast theorem term_realize_cast {Ξ² : Type*} (x : Ξ² β†’ βˆ€ a, M a) (t : L.Term Ξ²) : (t.realize fun i => (x i : (u : Filter Ξ±).Product M)) = (fun a => t.realize fun i => x i a : (u : Filter Ξ±).Product M) := by convert @Term.realize_quotient_mk' L _ ((u : Filter Ξ±).productSetoid M) (Ultraproduct.setoidPrestructure M u) _ t x using 2 ext a induction t with | var => rfl | func _ _ t_ih => simp only [Term.realize, t_ih]; rfl #align first_order.language.ultraproduct.term_realize_cast FirstOrder.Language.Ultraproduct.term_realize_cast variable [βˆ€ a : Ξ±, Nonempty (M a)]
Mathlib/ModelTheory/Ultraproducts.lean
96
144
theorem boundedFormula_realize_cast {Ξ² : Type*} {n : β„•} (Ο† : L.BoundedFormula Ξ² n) (x : Ξ² β†’ βˆ€ a, M a) (v : Fin n β†’ βˆ€ a, M a) : (Ο†.Realize (fun i : Ξ² => (x i : (u : Filter Ξ±).Product M)) (fun i => (v i : (u : Filter Ξ±).Product M))) ↔ βˆ€αΆ  a : Ξ± in u, Ο†.Realize (fun i : Ξ² => x i a) fun i => v i a := by
letI := (u : Filter Ξ±).productSetoid M induction' Ο† with _ _ _ _ _ _ _ _ m _ _ ih ih' k Ο† ih Β· simp only [BoundedFormula.Realize, eventually_const] Β· have h2 : βˆ€ a : Ξ±, (Sum.elim (fun i : Ξ² => x i a) fun i => v i a) = fun i => Sum.elim x v i a := fun a => funext fun i => Sum.casesOn i (fun i => rfl) fun i => rfl simp only [BoundedFormula.Realize, h2, term_realize_cast] erw [(Sum.comp_elim ((↑) : (βˆ€ a, M a) β†’ (u : Filter Ξ±).Product M) x v).symm, term_realize_cast, term_realize_cast] exact Quotient.eq'' Β· have h2 : βˆ€ a : Ξ±, (Sum.elim (fun i : Ξ² => x i a) fun i => v i a) = fun i => Sum.elim x v i a := fun a => funext fun i => Sum.casesOn i (fun i => rfl) fun i => rfl simp only [BoundedFormula.Realize, h2] erw [(Sum.comp_elim ((↑) : (βˆ€ a, M a) β†’ (u : Filter Ξ±).Product M) x v).symm] conv_lhs => enter [2, i]; erw [term_realize_cast] apply relMap_quotient_mk' Β· simp only [BoundedFormula.Realize, ih v, ih' v] rw [Ultrafilter.eventually_imp] Β· simp only [BoundedFormula.Realize] apply Iff.trans (b := βˆ€ m : βˆ€ a : Ξ±, M a, Ο†.Realize (fun i : Ξ² => (x i : (u : Filter Ξ±).Product M)) (Fin.snoc (((↑) : (βˆ€ a, M a) β†’ (u : Filter Ξ±).Product M) ∘ v) (m : (u : Filter Ξ±).Product M))) Β· exact Quotient.forall have h' : βˆ€ (m : βˆ€ a, M a) (a : Ξ±), (fun i : Fin (k + 1) => (Fin.snoc v m : _ β†’ βˆ€ a, M a) i a) = Fin.snoc (fun i : Fin k => v i a) (m a) := by refine fun m a => funext (Fin.reverseInduction ?_ fun i _ => ?_) Β· simp only [Fin.snoc_last] Β· simp only [Fin.snoc_castSucc] simp only [← Fin.comp_snoc] simp only [Function.comp, ih, h'] refine ⟨fun h => ?_, fun h m => ?_⟩ Β· contrapose! h simp_rw [← Ultrafilter.eventually_not, not_forall] at h refine ⟨fun a : Ξ± => Classical.epsilon fun m : M a => ¬φ.Realize (fun i => x i a) (Fin.snoc (fun i => v i a) m), ?_⟩ rw [← Ultrafilter.eventually_not] exact Filter.mem_of_superset h fun a ha => Classical.epsilon_spec ha Β· rw [Filter.eventually_iff] at * exact Filter.mem_of_superset h fun a ha => ha (m a)
[ " funMap f x β‰ˆ funMap f y", " a ∈ {x_1 | (fun a => funMap f x a = funMap f y a) x_1}", " RelMap r x = RelMap r y", " RelMap r x ↔ RelMap r y", " RelMap r y", " {x_1 | (fun a => RelMap r fun i => x i a) x_1} ∩ β‹‚ i, {x_1 | (fun a => x i a = y i a) x_1} βŠ†\n {x | (fun a => RelMap r fun i => y i a) x}", "...
[ " funMap f x β‰ˆ funMap f y", " a ∈ {x_1 | (fun a => funMap f x a = funMap f y a) x_1}", " RelMap r x = RelMap r y", " RelMap r x ↔ RelMap r y", " RelMap r y", " {x_1 | (fun a => RelMap r fun i => x i a) x_1} ∩ β‹‚ i, {x_1 | (fun a => x i a = y i a) x_1} βŠ†\n {x | (fun a => RelMap r fun i => y i a) x}", "...
import Mathlib.Data.List.Basic #align_import data.list.palindrome from "leanprover-community/mathlib"@"5a3e819569b0f12cbec59d740a2613018e7b8eec" variable {Ξ± Ξ² : Type*} namespace List inductive Palindrome : List Ξ± β†’ Prop | nil : Palindrome [] | singleton : βˆ€ x, Palindrome [x] | cons_concat : βˆ€ (x) {l}, Palindrome l β†’ Palindrome (x :: (l ++ [x])) #align list.palindrome List.Palindrome namespace Palindrome variable {l : List Ξ±} theorem reverse_eq {l : List Ξ±} (p : Palindrome l) : reverse l = l := by induction p <;> try (exact rfl) simpa #align list.palindrome.reverse_eq List.Palindrome.reverse_eq theorem of_reverse_eq {l : List Ξ±} : reverse l = l β†’ Palindrome l := by refine bidirectionalRecOn l (fun _ => Palindrome.nil) (fun a _ => Palindrome.singleton a) ?_ intro x l y hp hr rw [reverse_cons, reverse_append] at hr rw [head_eq_of_cons_eq hr] have : Palindrome l := hp (append_inj_left' (tail_eq_of_cons_eq hr) rfl) exact Palindrome.cons_concat x this #align list.palindrome.of_reverse_eq List.Palindrome.of_reverse_eq theorem iff_reverse_eq {l : List Ξ±} : Palindrome l ↔ reverse l = l := Iff.intro reverse_eq of_reverse_eq #align list.palindrome.iff_reverse_eq List.Palindrome.iff_reverse_eq
Mathlib/Data/List/Palindrome.lean
68
70
theorem append_reverse (l : List Ξ±) : Palindrome (l ++ reverse l) := by
apply of_reverse_eq rw [reverse_append, reverse_reverse]
[ " l.reverse = l", " [].reverse = []", " [x✝].reverse = [x✝]", " (x✝ :: (l✝ ++ [x✝])).reverse = x✝ :: (l✝ ++ [x✝])", " l.reverse = l β†’ l.Palindrome", " βˆ€ (a : Ξ±) (l : List Ξ±) (b : Ξ±),\n (l.reverse = l β†’ l.Palindrome) β†’ (a :: (l ++ [b])).reverse = a :: (l ++ [b]) β†’ (a :: (l ++ [b])).Palindrome", " (x :...
[ " l.reverse = l", " [].reverse = []", " [x✝].reverse = [x✝]", " (x✝ :: (l✝ ++ [x✝])).reverse = x✝ :: (l✝ ++ [x✝])", " l.reverse = l β†’ l.Palindrome", " βˆ€ (a : Ξ±) (l : List Ξ±) (b : Ξ±),\n (l.reverse = l β†’ l.Palindrome) β†’ (a :: (l ++ [b])).reverse = a :: (l ++ [b]) β†’ (a :: (l ++ [b])).Palindrome", " (x :...
import Mathlib.Data.Finset.Image #align_import data.finset.card from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83" assert_not_exists MonoidWithZero -- TODO: After a lot more work, -- assert_not_exists OrderedCommMonoid open Function Multiset Nat variable {Ξ± Ξ² R : Type*} namespace Finset variable {s t : Finset Ξ±} {a b : Ξ±} def card (s : Finset Ξ±) : β„• := Multiset.card s.1 #align finset.card Finset.card theorem card_def (s : Finset Ξ±) : s.card = Multiset.card s.1 := rfl #align finset.card_def Finset.card_def @[simp] lemma card_val (s : Finset Ξ±) : Multiset.card s.1 = s.card := rfl #align finset.card_val Finset.card_val @[simp] theorem card_mk {m nodup} : (⟨m, nodup⟩ : Finset Ξ±).card = Multiset.card m := rfl #align finset.card_mk Finset.card_mk @[simp] theorem card_empty : card (βˆ… : Finset Ξ±) = 0 := rfl #align finset.card_empty Finset.card_empty @[gcongr] theorem card_le_card : s βŠ† t β†’ s.card ≀ t.card := Multiset.card_le_card ∘ val_le_iff.mpr #align finset.card_le_of_subset Finset.card_le_card @[mono] theorem card_mono : Monotone (@card Ξ±) := by apply card_le_card #align finset.card_mono Finset.card_mono @[simp] lemma card_eq_zero : s.card = 0 ↔ s = βˆ… := card_eq_zero.trans val_eq_zero lemma card_ne_zero : s.card β‰  0 ↔ s.Nonempty := card_eq_zero.ne.trans nonempty_iff_ne_empty.symm lemma card_pos : 0 < s.card ↔ s.Nonempty := Nat.pos_iff_ne_zero.trans card_ne_zero #align finset.card_eq_zero Finset.card_eq_zero #align finset.card_pos Finset.card_pos alias ⟨_, Nonempty.card_pos⟩ := card_pos alias ⟨_, Nonempty.card_ne_zero⟩ := card_ne_zero #align finset.nonempty.card_pos Finset.Nonempty.card_pos theorem card_ne_zero_of_mem (h : a ∈ s) : s.card β‰  0 := (not_congr card_eq_zero).2 <| ne_empty_of_mem h #align finset.card_ne_zero_of_mem Finset.card_ne_zero_of_mem @[simp] theorem card_singleton (a : Ξ±) : card ({a} : Finset Ξ±) = 1 := Multiset.card_singleton _ #align finset.card_singleton Finset.card_singleton theorem card_singleton_inter [DecidableEq Ξ±] : ({a} ∩ s).card ≀ 1 := by cases' Finset.decidableMem a s with h h Β· simp [Finset.singleton_inter_of_not_mem h] Β· simp [Finset.singleton_inter_of_mem h] #align finset.card_singleton_inter Finset.card_singleton_inter @[simp] theorem card_cons (h : a βˆ‰ s) : (s.cons a h).card = s.card + 1 := Multiset.card_cons _ _ #align finset.card_cons Finset.card_cons section InsertErase variable [DecidableEq Ξ±] @[simp] theorem card_insert_of_not_mem (h : a βˆ‰ s) : (insert a s).card = s.card + 1 := by rw [← cons_eq_insert _ _ h, card_cons] #align finset.card_insert_of_not_mem Finset.card_insert_of_not_mem theorem card_insert_of_mem (h : a ∈ s) : card (insert a s) = s.card := by rw [insert_eq_of_mem h] #align finset.card_insert_of_mem Finset.card_insert_of_mem
Mathlib/Data/Finset/Card.lean
114
118
theorem card_insert_le (a : Ξ±) (s : Finset Ξ±) : card (insert a s) ≀ s.card + 1 := by
by_cases h : a ∈ s · rw [insert_eq_of_mem h] exact Nat.le_succ _ · rw [card_insert_of_not_mem h]
[ " Monotone card", " ({a} ∩ s).card ≀ 1", " (insert a s).card = s.card + 1", " (insert a s).card = s.card", " (insert a s).card ≀ s.card + 1", " s.card ≀ s.card + 1" ]
[ " Monotone card", " ({a} ∩ s).card ≀ 1", " (insert a s).card = s.card + 1", " (insert a s).card = s.card" ]
import Mathlib.Data.Set.Lattice import Mathlib.Order.Directed #align_import data.set.Union_lift from "leanprover-community/mathlib"@"5a4ea8453f128345f73cc656e80a49de2a54f481" variable {Ξ± : Type*} {ΞΉ Ξ² : Sort _} namespace Set section UnionLift @[nolint unusedArguments] noncomputable def iUnionLift (S : ΞΉ β†’ Set Ξ±) (f : βˆ€ i, S i β†’ Ξ²) (_ : βˆ€ (i j) (x : Ξ±) (hxi : x ∈ S i) (hxj : x ∈ S j), f i ⟨x, hxi⟩ = f j ⟨x, hxj⟩) (T : Set Ξ±) (hT : T βŠ† iUnion S) (x : T) : Ξ² := let i := Classical.indefiniteDescription _ (mem_iUnion.1 (hT x.prop)) f i ⟨x, i.prop⟩ #align set.Union_lift Set.iUnionLift variable {S : ΞΉ β†’ Set Ξ±} {f : βˆ€ i, S i β†’ Ξ²} {hf : βˆ€ (i j) (x : Ξ±) (hxi : x ∈ S i) (hxj : x ∈ S j), f i ⟨x, hxi⟩ = f j ⟨x, hxj⟩} {T : Set Ξ±} {hT : T βŠ† iUnion S} (hT' : T = iUnion S) @[simp] theorem iUnionLift_mk {i : ΞΉ} (x : S i) (hx : (x : Ξ±) ∈ T) : iUnionLift S f hf T hT ⟨x, hx⟩ = f i x := hf _ i x _ _ #align set.Union_lift_mk Set.iUnionLift_mk @[simp] theorem iUnionLift_inclusion {i : ΞΉ} (x : S i) (h : S i βŠ† T) : iUnionLift S f hf T hT (Set.inclusion h x) = f i x := iUnionLift_mk x _ #align set.Union_lift_inclusion Set.iUnionLift_inclusion
Mathlib/Data/Set/UnionLift.lean
75
76
theorem iUnionLift_of_mem (x : T) {i : ι} (hx : (x : α) ∈ S i) : iUnionLift S f hf T hT x = f i ⟨x, hx⟩ := by
cases' x with x hx; exact hf _ _ _ _ _
[ " iUnionLift S f hf T hT x = f i βŸ¨β†‘x, hx⟩", " iUnionLift S f hf T hT ⟨x, hx✝⟩ = f i βŸ¨β†‘βŸ¨x, hx✝⟩, hx⟩" ]
[]
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
Mathlib/AlgebraicTopology/DoldKan/GammaCompN.lean
86
91
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
[ " βˆ€ (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 ...
[ " βˆ€ (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.Algebra.Polynomial.Eval import Mathlib.RingTheory.Ideal.Quotient #align_import linear_algebra.smodeq from "leanprover-community/mathlib"@"146d3d1fa59c091fedaad8a4afa09d6802886d24" open Submodule open Polynomial variable {R : Type*} [Ring R] variable {A : Type*} [CommRing A] variable {M : Type*} [AddCommGroup M] [Module R M] (U U₁ Uβ‚‚ : Submodule R M) variable {x x₁ xβ‚‚ y y₁ yβ‚‚ z z₁ zβ‚‚ : M} variable {N : Type*} [AddCommGroup N] [Module R N] (V V₁ Vβ‚‚ : Submodule R N) set_option backward.isDefEq.lazyWhnfCore false in -- See https://github.com/leanprover-community/mathlib4/issues/12534 def SModEq (x y : M) : Prop := (Submodule.Quotient.mk x : M β§Έ U) = Submodule.Quotient.mk y #align smodeq SModEq notation:50 x " ≑ " y " [SMOD " N "]" => SModEq N x y variable {U U₁ Uβ‚‚} set_option backward.isDefEq.lazyWhnfCore false in -- See https://github.com/leanprover-community/mathlib4/issues/12534 protected theorem SModEq.def : x ≑ y [SMOD U] ↔ (Submodule.Quotient.mk x : M β§Έ U) = Submodule.Quotient.mk y := Iff.rfl #align smodeq.def SModEq.def namespace SModEq theorem sub_mem : x ≑ y [SMOD U] ↔ x - y ∈ U := by rw [SModEq.def, Submodule.Quotient.eq] #align smodeq.sub_mem SModEq.sub_mem @[simp] theorem top : x ≑ y [SMOD (⊀ : Submodule R M)] := (Submodule.Quotient.eq ⊀).2 mem_top #align smodeq.top SModEq.top @[simp] theorem bot : x ≑ y [SMOD (βŠ₯ : Submodule R M)] ↔ x = y := by rw [SModEq.def, Submodule.Quotient.eq, mem_bot, sub_eq_zero] #align smodeq.bot SModEq.bot @[mono] theorem mono (HU : U₁ ≀ Uβ‚‚) (hxy : x ≑ y [SMOD U₁]) : x ≑ y [SMOD Uβ‚‚] := (Submodule.Quotient.eq Uβ‚‚).2 <| HU <| (Submodule.Quotient.eq U₁).1 hxy #align smodeq.mono SModEq.mono @[refl] protected theorem refl (x : M) : x ≑ x [SMOD U] := @rfl _ _ #align smodeq.refl SModEq.refl protected theorem rfl : x ≑ x [SMOD U] := SModEq.refl _ #align smodeq.rfl SModEq.rfl instance : IsRefl _ (SModEq U) := ⟨SModEq.refl⟩ @[symm] nonrec theorem symm (hxy : x ≑ y [SMOD U]) : y ≑ x [SMOD U] := hxy.symm #align smodeq.symm SModEq.symm @[trans] nonrec theorem trans (hxy : x ≑ y [SMOD U]) (hyz : y ≑ z [SMOD U]) : x ≑ z [SMOD U] := hxy.trans hyz #align smodeq.trans SModEq.trans instance instTrans : Trans (SModEq U) (SModEq U) (SModEq U) where trans := trans theorem add (hxy₁ : x₁ ≑ y₁ [SMOD U]) (hxyβ‚‚ : xβ‚‚ ≑ yβ‚‚ [SMOD U]) : x₁ + xβ‚‚ ≑ y₁ + yβ‚‚ [SMOD U] := by rw [SModEq.def] at hxy₁ hxyβ‚‚ ⊒ simp_rw [Quotient.mk_add, hxy₁, hxyβ‚‚] #align smodeq.add SModEq.add theorem smul (hxy : x ≑ y [SMOD U]) (c : R) : c β€’ x ≑ c β€’ y [SMOD U] := by rw [SModEq.def] at hxy ⊒ simp_rw [Quotient.mk_smul, hxy] #align smodeq.smul SModEq.smul theorem mul {I : Ideal A} {x₁ xβ‚‚ y₁ yβ‚‚ : A} (hxy₁ : x₁ ≑ y₁ [SMOD I]) (hxyβ‚‚ : xβ‚‚ ≑ yβ‚‚ [SMOD I]) : x₁ * xβ‚‚ ≑ y₁ * yβ‚‚ [SMOD I] := by simp only [SModEq.def, Ideal.Quotient.mk_eq_mk, map_mul] at hxy₁ hxyβ‚‚ ⊒ rw [hxy₁, hxyβ‚‚]
Mathlib/LinearAlgebra/SModEq.lean
102
102
theorem zero : x ≑ 0 [SMOD U] ↔ x ∈ U := by
rw [SModEq.def, Submodule.Quotient.eq, sub_zero]
[ " x ≑ y [SMOD U] ↔ x - y ∈ U", " x ≑ y [SMOD βŠ₯] ↔ x = y", " x₁ + xβ‚‚ ≑ y₁ + yβ‚‚ [SMOD U]", " Submodule.Quotient.mk (x₁ + xβ‚‚) = Submodule.Quotient.mk (y₁ + yβ‚‚)", " c β€’ x ≑ c β€’ y [SMOD U]", " Submodule.Quotient.mk (c β€’ x) = Submodule.Quotient.mk (c β€’ y)", " x₁ * xβ‚‚ ≑ y₁ * yβ‚‚ [SMOD I]", " (Ideal.Quotient.m...
[ " x ≑ y [SMOD U] ↔ x - y ∈ U", " x ≑ y [SMOD βŠ₯] ↔ x = y", " x₁ + xβ‚‚ ≑ y₁ + yβ‚‚ [SMOD U]", " Submodule.Quotient.mk (x₁ + xβ‚‚) = Submodule.Quotient.mk (y₁ + yβ‚‚)", " c β€’ x ≑ c β€’ y [SMOD U]", " Submodule.Quotient.mk (c β€’ x) = Submodule.Quotient.mk (c β€’ y)", " x₁ * xβ‚‚ ≑ y₁ * yβ‚‚ [SMOD I]", " (Ideal.Quotient.m...
import Mathlib.Analysis.SpecialFunctions.Integrals import Mathlib.Analysis.SumIntegralComparisons import Mathlib.NumberTheory.Harmonic.Defs theorem log_add_one_le_harmonic (n : β„•) : Real.log ↑(n+1) ≀ harmonic n := by calc _ = ∫ x in (1:β„•)..↑(n+1), x⁻¹ := ?_ _ ≀ βˆ‘ d ∈ Finset.Icc 1 n, (d:ℝ)⁻¹ := ?_ _ = harmonic n := ?_ Β· rw [Nat.cast_one, integral_inv (by simp [(show Β¬ (1 : ℝ) ≀ 0 by norm_num)]), div_one] Β· exact (inv_antitoneOn_Icc_right <| by norm_num).integral_le_sum_Ico (Nat.le_add_left 1 n) Β· simp only [harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast] theorem harmonic_le_one_add_log (n : β„•) : harmonic n ≀ 1 + Real.log n := by by_cases hn0 : n = 0 Β· simp [hn0] have hn : 1 ≀ n := Nat.one_le_iff_ne_zero.mpr hn0 simp_rw [harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast] rw [← Finset.sum_erase_add (Finset.Icc 1 n) _ (Finset.left_mem_Icc.mpr hn), add_comm, Nat.cast_one, inv_one] refine add_le_add_left ?_ 1 simp only [Nat.lt_one_iff, Finset.mem_Icc, Finset.Icc_erase_left] calc βˆ‘ d ∈ .Ico 2 (n + 1), (d : ℝ)⁻¹ _ = βˆ‘ d ∈ .Ico 2 (n + 1), (↑(d + 1) - 1)⁻¹ := ?_ _ ≀ ∫ x in (2).. ↑(n + 1), (x - 1)⁻¹ := ?_ _ = ∫ x in (1)..n, x⁻¹ := ?_ _ = Real.log ↑n := ?_ Β· simp_rw [Nat.cast_add, Nat.cast_one, add_sub_cancel_right] Β· exact @AntitoneOn.sum_le_integral_Ico 2 (n + 1) (fun x : ℝ ↦ (x - 1)⁻¹) (by linarith [hn]) <| sub_inv_antitoneOn_Icc_right (by norm_num) Β· convert intervalIntegral.integral_comp_sub_right _ 1 Β· norm_num Β· simp only [Nat.cast_add, Nat.cast_one, add_sub_cancel_right] Β· convert integral_inv _ Β· rw [div_one] Β· simp only [Nat.one_le_cast, hn, Set.uIcc_of_le, Set.mem_Icc, Nat.cast_nonneg, and_true, not_le, zero_lt_one] theorem log_le_harmonic_floor (y : ℝ) (hy : 0 ≀ y) : Real.log y ≀ harmonic ⌊yβŒ‹β‚Š := by by_cases h0 : y = 0 Β· simp [h0] Β· calc _ ≀ Real.log ↑(Nat.floor y + 1) := ?_ _ ≀ _ := log_add_one_le_harmonic _ gcongr apply (Nat.le_ceil y).trans norm_cast exact Nat.ceil_le_floor_add_one y
Mathlib/NumberTheory/Harmonic/Bounds.lean
64
69
theorem harmonic_floor_le_one_add_log (y : ℝ) (hy : 1 ≀ y) : harmonic ⌊yβŒ‹β‚Š ≀ 1 + Real.log y := by
refine (harmonic_le_one_add_log _).trans ?_ gcongr Β· exact_mod_cast Nat.floor_pos.mpr hy Β· exact Nat.floor_le <| zero_le_one.trans hy
[ " (↑(n + 1)).log ≀ ↑(harmonic n)", " (↑(n + 1)).log = ∫ (x : ℝ) in ↑1 ..↑(n + 1), x⁻¹", " 0 βˆ‰ Set.uIcc 1 ↑(n + 1)", " Β¬1 ≀ 0", " ∫ (x : ℝ) in ↑1 ..↑(n + 1), x⁻¹ ≀ βˆ‘ d ∈ Finset.Icc 1 n, (↑d)⁻¹", " 0 < ↑1", " βˆ‘ d ∈ Finset.Icc 1 n, (↑d)⁻¹ = ↑(harmonic n)", " ↑(harmonic n) ≀ 1 + (↑n).log", " βˆ‘ x ∈ Finse...
[ " (↑(n + 1)).log ≀ ↑(harmonic n)", " (↑(n + 1)).log = ∫ (x : ℝ) in ↑1 ..↑(n + 1), x⁻¹", " 0 βˆ‰ Set.uIcc 1 ↑(n + 1)", " Β¬1 ≀ 0", " ∫ (x : ℝ) in ↑1 ..↑(n + 1), x⁻¹ ≀ βˆ‘ d ∈ Finset.Icc 1 n, (↑d)⁻¹", " 0 < ↑1", " βˆ‘ d ∈ Finset.Icc 1 n, (↑d)⁻¹ = ↑(harmonic n)", " ↑(harmonic n) ≀ 1 + (↑n).log", " βˆ‘ x ∈ Finse...
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 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⟩⟩] #align box_integral.box.mem_split_center_box BoxIntegral.Box.mem_splitCenterBox theorem splitCenterBox_le (I : Box ΞΉ) (s : Set ΞΉ) : I.splitCenterBox s ≀ I := fun _ hx ↦ (mem_splitCenterBox.1 hx).1 #align box_integral.box.split_center_box_le BoxIntegral.Box.splitCenterBox_le theorem disjoint_splitCenterBox (I : Box ΞΉ) {s t : Set ΞΉ} (h : s β‰  t) : Disjoint (I.splitCenterBox s : Set (ΞΉ β†’ ℝ)) (I.splitCenterBox t) := by rw [disjoint_iff_inf_le] rintro y ⟨hs, ht⟩; apply h ext i rw [mem_coe, mem_splitCenterBox] at hs ht rw [← hs.2, ← ht.2] #align box_integral.box.disjoint_split_center_box BoxIntegral.Box.disjoint_splitCenterBox theorem injective_splitCenterBox (I : Box ΞΉ) : Injective I.splitCenterBox := fun _ _ H ↦ by_contra fun Hne ↦ (I.disjoint_splitCenterBox Hne).ne (nonempty_coe _).ne_empty (H β–Έ rfl) #align box_integral.box.injective_split_center_box BoxIntegral.Box.injective_splitCenterBox @[simp] theorem exists_mem_splitCenterBox {I : Box ΞΉ} {x : ΞΉ β†’ ℝ} : (βˆƒ s, x ∈ I.splitCenterBox s) ↔ x ∈ I := ⟨fun ⟨s, hs⟩ ↦ I.splitCenterBox_le s hs, fun hx ↦ ⟨{ i | (I.lower i + I.upper i) / 2 < x i }, mem_splitCenterBox.2 ⟨hx, fun _ ↦ Iff.rfl⟩⟩⟩ #align box_integral.box.exists_mem_split_center_box BoxIntegral.Box.exists_mem_splitCenterBox @[simps] def splitCenterBoxEmb (I : Box ΞΉ) : Set ΞΉ β†ͺ Box ΞΉ := ⟨splitCenterBox I, injective_splitCenterBox I⟩ #align box_integral.box.split_center_box_emb BoxIntegral.Box.splitCenterBoxEmb @[simp] theorem iUnion_coe_splitCenterBox (I : Box ΞΉ) : ⋃ s, (I.splitCenterBox s : Set (ΞΉ β†’ ℝ)) = I := by ext x simp #align box_integral.box.Union_coe_split_center_box BoxIntegral.Box.iUnion_coe_splitCenterBox @[simp] theorem upper_sub_lower_splitCenterBox (I : Box ΞΉ) (s : Set ΞΉ) (i : ΞΉ) : (I.splitCenterBox s).upper i - (I.splitCenterBox s).lower i = (I.upper i - I.lower i) / 2 := by by_cases i ∈ s <;> field_simp [splitCenterBox] <;> field_simp [mul_two, two_mul] #align box_integral.box.upper_sub_lower_split_center_box BoxIntegral.Box.upper_sub_lower_splitCenterBox @[elab_as_elim]
Mathlib/Analysis/BoxIntegral/Box/SubboxInduction.lean
122
170
theorem subbox_induction_on' {p : Box ΞΉ β†’ Prop} (I : Box ΞΉ) (H_ind : βˆ€ J ≀ I, (βˆ€ s, p (splitCenterBox J s)) β†’ p J) (H_nhds : βˆ€ z ∈ Box.Icc I, βˆƒ U ∈ 𝓝[Box.Icc I] z, βˆ€ J ≀ I, βˆ€ (m : β„•), z ∈ Box.Icc J β†’ Box.Icc J βŠ† U β†’ (βˆ€ i, J.upper i - J.lower i = (I.upper i - I.lower i) / 2 ^ m) β†’ p J) : p I := by
by_contra hpI -- First we use `H_ind` to construct a decreasing sequence of boxes such that `βˆ€ m, Β¬p (J m)`. replace H_ind := fun J hJ ↦ not_imp_not.2 (H_ind J hJ) simp only [exists_imp, not_forall] at H_ind choose! s hs using H_ind set J : β„• β†’ Box ΞΉ := fun m ↦ (fun J ↦ splitCenterBox J (s J))^[m] I have J_succ : βˆ€ m, J (m + 1) = splitCenterBox (J m) (s <| J m) := fun m ↦ iterate_succ_apply' _ _ _ -- Now we prove some properties of `J` have hJmono : Antitone J := antitone_nat_of_succ_le fun n ↦ by simpa [J_succ] using splitCenterBox_le _ _ have hJle : βˆ€ m, J m ≀ I := fun m ↦ hJmono (zero_le m) have hJp : βˆ€ m, Β¬p (J m) := fun m ↦ Nat.recOn m hpI fun m ↦ by simpa only [J_succ] using hs (J m) (hJle m) have hJsub : βˆ€ m i, (J m).upper i - (J m).lower i = (I.upper i - I.lower i) / 2 ^ m := by intro m i induction' m with m ihm Β· simp [J, Nat.zero_eq] simp only [pow_succ, J_succ, upper_sub_lower_splitCenterBox, ihm, div_div] have h0 : J 0 = I := rfl clear_value J clear hpI hs J_succ s -- Let `z` be the unique common point of all `(J m).Icc`. Then `H_nhds` proves `p (J m)` for -- sufficiently large `m`. This contradicts `hJp`. set z : ΞΉ β†’ ℝ := ⨆ m, (J m).lower have hzJ : βˆ€ m, z ∈ Box.Icc (J m) := mem_iInter.1 (ciSup_mem_iInter_Icc_of_antitone_Icc ((@Box.Icc ΞΉ).monotone.comp_antitone hJmono) fun m ↦ (J m).lower_le_upper) have hJl_mem : βˆ€ m, (J m).lower ∈ Box.Icc I := fun m ↦ le_iff_Icc.1 (hJle m) (J m).lower_mem_Icc have hJu_mem : βˆ€ m, (J m).upper ∈ Box.Icc I := fun m ↦ le_iff_Icc.1 (hJle m) (J m).upper_mem_Icc have hJlz : Tendsto (fun m ↦ (J m).lower) atTop (𝓝 z) := tendsto_atTop_ciSup (antitone_lower.comp hJmono) ⟨I.upper, fun x ⟨m, hm⟩ ↦ hm β–Έ (hJl_mem m).2⟩ have hJuz : Tendsto (fun m ↦ (J m).upper) atTop (𝓝 z) := by suffices Tendsto (fun m ↦ (J m).upper - (J m).lower) atTop (𝓝 0) by simpa using hJlz.add this refine tendsto_pi_nhds.2 fun i ↦ ?_ simpa [hJsub] using tendsto_const_nhds.div_atTop (tendsto_pow_atTop_atTop_of_one_lt _root_.one_lt_two) replace hJlz : Tendsto (fun m ↦ (J m).lower) atTop (𝓝[Icc I.lower I.upper] z) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ hJlz (eventually_of_forall hJl_mem) replace hJuz : Tendsto (fun m ↦ (J m).upper) atTop (𝓝[Icc I.lower I.upper] z) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ hJuz (eventually_of_forall hJu_mem) rcases H_nhds z (h0 β–Έ hzJ 0) with ⟨U, hUz, hU⟩ rcases (tendsto_lift'.1 (hJlz.Icc hJuz) U hUz).exists with ⟨m, hUm⟩ exact hJp m (hU (J m) (hJle m) m (hzJ m) hUm (hJsub m))
[ " 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...
[ " 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.Probability.Notation import Mathlib.Probability.Process.Stopping #align_import probability.martingale.basic from "leanprover-community/mathlib"@"ba074af83b6cf54c3104e59402b39410ddbd6dca" open TopologicalSpace Filter open scoped NNReal ENNReal MeasureTheory ProbabilityTheory namespace MeasureTheory variable {Ξ© E ΞΉ : Type*} [Preorder ΞΉ] {m0 : MeasurableSpace Ξ©} {ΞΌ : Measure Ξ©} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {f g : ΞΉ β†’ Ξ© β†’ E} {β„± : Filtration ΞΉ m0} def Martingale (f : ΞΉ β†’ Ξ© β†’ E) (β„± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) : Prop := Adapted β„± f ∧ βˆ€ i j, i ≀ j β†’ ΞΌ[f j|β„± i] =ᡐ[ΞΌ] f i #align measure_theory.martingale MeasureTheory.Martingale def Supermartingale [LE E] (f : ΞΉ β†’ Ξ© β†’ E) (β„± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) : Prop := Adapted β„± f ∧ (βˆ€ i j, i ≀ j β†’ ΞΌ[f j|β„± i] ≀ᡐ[ΞΌ] f i) ∧ βˆ€ i, Integrable (f i) ΞΌ #align measure_theory.supermartingale MeasureTheory.Supermartingale def Submartingale [LE E] (f : ΞΉ β†’ Ξ© β†’ E) (β„± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) : Prop := Adapted β„± f ∧ (βˆ€ i j, i ≀ j β†’ f i ≀ᡐ[ΞΌ] ΞΌ[f j|β„± i]) ∧ βˆ€ i, Integrable (f i) ΞΌ #align measure_theory.submartingale MeasureTheory.Submartingale theorem martingale_const (β„± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] (x : E) : Martingale (fun _ _ => x) β„± ΞΌ := ⟨adapted_const β„± _, fun i j _ => by rw [condexp_const (β„±.le _)]⟩ #align measure_theory.martingale_const MeasureTheory.martingale_const theorem martingale_const_fun [OrderBot ΞΉ] (β„± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] {f : Ξ© β†’ E} (hf : StronglyMeasurable[β„± βŠ₯] f) (hfint : Integrable f ΞΌ) : Martingale (fun _ => f) β„± ΞΌ := by refine ⟨fun i => hf.mono <| β„±.mono bot_le, fun i j _ => ?_⟩ rw [condexp_of_stronglyMeasurable (β„±.le _) (hf.mono <| β„±.mono bot_le) hfint] #align measure_theory.martingale_const_fun MeasureTheory.martingale_const_fun variable (E) theorem martingale_zero (β„± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) : Martingale (0 : ΞΉ β†’ Ξ© β†’ E) β„± ΞΌ := ⟨adapted_zero E β„±, fun i j _ => by rw [Pi.zero_apply, condexp_zero]; simp⟩ #align measure_theory.martingale_zero MeasureTheory.martingale_zero variable {E} namespace Martingale protected theorem adapted (hf : Martingale f β„± ΞΌ) : Adapted β„± f := hf.1 #align measure_theory.martingale.adapted MeasureTheory.Martingale.adapted protected theorem stronglyMeasurable (hf : Martingale f β„± ΞΌ) (i : ΞΉ) : StronglyMeasurable[β„± i] (f i) := hf.adapted i #align measure_theory.martingale.strongly_measurable MeasureTheory.Martingale.stronglyMeasurable theorem condexp_ae_eq (hf : Martingale f β„± ΞΌ) {i j : ΞΉ} (hij : i ≀ j) : ΞΌ[f j|β„± i] =ᡐ[ΞΌ] f i := hf.2 i j hij #align measure_theory.martingale.condexp_ae_eq MeasureTheory.Martingale.condexp_ae_eq protected theorem integrable (hf : Martingale f β„± ΞΌ) (i : ΞΉ) : Integrable (f i) ΞΌ := integrable_condexp.congr (hf.condexp_ae_eq (le_refl i)) #align measure_theory.martingale.integrable MeasureTheory.Martingale.integrable
Mathlib/Probability/Martingale/Basic.lean
109
113
theorem setIntegral_eq [SigmaFiniteFiltration ΞΌ β„±] (hf : Martingale f β„± ΞΌ) {i j : ΞΉ} (hij : i ≀ j) {s : Set Ξ©} (hs : MeasurableSet[β„± i] s) : ∫ Ο‰ in s, f i Ο‰ βˆ‚ΞΌ = ∫ Ο‰ in s, f j Ο‰ βˆ‚ΞΌ := by
rw [← @setIntegral_condexp _ _ _ _ _ (β„± i) m0 _ _ _ (β„±.le i) _ (hf.integrable j) hs] refine setIntegral_congr_ae (β„±.le i s hs) ?_ filter_upwards [hf.2 i j hij] with _ heq _ using heq.symm
[ " ΞΌ[(fun x_1 x_2 => x) j|↑ℱ i] =αΆ [ae ΞΌ] (fun x_1 x_2 => x) i", " Martingale (fun x => f) β„± ΞΌ", " ΞΌ[(fun x => f) j|↑ℱ i] =αΆ [ae ΞΌ] (fun x => f) i", " ΞΌ[0 j|↑ℱ i] =αΆ [ae ΞΌ] 0 i", " 0 =αΆ [ae ΞΌ] 0 i", " ∫ (Ο‰ : Ξ©) in s, f i Ο‰ βˆ‚ΞΌ = ∫ (Ο‰ : Ξ©) in s, f j Ο‰ βˆ‚ΞΌ", " ∫ (Ο‰ : Ξ©) in s, f i Ο‰ βˆ‚ΞΌ = ∫ (x : Ξ©) in s, (ΞΌ[f j|↑ℱ...
[ " ΞΌ[(fun x_1 x_2 => x) j|↑ℱ i] =αΆ [ae ΞΌ] (fun x_1 x_2 => x) i", " Martingale (fun x => f) β„± ΞΌ", " ΞΌ[(fun x => f) j|↑ℱ i] =αΆ [ae ΞΌ] (fun x => f) i", " ΞΌ[0 j|↑ℱ i] =αΆ [ae ΞΌ] 0 i", " 0 =αΆ [ae ΞΌ] 0 i" ]
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)] 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 #align category_theory.glue_data.t_inv CategoryTheory.GlueData.t_inv theorem t'_inv (i j k : D.J) : D.t' i j k ≫ (pullbackSymmetry _ _).hom ≫ D.t' j i k ≫ (pullbackSymmetry _ _).hom = πŸ™ _ := by rw [← cancel_mono (pullback.fst : pullback (D.f i j) (D.f i k) ⟢ _)] simp [t_fac, t_fac_assoc] #align category_theory.glue_data.t'_inv CategoryTheory.GlueData.t'_inv instance t_isIso (i j : D.J) : IsIso (D.t i j) := ⟨⟨D.t j i, D.t_inv _ _, D.t_inv _ _⟩⟩ #align category_theory.glue_data.t_is_iso CategoryTheory.GlueData.t_isIso instance t'_isIso (i j k : D.J) : IsIso (D.t' i j k) := ⟨⟨D.t' j k i ≫ D.t' k i j, D.cocycle _ _ _, by simpa using D.cocycle _ _ _⟩⟩ #align category_theory.glue_data.t'_is_iso CategoryTheory.GlueData.t'_isIso @[reassoc]
Mathlib/CategoryTheory/GlueData.lean
123
129
theorem t'_comp_eq_pullbackSymmetry (i j k : D.J) : D.t' j k i ≫ D.t' k i j = (pullbackSymmetry _ _).hom ≫ D.t' j i k ≫ (pullbackSymmetry _ _).hom := by
trans inv (D.t' i j k) Β· exact IsIso.eq_inv_of_hom_inv_id (D.cocycle _ _ _) Β· rw [← cancel_mono (pullback.fst : pullback (D.f i j) (D.f i k) ⟢ _)] simp [t_fac, t_fac_assoc]
[ " 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", ...
[ " 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.Analysis.Complex.Circle import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup #align_import analysis.complex.isometry from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5" noncomputable section open Complex open ComplexConjugate local notation "|" x "|" => Complex.abs x def rotation : circle β†’* β„‚ ≃ₗᡒ[ℝ] β„‚ where toFun a := { DistribMulAction.toLinearEquiv ℝ β„‚ a with norm_map' := fun x => show |a * x| = |x| by rw [map_mul, abs_coe_circle, one_mul] } map_one' := LinearIsometryEquiv.ext <| one_smul circle map_mul' a b := LinearIsometryEquiv.ext <| mul_smul a b #align rotation rotation @[simp] theorem rotation_apply (a : circle) (z : β„‚) : rotation a z = a * z := rfl #align rotation_apply rotation_apply @[simp] theorem rotation_symm (a : circle) : (rotation a).symm = rotation a⁻¹ := LinearIsometryEquiv.ext fun _ => rfl #align rotation_symm rotation_symm @[simp]
Mathlib/Analysis/Complex/Isometry.lean
60
62
theorem rotation_trans (a b : circle) : (rotation a).trans (rotation b) = rotation (b * a) := by
ext1 simp
[ " Complex.abs (↑a * x) = Complex.abs x", " (rotation a).trans (rotation b) = rotation (b * a)", " ((rotation a).trans (rotation b)) x✝ = (rotation (b * a)) x✝" ]
[ " Complex.abs (↑a * x) = Complex.abs x" ]
import Mathlib.Algebra.Field.Defs import Mathlib.Algebra.GroupWithZero.Units.Lemmas import Mathlib.Algebra.Ring.Commute import Mathlib.Algebra.Ring.Invertible import Mathlib.Order.Synonym #align_import algebra.field.basic from "leanprover-community/mathlib"@"05101c3df9d9cfe9430edc205860c79b6d660102" open Function OrderDual Set universe u variable {Ξ± Ξ² K : Type*} section DivisionSemiring variable [DivisionSemiring Ξ±] {a b c d : Ξ±} theorem add_div (a b c : Ξ±) : (a + b) / c = a / c + b / c := by simp_rw [div_eq_mul_inv, add_mul] #align add_div add_div @[field_simps] theorem div_add_div_same (a b c : Ξ±) : a / c + b / c = (a + b) / c := (add_div _ _ _).symm #align div_add_div_same div_add_div_same theorem same_add_div (h : b β‰  0) : (b + a) / b = 1 + a / b := by rw [← div_self h, add_div] #align same_add_div same_add_div theorem div_add_same (h : b β‰  0) : (a + b) / b = a / b + 1 := by rw [← div_self h, add_div] #align div_add_same div_add_same theorem one_add_div (h : b β‰  0) : 1 + a / b = (b + a) / b := (same_add_div h).symm #align one_add_div one_add_div theorem div_add_one (h : b β‰  0) : a / b + 1 = (a + b) / b := (div_add_same h).symm #align div_add_one div_add_one theorem inv_add_inv' (ha : a β‰  0) (hb : b β‰  0) : a⁻¹ + b⁻¹ = a⁻¹ * (a + b) * b⁻¹ := let _ := invertibleOfNonzero ha; let _ := invertibleOfNonzero hb; invOf_add_invOf a b theorem one_div_mul_add_mul_one_div_eq_one_div_add_one_div (ha : a β‰  0) (hb : b β‰  0) : 1 / a * (a + b) * (1 / b) = 1 / a + 1 / b := by simpa only [one_div] using (inv_add_inv' ha hb).symm #align one_div_mul_add_mul_one_div_eq_one_div_add_one_div one_div_mul_add_mul_one_div_eq_one_div_add_one_div theorem add_div_eq_mul_add_div (a b : Ξ±) (hc : c β‰  0) : a + b / c = (a * c + b) / c := (eq_div_iff_mul_eq hc).2 <| by rw [right_distrib, div_mul_cancelβ‚€ _ hc] #align add_div_eq_mul_add_div add_div_eq_mul_add_div @[field_simps]
Mathlib/Algebra/Field/Basic.lean
66
67
theorem add_div' (a b c : Ξ±) (hc : c β‰  0) : b + a / c = (b * c + a) / c := by
rw [add_div, mul_div_cancel_rightβ‚€ _ hc]
[ " (a + b) / c = a / c + b / c", " (b + a) / b = 1 + a / b", " (a + b) / b = a / b + 1", " 1 / a * (a + b) * (1 / b) = 1 / a + 1 / b", " (a + b / c) * c = a * c + b", " b + a / c = (b * c + a) / c" ]
[ " (a + b) / c = a / c + b / c", " (b + a) / b = 1 + a / b", " (a + b) / b = a / b + 1", " 1 / a * (a + b) * (1 / b) = 1 / a + 1 / b", " (a + b / c) * c = a * c + b" ]
import Mathlib.Algebra.Group.Pi.Basic import Mathlib.CategoryTheory.Limits.Shapes.Products import Mathlib.CategoryTheory.Limits.Shapes.Images import Mathlib.CategoryTheory.IsomorphismClasses import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects #align_import category_theory.limits.shapes.zero_morphisms from "leanprover-community/mathlib"@"f7707875544ef1f81b32cb68c79e0e24e45a0e76" noncomputable section universe v u universe v' u' open CategoryTheory open CategoryTheory.Category open scoped Classical namespace CategoryTheory.Limits variable (C : Type u) [Category.{v} C] variable (D : Type u') [Category.{v'} D] class HasZeroMorphisms where [zero : βˆ€ X Y : C, Zero (X ⟢ Y)] comp_zero : βˆ€ {X Y : C} (f : X ⟢ Y) (Z : C), f ≫ (0 : Y ⟢ Z) = (0 : X ⟢ Z) := by aesop_cat zero_comp : βˆ€ (X : C) {Y Z : C} (f : Y ⟢ Z), (0 : X ⟢ Y) ≫ f = (0 : X ⟢ Z) := by aesop_cat #align category_theory.limits.has_zero_morphisms CategoryTheory.Limits.HasZeroMorphisms #align category_theory.limits.has_zero_morphisms.comp_zero' CategoryTheory.Limits.HasZeroMorphisms.comp_zero #align category_theory.limits.has_zero_morphisms.zero_comp' CategoryTheory.Limits.HasZeroMorphisms.zero_comp attribute [instance] HasZeroMorphisms.zero variable {C} @[simp] theorem comp_zero [HasZeroMorphisms C] {X Y : C} {f : X ⟢ Y} {Z : C} : f ≫ (0 : Y ⟢ Z) = (0 : X ⟢ Z) := HasZeroMorphisms.comp_zero f Z #align category_theory.limits.comp_zero CategoryTheory.Limits.comp_zero @[simp] theorem zero_comp [HasZeroMorphisms C] {X : C} {Y Z : C} {f : Y ⟢ Z} : (0 : X ⟢ Y) ≫ f = (0 : X ⟢ Z) := HasZeroMorphisms.zero_comp X f #align category_theory.limits.zero_comp CategoryTheory.Limits.zero_comp instance hasZeroMorphismsPEmpty : HasZeroMorphisms (Discrete PEmpty) where zero := by aesop_cat #align category_theory.limits.has_zero_morphisms_pempty CategoryTheory.Limits.hasZeroMorphismsPEmpty instance hasZeroMorphismsPUnit : HasZeroMorphisms (Discrete PUnit) where zero X Y := by repeat (constructor) #align category_theory.limits.has_zero_morphisms_punit CategoryTheory.Limits.hasZeroMorphismsPUnit open Opposite HasZeroMorphisms instance hasZeroMorphismsOpposite [HasZeroMorphisms C] : HasZeroMorphisms Cα΅’α΅– where zero X Y := ⟨(0 : unop Y ⟢ unop X).op⟩ comp_zero f Z := congr_arg Quiver.Hom.op (HasZeroMorphisms.zero_comp (unop Z) f.unop) zero_comp X {Y Z} (f : Y ⟢ Z) := congrArg Quiver.Hom.op (HasZeroMorphisms.comp_zero f.unop (unop X)) #align category_theory.limits.has_zero_morphisms_opposite CategoryTheory.Limits.hasZeroMorphismsOpposite section variable [HasZeroMorphisms C] @[simp] lemma op_zero (X Y : C) : (0 : X ⟢ Y).op = 0 := rfl #align category_theory.op_zero CategoryTheory.Limits.op_zero @[simp] lemma unop_zero (X Y : Cα΅’α΅–) : (0 : X ⟢ Y).unop = 0 := rfl #align category_theory.unop_zero CategoryTheory.Limits.unop_zero theorem zero_of_comp_mono {X Y Z : C} {f : X ⟢ Y} (g : Y ⟢ Z) [Mono g] (h : f ≫ g = 0) : f = 0 := by rw [← zero_comp, cancel_mono] at h exact h #align category_theory.limits.zero_of_comp_mono CategoryTheory.Limits.zero_of_comp_mono theorem zero_of_epi_comp {X Y Z : C} (f : X ⟢ Y) {g : Y ⟢ Z} [Epi f] (h : f ≫ g = 0) : g = 0 := by rw [← comp_zero, cancel_epi] at h exact h #align category_theory.limits.zero_of_epi_comp CategoryTheory.Limits.zero_of_epi_comp
Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean
150
151
theorem eq_zero_of_image_eq_zero {X Y : C} {f : X ⟢ Y} [HasImage f] (w : image.ι f = 0) : f = 0 := by
rw [← image.fac f, w, HasZeroMorphisms.comp_zero]
[]
[]
import Mathlib.Analysis.Normed.Field.Basic #align_import analysis.normed_space.int from "leanprover-community/mathlib"@"5cc2dfdd3e92f340411acea4427d701dc7ed26f8" namespace Int
Mathlib/Analysis/NormedSpace/Int.lean
24
26
theorem nnnorm_coe_units (e : β„€Λ£) : β€–(e : β„€)β€–β‚Š = 1 := by
obtain rfl | rfl := units_eq_one_or e <;> simp only [Units.coe_neg_one, Units.val_one, nnnorm_neg, nnnorm_one]
[ " ‖↑eβ€–β‚Š = 1", " ‖↑1β€–β‚Š = 1", " ‖↑(-1)β€–β‚Š = 1" ]
[]
import Mathlib.Algebra.Order.BigOperators.Ring.Finset import Mathlib.Analysis.Convex.Hull import Mathlib.LinearAlgebra.AffineSpace.Basis #align_import analysis.convex.combination from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d" open Set Function open scoped Classical open Pointwise universe u u' variable {R R' E F ΞΉ ΞΉ' Ξ± : Type*} [LinearOrderedField R] [LinearOrderedField R'] [AddCommGroup E] [AddCommGroup F] [LinearOrderedAddCommGroup Ξ±] [Module R E] [Module R F] [Module R Ξ±] [OrderedSMul R Ξ±] {s : Set E} def Finset.centerMass (t : Finset ΞΉ) (w : ΞΉ β†’ R) (z : ΞΉ β†’ E) : E := (βˆ‘ i ∈ t, w i)⁻¹ β€’ βˆ‘ i ∈ t, w i β€’ z i #align finset.center_mass Finset.centerMass variable (i j : ΞΉ) (c : R) (t : Finset ΞΉ) (w : ΞΉ β†’ R) (z : ΞΉ β†’ E) open Finset theorem Finset.centerMass_empty : (βˆ… : Finset ΞΉ).centerMass w z = 0 := by simp only [centerMass, sum_empty, smul_zero] #align finset.center_mass_empty Finset.centerMass_empty theorem Finset.centerMass_pair (hne : i β‰  j) : ({i, j} : Finset ΞΉ).centerMass w z = (w i / (w i + w j)) β€’ z i + (w j / (w i + w j)) β€’ z j := by simp only [centerMass, sum_pair hne, smul_add, (mul_smul _ _ _).symm, div_eq_inv_mul] #align finset.center_mass_pair Finset.centerMass_pair variable {w} theorem Finset.centerMass_insert (ha : i βˆ‰ t) (hw : βˆ‘ j ∈ t, w j β‰  0) : (insert i t).centerMass w z = (w i / (w i + βˆ‘ j ∈ t, w j)) β€’ z i + ((βˆ‘ j ∈ t, w j) / (w i + βˆ‘ j ∈ t, w j)) β€’ t.centerMass w z := by simp only [centerMass, sum_insert ha, smul_add, (mul_smul _ _ _).symm, ← div_eq_inv_mul] congr 2 rw [div_mul_eq_mul_div, mul_inv_cancel hw, one_div] #align finset.center_mass_insert Finset.centerMass_insert theorem Finset.centerMass_singleton (hw : w i β‰  0) : ({i} : Finset ΞΉ).centerMass w z = z i := by rw [centerMass, sum_singleton, sum_singleton, ← mul_smul, inv_mul_cancel hw, one_smul] #align finset.center_mass_singleton Finset.centerMass_singleton @[simp] lemma Finset.centerMass_neg_left : t.centerMass (-w) z = t.centerMass w z := by simp [centerMass, inv_neg] lemma Finset.centerMass_smul_left {c : R'} [Module R' R] [Module R' E] [SMulCommClass R' R R] [IsScalarTower R' R R] [SMulCommClass R R' E] [IsScalarTower R' R E] (hc : c β‰  0) : t.centerMass (c β€’ w) z = t.centerMass w z := by simp [centerMass, -smul_assoc, smul_assoc c, ← smul_sum, smul_invβ‚€, smul_smul_smul_comm, hc] theorem Finset.centerMass_eq_of_sum_1 (hw : βˆ‘ i ∈ t, w i = 1) : t.centerMass w z = βˆ‘ i ∈ t, w i β€’ z i := by simp only [Finset.centerMass, hw, inv_one, one_smul] #align finset.center_mass_eq_of_sum_1 Finset.centerMass_eq_of_sum_1
Mathlib/Analysis/Convex/Combination.lean
87
88
theorem Finset.centerMass_smul : (t.centerMass w fun i => c β€’ z i) = c β€’ t.centerMass w z := by
simp only [Finset.centerMass, Finset.smul_sum, (mul_smul _ _ _).symm, mul_comm c, mul_assoc]
[ " βˆ….centerMass w z = 0", " {i, j}.centerMass w z = (w i / (w i + w j)) β€’ z i + (w j / (w i + w j)) β€’ z j", " (insert i t).centerMass w z =\n (w i / (w i + βˆ‘ j ∈ t, w j)) β€’ z i + ((βˆ‘ j ∈ t, w j) / (w i + βˆ‘ j ∈ t, w j)) β€’ t.centerMass w z", " (w i / (w i + βˆ‘ i ∈ t, w i)) β€’ z i + (w i + βˆ‘ i ∈ t, w i)⁻¹ β€’ βˆ‘ i ...
[ " βˆ….centerMass w z = 0", " {i, j}.centerMass w z = (w i / (w i + w j)) β€’ z i + (w j / (w i + w j)) β€’ z j", " (insert i t).centerMass w z =\n (w i / (w i + βˆ‘ j ∈ t, w j)) β€’ z i + ((βˆ‘ j ∈ t, w j) / (w i + βˆ‘ j ∈ t, w j)) β€’ t.centerMass w z", " (w i / (w i + βˆ‘ i ∈ t, w i)) β€’ z i + (w i + βˆ‘ i ∈ t, w i)⁻¹ β€’ βˆ‘ i ...
import Mathlib.Logic.Pairwise import Mathlib.Order.CompleteBooleanAlgebra import Mathlib.Order.Directed import Mathlib.Order.GaloisConnection #align_import data.set.lattice from "leanprover-community/mathlib"@"b86832321b586c6ac23ef8cdef6a7a27e42b13bd" open Function Set universe u variable {Ξ± Ξ² Ξ³ : Type*} {ΞΉ ΞΉ' ΞΉβ‚‚ : Sort*} {ΞΊ κ₁ ΞΊβ‚‚ : ΞΉ β†’ Sort*} {ΞΊ' : ΞΉ' β†’ Sort*} namespace Set theorem mem_iUnionβ‚‚ {x : Ξ³} {s : βˆ€ i, ΞΊ i β†’ Set Ξ³} : (x ∈ ⋃ (i) (j), s i j) ↔ βˆƒ i j, x ∈ s i j := by simp_rw [mem_iUnion] #align set.mem_Unionβ‚‚ Set.mem_iUnionβ‚‚ theorem mem_iInterβ‚‚ {x : Ξ³} {s : βˆ€ i, ΞΊ i β†’ Set Ξ³} : (x ∈ β‹‚ (i) (j), s i j) ↔ βˆ€ i j, x ∈ s i j := by simp_rw [mem_iInter] #align set.mem_Interβ‚‚ Set.mem_iInterβ‚‚ theorem mem_iUnion_of_mem {s : ΞΉ β†’ Set Ξ±} {a : Ξ±} (i : ΞΉ) (ha : a ∈ s i) : a ∈ ⋃ i, s i := mem_iUnion.2 ⟨i, ha⟩ #align set.mem_Union_of_mem Set.mem_iUnion_of_mem theorem mem_iUnionβ‚‚_of_mem {s : βˆ€ i, ΞΊ i β†’ Set Ξ±} {a : Ξ±} {i : ΞΉ} (j : ΞΊ i) (ha : a ∈ s i j) : a ∈ ⋃ (i) (j), s i j := mem_iUnionβ‚‚.2 ⟨i, j, ha⟩ #align set.mem_Unionβ‚‚_of_mem Set.mem_iUnionβ‚‚_of_mem theorem mem_iInter_of_mem {s : ΞΉ β†’ Set Ξ±} {a : Ξ±} (h : βˆ€ i, a ∈ s i) : a ∈ β‹‚ i, s i := mem_iInter.2 h #align set.mem_Inter_of_mem Set.mem_iInter_of_mem theorem mem_iInterβ‚‚_of_mem {s : βˆ€ i, ΞΊ i β†’ Set Ξ±} {a : Ξ±} (h : βˆ€ i j, a ∈ s i j) : a ∈ β‹‚ (i) (j), s i j := mem_iInterβ‚‚.2 h #align set.mem_Interβ‚‚_of_mem Set.mem_iInterβ‚‚_of_mem instance completeAtomicBooleanAlgebra : CompleteAtomicBooleanAlgebra (Set Ξ±) := { instBooleanAlgebraSet with le_sSup := fun s t t_in a a_in => ⟨t, t_in, a_in⟩ sSup_le := fun s t h a ⟨t', ⟨t'_in, a_in⟩⟩ => h t' t'_in a_in le_sInf := fun s t h a a_in t' t'_in => h t' t'_in a_in sInf_le := fun s t t_in a h => h _ t_in iInf_iSup_eq := by intros; ext; simp [Classical.skolem] } instance : OrderTop (Set Ξ±) where top := univ le_top := by simp @[congr] theorem iUnion_congr_Prop {p q : Prop} {f₁ : p β†’ Set Ξ±} {fβ‚‚ : q β†’ Set Ξ±} (pq : p ↔ q) (f : βˆ€ x, f₁ (pq.mpr x) = fβ‚‚ x) : iUnion f₁ = iUnion fβ‚‚ := iSup_congr_Prop pq f #align set.Union_congr_Prop Set.iUnion_congr_Prop @[congr] theorem iInter_congr_Prop {p q : Prop} {f₁ : p β†’ Set Ξ±} {fβ‚‚ : q β†’ Set Ξ±} (pq : p ↔ q) (f : βˆ€ x, f₁ (pq.mpr x) = fβ‚‚ x) : iInter f₁ = iInter fβ‚‚ := iInf_congr_Prop pq f #align set.Inter_congr_Prop Set.iInter_congr_Prop theorem iUnion_plift_up (f : PLift ΞΉ β†’ Set Ξ±) : ⋃ i, f (PLift.up i) = ⋃ i, f i := iSup_plift_up _ #align set.Union_plift_up Set.iUnion_plift_up theorem iUnion_plift_down (f : ΞΉ β†’ Set Ξ±) : ⋃ i, f (PLift.down i) = ⋃ i, f i := iSup_plift_down _ #align set.Union_plift_down Set.iUnion_plift_down theorem iInter_plift_up (f : PLift ΞΉ β†’ Set Ξ±) : β‹‚ i, f (PLift.up i) = β‹‚ i, f i := iInf_plift_up _ #align set.Inter_plift_up Set.iInter_plift_up theorem iInter_plift_down (f : ΞΉ β†’ Set Ξ±) : β‹‚ i, f (PLift.down i) = β‹‚ i, f i := iInf_plift_down _ #align set.Inter_plift_down Set.iInter_plift_down theorem iUnion_eq_if {p : Prop} [Decidable p] (s : Set Ξ±) : ⋃ _ : p, s = if p then s else βˆ… := iSup_eq_if _ #align set.Union_eq_if Set.iUnion_eq_if theorem iUnion_eq_dif {p : Prop} [Decidable p] (s : p β†’ Set Ξ±) : ⋃ h : p, s h = if h : p then s h else βˆ… := iSup_eq_dif _ #align set.Union_eq_dif Set.iUnion_eq_dif theorem iInter_eq_if {p : Prop} [Decidable p] (s : Set Ξ±) : β‹‚ _ : p, s = if p then s else univ := iInf_eq_if _ #align set.Inter_eq_if Set.iInter_eq_if theorem iInf_eq_dif {p : Prop} [Decidable p] (s : p β†’ Set Ξ±) : β‹‚ h : p, s h = if h : p then s h else univ := _root_.iInf_eq_dif _ #align set.Infi_eq_dif Set.iInf_eq_dif
Mathlib/Data/Set/Lattice.lean
207
211
theorem exists_set_mem_of_union_eq_top {ΞΉ : Type*} (t : Set ΞΉ) (s : ΞΉ β†’ Set Ξ²) (w : ⋃ i ∈ t, s i = ⊀) (x : Ξ²) : βˆƒ i ∈ t, x ∈ s i := by
have p : x ∈ ⊀ := Set.mem_univ x rw [← w, Set.mem_iUnion] at p simpa using p
[ " x ∈ ⋃ i, ⋃ j, s i j ↔ βˆƒ i j, x ∈ s i j", " x ∈ β‹‚ i, β‹‚ j, s i j ↔ βˆ€ (i : ΞΉ) (j : ΞΊ i), x ∈ s i j", " βˆ€ {ΞΉ : Type u_1} {ΞΊ : ΞΉ β†’ Type u_1} (f : (a : ΞΉ) β†’ ΞΊ a β†’ Set Ξ±), β¨… a, ⨆ b, f a b = ⨆ g, β¨… a, f a (g a)", " β¨… a, ⨆ b, f✝ a b = ⨆ g, β¨… a, f✝ a (g a)", " x✝ ∈ β¨… a, ⨆ b, f✝ a b ↔ x✝ ∈ ⨆ g, β¨… a, f✝ a (g a)", "...
[ " x ∈ ⋃ i, ⋃ j, s i j ↔ βˆƒ i j, x ∈ s i j", " x ∈ β‹‚ i, β‹‚ j, s i j ↔ βˆ€ (i : ΞΉ) (j : ΞΊ i), x ∈ s i j", " βˆ€ {ΞΉ : Type u_1} {ΞΊ : ΞΉ β†’ Type u_1} (f : (a : ΞΉ) β†’ ΞΊ a β†’ Set Ξ±), β¨… a, ⨆ b, f a b = ⨆ g, β¨… a, f a (g a)", " β¨… a, ⨆ b, f✝ a b = ⨆ g, β¨… a, f✝ a (g a)", " x✝ ∈ β¨… a, ⨆ b, f✝ a b ↔ x✝ ∈ ⨆ g, β¨… a, f✝ a (g a)", "...
import Mathlib.Combinatorics.SimpleGraph.Connectivity import Mathlib.Data.Nat.Lattice #align_import combinatorics.simple_graph.metric from "leanprover-community/mathlib"@"352ecfe114946c903338006dd3287cb5a9955ff2" namespace SimpleGraph variable {V : Type*} (G : SimpleGraph V) noncomputable def dist (u v : V) : β„• := sInf (Set.range (Walk.length : G.Walk u v β†’ β„•)) #align simple_graph.dist SimpleGraph.dist variable {G} protected theorem Reachable.exists_walk_of_dist {u v : V} (hr : G.Reachable u v) : βˆƒ p : G.Walk u v, p.length = G.dist u v := Nat.sInf_mem (Set.range_nonempty_iff_nonempty.mpr hr) #align simple_graph.reachable.exists_walk_of_dist SimpleGraph.Reachable.exists_walk_of_dist protected theorem Connected.exists_walk_of_dist (hconn : G.Connected) (u v : V) : βˆƒ p : G.Walk u v, p.length = G.dist u v := (hconn u v).exists_walk_of_dist #align simple_graph.connected.exists_walk_of_dist SimpleGraph.Connected.exists_walk_of_dist theorem dist_le {u v : V} (p : G.Walk u v) : G.dist u v ≀ p.length := Nat.sInf_le ⟨p, rfl⟩ #align simple_graph.dist_le SimpleGraph.dist_le @[simp] theorem dist_eq_zero_iff_eq_or_not_reachable {u v : V} : G.dist u v = 0 ↔ u = v ∨ Β¬G.Reachable u v := by simp [dist, Nat.sInf_eq_zero, Reachable] #align simple_graph.dist_eq_zero_iff_eq_or_not_reachable SimpleGraph.dist_eq_zero_iff_eq_or_not_reachable theorem dist_self {v : V} : dist G v v = 0 := by simp #align simple_graph.dist_self SimpleGraph.dist_self protected theorem Reachable.dist_eq_zero_iff {u v : V} (hr : G.Reachable u v) : G.dist u v = 0 ↔ u = v := by simp [hr] #align simple_graph.reachable.dist_eq_zero_iff SimpleGraph.Reachable.dist_eq_zero_iff protected theorem Reachable.pos_dist_of_ne {u v : V} (h : G.Reachable u v) (hne : u β‰  v) : 0 < G.dist u v := Nat.pos_of_ne_zero (by simp [h, hne]) #align simple_graph.reachable.pos_dist_of_ne SimpleGraph.Reachable.pos_dist_of_ne protected theorem Connected.dist_eq_zero_iff (hconn : G.Connected) {u v : V} : G.dist u v = 0 ↔ u = v := by simp [hconn u v] #align simple_graph.connected.dist_eq_zero_iff SimpleGraph.Connected.dist_eq_zero_iff protected theorem Connected.pos_dist_of_ne {u v : V} (hconn : G.Connected) (hne : u β‰  v) : 0 < G.dist u v := Nat.pos_of_ne_zero (by intro h; exact False.elim (hne (hconn.dist_eq_zero_iff.mp h))) #align simple_graph.connected.pos_dist_of_ne SimpleGraph.Connected.pos_dist_of_ne theorem dist_eq_zero_of_not_reachable {u v : V} (h : Β¬G.Reachable u v) : G.dist u v = 0 := by simp [h] #align simple_graph.dist_eq_zero_of_not_reachable SimpleGraph.dist_eq_zero_of_not_reachable theorem nonempty_of_pos_dist {u v : V} (h : 0 < G.dist u v) : (Set.univ : Set (G.Walk u v)).Nonempty := by simpa [Set.range_nonempty_iff_nonempty, Set.nonempty_iff_univ_nonempty] using Nat.nonempty_of_pos_sInf h #align simple_graph.nonempty_of_pos_dist SimpleGraph.nonempty_of_pos_dist protected theorem Connected.dist_triangle (hconn : G.Connected) {u v w : V} : G.dist u w ≀ G.dist u v + G.dist v w := by obtain ⟨p, hp⟩ := hconn.exists_walk_of_dist u v obtain ⟨q, hq⟩ := hconn.exists_walk_of_dist v w rw [← hp, ← hq, ← Walk.length_append] apply dist_le #align simple_graph.connected.dist_triangle SimpleGraph.Connected.dist_triangle private theorem dist_comm_aux {u v : V} (h : G.Reachable u v) : G.dist u v ≀ G.dist v u := by obtain ⟨p, hp⟩ := h.symm.exists_walk_of_dist rw [← hp, ← Walk.length_reverse] apply dist_le theorem dist_comm {u v : V} : G.dist u v = G.dist v u := by by_cases h : G.Reachable u v Β· apply le_antisymm (dist_comm_aux h) (dist_comm_aux h.symm) Β· have h' : Β¬G.Reachable v u := fun h' => absurd h'.symm h simp [h, h', dist_eq_zero_of_not_reachable] #align simple_graph.dist_comm SimpleGraph.dist_comm lemma dist_ne_zero_iff_ne_and_reachable {u v : V} : G.dist u v β‰  0 ↔ u β‰  v ∧ G.Reachable u v := by rw [ne_eq, dist_eq_zero_iff_eq_or_not_reachable.not] push_neg; rfl lemma Reachable.of_dist_ne_zero {u v : V} (h : G.dist u v β‰  0) : G.Reachable u v := (dist_ne_zero_iff_ne_and_reachable.mp h).2 lemma exists_walk_of_dist_ne_zero {u v : V} (h : G.dist u v β‰  0) : βˆƒ p : G.Walk u v, p.length = G.dist u v := (Reachable.of_dist_ne_zero h).exists_walk_of_dist
Mathlib/Combinatorics/SimpleGraph/Metric.lean
137
142
theorem dist_eq_one_iff_adj {u v : V} : G.dist u v = 1 ↔ G.Adj u v := by
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ Β· let ⟨w, hw⟩ := exists_walk_of_dist_ne_zero <| ne_zero_of_eq_one h exact w.adj_of_length_eq_one <| h β–Έ hw Β· have : h.toWalk.length = 1 := Walk.length_cons _ _ exact ge_antisymm (h.reachable.pos_dist_of_ne h.ne) (this β–Έ dist_le _)
[ " G.dist u v = 0 ↔ u = v ∨ Β¬G.Reachable u v", " G.dist v v = 0", " G.dist u v = 0 ↔ u = v", " G.dist u v β‰  0", " False", " G.dist u v = 0", " Set.univ.Nonempty", " G.dist u w ≀ G.dist u v + G.dist v w", " G.dist u w ≀ (p.append q).length", " G.dist u v ≀ G.dist v u", " G.dist u v ≀ p.reverse.len...
[ " G.dist u v = 0 ↔ u = v ∨ Β¬G.Reachable u v", " G.dist v v = 0", " G.dist u v = 0 ↔ u = v", " G.dist u v β‰  0", " False", " G.dist u v = 0", " Set.univ.Nonempty", " G.dist u w ≀ G.dist u v + G.dist v w", " G.dist u w ≀ (p.append q).length", " G.dist u v ≀ G.dist v u", " G.dist u v ≀ p.reverse.len...
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Combinatorics.SimpleGraph.Maps open Finset namespace SimpleGraph variable {V : Type*} [DecidableEq V] (G : SimpleGraph V) (s t : V) section AddEdge def edge : SimpleGraph V := fromEdgeSet {s(s, t)} lemma edge_adj (v w : V) : (edge s t).Adj v w ↔ (v = s ∧ w = t ∨ v = t ∧ w = s) ∧ v β‰  w := by rw [edge, fromEdgeSet_adj, Set.mem_singleton_iff, Sym2.eq_iff] instance : DecidableRel (edge s t).Adj := fun _ _ ↦ by rw [edge_adj]; infer_instance lemma edge_self_eq_bot : edge s s = βŠ₯ := by ext; rw [edge_adj]; aesop @[simp] lemma sup_edge_self : G βŠ” edge s s = G := by rw [edge_self_eq_bot, sup_of_le_left bot_le] variable {s t} lemma edge_edgeSet_of_ne (h : s β‰  t) : (edge s t).edgeSet = {s(s, t)} := by rwa [edge, edgeSet_fromEdgeSet, sdiff_eq_left, Set.disjoint_singleton_left, Set.mem_setOf_eq, Sym2.isDiag_iff_proj_eq] lemma sup_edge_of_adj (h : G.Adj s t) : G βŠ” edge s t = G := by rwa [sup_eq_left, ← edgeSet_subset_edgeSet, edge_edgeSet_of_ne h.ne, Set.singleton_subset_iff, mem_edgeSet] variable [Fintype V] [DecidableRel G.Adj] instance : Fintype (edge s t).edgeSet := by rw [edge]; infer_instance
Mathlib/Combinatorics/SimpleGraph/Operations.lean
171
175
theorem edgeFinset_sup_edge [Fintype (edgeSet (G βŠ” edge s t))] (hn : Β¬G.Adj s t) (h : s β‰  t) : (G βŠ” edge s t).edgeFinset = G.edgeFinset.cons s(s, t) (by simp_all) := by
letI := Classical.decEq V rw [edgeFinset_sup, cons_eq_insert, insert_eq, union_comm] simp_rw [edgeFinset, edge_edgeSet_of_ne h]; rfl
[ " (edge s t).Adj v w ↔ (v = s ∧ w = t ∨ v = t ∧ w = s) ∧ v β‰  w", " Decidable ((edge s t).Adj x✝¹ x✝)", " Decidable ((x✝¹ = s ∧ x✝ = t ∨ x✝¹ = t ∧ x✝ = s) ∧ x✝¹ β‰  x✝)", " edge s s = βŠ₯", " (edge s s).Adj x✝¹ x✝ ↔ βŠ₯.Adj x✝¹ x✝", " (x✝¹ = s ∧ x✝ = s ∨ x✝¹ = s ∧ x✝ = s) ∧ x✝¹ β‰  x✝ ↔ βŠ₯.Adj x✝¹ x✝", " G βŠ” edge...
[ " (edge s t).Adj v w ↔ (v = s ∧ w = t ∨ v = t ∧ w = s) ∧ v β‰  w", " Decidable ((edge s t).Adj x✝¹ x✝)", " Decidable ((x✝¹ = s ∧ x✝ = t ∨ x✝¹ = t ∧ x✝ = s) ∧ x✝¹ β‰  x✝)", " edge s s = βŠ₯", " (edge s s).Adj x✝¹ x✝ ↔ βŠ₯.Adj x✝¹ x✝", " (x✝¹ = s ∧ x✝ = s ∨ x✝¹ = s ∧ x✝ = s) ∧ x✝¹ β‰  x✝ ↔ βŠ₯.Adj x✝¹ x✝", " G βŠ” edge...
import Mathlib.Data.Set.Image import Mathlib.Order.Interval.Set.Basic #align_import data.set.intervals.with_bot_top from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105" open Set variable {Ξ± : Type*} namespace WithTop @[simp] theorem preimage_coe_top : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' {⊀} = (βˆ… : Set Ξ±) := eq_empty_of_subset_empty fun _ => coe_ne_top #align with_top.preimage_coe_top WithTop.preimage_coe_top variable [Preorder Ξ±] {a b : Ξ±} theorem range_coe : range (some : Ξ± β†’ WithTop Ξ±) = Iio ⊀ := by ext x rw [mem_Iio, WithTop.lt_top_iff_ne_top, mem_range, ne_top_iff_exists] #align with_top.range_coe WithTop.range_coe @[simp] theorem preimage_coe_Ioi : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Ioi a = Ioi a := ext fun _ => coe_lt_coe #align with_top.preimage_coe_Ioi WithTop.preimage_coe_Ioi @[simp] theorem preimage_coe_Ici : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Ici a = Ici a := ext fun _ => coe_le_coe #align with_top.preimage_coe_Ici WithTop.preimage_coe_Ici @[simp] theorem preimage_coe_Iio : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Iio a = Iio a := ext fun _ => coe_lt_coe #align with_top.preimage_coe_Iio WithTop.preimage_coe_Iio @[simp] theorem preimage_coe_Iic : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Iic a = Iic a := ext fun _ => coe_le_coe #align with_top.preimage_coe_Iic WithTop.preimage_coe_Iic @[simp] theorem preimage_coe_Icc : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Icc a b = Icc a b := by simp [← Ici_inter_Iic] #align with_top.preimage_coe_Icc WithTop.preimage_coe_Icc @[simp] theorem preimage_coe_Ico : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Ico a b = Ico a b := by simp [← Ici_inter_Iio] #align with_top.preimage_coe_Ico WithTop.preimage_coe_Ico @[simp]
Mathlib/Order/Interval/Set/WithBotTop.lean
67
67
theorem preimage_coe_Ioc : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Ioc a b = Ioc a b := by
simp [← Ioi_inter_Iic]
[ " range some = Iio ⊀", " x ∈ range some ↔ x ∈ Iio ⊀", " some ⁻¹' Icc ↑a ↑b = Icc a b", " some ⁻¹' Ico ↑a ↑b = Ico a b", " some ⁻¹' Ioc ↑a ↑b = Ioc a b" ]
[ " range some = Iio ⊀", " x ∈ range some ↔ x ∈ Iio ⊀", " some ⁻¹' Icc ↑a ↑b = Icc a b", " some ⁻¹' Ico ↑a ↑b = Ico a b" ]
import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Data.Int.Cast.Defs import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f" universe u v w x variable {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w} {R : Type x} open Function class Distrib (R : Type*) extends Mul R, Add R where protected left_distrib : βˆ€ a b c : R, a * (b + c) = a * b + a * c protected right_distrib : βˆ€ a b c : R, (a + b) * c = a * c + b * c #align distrib Distrib class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected left_distrib : βˆ€ a b c : R, a * (b + c) = a * b + a * c #align left_distrib_class LeftDistribClass class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected right_distrib : βˆ€ a b c : R, (a + b) * c = a * c + b * c #align right_distrib_class RightDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R := ⟨Distrib.left_distrib⟩ #align distrib.left_distrib_class Distrib.leftDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] : RightDistribClass R := ⟨Distrib.right_distrib⟩ #align distrib.right_distrib_class Distrib.rightDistribClass theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) : a * (b + c) = a * b + a * c := LeftDistribClass.left_distrib a b c #align left_distrib left_distrib alias mul_add := left_distrib #align mul_add mul_add theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) : (a + b) * c = a * c + b * c := RightDistribClass.right_distrib a b c #align right_distrib right_distrib alias add_mul := right_distrib #align add_mul add_mul theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) : (a + b + c) * d = a * d + b * d + c * d := by simp [right_distrib] #align distrib_three_right distrib_three_right class NonUnitalNonAssocSemiring (Ξ± : Type u) extends AddCommMonoid Ξ±, Distrib Ξ±, MulZeroClass Ξ± #align non_unital_non_assoc_semiring NonUnitalNonAssocSemiring class NonUnitalSemiring (Ξ± : Type u) extends NonUnitalNonAssocSemiring Ξ±, SemigroupWithZero Ξ± #align non_unital_semiring NonUnitalSemiring class NonAssocSemiring (Ξ± : Type u) extends NonUnitalNonAssocSemiring Ξ±, MulZeroOneClass Ξ±, AddCommMonoidWithOne Ξ± #align non_assoc_semiring NonAssocSemiring class NonUnitalNonAssocRing (Ξ± : Type u) extends AddCommGroup Ξ±, NonUnitalNonAssocSemiring Ξ± #align non_unital_non_assoc_ring NonUnitalNonAssocRing class NonUnitalRing (Ξ± : Type*) extends NonUnitalNonAssocRing Ξ±, NonUnitalSemiring Ξ± #align non_unital_ring NonUnitalRing class NonAssocRing (Ξ± : Type*) extends NonUnitalNonAssocRing Ξ±, NonAssocSemiring Ξ±, AddCommGroupWithOne Ξ± #align non_assoc_ring NonAssocRing class Semiring (Ξ± : Type u) extends NonUnitalSemiring Ξ±, NonAssocSemiring Ξ±, MonoidWithZero Ξ± #align semiring Semiring class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R #align ring Ring @[to_additive] theorem mul_ite {Ξ±} [Mul Ξ±] (P : Prop) [Decidable P] (a b c : Ξ±) : (a * if P then b else c) = if P then a * b else a * c := by split_ifs <;> rfl #align mul_ite mul_ite #align add_ite add_ite @[to_additive] theorem ite_mul {Ξ±} [Mul Ξ±] (P : Prop) [Decidable P] (a b c : Ξ±) : (if P then a else b) * c = if P then a * c else b * c := by split_ifs <;> rfl #align ite_mul ite_mul #align ite_add ite_add -- We make `mul_ite` and `ite_mul` simp lemmas, -- but not `add_ite` or `ite_add`. -- The problem we're trying to avoid is dealing with -- summations of the form `βˆ‘ x ∈ s, (f x + ite P 1 0)`, -- in which `add_ite` followed by `sum_ite` would needlessly slice up -- the `f x` terms according to whether `P` holds at `x`. -- There doesn't appear to be a corresponding difficulty so far with -- `mul_ite` and `ite_mul`. attribute [simp] mul_ite ite_mul theorem ite_sub_ite {Ξ±} [Sub Ξ±] (P : Prop) [Decidable P] (a b c d : Ξ±) : ((if P then a else b) - if P then c else d) = if P then a - c else b - d := by split repeat rfl theorem ite_add_ite {Ξ±} [Add Ξ±] (P : Prop) [Decidable P] (a b c d : Ξ±) : ((if P then a else b) + if P then c else d) = if P then a + c else b + d := by split repeat rfl -- Porting note: no @[simp] because simp proves it
Mathlib/Algebra/Ring/Defs.lean
244
245
theorem mul_boole {Ξ±} [MulZeroOneClass Ξ±] (P : Prop) [Decidable P] (a : Ξ±) : (a * if P then 1 else 0) = if P then a else 0 := by
simp
[]
[]
import Mathlib.Data.Fintype.Basic #align_import data.fintype.quotient from "leanprover-community/mathlib"@"d78597269638367c3863d40d45108f52207e03cf" def Quotient.finChoiceAux {ΞΉ : Type*} [DecidableEq ΞΉ] {Ξ± : ΞΉ β†’ Type*} [S : βˆ€ i, Setoid (Ξ± i)] : βˆ€ l : List ΞΉ, (βˆ€ i ∈ l, Quotient (S i)) β†’ @Quotient (βˆ€ i ∈ l, Ξ± i) (by infer_instance) | [], _ => ⟦fun i h => nomatch List.not_mem_nil _ h⟧ | i :: l, f => by refine Quotient.liftOnβ‚‚ (f i (List.mem_cons_self _ _)) (Quotient.finChoiceAux l fun j h => f j (List.mem_cons_of_mem _ h)) ?_ ?_ Β· exact fun a l => ⟦fun j h => if e : j = i then by rw [e]; exact a else l _ ((List.mem_cons.1 h).resolve_left e)⟧ refine fun a₁ l₁ aβ‚‚ lβ‚‚ h₁ hβ‚‚ => Quotient.sound fun j h => ?_ by_cases e : j = i <;> simp [e] Β· subst j exact h₁ Β· exact hβ‚‚ _ _ #align quotient.fin_choice_aux Quotient.finChoiceAux theorem Quotient.finChoiceAux_eq {ΞΉ : Type*} [DecidableEq ΞΉ] {Ξ± : ΞΉ β†’ Type*} [S : βˆ€ i, Setoid (Ξ± i)] : βˆ€ (l : List ΞΉ) (f : βˆ€ i ∈ l, Ξ± i), (Quotient.finChoiceAux l fun i h => ⟦f i h⟧) = ⟦f⟧ | [], f => Quotient.sound fun i h => nomatch List.not_mem_nil _ h | i :: l, f => by simp only [finChoiceAux, Quotient.finChoiceAux_eq l, eq_mpr_eq_cast, lift_mk] refine Quotient.sound fun j h => ?_ by_cases e : j = i <;> simp [e] <;> try exact Setoid.refl _ subst j; exact Setoid.refl _ #align quotient.fin_choice_aux_eq Quotient.finChoiceAux_eq def Quotient.finChoice {ΞΉ : Type*} [DecidableEq ΞΉ] [Fintype ΞΉ] {Ξ± : ΞΉ β†’ Type*} [S : βˆ€ i, Setoid (Ξ± i)] (f : βˆ€ i, Quotient (S i)) : @Quotient (βˆ€ i, Ξ± i) (by infer_instance) := Quotient.liftOn (@Quotient.recOn _ _ (fun l : Multiset ΞΉ => @Quotient (βˆ€ i ∈ l, Ξ± i) (by infer_instance)) Finset.univ.1 (fun l => Quotient.finChoiceAux l fun i _ => f i) (fun a b h => by have := fun a => Quotient.finChoiceAux_eq a fun i _ => Quotient.out (f i) simp? [Quotient.out_eq] at this says simp only [out_eq] at this simp only [Multiset.quot_mk_to_coe, this] let g := fun a : Multiset ΞΉ => (⟦fun (i : ΞΉ) (_ : i ∈ a) => Quotient.out (f i)⟧ : Quotient (by infer_instance)) apply eq_of_heq trans (g a) Β· exact eq_rec_heq (Ο† := fun l : Multiset ΞΉ => @Quotient (βˆ€ i ∈ l, Ξ± i) (by infer_instance)) (Quotient.sound h) (g a) Β· change HEq (g a) (g b); congr 1; exact Quotient.sound h)) (fun f => ⟦fun i => f i (Finset.mem_univ _)⟧) (fun a b h => Quotient.sound fun i => by apply h) #align quotient.fin_choice Quotient.finChoice
Mathlib/Data/Fintype/Quotient.lean
76
84
theorem Quotient.finChoice_eq {ΞΉ : Type*} [DecidableEq ΞΉ] [Fintype ΞΉ] {Ξ± : ΞΉ β†’ Type*} [βˆ€ i, Setoid (Ξ± i)] (f : βˆ€ i, Ξ± i) : (Quotient.finChoice fun i => ⟦f i⟧) = ⟦f⟧ := by
dsimp only [Quotient.finChoice] conv_lhs => enter [1] tactic => change _ = ⟦fun i _ => f i⟧ exact Quotient.inductionOn (@Finset.univ ι _).1 fun l => Quotient.finChoiceAux_eq _ _ rfl
[ " Setoid ((i : ΞΉ) β†’ i ∈ l β†’ Ξ± i)", " Quotient inferInstance", " Ξ± i β†’ ((i : ΞΉ) β†’ i ∈ l β†’ Ξ± i) β†’ Quotient inferInstance", " Ξ± j", " Ξ± i", " βˆ€ (a₁ : Ξ± i) (b₁ : (i : ΞΉ) β†’ i ∈ l β†’ Ξ± i) (aβ‚‚ : Ξ± i) (bβ‚‚ : (i : ΞΉ) β†’ i ∈ l β†’ Ξ± i),\n a₁ β‰ˆ aβ‚‚ β†’\n b₁ β‰ˆ bβ‚‚ β†’\n ⟦fun j h => if e : j = i then β‹―.mpr a₁ else...
[ " Setoid ((i : ΞΉ) β†’ i ∈ l β†’ Ξ± i)", " Quotient inferInstance", " Ξ± i β†’ ((i : ΞΉ) β†’ i ∈ l β†’ Ξ± i) β†’ Quotient inferInstance", " Ξ± j", " Ξ± i", " βˆ€ (a₁ : Ξ± i) (b₁ : (i : ΞΉ) β†’ i ∈ l β†’ Ξ± i) (aβ‚‚ : Ξ± i) (bβ‚‚ : (i : ΞΉ) β†’ i ∈ l β†’ Ξ± i),\n a₁ β‰ˆ aβ‚‚ β†’\n b₁ β‰ˆ bβ‚‚ β†’\n ⟦fun j h => if e : j = i then β‹―.mpr a₁ else...
import Mathlib.LinearAlgebra.Finsupp import Mathlib.Algebra.MonoidAlgebra.Support import Mathlib.Algebra.DirectSum.Internal import Mathlib.RingTheory.GradedAlgebra.Basic #align_import algebra.monoid_algebra.grading from "leanprover-community/mathlib"@"feb99064803fd3108e37c18b0f77d0a8344677a3" noncomputable section namespace AddMonoidAlgebra variable {M : Type*} {ΞΉ : Type*} {R : Type*} section variable (R) [CommSemiring R] abbrev gradeBy (f : M β†’ ΞΉ) (i : ΞΉ) : Submodule R R[M] where carrier := { a | βˆ€ m, m ∈ a.support β†’ f m = i } zero_mem' m h := by cases h add_mem' {a b} ha hb m h := by classical exact (Finset.mem_union.mp (Finsupp.support_add h)).elim (ha m) (hb m) smul_mem' a m h := Set.Subset.trans Finsupp.support_smul h #align add_monoid_algebra.grade_by AddMonoidAlgebra.gradeBy abbrev grade (m : M) : Submodule R R[M] := gradeBy R id m #align add_monoid_algebra.grade AddMonoidAlgebra.grade theorem gradeBy_id : gradeBy R (id : M β†’ M) = grade R := rfl #align add_monoid_algebra.grade_by_id AddMonoidAlgebra.gradeBy_id theorem mem_gradeBy_iff (f : M β†’ ΞΉ) (i : ΞΉ) (a : R[M]) : a ∈ gradeBy R f i ↔ (a.support : Set M) βŠ† f ⁻¹' {i} := by rfl #align add_monoid_algebra.mem_grade_by_iff AddMonoidAlgebra.mem_gradeBy_iff theorem mem_grade_iff (m : M) (a : R[M]) : a ∈ grade R m ↔ a.support βŠ† {m} := by rw [← Finset.coe_subset, Finset.coe_singleton] rfl #align add_monoid_algebra.mem_grade_iff AddMonoidAlgebra.mem_grade_iff
Mathlib/Algebra/MonoidAlgebra/Grading.lean
72
78
theorem mem_grade_iff' (m : M) (a : R[M]) : a ∈ grade R m ↔ a ∈ (LinearMap.range (Finsupp.lsingle m : R β†’β‚—[R] M β†’β‚€ R) : Submodule R R[M]) := by
rw [mem_grade_iff, Finsupp.support_subset_singleton'] apply exists_congr intro r constructor <;> exact Eq.symm
[ " f m = i", " a ∈ gradeBy R f i ↔ ↑a.support βŠ† f ⁻¹' {i}", " a ∈ grade R m ↔ a.support βŠ† {m}", " a ∈ grade R m ↔ ↑a.support βŠ† {m}", " a ∈ grade R m ↔ a ∈ LinearMap.range (Finsupp.lsingle m)", " (βˆƒ b, a = Finsupp.single m b) ↔ a ∈ LinearMap.range (Finsupp.lsingle m)", " βˆ€ (a_1 : R), a = Finsupp.single m ...
[ " f m = i", " a ∈ gradeBy R f i ↔ ↑a.support βŠ† f ⁻¹' {i}", " a ∈ grade R m ↔ a.support βŠ† {m}", " a ∈ grade R m ↔ ↑a.support βŠ† {m}" ]
import Mathlib.Algebra.CharP.ExpChar import Mathlib.GroupTheory.OrderOfElement #align_import algebra.char_p.two from "leanprover-community/mathlib"@"7f1ba1a333d66eed531ecb4092493cd1b6715450" variable {R ΞΉ : Type*} namespace CharTwo section Semiring variable [Semiring R] [CharP R 2] theorem two_eq_zero : (2 : R) = 0 := by rw [← Nat.cast_two, CharP.cast_eq_zero] #align char_two.two_eq_zero CharTwo.two_eq_zero @[simp] theorem add_self_eq_zero (x : R) : x + x = 0 := by rw [← two_smul R x, two_eq_zero, zero_smul] #align char_two.add_self_eq_zero CharTwo.add_self_eq_zero set_option linter.deprecated false in @[simp] theorem bit0_eq_zero : (bit0 : R β†’ R) = 0 := by funext exact add_self_eq_zero _ #align char_two.bit0_eq_zero CharTwo.bit0_eq_zero set_option linter.deprecated false in
Mathlib/Algebra/CharP/Two.lean
44
44
theorem bit0_apply_eq_zero (x : R) : (bit0 x : R) = 0 := by
simp
[ " 2 = 0", " x + x = 0", " bit0 = 0", " bit0 x✝ = 0 x✝", " bit0 x = 0" ]
[ " 2 = 0", " x + x = 0", " bit0 = 0", " bit0 x✝ = 0 x✝" ]
import Mathlib.Algebra.ContinuedFractions.Computation.ApproximationCorollaries import Mathlib.Algebra.ContinuedFractions.Computation.Translations import Mathlib.Data.Real.Irrational import Mathlib.RingTheory.Coprime.Lemmas import Mathlib.Tactic.Basic #align_import number_theory.diophantine_approximation from "leanprover-community/mathlib"@"e25a317463bd37d88e33da164465d8c47922b1cd" namespace Real section Dirichlet open Finset Int theorem exists_int_int_abs_mul_sub_le (ΞΎ : ℝ) {n : β„•} (n_pos : 0 < n) : βˆƒ j k : β„€, 0 < k ∧ k ≀ n ∧ |↑k * ΞΎ - j| ≀ 1 / (n + 1) := by let f : β„€ β†’ β„€ := fun m => ⌊fract (ΞΎ * m) * (n + 1)βŒ‹ have hn : 0 < (n : ℝ) + 1 := mod_cast Nat.succ_pos _ have hfu := fun m : β„€ => mul_lt_of_lt_one_left hn <| fract_lt_one (ΞΎ * ↑m) conv in |_| ≀ _ => rw [mul_comm, le_div_iff hn, ← abs_of_pos hn, ← abs_mul] let D := Icc (0 : β„€) n by_cases H : βˆƒ m ∈ D, f m = n Β· obtain ⟨m, hm, hf⟩ := H have hf' : ((n : β„€) : ℝ) ≀ fract (ΞΎ * m) * (n + 1) := hf β–Έ floor_le (fract (ΞΎ * m) * (n + 1)) have hmβ‚€ : 0 < m := by have hfβ‚€ : f 0 = 0 := by -- Porting note: was -- simp only [floor_eq_zero_iff, algebraMap.coe_zero, mul_zero, fract_zero, -- zero_mul, Set.left_mem_Ico, zero_lt_one] simp only [f, cast_zero, mul_zero, fract_zero, zero_mul, floor_zero] refine Ne.lt_of_le (fun h => n_pos.ne ?_) (mem_Icc.mp hm).1 exact mod_cast hfβ‚€.symm.trans (h.symm β–Έ hf : f 0 = n) refine ⟨⌊ξ * mβŒ‹ + 1, m, hmβ‚€, (mem_Icc.mp hm).2, ?_⟩ rw [cast_add, ← sub_sub, sub_mul, cast_one, one_mul, abs_le] refine ⟨le_sub_iff_add_le.mpr ?_, sub_le_iff_le_add.mpr <| le_of_lt <| (hfu m).trans <| lt_one_add _⟩ simpa only [neg_add_cancel_comm_assoc] using hf' Β· -- Porting note(https://github.com/leanprover-community/mathlib4/issues/5127): added `not_and` simp_rw [not_exists, not_and] at H have hD : (Ico (0 : β„€) n).card < D.card := by rw [card_Icc, card_Ico]; exact lt_add_one n have hfu' : βˆ€ m, f m ≀ n := fun m => lt_add_one_iff.mp (floor_lt.mpr (mod_cast hfu m)) have hwd : βˆ€ m : β„€, m ∈ D β†’ f m ∈ Ico (0 : β„€) n := fun x hx => mem_Ico.mpr ⟨floor_nonneg.mpr (mul_nonneg (fract_nonneg (ΞΎ * x)) hn.le), Ne.lt_of_le (H x hx) (hfu' x)⟩ obtain ⟨x, hx, y, hy, x_lt_y, hxy⟩ : βˆƒ x ∈ D, βˆƒ y ∈ D, x < y ∧ f x = f y := by obtain ⟨x, hx, y, hy, x_ne_y, hxy⟩ := exists_ne_map_eq_of_card_lt_of_maps_to hD hwd rcases lt_trichotomy x y with (h | h | h) exacts [⟨x, hx, y, hy, h, hxy⟩, False.elim (x_ne_y h), ⟨y, hy, x, hx, h, hxy.symm⟩] refine ⟨⌊ξ * yβŒ‹ - ⌊ξ * xβŒ‹, y - x, sub_pos_of_lt x_lt_y, sub_le_iff_le_add.mpr <| le_add_of_le_of_nonneg (mem_Icc.mp hy).2 (mem_Icc.mp hx).1, ?_⟩ convert_to |fract (ΞΎ * y) * (n + 1) - fract (ΞΎ * x) * (n + 1)| ≀ 1 Β· congr; push_cast; simp only [fract]; ring exact (abs_sub_lt_one_of_floor_eq_floor hxy.symm).le #align real.exists_int_int_abs_mul_sub_le Real.exists_int_int_abs_mul_sub_le
Mathlib/NumberTheory/DiophantineApproximation.lean
139
144
theorem exists_nat_abs_mul_sub_round_le (ΞΎ : ℝ) {n : β„•} (n_pos : 0 < n) : βˆƒ k : β„•, 0 < k ∧ k ≀ n ∧ |↑k * ΞΎ - round (↑k * ΞΎ)| ≀ 1 / (n + 1) := by
obtain ⟨j, k, hkβ‚€, hk₁, h⟩ := exists_int_int_abs_mul_sub_le ΞΎ n_pos have hk := toNat_of_nonneg hkβ‚€.le rw [← hk] at hkβ‚€ hk₁ h exact ⟨k.toNat, natCast_pos.mp hkβ‚€, Nat.cast_le.mp hk₁, (round_le (↑k.toNat * ΞΎ) j).trans h⟩
[ " βˆƒ j k, 0 < k ∧ k ≀ ↑n ∧ |↑k * ΞΎ - ↑j| ≀ 1 / (↑n + 1)", "ΞΎ : ℝ\nn : β„•\nn_pos : 0 < n\nf : β„€ β†’ β„€ := fun m => ⌊fract (ΞΎ * ↑m) * (↑n + 1)βŒ‹\nhn : 0 < ↑n + 1\nhfu : βˆ€ (m : β„€), fract (ΞΎ * ↑m) * (↑n + 1) < ↑n + 1\nj k : β„€\n| |↑k * ΞΎ - ↑j| ≀ 1 / (↑n + 1)", " βˆƒ j k, 0 < k ∧ k ≀ ↑n ∧ |(ΞΎ * ↑k - ↑j) * (↑n + 1)| ≀ 1", "...
[ " βˆƒ j k, 0 < k ∧ k ≀ ↑n ∧ |↑k * ΞΎ - ↑j| ≀ 1 / (↑n + 1)", "ΞΎ : ℝ\nn : β„•\nn_pos : 0 < n\nf : β„€ β†’ β„€ := fun m => ⌊fract (ΞΎ * ↑m) * (↑n + 1)βŒ‹\nhn : 0 < ↑n + 1\nhfu : βˆ€ (m : β„€), fract (ΞΎ * ↑m) * (↑n + 1) < ↑n + 1\nj k : β„€\n| |↑k * ΞΎ - ↑j| ≀ 1 / (↑n + 1)", " βˆƒ j k, 0 < k ∧ k ≀ ↑n ∧ |(ΞΎ * ↑k - ↑j) * (↑n + 1)| ≀ 1", "...
import Mathlib.Topology.PartialHomeomorph import Mathlib.Analysis.Normed.Group.AddTorsor import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Data.Real.Sqrt #align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Set Metric Pointwise variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] noncomputable section @[simps (config := .lemmasOnly)] def PartialHomeomorph.univUnitBall : PartialHomeomorph E E where toFun x := (√(1 + β€–xβ€– ^ 2))⁻¹ β€’ x invFun y := (√(1 - β€–(y : E)β€– ^ 2))⁻¹ β€’ (y : E) source := univ target := ball 0 1 map_source' x _ := by have : 0 < 1 + β€–xβ€– ^ 2 := by positivity rw [mem_ball_zero_iff, norm_smul, Real.norm_eq_abs, abs_inv, ← _root_.div_eq_inv_mul, div_lt_one (abs_pos.mpr <| Real.sqrt_ne_zero'.mpr this), ← abs_norm x, ← sq_lt_sq, abs_norm, Real.sq_sqrt this.le] exact lt_one_add _ map_target' _ _ := trivial left_inv' x _ := by field_simp [norm_smul, smul_smul, (zero_lt_one_add_norm_sq x).ne', sq_abs, Real.sq_sqrt (zero_lt_one_add_norm_sq x).le, ← Real.sqrt_div (zero_lt_one_add_norm_sq x).le] right_inv' y hy := by have : 0 < 1 - β€–yβ€– ^ 2 := by nlinarith [norm_nonneg y, mem_ball_zero_iff.1 hy] field_simp [norm_smul, smul_smul, this.ne', sq_abs, Real.sq_sqrt this.le, ← Real.sqrt_div this.le] open_source := isOpen_univ open_target := isOpen_ball continuousOn_toFun := by suffices Continuous fun (x:E) => (√(1 + β€–xβ€– ^ 2))⁻¹ from (this.smul continuous_id).continuousOn refine Continuous.invβ‚€ ?_ fun x => Real.sqrt_ne_zero'.mpr (by positivity) continuity continuousOn_invFun := by have : βˆ€ y ∈ ball (0 : E) 1, √(1 - β€–(y : E)β€– ^ 2) β‰  0 := fun y hy ↦ by rw [Real.sqrt_ne_zero'] nlinarith [norm_nonneg y, mem_ball_zero_iff.1 hy] exact ContinuousOn.smul (ContinuousOn.invβ‚€ (continuousOn_const.sub (continuous_norm.continuousOn.pow _)).sqrt this) continuousOn_id @[simp]
Mathlib/Analysis/NormedSpace/HomeomorphBall.lean
77
78
theorem PartialHomeomorph.univUnitBall_apply_zero : univUnitBall (0 : E) = 0 := by
simp [PartialHomeomorph.univUnitBall_apply]
[ " (fun x => (√(1 + β€–xβ€– ^ 2))⁻¹ β€’ x) x ∈ ball 0 1", " 0 < 1 + β€–xβ€– ^ 2", " β€–xβ€– ^ 2 < 1 + β€–xβ€– ^ 2", " (fun y => (√(1 - β€–yβ€– ^ 2))⁻¹ β€’ y) ((fun x => (√(1 + β€–xβ€– ^ 2))⁻¹ β€’ x) x) = x", " (fun x => (√(1 + β€–xβ€– ^ 2))⁻¹ β€’ x) ((fun y => (√(1 - β€–yβ€– ^ 2))⁻¹ β€’ y) y) = y", " 0 < 1 - β€–yβ€– ^ 2", " ContinuousOn\n ↑{ toFu...
[ " (fun x => (√(1 + β€–xβ€– ^ 2))⁻¹ β€’ x) x ∈ ball 0 1", " 0 < 1 + β€–xβ€– ^ 2", " β€–xβ€– ^ 2 < 1 + β€–xβ€– ^ 2", " (fun y => (√(1 - β€–yβ€– ^ 2))⁻¹ β€’ y) ((fun x => (√(1 + β€–xβ€– ^ 2))⁻¹ β€’ x) x) = x", " (fun x => (√(1 + β€–xβ€– ^ 2))⁻¹ β€’ x) ((fun y => (√(1 - β€–yβ€– ^ 2))⁻¹ β€’ y) y) = y", " 0 < 1 - β€–yβ€– ^ 2", " ContinuousOn\n ↑{ toFu...
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
Mathlib/Topology/Algebra/Order/Field.lean
79
82
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
[ " 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 Γ—Λ’ οΏ½...
[ " 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.Topology.Algebra.InfiniteSum.Order import Mathlib.Topology.Algebra.InfiniteSum.Ring import Mathlib.Topology.Instances.Real import Mathlib.Topology.MetricSpace.Isometry #align_import topology.instances.nnreal from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" noncomputable section open Set TopologicalSpace Metric Filter open Topology namespace NNReal open NNReal Filter instance : TopologicalSpace ℝβ‰₯0 := inferInstance -- short-circuit type class inference instance : TopologicalSemiring ℝβ‰₯0 where toContinuousAdd := continuousAdd_induced toRealHom toContinuousMul := continuousMul_induced toRealHom instance : SecondCountableTopology ℝβ‰₯0 := inferInstanceAs (SecondCountableTopology { x : ℝ | 0 ≀ x }) instance : OrderTopology ℝβ‰₯0 := orderTopology_of_ordConnected (t := Ici 0) instance : CompleteSpace ℝβ‰₯0 := isClosed_Ici.completeSpace_coe instance : ContinuousStar ℝβ‰₯0 where continuous_star := continuous_id section coe variable {Ξ± : Type*} open Filter Finset theorem _root_.continuous_real_toNNReal : Continuous Real.toNNReal := (continuous_id.max continuous_const).subtype_mk _ #align continuous_real_to_nnreal continuous_real_toNNReal @[simps (config := .asFn)] noncomputable def _root_.ContinuousMap.realToNNReal : C(ℝ, ℝβ‰₯0) := .mk Real.toNNReal continuous_real_toNNReal theorem continuous_coe : Continuous ((↑) : ℝβ‰₯0 β†’ ℝ) := continuous_subtype_val #align nnreal.continuous_coe NNReal.continuous_coe @[simps (config := .asFn)] def _root_.ContinuousMap.coeNNRealReal : C(ℝβ‰₯0, ℝ) := ⟨(↑), continuous_coe⟩ #align continuous_map.coe_nnreal_real ContinuousMap.coeNNRealReal #align continuous_map.coe_nnreal_real_apply ContinuousMap.coeNNRealReal_apply instance ContinuousMap.canLift {X : Type*} [TopologicalSpace X] : CanLift C(X, ℝ) C(X, ℝβ‰₯0) ContinuousMap.coeNNRealReal.comp fun f => βˆ€ x, 0 ≀ f x where prf f hf := ⟨⟨fun x => ⟨f x, hf x⟩, f.2.subtype_mk _⟩, DFunLike.ext' rfl⟩ #align nnreal.continuous_map.can_lift NNReal.ContinuousMap.canLift @[simp, norm_cast] theorem tendsto_coe {f : Filter Ξ±} {m : Ξ± β†’ ℝβ‰₯0} {x : ℝβ‰₯0} : Tendsto (fun a => (m a : ℝ)) f (𝓝 (x : ℝ)) ↔ Tendsto m f (𝓝 x) := tendsto_subtype_rng.symm #align nnreal.tendsto_coe NNReal.tendsto_coe theorem tendsto_coe' {f : Filter Ξ±} [NeBot f] {m : Ξ± β†’ ℝβ‰₯0} {x : ℝ} : Tendsto (fun a => m a : Ξ± β†’ ℝ) f (𝓝 x) ↔ βˆƒ hx : 0 ≀ x, Tendsto m f (𝓝 ⟨x, hx⟩) := ⟨fun h => ⟨ge_of_tendsto' h fun c => (m c).2, tendsto_coe.1 h⟩, fun ⟨_, hm⟩ => tendsto_coe.2 hm⟩ #align nnreal.tendsto_coe' NNReal.tendsto_coe' @[simp] theorem map_coe_atTop : map toReal atTop = atTop := map_val_Ici_atTop 0 #align nnreal.map_coe_at_top NNReal.map_coe_atTop theorem comap_coe_atTop : comap toReal atTop = atTop := (atTop_Ici_eq 0).symm #align nnreal.comap_coe_at_top NNReal.comap_coe_atTop @[simp, norm_cast] theorem tendsto_coe_atTop {f : Filter Ξ±} {m : Ξ± β†’ ℝβ‰₯0} : Tendsto (fun a => (m a : ℝ)) f atTop ↔ Tendsto m f atTop := tendsto_Ici_atTop.symm #align nnreal.tendsto_coe_at_top NNReal.tendsto_coe_atTop theorem _root_.tendsto_real_toNNReal {f : Filter Ξ±} {m : Ξ± β†’ ℝ} {x : ℝ} (h : Tendsto m f (𝓝 x)) : Tendsto (fun a => Real.toNNReal (m a)) f (𝓝 (Real.toNNReal x)) := (continuous_real_toNNReal.tendsto _).comp h #align tendsto_real_to_nnreal tendsto_real_toNNReal theorem _root_.tendsto_real_toNNReal_atTop : Tendsto Real.toNNReal atTop atTop := by rw [← tendsto_coe_atTop] exact tendsto_atTop_mono Real.le_coe_toNNReal tendsto_id #align tendsto_real_to_nnreal_at_top tendsto_real_toNNReal_atTop theorem nhds_zero : 𝓝 (0 : ℝβ‰₯0) = β¨… (a : ℝβ‰₯0) (_ : a β‰  0), π“Ÿ (Iio a) := nhds_bot_order.trans <| by simp only [bot_lt_iff_ne_bot]; rfl #align nnreal.nhds_zero NNReal.nhds_zero theorem nhds_zero_basis : (𝓝 (0 : ℝβ‰₯0)).HasBasis (fun a : ℝβ‰₯0 => 0 < a) fun a => Iio a := nhds_bot_basis #align nnreal.nhds_zero_basis NNReal.nhds_zero_basis instance : ContinuousSub ℝβ‰₯0 := ⟨((continuous_coe.fst'.sub continuous_coe.snd').max continuous_const).subtype_mk _⟩ instance : HasContinuousInvβ‚€ ℝβ‰₯0 := inferInstance instance [TopologicalSpace Ξ±] [MulAction ℝ Ξ±] [ContinuousSMul ℝ Ξ±] : ContinuousSMul ℝβ‰₯0 Ξ± where continuous_smul := continuous_induced_dom.fst'.smul continuous_snd @[norm_cast]
Mathlib/Topology/Instances/NNReal.lean
163
164
theorem hasSum_coe {f : Ξ± β†’ ℝβ‰₯0} {r : ℝβ‰₯0} : HasSum (fun a => (f a : ℝ)) (r : ℝ) ↔ HasSum f r := by
simp only [HasSum, ← coe_sum, tendsto_coe]
[ " Tendsto Real.toNNReal atTop atTop", " Tendsto (fun a => ↑a.toNNReal) atTop atTop", " β¨… l, β¨… (_ : βŠ₯ < l), π“Ÿ (Set.Iio l) = β¨… a, β¨… (_ : a β‰  0), π“Ÿ (Set.Iio a)", " β¨… l, β¨… (_ : l β‰  βŠ₯), π“Ÿ (Set.Iio l) = β¨… a, β¨… (_ : a β‰  0), π“Ÿ (Set.Iio a)", " HasSum (fun a => ↑(f a)) ↑r ↔ HasSum f r" ]
[ " Tendsto Real.toNNReal atTop atTop", " Tendsto (fun a => ↑a.toNNReal) atTop atTop", " β¨… l, β¨… (_ : βŠ₯ < l), π“Ÿ (Set.Iio l) = β¨… a, β¨… (_ : a β‰  0), π“Ÿ (Set.Iio a)", " β¨… l, β¨… (_ : l β‰  βŠ₯), π“Ÿ (Set.Iio l) = β¨… a, β¨… (_ : a β‰  0), π“Ÿ (Set.Iio a)" ]
import Mathlib.Data.Set.Prod #align_import data.set.n_ary from "leanprover-community/mathlib"@"5e526d18cea33550268dcbbddcb822d5cde40654" open Function namespace Set variable {Ξ± Ξ±' Ξ² Ξ²' Ξ³ Ξ³' Ξ΄ Ξ΄' Ξ΅ Ξ΅' ΞΆ ΞΆ' Ξ½ : Type*} {f f' : Ξ± β†’ Ξ² β†’ Ξ³} {g g' : Ξ± β†’ Ξ² β†’ Ξ³ β†’ Ξ΄} variable {s s' : Set Ξ±} {t t' : Set Ξ²} {u u' : Set Ξ³} {v : Set Ξ΄} {a a' : Ξ±} {b b' : Ξ²} {c c' : Ξ³} {d d' : Ξ΄} theorem mem_image2_iff (hf : Injective2 f) : f a b ∈ image2 f s t ↔ a ∈ s ∧ b ∈ t := ⟨by rintro ⟨a', ha', b', hb', h⟩ rcases hf h with ⟨rfl, rfl⟩ exact ⟨ha', hb'⟩, fun ⟨ha, hb⟩ => mem_image2_of_mem ha hb⟩ #align set.mem_image2_iff Set.mem_image2_iff theorem image2_subset (hs : s βŠ† s') (ht : t βŠ† t') : image2 f s t βŠ† image2 f s' t' := by rintro _ ⟨a, ha, b, hb, rfl⟩ exact mem_image2_of_mem (hs ha) (ht hb) #align set.image2_subset Set.image2_subset theorem image2_subset_left (ht : t βŠ† t') : image2 f s t βŠ† image2 f s t' := image2_subset Subset.rfl ht #align set.image2_subset_left Set.image2_subset_left theorem image2_subset_right (hs : s βŠ† s') : image2 f s t βŠ† image2 f s' t := image2_subset hs Subset.rfl #align set.image2_subset_right Set.image2_subset_right theorem image_subset_image2_left (hb : b ∈ t) : (fun a => f a b) '' s βŠ† image2 f s t := forall_mem_image.2 fun _ ha => mem_image2_of_mem ha hb #align set.image_subset_image2_left Set.image_subset_image2_left theorem image_subset_image2_right (ha : a ∈ s) : f a '' t βŠ† image2 f s t := forall_mem_image.2 fun _ => mem_image2_of_mem ha #align set.image_subset_image2_right Set.image_subset_image2_right theorem forall_image2_iff {p : Ξ³ β†’ Prop} : (βˆ€ z ∈ image2 f s t, p z) ↔ βˆ€ x ∈ s, βˆ€ y ∈ t, p (f x y) := ⟨fun h x hx y hy => h _ ⟨x, hx, y, hy, rfl⟩, fun h _ ⟨x, hx, y, hy, hz⟩ => hz β–Έ h x hx y hy⟩ #align set.forall_image2_iff Set.forall_image2_iff @[simp] theorem image2_subset_iff {u : Set Ξ³} : image2 f s t βŠ† u ↔ βˆ€ x ∈ s, βˆ€ y ∈ t, f x y ∈ u := forall_image2_iff #align set.image2_subset_iff Set.image2_subset_iff theorem image2_subset_iff_left : image2 f s t βŠ† u ↔ βˆ€ a ∈ s, (fun b => f a b) '' t βŠ† u := by simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage] #align set.image2_subset_iff_left Set.image2_subset_iff_left theorem image2_subset_iff_right : image2 f s t βŠ† u ↔ βˆ€ b ∈ t, (fun a => f a b) '' s βŠ† u := by simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage, @forallβ‚‚_swap Ξ±] #align set.image2_subset_iff_right Set.image2_subset_iff_right variable (f) -- Porting note: Removing `simp` - LHS does not simplify lemma image_prod : (fun x : Ξ± Γ— Ξ² ↦ f x.1 x.2) '' s Γ—Λ’ t = image2 f s t := ext fun _ ↦ by simp [and_assoc] #align set.image_prod Set.image_prod @[simp] lemma image_uncurry_prod (s : Set Ξ±) (t : Set Ξ²) : uncurry f '' s Γ—Λ’ t = image2 f s t := image_prod _ #align set.image_uncurry_prod Set.image_uncurry_prod @[simp] lemma image2_mk_eq_prod : image2 Prod.mk s t = s Γ—Λ’ t := ext <| by simp #align set.image2_mk_eq_prod Set.image2_mk_eq_prod -- Porting note: Removing `simp` - LHS does not simplify lemma image2_curry (f : Ξ± Γ— Ξ² β†’ Ξ³) (s : Set Ξ±) (t : Set Ξ²) : image2 (fun a b ↦ f (a, b)) s t = f '' s Γ—Λ’ t := by simp [← image_uncurry_prod, uncurry] #align set.image2_curry Set.image2_curry theorem image2_swap (s : Set Ξ±) (t : Set Ξ²) : image2 f s t = image2 (fun a b => f b a) t s := by ext constructor <;> rintro ⟨a, ha, b, hb, rfl⟩ <;> exact ⟨b, hb, a, ha, rfl⟩ #align set.image2_swap Set.image2_swap variable {f} theorem image2_union_left : image2 f (s βˆͺ s') t = image2 f s t βˆͺ image2 f s' t := by simp_rw [← image_prod, union_prod, image_union] #align set.image2_union_left Set.image2_union_left
Mathlib/Data/Set/NAry.lean
107
108
theorem image2_union_right : image2 f s (t βˆͺ t') = image2 f s t βˆͺ image2 f s t' := by
rw [← image2_swap, image2_union_left, image2_swap f, image2_swap f]
[ " f a b ∈ image2 f s t β†’ a ∈ s ∧ b ∈ t", " a ∈ s ∧ b ∈ t", " a' ∈ s ∧ b' ∈ t", " image2 f s t βŠ† image2 f s' t'", " f a b ∈ image2 f s' t'", " image2 f s t βŠ† u ↔ βˆ€ a ∈ s, (fun b => f a b) '' t βŠ† u", " image2 f s t βŠ† u ↔ βˆ€ b ∈ t, (fun a => f a b) '' s βŠ† u", " x✝ ∈ (fun x => f x.1 x.2) '' s Γ—Λ’ t ↔ x✝ ∈ i...
[ " f a b ∈ image2 f s t β†’ a ∈ s ∧ b ∈ t", " a ∈ s ∧ b ∈ t", " a' ∈ s ∧ b' ∈ t", " image2 f s t βŠ† image2 f s' t'", " f a b ∈ image2 f s' t'", " image2 f s t βŠ† u ↔ βˆ€ a ∈ s, (fun b => f a b) '' t βŠ† u", " image2 f s t βŠ† u ↔ βˆ€ b ∈ t, (fun a => f a b) '' s βŠ† u", " x✝ ∈ (fun x => f x.1 x.2) '' s Γ—Λ’ t ↔ x✝ ∈ i...
import Mathlib.Algebra.CharP.Two import Mathlib.Algebra.CharP.Reduced import Mathlib.Algebra.NeZero import Mathlib.Algebra.Polynomial.RingDivision import Mathlib.GroupTheory.SpecificGroups.Cyclic import Mathlib.NumberTheory.Divisors import Mathlib.RingTheory.IntegralDomain import Mathlib.Tactic.Zify #align_import ring_theory.roots_of_unity.basic from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f" open scoped Classical Polynomial noncomputable section open Polynomial open Finset variable {M N G R S F : Type*} variable [CommMonoid M] [CommMonoid N] [DivisionCommMonoid G] section rootsOfUnity variable {k l : β„•+} def rootsOfUnity (k : β„•+) (M : Type*) [CommMonoid M] : Subgroup MΛ£ where carrier := {ΞΆ | ΞΆ ^ (k : β„•) = 1} one_mem' := one_pow _ mul_mem' _ _ := by simp_all only [Set.mem_setOf_eq, mul_pow, one_mul] inv_mem' _ := by simp_all only [Set.mem_setOf_eq, inv_pow, inv_one] #align roots_of_unity rootsOfUnity @[simp] theorem mem_rootsOfUnity (k : β„•+) (ΞΆ : MΛ£) : ΞΆ ∈ rootsOfUnity k M ↔ ΞΆ ^ (k : β„•) = 1 := Iff.rfl #align mem_roots_of_unity mem_rootsOfUnity theorem mem_rootsOfUnity' (k : β„•+) (ΞΆ : MΛ£) : ΞΆ ∈ rootsOfUnity k M ↔ (ΞΆ : M) ^ (k : β„•) = 1 := by rw [mem_rootsOfUnity]; norm_cast #align mem_roots_of_unity' mem_rootsOfUnity' @[simp] theorem rootsOfUnity_one (M : Type*) [CommMonoid M] : rootsOfUnity 1 M = βŠ₯ := by ext; simp theorem rootsOfUnity.coe_injective {n : β„•+} : Function.Injective (fun x : rootsOfUnity n M ↦ x.val.val) := Units.ext.comp fun _ _ => Subtype.eq #align roots_of_unity.coe_injective rootsOfUnity.coe_injective @[simps! coe_val] def rootsOfUnity.mkOfPowEq (ΞΆ : M) {n : β„•+} (h : ΞΆ ^ (n : β„•) = 1) : rootsOfUnity n M := ⟨Units.ofPowEqOne ΞΆ n h n.ne_zero, Units.pow_ofPowEqOne _ _⟩ #align roots_of_unity.mk_of_pow_eq rootsOfUnity.mkOfPowEq #align roots_of_unity.mk_of_pow_eq_coe_coe rootsOfUnity.val_mkOfPowEq_coe @[simp] theorem rootsOfUnity.coe_mkOfPowEq {ΞΆ : M} {n : β„•+} (h : ΞΆ ^ (n : β„•) = 1) : ((rootsOfUnity.mkOfPowEq _ h : MΛ£) : M) = ΞΆ := rfl #align roots_of_unity.coe_mk_of_pow_eq rootsOfUnity.coe_mkOfPowEq theorem rootsOfUnity_le_of_dvd (h : k ∣ l) : rootsOfUnity k M ≀ rootsOfUnity l M := by obtain ⟨d, rfl⟩ := h intro ΞΆ h simp_all only [mem_rootsOfUnity, PNat.mul_coe, pow_mul, one_pow] #align roots_of_unity_le_of_dvd rootsOfUnity_le_of_dvd theorem map_rootsOfUnity (f : MΛ£ β†’* NΛ£) (k : β„•+) : (rootsOfUnity k M).map f ≀ rootsOfUnity k N := by rintro _ ⟨΢, h, rfl⟩ simp_all only [← map_pow, mem_rootsOfUnity, SetLike.mem_coe, MonoidHom.map_one] #align map_roots_of_unity map_rootsOfUnity @[norm_cast] theorem rootsOfUnity.coe_pow [CommMonoid R] (ΞΆ : rootsOfUnity k R) (m : β„•) : (((ΞΆ ^ m :) : RΛ£) : R) = ((ΞΆ : RΛ£) : R) ^ m := by rw [Subgroup.coe_pow, Units.val_pow_eq_pow_val] #align roots_of_unity.coe_pow rootsOfUnity.coe_pow section Reduced variable (R) [CommRing R] [IsReduced R] -- @[simp] -- Porting note: simp normal form is `mem_rootsOfUnity_prime_pow_mul_iff'`
Mathlib/RingTheory/RootsOfUnity/Basic.lean
268
271
theorem mem_rootsOfUnity_prime_pow_mul_iff (p k : β„•) (m : β„•+) [ExpChar R p] {ΞΆ : RΛ£} : ΞΆ ∈ rootsOfUnity (⟨p, expChar_pos R p⟩ ^ k * m) R ↔ ΞΆ ∈ rootsOfUnity m R := by
simp only [mem_rootsOfUnity', PNat.mul_coe, PNat.pow_coe, PNat.mk_coe, ExpChar.pow_prime_pow_mul_eq_one_iff]
[ " a✝ * b✝ ∈ {ΞΆ | ΞΆ ^ ↑k = 1}", " x✝¹⁻¹ ∈ { carrier := {ΞΆ | ΞΆ ^ ↑k = 1}, mul_mem' := β‹―, one_mem' := β‹― }.carrier", " ΞΆ ∈ rootsOfUnity k M ↔ ↑΢ ^ ↑k = 1", " ΞΆ ^ ↑k = 1 ↔ ↑΢ ^ ↑k = 1", " rootsOfUnity 1 M = βŠ₯", " x✝ ∈ rootsOfUnity 1 M ↔ x✝ ∈ βŠ₯", " rootsOfUnity k M ≀ rootsOfUnity l M", " rootsOfUnity k M ≀ ...
[ " a✝ * b✝ ∈ {ΞΆ | ΞΆ ^ ↑k = 1}", " x✝¹⁻¹ ∈ { carrier := {ΞΆ | ΞΆ ^ ↑k = 1}, mul_mem' := β‹―, one_mem' := β‹― }.carrier", " ΞΆ ∈ rootsOfUnity k M ↔ ↑΢ ^ ↑k = 1", " ΞΆ ^ ↑k = 1 ↔ ↑΢ ^ ↑k = 1", " rootsOfUnity 1 M = βŠ₯", " x✝ ∈ rootsOfUnity 1 M ↔ x✝ ∈ βŠ₯", " rootsOfUnity k M ≀ rootsOfUnity l M", " rootsOfUnity k M ≀ ...
import Mathlib.MeasureTheory.Decomposition.RadonNikodym import Mathlib.MeasureTheory.Measure.Haar.OfBasis import Mathlib.Probability.Independence.Basic #align_import probability.density from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520" open scoped Classical MeasureTheory NNReal ENNReal open TopologicalSpace MeasureTheory.Measure noncomputable section namespace MeasureTheory variable {Ξ© E : Type*} [MeasurableSpace E] class HasPDF {m : MeasurableSpace Ξ©} (X : Ξ© β†’ E) (β„™ : Measure Ξ©) (ΞΌ : Measure E := by volume_tac) : Prop where pdf' : AEMeasurable X β„™ ∧ (map X β„™).HaveLebesgueDecomposition ΞΌ ∧ map X β„™ β‰ͺ ΞΌ #align measure_theory.has_pdf MeasureTheory.HasPDF section HasPDF variable {_ : MeasurableSpace Ξ©} theorem hasPDF_iff {X : Ξ© β†’ E} {β„™ : Measure Ξ©} {ΞΌ : Measure E} : HasPDF X β„™ ΞΌ ↔ AEMeasurable X β„™ ∧ (map X β„™).HaveLebesgueDecomposition ΞΌ ∧ map X β„™ β‰ͺ ΞΌ := ⟨@HasPDF.pdf' _ _ _ _ _ _ _, HasPDF.mk⟩ #align measure_theory.pdf.has_pdf_iff MeasureTheory.hasPDF_iff
Mathlib/Probability/Density.lean
82
86
theorem hasPDF_iff_of_aemeasurable {X : Ξ© β†’ E} {β„™ : Measure Ξ©} {ΞΌ : Measure E} (hX : AEMeasurable X β„™) : HasPDF X β„™ ΞΌ ↔ (map X β„™).HaveLebesgueDecomposition ΞΌ ∧ map X β„™ β‰ͺ ΞΌ := by
rw [hasPDF_iff] simp only [hX, true_and]
[ " HasPDF X β„™ ΞΌ ↔ (map X β„™).HaveLebesgueDecomposition ΞΌ ∧ map X β„™ β‰ͺ ΞΌ", " AEMeasurable X β„™ ∧ (map X β„™).HaveLebesgueDecomposition ΞΌ ∧ map X β„™ β‰ͺ ΞΌ ↔\n (map X β„™).HaveLebesgueDecomposition ΞΌ ∧ map X β„™ β‰ͺ ΞΌ" ]
[]
import Mathlib.Probability.ProbabilityMassFunction.Constructions import Mathlib.Tactic.FinCases namespace PMF open ENNReal noncomputable def binomial (p : ℝβ‰₯0∞) (h : p ≀ 1) (n : β„•) : PMF (Fin (n + 1)) := .ofFintype (fun i => p^(i : β„•) * (1-p)^((Fin.last n - i) : β„•) * (n.choose i : β„•)) (by convert (add_pow p (1-p) n).symm Β· rw [Finset.sum_fin_eq_sum_range] apply Finset.sum_congr rfl intro i hi rw [Finset.mem_range] at hi rw [dif_pos hi, Fin.last] Β· simp [h]) theorem binomial_apply (p : ℝβ‰₯0∞) (h : p ≀ 1) (n : β„•) (i : Fin (n + 1)) : binomial p h n i = p^(i : β„•) * (1-p)^((Fin.last n - i) : β„•) * (n.choose i : β„•) := rfl @[simp]
Mathlib/Probability/ProbabilityMassFunction/Binomial.lean
40
42
theorem binomial_apply_zero (p : ℝβ‰₯0∞) (h : p ≀ 1) (n : β„•) : binomial p h n 0 = (1-p)^n := by
simp [binomial_apply]
[ " βˆ‘ a : Fin (n + 1), (fun i => p ^ ↑i * (1 - p) ^ (↑(Fin.last n) - ↑i) * ↑(n.choose ↑i)) a = 1", " βˆ‘ a : Fin (n + 1), (fun i => p ^ ↑i * (1 - p) ^ (↑(Fin.last n) - ↑i) * ↑(n.choose ↑i)) a =\n βˆ‘ m ∈ Finset.range (n + 1), p ^ m * (1 - p) ^ (n - m) * ↑(n.choose m)", " (βˆ‘ i ∈ Finset.range (n + 1),\n if h : ...
[ " βˆ‘ a : Fin (n + 1), (fun i => p ^ ↑i * (1 - p) ^ (↑(Fin.last n) - ↑i) * ↑(n.choose ↑i)) a = 1", " βˆ‘ a : Fin (n + 1), (fun i => p ^ ↑i * (1 - p) ^ (↑(Fin.last n) - ↑i) * ↑(n.choose ↑i)) a =\n βˆ‘ m ∈ Finset.range (n + 1), p ^ m * (1 - p) ^ (n - m) * ↑(n.choose m)", " (βˆ‘ i ∈ Finset.range (n + 1),\n if h : ...
import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" noncomputable section open RCLike Real Filter open scoped Classical Topology section DerivInner variable {π•œ E F : Type*} [RCLike π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] def fderivInnerCLM (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerCLM @[simp] theorem fderivInnerCLM_apply (p x : E Γ— E) : fderivInnerCLM π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerCLM_apply variable {π•œ} -- Porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerCLM π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerCLM π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerCLM π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner
Mathlib/Analysis/InnerProductSpace/Calculus.lean
115
118
theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by
simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ
[ " HasDerivWithinAt (fun t => βŸͺf t, g t⟫_π•œ) (βŸͺf x, g'⟫_π•œ + βŸͺf', g x⟫_π•œ) s x", " HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫_π•œ) (βŸͺf x, g'⟫_π•œ + βŸͺf', g x⟫_π•œ) x" ]
[ " HasDerivWithinAt (fun t => βŸͺf t, g t⟫_π•œ) (βŸͺf x, g'⟫_π•œ + βŸͺf', g x⟫_π•œ) s x" ]
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp]
Mathlib/Data/Real/Cardinality.lean
69
70
theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by
simp [cantorFunctionAux, h]
[ " cantorFunctionAux c f n = c ^ n", " cantorFunctionAux c f n = 0" ]
[ " cantorFunctionAux c f n = c ^ n" ]
import Mathlib.Analysis.Calculus.LineDeriv.Basic import Mathlib.Analysis.Calculus.FDeriv.Measurable open MeasureTheory variable {π•œ : Type*} [NontriviallyNormedField π•œ] [LocallyCompactSpace π•œ] {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] [MeasurableSpace E] [OpensMeasurableSpace E] {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] [CompleteSpace F] {f : E β†’ F} {v : E} theorem measurableSet_lineDifferentiableAt (hf : Continuous f) : MeasurableSet {x : E | LineDifferentiableAt π•œ f x v} := by borelize π•œ let g : E β†’ π•œ β†’ F := fun x t ↦ f (x + t β€’ v) have hg : Continuous g.uncurry := by apply hf.comp; continuity exact measurable_prod_mk_right (measurableSet_of_differentiableAt_with_param π•œ hg) theorem measurable_lineDeriv [MeasurableSpace F] [BorelSpace F] (hf : Continuous f) : Measurable (fun x ↦ lineDeriv π•œ f x v) := by borelize π•œ let g : E β†’ π•œ β†’ F := fun x t ↦ f (x + t β€’ v) have hg : Continuous g.uncurry := by apply hf.comp; continuity exact (measurable_deriv_with_param hg).comp measurable_prod_mk_right
Mathlib/Analysis/Calculus/LineDeriv/Measurable.lean
47
52
theorem stronglyMeasurable_lineDeriv [SecondCountableTopologyEither E F] (hf : Continuous f) : StronglyMeasurable (fun x ↦ lineDeriv π•œ f x v) := by
borelize π•œ let g : E β†’ π•œ β†’ F := fun x t ↦ f (x + t β€’ v) have hg : Continuous g.uncurry := by apply hf.comp; continuity exact (stronglyMeasurable_deriv_with_param hg).comp_measurable measurable_prod_mk_right
[ " MeasurableSet {x | LineDifferentiableAt π•œ f x v}", " Continuous (Function.uncurry g)", " Continuous fun x => x.1 + x.2 β€’ v", " Measurable fun x => lineDeriv π•œ f x v", " StronglyMeasurable fun x => lineDeriv π•œ f x v" ]
[ " MeasurableSet {x | LineDifferentiableAt π•œ f x v}", " Continuous (Function.uncurry g)", " Continuous fun x => x.1 + x.2 β€’ v", " Measurable fun x => lineDeriv π•œ f x v" ]
import Mathlib.Analysis.Calculus.Conformal.NormedSpace import Mathlib.Analysis.InnerProductSpace.ConformalLinearMap #align_import analysis.calculus.conformal.inner_product from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" noncomputable section variable {E F : Type*} variable [NormedAddCommGroup E] [NormedAddCommGroup F] variable [InnerProductSpace ℝ E] [InnerProductSpace ℝ F] open RealInnerProductSpace theorem conformalAt_iff' {f : E β†’ F} {x : E} : ConformalAt f x ↔ βˆƒ c : ℝ, 0 < c ∧ βˆ€ u v : E, βŸͺfderiv ℝ f x u, fderiv ℝ f x v⟫ = c * βŸͺu, v⟫ := by rw [conformalAt_iff_isConformalMap_fderiv, isConformalMap_iff] #align conformal_at_iff' conformalAt_iff'
Mathlib/Analysis/Calculus/Conformal/InnerProduct.lean
36
38
theorem conformalAt_iff {f : E β†’ F} {x : E} {f' : E β†’L[ℝ] F} (h : HasFDerivAt f f' x) : ConformalAt f x ↔ βˆƒ c : ℝ, 0 < c ∧ βˆ€ u v : E, βŸͺf' u, f' v⟫ = c * βŸͺu, v⟫ := by
simp only [conformalAt_iff', h.fderiv]
[ " ConformalAt f x ↔ βˆƒ c, 0 < c ∧ βˆ€ (u v : E), βŸͺ(fderiv ℝ f x) u, (fderiv ℝ f x) v⟫_ℝ = c * βŸͺu, v⟫_ℝ", " ConformalAt f x ↔ βˆƒ c, 0 < c ∧ βˆ€ (u v : E), βŸͺf' u, f' v⟫_ℝ = c * βŸͺu, v⟫_ℝ" ]
[ " ConformalAt f x ↔ βˆƒ c, 0 < c ∧ βˆ€ (u v : E), βŸͺ(fderiv ℝ f x) u, (fderiv ℝ f x) v⟫_ℝ = c * βŸͺu, v⟫_ℝ" ]
import Mathlib.Analysis.Complex.UpperHalfPlane.Basic import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup import Mathlib.Tactic.AdaptationNote #align_import number_theory.modular_forms.slash_actions from "leanprover-community/mathlib"@"738054fa93d43512da144ec45ce799d18fd44248" open Complex UpperHalfPlane ModularGroup open scoped UpperHalfPlane local notation "GL(" n ", " R ")" "⁺" => Matrix.GLPos (Fin n) R local notation "SL(" n ", " R ")" => Matrix.SpecialLinearGroup (Fin n) R local notation:1024 "β†‘β‚˜" A:1024 => (((A : GL(2, ℝ)⁺) : GL (Fin 2) ℝ) : Matrix (Fin 2) (Fin 2) _) -- like `β†‘β‚˜`, but allows the user to specify the ring `R`. Useful to help Lean elaborate. local notation:1024 "β†‘β‚˜[" R "]" A:1024 => ((A : GL (Fin 2) R) : Matrix (Fin 2) (Fin 2) R) class SlashAction (Ξ² G Ξ± Ξ³ : Type*) [Group G] [AddMonoid Ξ±] [SMul Ξ³ Ξ±] where map : Ξ² β†’ G β†’ Ξ± β†’ Ξ± zero_slash : βˆ€ (k : Ξ²) (g : G), map k g 0 = 0 slash_one : βˆ€ (k : Ξ²) (a : Ξ±), map k 1 a = a slash_mul : βˆ€ (k : Ξ²) (g h : G) (a : Ξ±), map k (g * h) a = map k h (map k g a) smul_slash : βˆ€ (k : Ξ²) (g : G) (a : Ξ±) (z : Ξ³), map k g (z β€’ a) = z β€’ map k g a add_slash : βˆ€ (k : Ξ²) (g : G) (a b : Ξ±), map k g (a + b) = map k g a + map k g b #align slash_action SlashAction scoped[ModularForm] notation:100 f " ∣[" k ";" Ξ³ "] " a:100 => SlashAction.map Ξ³ k a f scoped[ModularForm] notation:100 f " ∣[" k "] " a:100 => SlashAction.map β„‚ k a f open scoped ModularForm @[simp] theorem SlashAction.neg_slash {Ξ² G Ξ± Ξ³ : Type*} [Group G] [AddGroup Ξ±] [SMul Ξ³ Ξ±] [SlashAction Ξ² G Ξ± Ξ³] (k : Ξ²) (g : G) (a : Ξ±) : (-a) ∣[k;Ξ³] g = -a ∣[k;Ξ³] g := eq_neg_of_add_eq_zero_left <| by rw [← SlashAction.add_slash, add_left_neg, SlashAction.zero_slash] #align slash_action.neg_slash SlashAction.neg_slash @[simp]
Mathlib/NumberTheory/ModularForms/SlashActions.lean
67
70
theorem SlashAction.smul_slash_of_tower {R Ξ² G Ξ± : Type*} (Ξ³ : Type*) [Group G] [AddGroup Ξ±] [Monoid Ξ³] [MulAction Ξ³ Ξ±] [SMul R Ξ³] [SMul R Ξ±] [IsScalarTower R Ξ³ Ξ±] [SlashAction Ξ² G Ξ± Ξ³] (k : Ξ²) (g : G) (a : Ξ±) (r : R) : (r β€’ a) ∣[k;Ξ³] g = r β€’ a ∣[k;Ξ³] g := by
rw [← smul_one_smul Ξ³ r a, SlashAction.smul_slash, smul_one_smul]
[ " (-a) ∣[k;Ξ³] g + a ∣[k;Ξ³] g = 0", " (r β€’ a) ∣[k;Ξ³] g = r β€’ a ∣[k;Ξ³] g" ]
[ " (-a) ∣[k;γ] g + a ∣[k;γ] g = 0" ]
import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv #align_import linear_algebra.affine_space.affine_subspace from "leanprover-community/mathlib"@"e96bdfbd1e8c98a09ff75f7ac6204d142debc840" noncomputable section open Affine open Set section variable (k : Type*) {V : Type*} {P : Type*} [Ring k] [AddCommGroup V] [Module k V] variable [AffineSpace V P] def vectorSpan (s : Set P) : Submodule k V := Submodule.span k (s -α΅₯ s) #align vector_span vectorSpan theorem vectorSpan_def (s : Set P) : vectorSpan k s = Submodule.span k (s -α΅₯ s) := rfl #align vector_span_def vectorSpan_def theorem vectorSpan_mono {s₁ sβ‚‚ : Set P} (h : s₁ βŠ† sβ‚‚) : vectorSpan k s₁ ≀ vectorSpan k sβ‚‚ := Submodule.span_mono (vsub_self_mono h) #align vector_span_mono vectorSpan_mono variable (P) @[simp] theorem vectorSpan_empty : vectorSpan k (βˆ… : Set P) = (βŠ₯ : Submodule k V) := by rw [vectorSpan_def, vsub_empty, Submodule.span_empty] #align vector_span_empty vectorSpan_empty variable {P} @[simp] theorem vectorSpan_singleton (p : P) : vectorSpan k ({p} : Set P) = βŠ₯ := by simp [vectorSpan_def] #align vector_span_singleton vectorSpan_singleton theorem vsub_set_subset_vectorSpan (s : Set P) : s -α΅₯ s βŠ† ↑(vectorSpan k s) := Submodule.subset_span #align vsub_set_subset_vector_span vsub_set_subset_vectorSpan theorem vsub_mem_vectorSpan {s : Set P} {p1 p2 : P} (hp1 : p1 ∈ s) (hp2 : p2 ∈ s) : p1 -α΅₯ p2 ∈ vectorSpan k s := vsub_set_subset_vectorSpan k s (vsub_mem_vsub hp1 hp2) #align vsub_mem_vector_span vsub_mem_vectorSpan def spanPoints (s : Set P) : Set P := { p | βˆƒ p1 ∈ s, βˆƒ v ∈ vectorSpan k s, p = v +α΅₯ p1 } #align span_points spanPoints theorem mem_spanPoints (p : P) (s : Set P) : p ∈ s β†’ p ∈ spanPoints k s | hp => ⟨p, hp, 0, Submodule.zero_mem _, (zero_vadd V p).symm⟩ #align mem_span_points mem_spanPoints theorem subset_spanPoints (s : Set P) : s βŠ† spanPoints k s := fun p => mem_spanPoints k p s #align subset_span_points subset_spanPoints @[simp] theorem spanPoints_nonempty (s : Set P) : (spanPoints k s).Nonempty ↔ s.Nonempty := by constructor Β· contrapose rw [Set.not_nonempty_iff_eq_empty, Set.not_nonempty_iff_eq_empty] intro h simp [h, spanPoints] Β· exact fun h => h.mono (subset_spanPoints _ _) #align span_points_nonempty spanPoints_nonempty theorem vadd_mem_spanPoints_of_mem_spanPoints_of_mem_vectorSpan {s : Set P} {p : P} {v : V} (hp : p ∈ spanPoints k s) (hv : v ∈ vectorSpan k s) : v +α΅₯ p ∈ spanPoints k s := by rcases hp with ⟨p2, ⟨hp2, ⟨v2, ⟨hv2, hv2p⟩⟩⟩⟩ rw [hv2p, vadd_vadd] exact ⟨p2, hp2, v + v2, (vectorSpan k s).add_mem hv hv2, rfl⟩ #align vadd_mem_span_points_of_mem_span_points_of_mem_vector_span vadd_mem_spanPoints_of_mem_spanPoints_of_mem_vectorSpan
Mathlib/LinearAlgebra/AffineSpace/AffineSubspace.lean
136
143
theorem vsub_mem_vectorSpan_of_mem_spanPoints_of_mem_spanPoints {s : Set P} {p1 p2 : P} (hp1 : p1 ∈ spanPoints k s) (hp2 : p2 ∈ spanPoints k s) : p1 -α΅₯ p2 ∈ vectorSpan k s := by
rcases hp1 with ⟨p1a, ⟨hp1a, ⟨v1, ⟨hv1, hv1p⟩⟩⟩⟩ rcases hp2 with ⟨p2a, ⟨hp2a, ⟨v2, ⟨hv2, hv2p⟩⟩⟩⟩ rw [hv1p, hv2p, vsub_vadd_eq_vsub_sub (v1 +α΅₯ p1a), vadd_vsub_assoc, add_comm, add_sub_assoc] have hv1v2 : v1 - v2 ∈ vectorSpan k s := (vectorSpan k s).sub_mem hv1 hv2 refine (vectorSpan k s).add_mem ?_ hv1v2 exact vsub_mem_vectorSpan k hp1a hp2a
[ " vectorSpan k βˆ… = βŠ₯", " vectorSpan k {p} = βŠ₯", " (spanPoints k s).Nonempty ↔ s.Nonempty", " (spanPoints k s).Nonempty β†’ s.Nonempty", " Β¬s.Nonempty β†’ Β¬(spanPoints k s).Nonempty", " s = βˆ… β†’ spanPoints k s = βˆ…", " spanPoints k s = βˆ…", " s.Nonempty β†’ (spanPoints k s).Nonempty", " v +α΅₯ p ∈ spanPoints k ...
[ " vectorSpan k βˆ… = βŠ₯", " vectorSpan k {p} = βŠ₯", " (spanPoints k s).Nonempty ↔ s.Nonempty", " (spanPoints k s).Nonempty β†’ s.Nonempty", " Β¬s.Nonempty β†’ Β¬(spanPoints k s).Nonempty", " s = βˆ… β†’ spanPoints k s = βˆ…", " spanPoints k s = βˆ…", " s.Nonempty β†’ (spanPoints k s).Nonempty", " v +α΅₯ p ∈ spanPoints k ...
import Mathlib.Data.ULift import Mathlib.Data.ZMod.Defs import Mathlib.SetTheory.Cardinal.PartENat #align_import set_theory.cardinal.finite from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8" set_option autoImplicit true open Cardinal Function noncomputable section variable {Ξ± Ξ² : Type*} namespace Nat protected def card (Ξ± : Type*) : β„• := toNat (mk Ξ±) #align nat.card Nat.card @[simp] theorem card_eq_fintype_card [Fintype Ξ±] : Nat.card Ξ± = Fintype.card Ξ± := mk_toNat_eq_card #align nat.card_eq_fintype_card Nat.card_eq_fintype_card theorem _root_.Fintype.card_eq_nat_card {_ : Fintype Ξ±} : Fintype.card Ξ± = Nat.card Ξ± := mk_toNat_eq_card.symm lemma card_eq_finsetCard (s : Finset Ξ±) : Nat.card s = s.card := by simp only [Nat.card_eq_fintype_card, Fintype.card_coe] lemma card_eq_card_toFinset (s : Set Ξ±) [Fintype s] : Nat.card s = s.toFinset.card := by simp only [← Nat.card_eq_finsetCard, s.mem_toFinset] lemma card_eq_card_finite_toFinset {s : Set Ξ±} (hs : s.Finite) : Nat.card s = hs.toFinset.card := by simp only [← Nat.card_eq_finsetCard, hs.mem_toFinset] @[simp] theorem card_of_isEmpty [IsEmpty Ξ±] : Nat.card Ξ± = 0 := by simp [Nat.card] #align nat.card_of_is_empty Nat.card_of_isEmpty @[simp] lemma card_eq_zero_of_infinite [Infinite Ξ±] : Nat.card Ξ± = 0 := mk_toNat_of_infinite #align nat.card_eq_zero_of_infinite Nat.card_eq_zero_of_infinite lemma _root_.Set.Infinite.card_eq_zero {s : Set Ξ±} (hs : s.Infinite) : Nat.card s = 0 := @card_eq_zero_of_infinite _ hs.to_subtype lemma card_eq_zero : Nat.card Ξ± = 0 ↔ IsEmpty Ξ± ∨ Infinite Ξ± := by simp [Nat.card, mk_eq_zero_iff, aleph0_le_mk_iff] lemma card_ne_zero : Nat.card Ξ± β‰  0 ↔ Nonempty Ξ± ∧ Finite Ξ± := by simp [card_eq_zero, not_or] lemma card_pos_iff : 0 < Nat.card Ξ± ↔ Nonempty Ξ± ∧ Finite Ξ± := by simp [Nat.card, mk_eq_zero_iff, mk_lt_aleph0_iff] @[simp] lemma card_pos [Nonempty Ξ±] [Finite Ξ±] : 0 < Nat.card Ξ± := card_pos_iff.2 βŸ¨β€Ή_β€Ί, β€Ή_β€ΊβŸ© theorem finite_of_card_ne_zero (h : Nat.card Ξ± β‰  0) : Finite Ξ± := (card_ne_zero.1 h).2 #align nat.finite_of_card_ne_zero Nat.finite_of_card_ne_zero theorem card_congr (f : Ξ± ≃ Ξ²) : Nat.card Ξ± = Nat.card Ξ² := Cardinal.toNat_congr f #align nat.card_congr Nat.card_congr lemma card_le_card_of_injective {Ξ± : Type u} {Ξ² : Type v} [Finite Ξ²] (f : Ξ± β†’ Ξ²) (hf : Injective f) : Nat.card Ξ± ≀ Nat.card Ξ² := by simpa using toNat_le_toNat (lift_mk_le_lift_mk_of_injective hf) (by simp [lt_aleph0_of_finite]) lemma card_le_card_of_surjective {Ξ± : Type u} {Ξ² : Type v} [Finite Ξ±] (f : Ξ± β†’ Ξ²) (hf : Surjective f) : Nat.card Ξ² ≀ Nat.card Ξ± := by have : lift.{u} #Ξ² ≀ lift.{v} #Ξ± := mk_le_of_surjective (ULift.map_surjective.2 hf) simpa using toNat_le_toNat this (by simp [lt_aleph0_of_finite]) theorem card_eq_of_bijective (f : Ξ± β†’ Ξ²) (hf : Function.Bijective f) : Nat.card Ξ± = Nat.card Ξ² := card_congr (Equiv.ofBijective f hf) #align nat.card_eq_of_bijective Nat.card_eq_of_bijective theorem card_eq_of_equiv_fin {Ξ± : Type*} {n : β„•} (f : Ξ± ≃ Fin n) : Nat.card Ξ± = n := by simpa only [card_eq_fintype_card, Fintype.card_fin] using card_congr f #align nat.card_eq_of_equiv_fin Nat.card_eq_of_equiv_fin def equivFinOfCardPos {Ξ± : Type*} (h : Nat.card Ξ± β‰  0) : Ξ± ≃ Fin (Nat.card Ξ±) := by cases fintypeOrInfinite Ξ± Β· simpa only [card_eq_fintype_card] using Fintype.equivFin Ξ± Β· simp only [card_eq_zero_of_infinite, ne_eq, not_true_eq_false] at h #align nat.equiv_fin_of_card_pos Nat.equivFinOfCardPos theorem card_of_subsingleton (a : Ξ±) [Subsingleton Ξ±] : Nat.card Ξ± = 1 := by letI := Fintype.ofSubsingleton a rw [card_eq_fintype_card, Fintype.card_ofSubsingleton a] #align nat.card_of_subsingleton Nat.card_of_subsingleton -- @[simp] -- Porting note (#10618): simp can prove this theorem card_unique [Unique Ξ±] : Nat.card Ξ± = 1 := card_of_subsingleton default #align nat.card_unique Nat.card_unique theorem card_eq_one_iff_unique : Nat.card Ξ± = 1 ↔ Subsingleton Ξ± ∧ Nonempty Ξ± := Cardinal.toNat_eq_one_iff_unique #align nat.card_eq_one_iff_unique Nat.card_eq_one_iff_unique theorem card_eq_two_iff : Nat.card Ξ± = 2 ↔ βˆƒ x y : Ξ±, x β‰  y ∧ {x, y} = @Set.univ Ξ± := toNat_eq_ofNat.trans mk_eq_two_iff #align nat.card_eq_two_iff Nat.card_eq_two_iff theorem card_eq_two_iff' (x : Ξ±) : Nat.card Ξ± = 2 ↔ βˆƒ! y, y β‰  x := toNat_eq_ofNat.trans (mk_eq_two_iff' x) #align nat.card_eq_two_iff' Nat.card_eq_two_iff' @[simp]
Mathlib/SetTheory/Cardinal/Finite.lean
167
170
theorem card_sum [Finite Ξ±] [Finite Ξ²] : Nat.card (Ξ± βŠ• Ξ²) = Nat.card Ξ± + Nat.card Ξ² := by
have := Fintype.ofFinite Ξ± have := Fintype.ofFinite Ξ² simp_rw [Nat.card_eq_fintype_card, Fintype.card_sum]
[ " Nat.card { x // x ∈ s } = s.card", " Nat.card ↑s = s.toFinset.card", " Nat.card ↑s = hs.toFinset.card", " Nat.card Ξ± = 0", " Nat.card Ξ± = 0 ↔ IsEmpty Ξ± ∨ Infinite Ξ±", " Nat.card Ξ± β‰  0 ↔ Nonempty Ξ± ∧ Finite Ξ±", " 0 < Nat.card Ξ± ↔ Nonempty Ξ± ∧ Finite Ξ±", " Nat.card Ξ± ≀ Nat.card Ξ²", " lift.{u, v} #Ξ² ...
[ " Nat.card { x // x ∈ s } = s.card", " Nat.card ↑s = s.toFinset.card", " Nat.card ↑s = hs.toFinset.card", " Nat.card Ξ± = 0", " Nat.card Ξ± = 0 ↔ IsEmpty Ξ± ∨ Infinite Ξ±", " Nat.card Ξ± β‰  0 ↔ Nonempty Ξ± ∧ Finite Ξ±", " 0 < Nat.card Ξ± ↔ Nonempty Ξ± ∧ Finite Ξ±", " Nat.card Ξ± ≀ Nat.card Ξ²", " lift.{u, v} #Ξ² ...
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
Mathlib/Algebra/Polynomial/Degree/Definitions.lean
138
144
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]
[ " 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", ...
[ " 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))" ]
import Mathlib.Algebra.Module.Submodule.EqLocus import Mathlib.Algebra.Module.Submodule.RestrictScalars import Mathlib.Algebra.Ring.Idempotents import Mathlib.Data.Set.Pointwise.SMul import Mathlib.LinearAlgebra.Basic import Mathlib.Order.CompactlyGenerated.Basic import Mathlib.Order.OmegaCompletePartialOrder #align_import linear_algebra.span from "leanprover-community/mathlib"@"10878f6bf1dab863445907ab23fbfcefcb5845d0" variable {R Rβ‚‚ K M Mβ‚‚ V S : Type*} namespace Submodule open Function Set open Pointwise section AddCommMonoid variable [Semiring R] [AddCommMonoid M] [Module R M] variable {x : M} (p p' : Submodule R M) variable [Semiring Rβ‚‚] {σ₁₂ : R β†’+* Rβ‚‚} variable [AddCommMonoid Mβ‚‚] [Module Rβ‚‚ Mβ‚‚] variable {F : Type*} [FunLike F M Mβ‚‚] [SemilinearMapClass F σ₁₂ M Mβ‚‚] section variable (R) def span (s : Set M) : Submodule R M := sInf { p | s βŠ† p } #align submodule.span Submodule.span variable {R} -- Porting note: renamed field to `principal'` and added `principal` to fix explicit argument @[mk_iff] class IsPrincipal (S : Submodule R M) : Prop where principal' : βˆƒ a, S = span R {a} #align submodule.is_principal Submodule.IsPrincipal theorem IsPrincipal.principal (S : Submodule R M) [S.IsPrincipal] : βˆƒ a, S = span R {a} := Submodule.IsPrincipal.principal' #align submodule.is_principal.principal Submodule.IsPrincipal.principal end variable {s t : Set M} theorem mem_span : x ∈ span R s ↔ βˆ€ p : Submodule R M, s βŠ† p β†’ x ∈ p := mem_iInterβ‚‚ #align submodule.mem_span Submodule.mem_span @[aesop safe 20 apply (rule_sets := [SetLike])] theorem subset_span : s βŠ† span R s := fun _ h => mem_span.2 fun _ hp => hp h #align submodule.subset_span Submodule.subset_span theorem span_le {p} : span R s ≀ p ↔ s βŠ† p := ⟨Subset.trans subset_span, fun ss _ h => mem_span.1 h _ ss⟩ #align submodule.span_le Submodule.span_le theorem span_mono (h : s βŠ† t) : span R s ≀ span R t := span_le.2 <| Subset.trans h subset_span #align submodule.span_mono Submodule.span_mono theorem span_monotone : Monotone (span R : Set M β†’ Submodule R M) := fun _ _ => span_mono #align submodule.span_monotone Submodule.span_monotone theorem span_eq_of_le (h₁ : s βŠ† p) (hβ‚‚ : p ≀ span R s) : span R s = p := le_antisymm (span_le.2 h₁) hβ‚‚ #align submodule.span_eq_of_le Submodule.span_eq_of_le theorem span_eq : span R (p : Set M) = p := span_eq_of_le _ (Subset.refl _) subset_span #align submodule.span_eq Submodule.span_eq theorem span_eq_span (hs : s βŠ† span R t) (ht : t βŠ† span R s) : span R s = span R t := le_antisymm (span_le.2 hs) (span_le.2 ht) #align submodule.span_eq_span Submodule.span_eq_span lemma coe_span_eq_self [SetLike S M] [AddSubmonoidClass S M] [SMulMemClass S R M] (s : S) : (span R (s : Set M) : Set M) = s := by refine le_antisymm ?_ subset_span let s' : Submodule R M := { carrier := s add_mem' := add_mem zero_mem' := zero_mem _ smul_mem' := SMulMemClass.smul_mem } exact span_le (p := s') |>.mpr le_rfl @[simp] theorem span_coe_eq_restrictScalars [Semiring S] [SMul S R] [Module S M] [IsScalarTower S R M] : span S (p : Set M) = p.restrictScalars S := span_eq (p.restrictScalars S) #align submodule.span_coe_eq_restrict_scalars Submodule.span_coe_eq_restrictScalars theorem image_span_subset (f : F) (s : Set M) (N : Submodule Rβ‚‚ Mβ‚‚) : f '' span R s βŠ† N ↔ βˆ€ m ∈ s, f m ∈ N := image_subset_iff.trans <| span_le (p := N.comap f) theorem image_span_subset_span (f : F) (s : Set M) : f '' span R s βŠ† span Rβ‚‚ (f '' s) := (image_span_subset f s _).2 fun x hx ↦ subset_span ⟨x, hx, rfl⟩ theorem map_span [RingHomSurjective σ₁₂] (f : F) (s : Set M) : (span R s).map f = span Rβ‚‚ (f '' s) := Eq.symm <| span_eq_of_le _ (Set.image_subset f subset_span) (image_span_subset_span f s) #align submodule.map_span Submodule.map_span alias _root_.LinearMap.map_span := Submodule.map_span #align linear_map.map_span LinearMap.map_span theorem map_span_le [RingHomSurjective σ₁₂] (f : F) (s : Set M) (N : Submodule Rβ‚‚ Mβ‚‚) : map f (span R s) ≀ N ↔ βˆ€ m ∈ s, f m ∈ N := image_span_subset f s N #align submodule.map_span_le Submodule.map_span_le alias _root_.LinearMap.map_span_le := Submodule.map_span_le #align linear_map.map_span_le LinearMap.map_span_le @[simp] theorem span_insert_zero : span R (insert (0 : M) s) = span R s := by refine le_antisymm ?_ (Submodule.span_mono (Set.subset_insert 0 s)) rw [span_le, Set.insert_subset_iff] exact ⟨by simp only [SetLike.mem_coe, Submodule.zero_mem], Submodule.subset_span⟩ #align submodule.span_insert_zero Submodule.span_insert_zero -- See also `span_preimage_eq` below.
Mathlib/LinearAlgebra/Span.lean
154
157
theorem span_preimage_le (f : F) (s : Set Mβ‚‚) : span R (f ⁻¹' s) ≀ (span Rβ‚‚ s).comap f := by
rw [span_le, comap_coe] exact preimage_mono subset_span
[ " ↑(span R ↑s) = ↑s", " ↑(span R ↑s) ≀ ↑s", " span R (insert 0 s) = span R s", " span R (insert 0 s) ≀ span R s", " 0 ∈ ↑(span R s) ∧ s βŠ† ↑(span R s)", " 0 ∈ ↑(span R s)", " span R (⇑f ⁻¹' s) ≀ comap f (span Rβ‚‚ s)", " ⇑f ⁻¹' s βŠ† ⇑f ⁻¹' ↑(span Rβ‚‚ s)" ]
[ " ↑(span R ↑s) = ↑s", " ↑(span R ↑s) ≀ ↑s", " span R (insert 0 s) = span R s", " span R (insert 0 s) ≀ span R s", " 0 ∈ ↑(span R s) ∧ s βŠ† ↑(span R s)", " 0 ∈ ↑(span R s)" ]
import Mathlib.Topology.Order.IsLUB open Set Filter TopologicalSpace Topology Function open OrderDual (toDual ofDual) variable {Ξ± Ξ² Ξ³ : Type*} section DenselyOrdered variable [TopologicalSpace Ξ±] [LinearOrder Ξ±] [OrderTopology Ξ±] [DenselyOrdered Ξ±] {a b : Ξ±} {s : Set Ξ±} theorem closure_Ioi' {a : Ξ±} (h : (Ioi a).Nonempty) : closure (Ioi a) = Ici a := by apply Subset.antisymm Β· exact closure_minimal Ioi_subset_Ici_self isClosed_Ici Β· rw [← diff_subset_closure_iff, Ici_diff_Ioi_same, singleton_subset_iff] exact isGLB_Ioi.mem_closure h #align closure_Ioi' closure_Ioi' @[simp] theorem closure_Ioi (a : Ξ±) [NoMaxOrder Ξ±] : closure (Ioi a) = Ici a := closure_Ioi' nonempty_Ioi #align closure_Ioi closure_Ioi theorem closure_Iio' (h : (Iio a).Nonempty) : closure (Iio a) = Iic a := closure_Ioi' (Ξ± := Ξ±α΅’α΅ˆ) h #align closure_Iio' closure_Iio' @[simp] theorem closure_Iio (a : Ξ±) [NoMinOrder Ξ±] : closure (Iio a) = Iic a := closure_Iio' nonempty_Iio #align closure_Iio closure_Iio @[simp] theorem closure_Ioo {a b : Ξ±} (hab : a β‰  b) : closure (Ioo a b) = Icc a b := by apply Subset.antisymm Β· exact closure_minimal Ioo_subset_Icc_self isClosed_Icc Β· cases' hab.lt_or_lt with hab hab Β· rw [← diff_subset_closure_iff, Icc_diff_Ioo_same hab.le] have hab' : (Ioo a b).Nonempty := nonempty_Ioo.2 hab simp only [insert_subset_iff, singleton_subset_iff] exact ⟨(isGLB_Ioo hab).mem_closure hab', (isLUB_Ioo hab).mem_closure hab'⟩ Β· rw [Icc_eq_empty_of_lt hab] exact empty_subset _ #align closure_Ioo closure_Ioo @[simp] theorem closure_Ioc {a b : Ξ±} (hab : a β‰  b) : closure (Ioc a b) = Icc a b := by apply Subset.antisymm Β· exact closure_minimal Ioc_subset_Icc_self isClosed_Icc Β· apply Subset.trans _ (closure_mono Ioo_subset_Ioc_self) rw [closure_Ioo hab] #align closure_Ioc closure_Ioc @[simp] theorem closure_Ico {a b : Ξ±} (hab : a β‰  b) : closure (Ico a b) = Icc a b := by apply Subset.antisymm Β· exact closure_minimal Ico_subset_Icc_self isClosed_Icc Β· apply Subset.trans _ (closure_mono Ioo_subset_Ico_self) rw [closure_Ioo hab] #align closure_Ico closure_Ico @[simp] theorem interior_Ici' {a : Ξ±} (ha : (Iio a).Nonempty) : interior (Ici a) = Ioi a := by rw [← compl_Iio, interior_compl, closure_Iio' ha, compl_Iic] #align interior_Ici' interior_Ici' theorem interior_Ici [NoMinOrder Ξ±] {a : Ξ±} : interior (Ici a) = Ioi a := interior_Ici' nonempty_Iio #align interior_Ici interior_Ici @[simp] theorem interior_Iic' {a : Ξ±} (ha : (Ioi a).Nonempty) : interior (Iic a) = Iio a := interior_Ici' (Ξ± := Ξ±α΅’α΅ˆ) ha #align interior_Iic' interior_Iic' theorem interior_Iic [NoMaxOrder Ξ±] {a : Ξ±} : interior (Iic a) = Iio a := interior_Iic' nonempty_Ioi #align interior_Iic interior_Iic @[simp] theorem interior_Icc [NoMinOrder Ξ±] [NoMaxOrder Ξ±] {a b : Ξ±} : interior (Icc a b) = Ioo a b := by rw [← Ici_inter_Iic, interior_inter, interior_Ici, interior_Iic, Ioi_inter_Iio] #align interior_Icc interior_Icc @[simp] theorem Icc_mem_nhds_iff [NoMinOrder Ξ±] [NoMaxOrder Ξ±] {a b x : Ξ±} : Icc a b ∈ 𝓝 x ↔ x ∈ Ioo a b := by rw [← interior_Icc, mem_interior_iff_mem_nhds] @[simp] theorem interior_Ico [NoMinOrder Ξ±] {a b : Ξ±} : interior (Ico a b) = Ioo a b := by rw [← Ici_inter_Iio, interior_inter, interior_Ici, interior_Iio, Ioi_inter_Iio] #align interior_Ico interior_Ico @[simp] theorem Ico_mem_nhds_iff [NoMinOrder Ξ±] {a b x : Ξ±} : Ico a b ∈ 𝓝 x ↔ x ∈ Ioo a b := by rw [← interior_Ico, mem_interior_iff_mem_nhds] @[simp] theorem interior_Ioc [NoMaxOrder Ξ±] {a b : Ξ±} : interior (Ioc a b) = Ioo a b := by rw [← Ioi_inter_Iic, interior_inter, interior_Ioi, interior_Iic, Ioi_inter_Iio] #align interior_Ioc interior_Ioc @[simp] theorem Ioc_mem_nhds_iff [NoMaxOrder Ξ±] {a b x : Ξ±} : Ioc a b ∈ 𝓝 x ↔ x ∈ Ioo a b := by rw [← interior_Ioc, mem_interior_iff_mem_nhds] theorem closure_interior_Icc {a b : Ξ±} (h : a β‰  b) : closure (interior (Icc a b)) = Icc a b := (closure_minimal interior_subset isClosed_Icc).antisymm <| calc Icc a b = closure (Ioo a b) := (closure_Ioo h).symm _ βŠ† closure (interior (Icc a b)) := closure_mono (interior_maximal Ioo_subset_Icc_self isOpen_Ioo) #align closure_interior_Icc closure_interior_Icc
Mathlib/Topology/Order/DenselyOrdered.lean
136
143
theorem Ioc_subset_closure_interior (a b : Ξ±) : Ioc a b βŠ† closure (interior (Ioc a b)) := by
rcases eq_or_ne a b with (rfl | h) Β· simp Β· calc Ioc a b βŠ† Icc a b := Ioc_subset_Icc_self _ = closure (Ioo a b) := (closure_Ioo h).symm _ βŠ† closure (interior (Ioc a b)) := closure_mono (interior_maximal Ioo_subset_Ioc_self isOpen_Ioo)
[ " closure (Ioi a) = Ici a", " closure (Ioi a) βŠ† Ici a", " Ici a βŠ† closure (Ioi a)", " a ∈ closure (Ioi a)", " closure (Ioo a b) = Icc a b", " closure (Ioo a b) βŠ† Icc a b", " Icc a b βŠ† closure (Ioo a b)", " {a, b} βŠ† closure (Ioo a b)", " a ∈ closure (Ioo a b) ∧ b ∈ closure (Ioo a b)", " βˆ… βŠ† closure...
[ " closure (Ioi a) = Ici a", " closure (Ioi a) βŠ† Ici a", " Ici a βŠ† closure (Ioi a)", " a ∈ closure (Ioi a)", " closure (Ioo a b) = Icc a b", " closure (Ioo a b) βŠ† Icc a b", " Icc a b βŠ† closure (Ioo a b)", " {a, b} βŠ† closure (Ioo a b)", " a ∈ closure (Ioo a b) ∧ b ∈ closure (Ioo a b)", " βˆ… βŠ† closure...
import Mathlib.Topology.Separation import Mathlib.Topology.UniformSpace.Basic import Mathlib.Topology.UniformSpace.Cauchy #align_import topology.uniform_space.uniform_convergence from "leanprover-community/mathlib"@"2705404e701abc6b3127da906f40bae062a169c9" noncomputable section open Topology Uniformity Filter Set universe u v w x variable {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w} {ΞΉ : Type x} [UniformSpace Ξ²] variable {F : ΞΉ β†’ Ξ± β†’ Ξ²} {f : Ξ± β†’ Ξ²} {s s' : Set Ξ±} {x : Ξ±} {p : Filter ΞΉ} {p' : Filter Ξ±} {g : ΞΉ β†’ Ξ±} def TendstoUniformlyOnFilter (F : ΞΉ β†’ Ξ± β†’ Ξ²) (f : Ξ± β†’ Ξ²) (p : Filter ΞΉ) (p' : Filter Ξ±) := βˆ€ u ∈ 𝓀 Ξ², βˆ€αΆ  n : ΞΉ Γ— Ξ± in p Γ—Λ’ p', (f n.snd, F n.fst n.snd) ∈ u #align tendsto_uniformly_on_filter TendstoUniformlyOnFilter theorem tendstoUniformlyOnFilter_iff_tendsto : TendstoUniformlyOnFilter F f p p' ↔ Tendsto (fun q : ΞΉ Γ— Ξ± => (f q.2, F q.1 q.2)) (p Γ—Λ’ p') (𝓀 Ξ²) := Iff.rfl #align tendsto_uniformly_on_filter_iff_tendsto tendstoUniformlyOnFilter_iff_tendsto def TendstoUniformlyOn (F : ΞΉ β†’ Ξ± β†’ Ξ²) (f : Ξ± β†’ Ξ²) (p : Filter ΞΉ) (s : Set Ξ±) := βˆ€ u ∈ 𝓀 Ξ², βˆ€αΆ  n in p, βˆ€ x : Ξ±, x ∈ s β†’ (f x, F n x) ∈ u #align tendsto_uniformly_on TendstoUniformlyOn theorem tendstoUniformlyOn_iff_tendstoUniformlyOnFilter : TendstoUniformlyOn F f p s ↔ TendstoUniformlyOnFilter F f p (π“Ÿ s) := by simp only [TendstoUniformlyOn, TendstoUniformlyOnFilter] apply forallβ‚‚_congr simp_rw [eventually_prod_principal_iff] simp #align tendsto_uniformly_on_iff_tendsto_uniformly_on_filter tendstoUniformlyOn_iff_tendstoUniformlyOnFilter alias ⟨TendstoUniformlyOn.tendstoUniformlyOnFilter, TendstoUniformlyOnFilter.tendstoUniformlyOn⟩ := tendstoUniformlyOn_iff_tendstoUniformlyOnFilter #align tendsto_uniformly_on.tendsto_uniformly_on_filter TendstoUniformlyOn.tendstoUniformlyOnFilter #align tendsto_uniformly_on_filter.tendsto_uniformly_on TendstoUniformlyOnFilter.tendstoUniformlyOn
Mathlib/Topology/UniformSpace/UniformConvergence.lean
124
127
theorem tendstoUniformlyOn_iff_tendsto {F : ΞΉ β†’ Ξ± β†’ Ξ²} {f : Ξ± β†’ Ξ²} {p : Filter ΞΉ} {s : Set Ξ±} : TendstoUniformlyOn F f p s ↔ Tendsto (fun q : ΞΉ Γ— Ξ± => (f q.2, F q.1 q.2)) (p Γ—Λ’ π“Ÿ s) (𝓀 Ξ²) := by
simp [tendstoUniformlyOn_iff_tendstoUniformlyOnFilter, tendstoUniformlyOnFilter_iff_tendsto]
[ " TendstoUniformlyOn F f p s ↔ TendstoUniformlyOnFilter F f p (π“Ÿ s)", " (βˆ€ u ∈ 𝓀 Ξ², βˆ€αΆ  (n : ΞΉ) in p, βˆ€ x ∈ s, (f x, F n x) ∈ u) ↔\n βˆ€ u ∈ 𝓀 Ξ², βˆ€αΆ  (n : ΞΉ Γ— Ξ±) in p Γ—Λ’ π“Ÿ s, (f n.2, F n.1 n.2) ∈ u", " βˆ€ a ∈ 𝓀 Ξ², (βˆ€αΆ  (n : ΞΉ) in p, βˆ€ x ∈ s, (f x, F n x) ∈ a) ↔ βˆ€αΆ  (n : ΞΉ Γ— Ξ±) in p Γ—Λ’ π“Ÿ s, (f n.2, F n.1 n.2) ...
[ " TendstoUniformlyOn F f p s ↔ TendstoUniformlyOnFilter F f p (π“Ÿ s)", " (βˆ€ u ∈ 𝓀 Ξ², βˆ€αΆ  (n : ΞΉ) in p, βˆ€ x ∈ s, (f x, F n x) ∈ u) ↔\n βˆ€ u ∈ 𝓀 Ξ², βˆ€αΆ  (n : ΞΉ Γ— Ξ±) in p Γ—Λ’ π“Ÿ s, (f n.2, F n.1 n.2) ∈ u", " βˆ€ a ∈ 𝓀 Ξ², (βˆ€αΆ  (n : ΞΉ) in p, βˆ€ x ∈ s, (f x, F n x) ∈ a) ↔ βˆ€αΆ  (n : ΞΉ Γ— Ξ±) in p Γ—Λ’ π“Ÿ s, (f n.2, F n.1 n.2) ...
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp import Mathlib.MeasureTheory.Integral.Bochner import Mathlib.Order.Filter.IndicatorFunction import Mathlib.MeasureTheory.Function.StronglyMeasurable.Inner import Mathlib.MeasureTheory.Function.LpSeminorm.Trim #align_import measure_theory.function.conditional_expectation.ae_measurable from "leanprover-community/mathlib"@"d8bbb04e2d2a44596798a9207ceefc0fb236e41e" set_option linter.uppercaseLean3 false open TopologicalSpace Filter open scoped ENNReal MeasureTheory namespace MeasureTheory def AEStronglyMeasurable' {Ξ± Ξ²} [TopologicalSpace Ξ²] (m : MeasurableSpace Ξ±) {_ : MeasurableSpace Ξ±} (f : Ξ± β†’ Ξ²) (ΞΌ : Measure Ξ±) : Prop := βˆƒ g : Ξ± β†’ Ξ², StronglyMeasurable[m] g ∧ f =ᡐ[ΞΌ] g #align measure_theory.ae_strongly_measurable' MeasureTheory.AEStronglyMeasurable' namespace AEStronglyMeasurable' variable {Ξ± Ξ² π•œ : Type*} {m m0 : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} [TopologicalSpace Ξ²] {f g : Ξ± β†’ Ξ²}
Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean
62
64
theorem congr (hf : AEStronglyMeasurable' m f μ) (hfg : f =ᡐ[μ] g) : AEStronglyMeasurable' m g μ := by
obtain ⟨f', hf'_meas, hff'⟩ := hf; exact ⟨f', hf'_meas, hfg.symm.trans hff'⟩
[ " AEStronglyMeasurable' m g ΞΌ" ]
[]
import Mathlib.GroupTheory.GroupAction.Prod import Mathlib.Algebra.Ring.Int import Mathlib.Data.Nat.Cast.Basic assert_not_exists DenselyOrdered variable {M : Type*} class NatPowAssoc (M : Type*) [MulOneClass M] [Pow M β„•] : Prop where protected npow_add : βˆ€ (k n: β„•) (x : M), x ^ (k + n) = x ^ k * x ^ n protected npow_zero : βˆ€ (x : M), x ^ 0 = 1 protected npow_one : βˆ€ (x : M), x ^ 1 = x section MulOneClass variable [MulOneClass M] [Pow M β„•] [NatPowAssoc M] theorem npow_add (k n : β„•) (x : M) : x ^ (k + n) = x ^ k * x ^ n := NatPowAssoc.npow_add k n x @[simp] theorem npow_zero (x : M) : x ^ 0 = 1 := NatPowAssoc.npow_zero x @[simp] theorem npow_one (x : M) : x ^ 1 = x := NatPowAssoc.npow_one x theorem npow_mul_assoc (k m n : β„•) (x : M) : (x ^ k * x ^ m) * x ^ n = x ^ k * (x ^ m * x ^ n) := by simp only [← npow_add, add_assoc]
Mathlib/Algebra/Group/NatPowAssoc.lean
69
70
theorem npow_mul_comm (m n : β„•) (x : M) : x ^ m * x ^ n = x ^ n * x ^ m := by
simp only [← npow_add, add_comm]
[ " x ^ k * x ^ m * x ^ n = x ^ k * (x ^ m * x ^ n)", " x ^ m * x ^ n = x ^ n * x ^ m" ]
[ " x ^ k * x ^ m * x ^ n = x ^ k * (x ^ m * x ^ n)" ]
import Mathlib.Data.Fintype.Basic import Mathlib.Data.Set.Finite #align_import combinatorics.hall.finite from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce" open Finset universe u v namespace HallMarriageTheorem variable {ΞΉ : Type u} {Ξ± : Type v} [DecidableEq Ξ±] {t : ΞΉ β†’ Finset Ξ±} section Fintype variable [Fintype ΞΉ] theorem hall_cond_of_erase {x : ΞΉ} (a : Ξ±) (ha : βˆ€ s : Finset ΞΉ, s.Nonempty β†’ s β‰  univ β†’ s.card < (s.biUnion t).card) (s' : Finset { x' : ΞΉ | x' β‰  x }) : s'.card ≀ (s'.biUnion fun x' => (t x').erase a).card := by haveI := Classical.decEq ΞΉ specialize ha (s'.image fun z => z.1) rw [image_nonempty, Finset.card_image_of_injective s' Subtype.coe_injective] at ha by_cases he : s'.Nonempty Β· have ha' : s'.card < (s'.biUnion fun x => t x).card := by convert ha he fun h => by simpa [← h] using mem_univ x using 2 ext x simp only [mem_image, mem_biUnion, exists_prop, SetCoe.exists, exists_and_right, exists_eq_right, Subtype.coe_mk] rw [← erase_biUnion] by_cases hb : a ∈ s'.biUnion fun x => t x Β· rw [card_erase_of_mem hb] exact Nat.le_sub_one_of_lt ha' Β· rw [erase_eq_of_not_mem hb] exact Nat.le_of_lt ha' Β· rw [nonempty_iff_ne_empty, not_not] at he subst s' simp #align hall_marriage_theorem.hall_cond_of_erase HallMarriageTheorem.hall_cond_of_erase theorem hall_hard_inductive_step_A {n : β„•} (hn : Fintype.card ΞΉ = n + 1) (ht : βˆ€ s : Finset ΞΉ, s.card ≀ (s.biUnion t).card) (ih : βˆ€ {ΞΉ' : Type u} [Fintype ΞΉ'] (t' : ΞΉ' β†’ Finset Ξ±), Fintype.card ΞΉ' ≀ n β†’ (βˆ€ s' : Finset ΞΉ', s'.card ≀ (s'.biUnion t').card) β†’ βˆƒ f : ΞΉ' β†’ Ξ±, Function.Injective f ∧ βˆ€ x, f x ∈ t' x) (ha : βˆ€ s : Finset ΞΉ, s.Nonempty β†’ s β‰  univ β†’ s.card < (s.biUnion t).card) : βˆƒ f : ΞΉ β†’ Ξ±, Function.Injective f ∧ βˆ€ x, f x ∈ t x := by haveI : Nonempty ΞΉ := Fintype.card_pos_iff.mp (hn.symm β–Έ Nat.succ_pos _) haveI := Classical.decEq ΞΉ -- Choose an arbitrary element `x : ΞΉ` and `y : t x`. let x := Classical.arbitrary ΞΉ have tx_ne : (t x).Nonempty := by rw [← Finset.card_pos] calc 0 < 1 := Nat.one_pos _ ≀ (Finset.biUnion {x} t).card := ht {x} _ = (t x).card := by rw [Finset.singleton_biUnion] choose y hy using tx_ne -- Restrict to everything except `x` and `y`. let ΞΉ' := { x' : ΞΉ | x' β‰  x } let t' : ΞΉ' β†’ Finset Ξ± := fun x' => (t x').erase y have card_ΞΉ' : Fintype.card ΞΉ' = n := calc Fintype.card ΞΉ' = Fintype.card ΞΉ - 1 := Set.card_ne_eq _ _ = n := by rw [hn, Nat.add_succ_sub_one, add_zero] rcases ih t' card_ΞΉ'.le (hall_cond_of_erase y ha) with ⟨f', hfinj, hfr⟩ -- Extend the resulting function. refine ⟨fun z => if h : z = x then y else f' ⟨z, h⟩, ?_, ?_⟩ Β· rintro z₁ zβ‚‚ have key : βˆ€ {x}, y β‰  f' x := by intro x h simpa [t', ← h] using hfr x by_cases h₁ : z₁ = x <;> by_cases hβ‚‚ : zβ‚‚ = x <;> simp [h₁, hβ‚‚, hfinj.eq_iff, key, key.symm] Β· intro z simp only [ne_eq, Set.mem_setOf_eq] split_ifs with hz Β· rwa [hz] Β· specialize hfr ⟨z, hz⟩ rw [mem_erase] at hfr exact hfr.2 set_option linter.uppercaseLean3 false in #align hall_marriage_theorem.hall_hard_inductive_step_A HallMarriageTheorem.hall_hard_inductive_step_A
Mathlib/Combinatorics/Hall/Finite.lean
125
133
theorem hall_cond_of_restrict {ΞΉ : Type u} {t : ΞΉ β†’ Finset Ξ±} {s : Finset ΞΉ} (ht : βˆ€ s : Finset ΞΉ, s.card ≀ (s.biUnion t).card) (s' : Finset (s : Set ΞΉ)) : s'.card ≀ (s'.biUnion fun a' => t a').card := by
classical rw [← card_image_of_injective s' Subtype.coe_injective] convert ht (s'.image fun z => z.1) using 1 apply congr_arg ext y simp
[ " s'.card ≀ (s'.biUnion fun x' => (t ↑x').erase a).card", " s'.card < (s'.biUnion fun x_1 => t ↑x_1).card", " False", " (s'.biUnion fun x_1 => t ↑x_1) = (image (fun z => ↑z) s').biUnion t", " (x ∈ s'.biUnion fun x => t ↑x) ↔ x ∈ (image (fun z => ↑z) s').biUnion t", " s'.card ≀ ((s'.biUnion fun x' => t ↑x'...
[ " s'.card ≀ (s'.biUnion fun x' => (t ↑x').erase a).card", " s'.card < (s'.biUnion fun x_1 => t ↑x_1).card", " False", " (s'.biUnion fun x_1 => t ↑x_1) = (image (fun z => ↑z) s').biUnion t", " (x ∈ s'.biUnion fun x => t ↑x) ↔ x ∈ (image (fun z => ↑z) s').biUnion t", " s'.card ≀ ((s'.biUnion fun x' => t ↑x'...
import Mathlib.AlgebraicTopology.SplitSimplicialObject import Mathlib.AlgebraicTopology.DoldKan.PInfty #align_import algebraic_topology.dold_kan.functor_gamma from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504" noncomputable section open CategoryTheory CategoryTheory.Category CategoryTheory.Limits SimplexCategory SimplicialObject Opposite CategoryTheory.Idempotents Simplicial DoldKan namespace AlgebraicTopology namespace DoldKan variable {C : Type*} [Category C] [Preadditive C] (K K' : ChainComplex C β„•) (f : K ⟢ K') {Ξ” Ξ”' Ξ”'' : SimplexCategory} @[nolint unusedArguments] def IsΞ΄β‚€ {Ξ” Ξ”' : SimplexCategory} (i : Ξ”' ⟢ Ξ”) [Mono i] : Prop := Ξ”.len = Ξ”'.len + 1 ∧ i.toOrderHom 0 β‰  0 #align algebraic_topology.dold_kan.is_Ξ΄β‚€ AlgebraicTopology.DoldKan.IsΞ΄β‚€ namespace Ξ“β‚€ namespace Obj def summand (Ξ” : SimplexCategoryα΅’α΅–) (A : Splitting.IndexSet Ξ”) : C := K.X A.1.unop.len #align algebraic_topology.dold_kan.Ξ“β‚€.obj.summand AlgebraicTopology.DoldKan.Ξ“β‚€.Obj.summand def objβ‚‚ (K : ChainComplex C β„•) (Ξ” : SimplexCategoryα΅’α΅–) [HasFiniteCoproducts C] : C := ∐ fun A : Splitting.IndexSet Ξ” => summand K Ξ” A #align algebraic_topology.dold_kan.Ξ“β‚€.obj.objβ‚‚ AlgebraicTopology.DoldKan.Ξ“β‚€.Obj.objβ‚‚ namespace Termwise def mapMono (K : ChainComplex C β„•) {Ξ”' Ξ” : SimplexCategory} (i : Ξ”' ⟢ Ξ”) [Mono i] : K.X Ξ”.len ⟢ K.X Ξ”'.len := by by_cases Ξ” = Ξ”' Β· exact eqToHom (by congr) Β· by_cases IsΞ΄β‚€ i Β· exact K.d Ξ”.len Ξ”'.len Β· exact 0 #align algebraic_topology.dold_kan.Ξ“β‚€.obj.termwise.map_mono AlgebraicTopology.DoldKan.Ξ“β‚€.Obj.Termwise.mapMono variable (Ξ”) theorem mapMono_id : mapMono K (πŸ™ Ξ”) = πŸ™ _ := by unfold mapMono simp only [eq_self_iff_true, eqToHom_refl, dite_eq_ite, if_true] #align algebraic_topology.dold_kan.Ξ“β‚€.obj.termwise.map_mono_id AlgebraicTopology.DoldKan.Ξ“β‚€.Obj.Termwise.mapMono_id variable {Ξ”}
Mathlib/AlgebraicTopology/DoldKan/FunctorGamma.lean
112
117
theorem mapMono_Ξ΄β‚€' (i : Ξ”' ⟢ Ξ”) [Mono i] (hi : IsΞ΄β‚€ i) : mapMono K i = K.d Ξ”.len Ξ”'.len := by
unfold mapMono suffices Ξ” β‰  Ξ”' by simp only [dif_neg this, dif_pos hi] rintro rfl simpa only [self_eq_add_right, Nat.one_ne_zero] using hi.1
[ " K.X Ξ”.len ⟢ K.X Ξ”'.len", " K.X Ξ”.len = K.X Ξ”'.len", " mapMono K (πŸ™ Ξ”) = πŸ™ (K.X Ξ”.len)", " (if h : Ξ” = Ξ” then eqToHom β‹― else if h : IsΞ΄β‚€ (πŸ™ Ξ”) then K.d Ξ”.len Ξ”.len else 0) = πŸ™ (K.X Ξ”.len)", " mapMono K i = K.d Ξ”.len Ξ”'.len", " (if h : Ξ” = Ξ”' then eqToHom β‹― else if h : IsΞ΄β‚€ i then K.d Ξ”.len Ξ”'.len els...
[ " K.X Ξ”.len ⟢ K.X Ξ”'.len", " K.X Ξ”.len = K.X Ξ”'.len", " mapMono K (πŸ™ Ξ”) = πŸ™ (K.X Ξ”.len)", " (if h : Ξ” = Ξ” then eqToHom β‹― else if h : IsΞ΄β‚€ (πŸ™ Ξ”) then K.d Ξ”.len Ξ”.len else 0) = πŸ™ (K.X Ξ”.len)" ]
import Mathlib.Algebra.MvPolynomial.Monad #align_import data.mv_polynomial.expand from "leanprover-community/mathlib"@"5da451b4c96b4c2e122c0325a7fce17d62ee46c6" namespace MvPolynomial variable {Οƒ Ο„ R S : Type*} [CommSemiring R] [CommSemiring S] noncomputable def expand (p : β„•) : MvPolynomial Οƒ R →ₐ[R] MvPolynomial Οƒ R := { (evalβ‚‚Hom C fun i ↦ X i ^ p : MvPolynomial Οƒ R β†’+* MvPolynomial Οƒ R) with commutes' := fun _ ↦ evalβ‚‚Hom_C _ _ _ } #align mv_polynomial.expand MvPolynomial.expand -- @[simp] -- Porting note (#10618): simp can prove this theorem expand_C (p : β„•) (r : R) : expand p (C r : MvPolynomial Οƒ R) = C r := evalβ‚‚Hom_C _ _ _ set_option linter.uppercaseLean3 false in #align mv_polynomial.expand_C MvPolynomial.expand_C @[simp] theorem expand_X (p : β„•) (i : Οƒ) : expand p (X i : MvPolynomial Οƒ R) = X i ^ p := evalβ‚‚Hom_X' _ _ _ set_option linter.uppercaseLean3 false in #align mv_polynomial.expand_X MvPolynomial.expand_X @[simp] theorem expand_monomial (p : β„•) (d : Οƒ β†’β‚€ β„•) (r : R) : expand p (monomial d r) = C r * ∏ i ∈ d.support, (X i ^ p) ^ d i := bind₁_monomial _ _ _ #align mv_polynomial.expand_monomial MvPolynomial.expand_monomial theorem expand_one_apply (f : MvPolynomial Οƒ R) : expand 1 f = f := by simp only [expand, pow_one, evalβ‚‚Hom_eq_bindβ‚‚, bindβ‚‚_C_left, RingHom.toMonoidHom_eq_coe, RingHom.coe_monoidHom_id, AlgHom.coe_mk, RingHom.coe_mk, MonoidHom.id_apply, RingHom.id_apply] #align mv_polynomial.expand_one_apply MvPolynomial.expand_one_apply @[simp] theorem expand_one : expand 1 = AlgHom.id R (MvPolynomial Οƒ R) := by ext1 f rw [expand_one_apply, AlgHom.id_apply] #align mv_polynomial.expand_one MvPolynomial.expand_one theorem expand_comp_bind₁ (p : β„•) (f : Οƒ β†’ MvPolynomial Ο„ R) : (expand p).comp (bind₁ f) = bind₁ fun i ↦ expand p (f i) := by apply algHom_ext intro i simp only [AlgHom.comp_apply, bind₁_X_right] #align mv_polynomial.expand_comp_bind₁ MvPolynomial.expand_comp_bind₁
Mathlib/Algebra/MvPolynomial/Expand.lean
71
73
theorem expand_bind₁ (p : β„•) (f : Οƒ β†’ MvPolynomial Ο„ R) (Ο† : MvPolynomial Οƒ R) : expand p (bind₁ f Ο†) = bind₁ (fun i ↦ expand p (f i)) Ο† := by
rw [← AlgHom.comp_apply, expand_comp_bind₁]
[ " (expand 1) f = f", " expand 1 = AlgHom.id R (MvPolynomial Οƒ R)", " (expand 1) (X f) = (AlgHom.id R (MvPolynomial Οƒ R)) (X f)", " (expand p).comp (bind₁ f) = bind₁ fun i => (expand p) (f i)", " βˆ€ (i : Οƒ), ((expand p).comp (bind₁ f)) (X i) = (bind₁ fun i => (expand p) (f i)) (X i)", " ((expand p).comp (bi...
[ " (expand 1) f = f", " expand 1 = AlgHom.id R (MvPolynomial Οƒ R)", " (expand 1) (X f) = (AlgHom.id R (MvPolynomial Οƒ R)) (X f)", " (expand p).comp (bind₁ f) = bind₁ fun i => (expand p) (f i)", " βˆ€ (i : Οƒ), ((expand p).comp (bind₁ f)) (X i) = (bind₁ fun i => (expand p) (f i)) (X i)", " ((expand p).comp (bi...
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
Mathlib/Data/Multiset/Functor.lean
129
134
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]
[ " βˆ€ {Ξ± : 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...
[ " βˆ€ {Ξ± : 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.Algebra.Group.Commute.Basic import Mathlib.GroupTheory.GroupAction.Basic import Mathlib.Dynamics.PeriodicPts import Mathlib.Data.Set.Pointwise.SMul namespace MulAction open Pointwise variable {Ξ± : Type*} variable {G : Type*} [Group G] [MulAction G Ξ±] variable {M : Type*} [Monoid M] [MulAction M Ξ±] section Commute @[to_additive "If `g` and `h` commute, then `g` fixes `h +α΅₯ x` iff `g` fixes `x`. This is equivalent to say that the set `fixedBy Ξ± g` is fixed by `h`. "]
Mathlib/GroupTheory/GroupAction/FixedPoints.lean
195
199
theorem fixedBy_mem_fixedBy_of_commute {g h : G} (comm: Commute g h) : (fixedBy α g) ∈ fixedBy (Set α) h := by
ext x rw [Set.mem_smul_set_iff_inv_smul_mem, mem_fixedBy, ← mul_smul, comm.inv_right, mul_smul, smul_left_cancel_iff, mem_fixedBy]
[ " fixedBy Ξ± g ∈ fixedBy (Set Ξ±) h", " x ∈ h β€’ fixedBy Ξ± g ↔ x ∈ fixedBy Ξ± g" ]
[]
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine #align_import geometry.euclidean.angle.unoriented.right_angle from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" noncomputable section open scoped EuclideanGeometry open scoped Real open scoped RealInnerProductSpace namespace InnerProductGeometry variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] theorem norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two (x y : V) : β€–x + yβ€– * β€–x + yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– ↔ angle x y = Ο€ / 2 := by rw [norm_add_sq_eq_norm_sq_add_norm_sq_iff_real_inner_eq_zero] exact inner_eq_zero_iff_angle_eq_pi_div_two x y #align inner_product_geometry.norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two InnerProductGeometry.norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two theorem norm_add_sq_eq_norm_sq_add_norm_sq' (x y : V) (h : angle x y = Ο€ / 2) : β€–x + yβ€– * β€–x + yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– := (norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two x y).2 h #align inner_product_geometry.norm_add_sq_eq_norm_sq_add_norm_sq' InnerProductGeometry.norm_add_sq_eq_norm_sq_add_norm_sq' theorem norm_sub_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two (x y : V) : β€–x - yβ€– * β€–x - yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– ↔ angle x y = Ο€ / 2 := by rw [norm_sub_sq_eq_norm_sq_add_norm_sq_iff_real_inner_eq_zero] exact inner_eq_zero_iff_angle_eq_pi_div_two x y #align inner_product_geometry.norm_sub_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two InnerProductGeometry.norm_sub_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two theorem norm_sub_sq_eq_norm_sq_add_norm_sq' (x y : V) (h : angle x y = Ο€ / 2) : β€–x - yβ€– * β€–x - yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– := (norm_sub_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two x y).2 h #align inner_product_geometry.norm_sub_sq_eq_norm_sq_add_norm_sq' InnerProductGeometry.norm_sub_sq_eq_norm_sq_add_norm_sq'
Mathlib/Geometry/Euclidean/Angle/Unoriented/RightAngle.lean
69
73
theorem angle_add_eq_arccos_of_inner_eq_zero {x y : V} (h : βŸͺx, y⟫ = 0) : angle x (x + y) = Real.arccos (β€–xβ€– / β€–x + yβ€–) := by
rw [angle, inner_add_right, h, add_zero, real_inner_self_eq_norm_mul_norm] by_cases hx : β€–xβ€– = 0; Β· simp [hx] rw [div_mul_eq_div_div, mul_self_div_self]
[ " β€–x + yβ€– * β€–x + yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– ↔ angle x y = Ο€ / 2", " βŸͺx, y⟫_ℝ = 0 ↔ angle x y = Ο€ / 2", " β€–x - yβ€– * β€–x - yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– ↔ angle x y = Ο€ / 2", " angle x (x + y) = (β€–xβ€– / β€–x + yβ€–).arccos", " (β€–xβ€– * β€–xβ€– / (β€–xβ€– * β€–x + yβ€–)).arccos = (β€–xβ€– / β€–x + yβ€–).arccos" ]
[ " β€–x + yβ€– * β€–x + yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– ↔ angle x y = Ο€ / 2", " βŸͺx, y⟫_ℝ = 0 ↔ angle x y = Ο€ / 2", " β€–x - yβ€– * β€–x - yβ€– = β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€– ↔ angle x y = Ο€ / 2" ]
import Mathlib.Logic.Pairwise import Mathlib.Logic.Relation import Mathlib.Data.List.Basic #align_import data.list.pairwise from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" open Nat Function namespace List variable {Ξ± Ξ² : Type*} {R S T : Ξ± β†’ Ξ± β†’ Prop} {a : Ξ±} {l : List Ξ±} mk_iff_of_inductive_prop List.Pairwise List.pairwise_iff #align list.pairwise_iff List.pairwise_iff #align list.pairwise.nil List.Pairwise.nil #align list.pairwise.cons List.Pairwise.cons #align list.rel_of_pairwise_cons List.rel_of_pairwise_cons #align list.pairwise.of_cons List.Pairwise.of_cons #align list.pairwise.tail List.Pairwise.tail #align list.pairwise.drop List.Pairwise.drop #align list.pairwise.imp_of_mem List.Pairwise.imp_of_mem #align list.pairwise.imp List.Pairwise.impβ‚“ -- Implicits Order #align list.pairwise_and_iff List.pairwise_and_iff #align list.pairwise.and List.Pairwise.and #align list.pairwise.impβ‚‚ List.Pairwise.impβ‚‚ #align list.pairwise.iff_of_mem List.Pairwise.iff_of_mem #align list.pairwise.iff List.Pairwise.iff #align list.pairwise_of_forall List.pairwise_of_forall #align list.pairwise.and_mem List.Pairwise.and_mem #align list.pairwise.imp_mem List.Pairwise.imp_mem #align list.pairwise.sublist List.Pairwise.sublistβ‚“ -- Implicits order #align list.pairwise.forall_of_forall_of_flip List.Pairwise.forall_of_forall_of_flip theorem Pairwise.forall_of_forall (H : Symmetric R) (H₁ : βˆ€ x ∈ l, R x x) (Hβ‚‚ : l.Pairwise R) : βˆ€ ⦃x⦄, x ∈ l β†’ βˆ€ ⦃y⦄, y ∈ l β†’ R x y := Hβ‚‚.forall_of_forall_of_flip H₁ <| by rwa [H.flip_eq] #align list.pairwise.forall_of_forall List.Pairwise.forall_of_forall theorem Pairwise.forall (hR : Symmetric R) (hl : l.Pairwise R) : βˆ€ ⦃a⦄, a ∈ l β†’ βˆ€ ⦃b⦄, b ∈ l β†’ a β‰  b β†’ R a b := by apply Pairwise.forall_of_forall Β· exact fun a b h hne => hR (h hne.symm) Β· exact fun _ _ hx => (hx rfl).elim Β· exact hl.imp (@fun a b h _ => by exact h) #align list.pairwise.forall List.Pairwise.forall theorem Pairwise.set_pairwise (hl : Pairwise R l) (hr : Symmetric R) : { x | x ∈ l }.Pairwise R := hl.forall hr #align list.pairwise.set_pairwise List.Pairwise.set_pairwise #align list.pairwise_singleton List.pairwise_singleton #align list.pairwise_pair List.pairwise_pair #align list.pairwise_append List.pairwise_append #align list.pairwise_append_comm List.pairwise_append_comm #align list.pairwise_middle List.pairwise_middle -- Porting note: Duplicate of `pairwise_map` but with `f` explicit. @[deprecated (since := "2024-02-25")] theorem pairwise_map' (f : Ξ² β†’ Ξ±) : βˆ€ {l : List Ξ²}, Pairwise R (map f l) ↔ Pairwise (fun a b : Ξ² => R (f a) (f b)) l | [] => by simp only [map, Pairwise.nil] | b :: l => by simp only [map, pairwise_cons, mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ‚‚, pairwise_map] #align list.pairwise_map List.pairwise_map' #align list.pairwise.of_map List.Pairwise.of_map #align list.pairwise.map List.Pairwise.map #align list.pairwise_filter_map List.pairwise_filterMap #align list.pairwise.filter_map List.Pairwise.filter_map #align list.pairwise_filter List.pairwise_filter #align list.pairwise.filter List.Pairwise.filterβ‚“ theorem pairwise_pmap {p : Ξ² β†’ Prop} {f : βˆ€ b, p b β†’ Ξ±} {l : List Ξ²} (h : βˆ€ x ∈ l, p x) : Pairwise R (l.pmap f h) ↔ Pairwise (fun b₁ bβ‚‚ => βˆ€ (h₁ : p b₁) (hβ‚‚ : p bβ‚‚), R (f b₁ h₁) (f bβ‚‚ hβ‚‚)) l := by induction' l with a l ihl Β· simp obtain ⟨_, hl⟩ : p a ∧ βˆ€ b, b ∈ l β†’ p b := by simpa using h simp only [ihl hl, pairwise_cons, existsβ‚‚_imp, pmap, and_congr_left_iff, mem_pmap] refine fun _ => ⟨fun H b hb _ hpb => H _ _ hb rfl, ?_⟩ rintro H _ b hb rfl exact H b hb _ _ #align list.pairwise_pmap List.pairwise_pmap theorem Pairwise.pmap {l : List Ξ±} (hl : Pairwise R l) {p : Ξ± β†’ Prop} {f : βˆ€ a, p a β†’ Ξ²} (h : βˆ€ x ∈ l, p x) {S : Ξ² β†’ Ξ² β†’ Prop} (hS : βˆ€ ⦃x⦄ (hx : p x) ⦃y⦄ (hy : p y), R x y β†’ S (f x hx) (f y hy)) : Pairwise S (l.pmap f h) := by refine (pairwise_pmap h).2 (Pairwise.imp_of_mem ?_ hl) intros; apply hS; assumption #align list.pairwise.pmap List.Pairwise.pmap #align list.pairwise_join List.pairwise_join #align list.pairwise_bind List.pairwise_bind #align list.pairwise_reverse List.pairwise_reverse #align list.pairwise_of_reflexive_on_dupl_of_forall_ne List.pairwise_of_reflexive_on_dupl_of_forall_ne
Mathlib/Data/List/Pairwise.lean
152
156
theorem pairwise_of_forall_mem_list {l : List Ξ±} {r : Ξ± β†’ Ξ± β†’ Prop} (h : βˆ€ a ∈ l, βˆ€ b ∈ l, r a b) : l.Pairwise r := by
rw [pairwise_iff_forall_sublist] intro a b hab apply h <;> (apply hab.subset; simp)
[ " Pairwise (flip fun x => R x) l", " βˆ€ ⦃a : α⦄, a ∈ l β†’ βˆ€ ⦃b : α⦄, b ∈ l β†’ a β‰  b β†’ R a b", " Symmetric fun x y => x β‰  y β†’ R x y", " βˆ€ (x : Ξ±), x ∈ l β†’ x β‰  x β†’ R x x", " Pairwise (fun x y => x β‰  y β†’ R x y) l", " R a b", " Pairwise R (map f []) ↔ Pairwise (fun a b => R (f a) (f b)) []", " Pairwise R (ma...
[ " Pairwise (flip fun x => R x) l", " βˆ€ ⦃a : α⦄, a ∈ l β†’ βˆ€ ⦃b : α⦄, b ∈ l β†’ a β‰  b β†’ R a b", " Symmetric fun x y => x β‰  y β†’ R x y", " βˆ€ (x : Ξ±), x ∈ l β†’ x β‰  x β†’ R x x", " Pairwise (fun x y => x β‰  y β†’ R x y) l", " R a b", " Pairwise R (map f []) ↔ Pairwise (fun a b => R (f a) (f b)) []", " Pairwise R (ma...
import Mathlib.Geometry.Manifold.ContMDiff.Basic open Set Function Filter ChartedSpace SmoothManifoldWithCorners open scoped Topology Manifold variable {π•œ : Type*} [NontriviallyNormedField π•œ] -- declare a smooth manifold `M` over the pair `(E, H)`. {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners π•œ E H) {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [SmoothManifoldWithCorners I M] -- declare a smooth manifold `M'` over the pair `(E', H')`. {E' : Type*} [NormedAddCommGroup E'] [NormedSpace π•œ E'] {H' : Type*} [TopologicalSpace H'] (I' : ModelWithCorners π•œ E' H') {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] [SmoothManifoldWithCorners I' M'] -- declare a manifold `M''` over the pair `(E'', H'')`. {E'' : Type*} [NormedAddCommGroup E''] [NormedSpace π•œ E''] {H'' : Type*} [TopologicalSpace H''] {I'' : ModelWithCorners π•œ E'' H''} {M'' : Type*} [TopologicalSpace M''] [ChartedSpace H'' M''] -- declare a smooth manifold `N` over the pair `(F, G)`. {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] {G : Type*} [TopologicalSpace G] {J : ModelWithCorners π•œ F G} {N : Type*} [TopologicalSpace N] [ChartedSpace G N] [SmoothManifoldWithCorners J N] -- declare a smooth manifold `N'` over the pair `(F', G')`. {F' : Type*} [NormedAddCommGroup F'] [NormedSpace π•œ F'] {G' : Type*} [TopologicalSpace G'] {J' : ModelWithCorners π•œ F' G'} {N' : Type*} [TopologicalSpace N'] [ChartedSpace G' N'] [SmoothManifoldWithCorners J' N'] -- F₁, Fβ‚‚, F₃, Fβ‚„ are normed spaces {F₁ : Type*} [NormedAddCommGroup F₁] [NormedSpace π•œ F₁] {Fβ‚‚ : Type*} [NormedAddCommGroup Fβ‚‚] [NormedSpace π•œ Fβ‚‚] {F₃ : Type*} [NormedAddCommGroup F₃] [NormedSpace π•œ F₃] {Fβ‚„ : Type*} [NormedAddCommGroup Fβ‚„] [NormedSpace π•œ Fβ‚„] -- declare functions, sets, points and smoothness indices {e : PartialHomeomorph M H} {e' : PartialHomeomorph M' H'} {f f₁ : M β†’ M'} {s s₁ t : Set M} {x : M} {m n : β„•βˆž} variable {I I'} section ProdMk theorem ContMDiffWithinAt.prod_mk {f : M β†’ M'} {g : M β†’ N'} (hf : ContMDiffWithinAt I I' n f s x) (hg : ContMDiffWithinAt I J' n g s x) : ContMDiffWithinAt I (I'.prod J') n (fun x => (f x, g x)) s x := by rw [contMDiffWithinAt_iff] at * exact ⟨hf.1.prod hg.1, hf.2.prod hg.2⟩ #align cont_mdiff_within_at.prod_mk ContMDiffWithinAt.prod_mk
Mathlib/Geometry/Manifold/ContMDiff/Product.lean
66
70
theorem ContMDiffWithinAt.prod_mk_space {f : M β†’ E'} {g : M β†’ F'} (hf : ContMDiffWithinAt I π“˜(π•œ, E') n f s x) (hg : ContMDiffWithinAt I π“˜(π•œ, F') n g s x) : ContMDiffWithinAt I π“˜(π•œ, E' Γ— F') n (fun x => (f x, g x)) s x := by
rw [contMDiffWithinAt_iff] at * exact ⟨hf.1.prod hg.1, hf.2.prod hg.2⟩
[ " ContMDiffWithinAt I (I'.prod J') n (fun x => (f x, g x)) s x", " ContinuousWithinAt (fun x => (f x, g x)) s x ∧\n ContDiffWithinAt π•œ n (↑(extChartAt (I'.prod J') (f x, g x)) ∘ (fun x => (f x, g x)) ∘ ↑(extChartAt I x).symm)\n (↑(extChartAt I x).symm ⁻¹' s ∩ range ↑I) (↑(extChartAt I x) x)", " ContMDi...
[ " ContMDiffWithinAt I (I'.prod J') n (fun x => (f x, g x)) s x", " ContinuousWithinAt (fun x => (f x, g x)) s x ∧\n ContDiffWithinAt π•œ n (↑(extChartAt (I'.prod J') (f x, g x)) ∘ (fun x => (f x, g x)) ∘ ↑(extChartAt I x).symm)\n (↑(extChartAt I x).symm ⁻¹' s ∩ range ↑I) (↑(extChartAt I x) x)" ]
import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison import Mathlib.CategoryTheory.Sites.Equivalence namespace CategoryTheory variable {C : Type*} [Category C] open GrothendieckTopology namespace Equivalence variable {D : Type*} [Category D] variable (e : C β‰Œ D) section Regular variable [Preregular C] theorem preregular : Preregular D := e.inverse.reflects_preregular instance [EssentiallySmall C] : Preregular (SmallModel C) := (equivSmallModel C).preregular instance : haveI := preregular e e.TransportsGrothendieckTopology (regularTopology C) (regularTopology D) where eq_inducedTopology := regularTopology.eq_induced e.inverse variable (A : Type*) [Category A] @[simps!] def sheafCongrPreregular : haveI := e.preregular Sheaf (regularTopology C) A β‰Œ Sheaf (regularTopology D) A := e.sheafCongr _ _ _ open Presheaf
Mathlib/CategoryTheory/Sites/Coherent/Equivalence.lean
101
106
theorem preregular_isSheaf_iff (F : Cα΅’α΅– β₯€ A) : haveI := e.preregular IsSheaf (regularTopology C) F ↔ IsSheaf (regularTopology D) (e.inverse.op β‹™ F) := by
refine ⟨fun hF ↦ ((e.sheafCongrPreregular A).functor.obj ⟨F, hF⟩).cond, fun hF ↦ ?_⟩ rw [isSheaf_of_iso_iff (P' := e.functor.op β‹™ e.inverse.op β‹™ F)] Β· exact (e.sheafCongrPreregular A).inverse.obj ⟨e.inverse.op β‹™ F, hF⟩ |>.cond Β· exact isoWhiskerRight e.op.unitIso F
[ " IsSheaf (regularTopology C) F ↔ IsSheaf (regularTopology D) (e.inverse.op β‹™ F)", " IsSheaf (regularTopology C) F", " IsSheaf (regularTopology C) (e.functor.op β‹™ e.inverse.op β‹™ F)", " F β‰… e.functor.op β‹™ e.inverse.op β‹™ F" ]
[]
import Mathlib.CategoryTheory.Sites.Sieves import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer import Mathlib.CategoryTheory.Category.Preorder import Mathlib.Order.Copy import Mathlib.Data.Set.Subsingleton #align_import category_theory.sites.grothendieck from "leanprover-community/mathlib"@"14b69e9f3c16630440a2cbd46f1ddad0d561dee7" universe v₁ u₁ v u namespace CategoryTheory open CategoryTheory Category variable (C : Type u) [Category.{v} C] structure GrothendieckTopology where sieves : βˆ€ X : C, Set (Sieve X) top_mem' : βˆ€ X, ⊀ ∈ sieves X pullback_stable' : βˆ€ ⦃X Y : C⦄ ⦃S : Sieve X⦄ (f : Y ⟢ X), S ∈ sieves X β†’ S.pullback f ∈ sieves Y transitive' : βˆ€ ⦃X⦄ ⦃S : Sieve X⦄ (_ : S ∈ sieves X) (R : Sieve X), (βˆ€ ⦃Y⦄ ⦃f : Y ⟢ X⦄, S f β†’ R.pullback f ∈ sieves Y) β†’ R ∈ sieves X #align category_theory.grothendieck_topology CategoryTheory.GrothendieckTopology namespace GrothendieckTopology instance : CoeFun (GrothendieckTopology C) fun _ => βˆ€ X : C, Set (Sieve X) := ⟨sieves⟩ variable {C} variable {X Y : C} {S R : Sieve X} variable (J : GrothendieckTopology C) @[ext]
Mathlib/CategoryTheory/Sites/Grothendieck.lean
105
109
theorem ext {J₁ Jβ‚‚ : GrothendieckTopology C} (h : (J₁ : βˆ€ X : C, Set (Sieve X)) = Jβ‚‚) : J₁ = Jβ‚‚ := by
cases J₁ cases Jβ‚‚ congr
[ " J₁ = Jβ‚‚", " { sieves := sieves✝, top_mem' := top_mem'✝, pullback_stable' := pullback_stable'✝, transitive' := transitive'✝ } = Jβ‚‚", " { sieves := sieves✝¹, top_mem' := top_mem'✝¹, pullback_stable' := pullback_stable'✝¹, transitive' := transitive'✝¹ } =\n { sieves := sieves✝, top_mem' := top_mem'✝, pullback...
[]
import Mathlib.Algebra.Algebra.Basic import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue import Mathlib.Data.Real.Archimedean #align_import number_theory.class_number.admissible_abs from "leanprover-community/mathlib"@"e97cf15cd1aec9bd5c193b2ffac5a6dc9118912b" namespace AbsoluteValue open Int
Mathlib/NumberTheory/ClassNumber/AdmissibleAbs.lean
31
52
theorem exists_partition_int (n : β„•) {Ξ΅ : ℝ} (hΞ΅ : 0 < Ξ΅) {b : β„€} (hb : b β‰  0) (A : Fin n β†’ β„€) : βˆƒ t : Fin n β†’ Fin ⌈1 / Ξ΅βŒ‰β‚Š, βˆ€ iβ‚€ i₁, t iβ‚€ = t i₁ β†’ ↑(abs (A i₁ % b - A iβ‚€ % b)) < abs b β€’ Ξ΅ := by
have hb' : (0 : ℝ) < ↑(abs b) := Int.cast_pos.mpr (abs_pos.mpr hb) have hbΞ΅ : 0 < abs b β€’ Ξ΅ := by rw [Algebra.smul_def] exact mul_pos hb' hΞ΅ have hfloor : βˆ€ i, 0 ≀ floor ((A i % b : β„€) / abs b β€’ Ξ΅ : ℝ) := fun _ ↦ floor_nonneg.mpr (div_nonneg (cast_nonneg.mpr (emod_nonneg _ hb)) hbΞ΅.le) refine ⟨fun i ↦ ⟨natAbs (floor ((A i % b : β„€) / abs b β€’ Ξ΅ : ℝ)), ?_⟩, ?_⟩ Β· rw [← ofNat_lt, natAbs_of_nonneg (hfloor i), floor_lt] apply lt_of_lt_of_le _ (Nat.le_ceil _) rw [Algebra.smul_def, eq_intCast, ← div_div, div_lt_div_right hΞ΅, div_lt_iff hb', one_mul, cast_lt] exact Int.emod_lt _ hb intro iβ‚€ i₁ hi have hi : (βŒŠβ†‘(A iβ‚€ % b) / abs b β€’ Ξ΅βŒ‹.natAbs : β„€) = βŒŠβ†‘(A i₁ % b) / abs b β€’ Ξ΅βŒ‹.natAbs := congr_arg ((↑) : β„• β†’ β„€) (Fin.mk_eq_mk.mp hi) rw [natAbs_of_nonneg (hfloor iβ‚€), natAbs_of_nonneg (hfloor i₁)] at hi have hi := abs_sub_lt_one_of_floor_eq_floor hi rw [abs_sub_comm, ← sub_div, abs_div, abs_of_nonneg hbΞ΅.le, div_lt_iff hbΞ΅, one_mul] at hi rwa [Int.cast_abs, Int.cast_sub]
[ " βˆƒ t, βˆ€ (iβ‚€ i₁ : Fin n), t iβ‚€ = t i₁ β†’ ↑|A i₁ % b - A iβ‚€ % b| < |b| β€’ Ξ΅", " 0 < |b| β€’ Ξ΅", " 0 < (algebraMap β„€ ℝ) |b| * Ξ΅", " βŒŠβ†‘(A i % b) / |b| β€’ Ξ΅βŒ‹.natAbs < ⌈1 / Ξ΅βŒ‰β‚Š", " ↑(A i % b) / |b| β€’ Ξ΅ < β†‘β†‘βŒˆ1 / Ξ΅βŒ‰β‚Š", " ↑(A i % b) / |b| β€’ Ξ΅ < 1 / Ξ΅", " A i % b < |b|", " βˆ€ (iβ‚€ i₁ : Fin n),\n (fun i => βŸ¨βŒŠβ†‘(A i ...
[]
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 Powerset def powerset (s : Finset Ξ±) : Finset (Finset Ξ±) := ⟨(s.1.powerset.pmap Finset.mk) fun _t h => nodup_of_le (mem_powerset.1 h) s.nodup, s.nodup.powerset.pmap fun _a _ha _b _hb => congr_arg Finset.val⟩ #align finset.powerset Finset.powerset @[simp] theorem mem_powerset {s t : Finset Ξ±} : s ∈ powerset t ↔ s βŠ† t := by cases s simp [powerset, mem_mk, mem_pmap, mk.injEq, mem_powerset, exists_prop, exists_eq_right, ← val_le_iff] #align finset.mem_powerset Finset.mem_powerset @[simp, norm_cast] theorem coe_powerset (s : Finset Ξ±) : (s.powerset : Set (Finset Ξ±)) = ((↑) : Finset Ξ± β†’ Set Ξ±) ⁻¹' (s : Set Ξ±).powerset := by ext simp #align finset.coe_powerset Finset.coe_powerset -- Porting note: remove @[simp], simp can prove it theorem empty_mem_powerset (s : Finset Ξ±) : βˆ… ∈ powerset s := mem_powerset.2 (empty_subset _) #align finset.empty_mem_powerset Finset.empty_mem_powerset -- Porting note: remove @[simp], simp can prove it theorem mem_powerset_self (s : Finset Ξ±) : s ∈ powerset s := mem_powerset.2 Subset.rfl #align finset.mem_powerset_self Finset.mem_powerset_self @[aesop safe apply (rule_sets := [finsetNonempty])] theorem powerset_nonempty (s : Finset Ξ±) : s.powerset.Nonempty := βŸ¨βˆ…, empty_mem_powerset _⟩ #align finset.powerset_nonempty Finset.powerset_nonempty @[simp] theorem powerset_mono {s t : Finset Ξ±} : powerset s βŠ† powerset t ↔ s βŠ† t := ⟨fun h => mem_powerset.1 <| h <| mem_powerset_self _, fun st _u h => mem_powerset.2 <| Subset.trans (mem_powerset.1 h) st⟩ #align finset.powerset_mono Finset.powerset_mono theorem powerset_injective : Injective (powerset : Finset Ξ± β†’ Finset (Finset Ξ±)) := (injective_of_le_imp_le _) powerset_mono.1 #align finset.powerset_injective Finset.powerset_injective @[simp] theorem powerset_inj : powerset s = powerset t ↔ s = t := powerset_injective.eq_iff #align finset.powerset_inj Finset.powerset_inj @[simp] theorem powerset_empty : (βˆ… : Finset Ξ±).powerset = {βˆ…} := rfl #align finset.powerset_empty Finset.powerset_empty @[simp] theorem powerset_eq_singleton_empty : s.powerset = {βˆ…} ↔ s = βˆ… := by rw [← powerset_empty, powerset_inj] #align finset.powerset_eq_singleton_empty Finset.powerset_eq_singleton_empty @[simp] theorem card_powerset (s : Finset Ξ±) : card (powerset s) = 2 ^ card s := (card_pmap _ _ _).trans (Multiset.card_powerset s.1) #align finset.card_powerset Finset.card_powerset
Mathlib/Data/Finset/Powerset.lean
93
96
theorem not_mem_of_mem_powerset_of_not_mem {s t : Finset Ξ±} {a : Ξ±} (ht : t ∈ s.powerset) (h : a βˆ‰ s) : a βˆ‰ t := by
apply mt _ h apply mem_powerset.1 ht
[ " s ∈ t.powerset ↔ s βŠ† t", " { val := val✝, nodup := nodup✝ } ∈ t.powerset ↔ { val := val✝, nodup := nodup✝ } βŠ† t", " ↑s.powerset = toSet ⁻¹' 𝒫↑s", " x✝ ∈ ↑s.powerset ↔ x✝ ∈ toSet ⁻¹' 𝒫↑s", " s.powerset = {βˆ…} ↔ s = βˆ…", " a βˆ‰ t", " a ∈ t β†’ a ∈ s" ]
[ " s ∈ t.powerset ↔ s βŠ† t", " { val := val✝, nodup := nodup✝ } ∈ t.powerset ↔ { val := val✝, nodup := nodup✝ } βŠ† t", " ↑s.powerset = toSet ⁻¹' 𝒫↑s", " x✝ ∈ ↑s.powerset ↔ x✝ ∈ toSet ⁻¹' 𝒫↑s", " s.powerset = {βˆ…} ↔ s = βˆ…" ]
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics #align_import analysis.special_functions.pow.continuity from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" noncomputable section open scoped Classical open Real Topology NNReal ENNReal Filter ComplexConjugate open Filter Finset Set section CpowLimits open Complex variable {Ξ± : Type*} theorem zero_cpow_eq_nhds {b : β„‚} (hb : b β‰  0) : (fun x : β„‚ => (0 : β„‚) ^ x) =αΆ [𝓝 b] 0 := by suffices βˆ€αΆ  x : β„‚ in 𝓝 b, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [zero_cpow hx, Pi.zero_apply] exact IsOpen.eventually_mem isOpen_ne hb #align zero_cpow_eq_nhds zero_cpow_eq_nhds theorem cpow_eq_nhds {a b : β„‚} (ha : a β‰  0) : (fun x => x ^ b) =αΆ [𝓝 a] fun x => exp (log x * b) := by suffices βˆ€αΆ  x : β„‚ in 𝓝 a, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] exact IsOpen.eventually_mem isOpen_ne ha #align cpow_eq_nhds cpow_eq_nhds theorem cpow_eq_nhds' {p : β„‚ Γ— β„‚} (hp_fst : p.fst β‰  0) : (fun x => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := by suffices βˆ€αΆ  x : β„‚ Γ— β„‚ in 𝓝 p, x.1 β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] refine IsOpen.eventually_mem ?_ hp_fst change IsOpen { x : β„‚ Γ— β„‚ | x.1 = 0 }ᢜ rw [isOpen_compl_iff] exact isClosed_eq continuous_fst continuous_const #align cpow_eq_nhds' cpow_eq_nhds' -- Continuity of `fun x => a ^ x`: union of these two lemmas is optimal. theorem continuousAt_const_cpow {a b : β„‚} (ha : a β‰  0) : ContinuousAt (fun x : β„‚ => a ^ x) b := by have cpow_eq : (fun x : β„‚ => a ^ x) = fun x => exp (log a * x) := by ext1 b rw [cpow_def_of_ne_zero ha] rw [cpow_eq] exact continuous_exp.continuousAt.comp (ContinuousAt.mul continuousAt_const continuousAt_id) #align continuous_at_const_cpow continuousAt_const_cpow theorem continuousAt_const_cpow' {a b : β„‚} (h : b β‰  0) : ContinuousAt (fun x : β„‚ => a ^ x) b := by by_cases ha : a = 0 Β· rw [ha, continuousAt_congr (zero_cpow_eq_nhds h)] exact continuousAt_const Β· exact continuousAt_const_cpow ha #align continuous_at_const_cpow' continuousAt_const_cpow' theorem continuousAt_cpow {p : β„‚ Γ— β„‚} (hp_fst : p.fst ∈ slitPlane) : ContinuousAt (fun x : β„‚ Γ— β„‚ => x.1 ^ x.2) p := by rw [continuousAt_congr (cpow_eq_nhds' <| slitPlane_ne_zero hp_fst)] refine continuous_exp.continuousAt.comp ?_ exact ContinuousAt.mul (ContinuousAt.comp (continuousAt_clog hp_fst) continuous_fst.continuousAt) continuous_snd.continuousAt #align continuous_at_cpow continuousAt_cpow theorem continuousAt_cpow_const {a b : β„‚} (ha : a ∈ slitPlane) : ContinuousAt (Β· ^ b) a := Tendsto.comp (@continuousAt_cpow (a, b) ha) (continuousAt_id.prod continuousAt_const) #align continuous_at_cpow_const continuousAt_cpow_const theorem Filter.Tendsto.cpow {l : Filter Ξ±} {f g : Ξ± β†’ β„‚} {a b : β„‚} (hf : Tendsto f l (𝓝 a)) (hg : Tendsto g l (𝓝 b)) (ha : a ∈ slitPlane) : Tendsto (fun x => f x ^ g x) l (𝓝 (a ^ b)) := (@continuousAt_cpow (a, b) ha).tendsto.comp (hf.prod_mk_nhds hg) #align filter.tendsto.cpow Filter.Tendsto.cpow
Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean
105
109
theorem Filter.Tendsto.const_cpow {l : Filter Ξ±} {f : Ξ± β†’ β„‚} {a b : β„‚} (hf : Tendsto f l (𝓝 b)) (h : a β‰  0 ∨ b β‰  0) : Tendsto (fun x => a ^ f x) l (𝓝 (a ^ b)) := by
cases h with | inl h => exact (continuousAt_const_cpow h).tendsto.comp hf | inr h => exact (continuousAt_const_cpow' h).tendsto.comp hf
[ " (fun x => 0 ^ x) =αΆ [𝓝 b] 0", " (fun x => 0 ^ x) x = 0 x", " 0 ^ x = OfNat.ofNat 0 x", " βˆ€αΆ  (x : β„‚) in 𝓝 b, x β‰  0", " (fun x => x ^ b) =αΆ [𝓝 a] fun x => cexp (x.log * b)", " (fun x => x ^ b) x = (fun x => cexp (x.log * b)) x", " x ^ b = cexp (x.log * b)", " βˆ€αΆ  (x : β„‚) in 𝓝 a, x β‰  0", " (fun x =>...
[ " (fun x => 0 ^ x) =αΆ [𝓝 b] 0", " (fun x => 0 ^ x) x = 0 x", " 0 ^ x = OfNat.ofNat 0 x", " βˆ€αΆ  (x : β„‚) in 𝓝 b, x β‰  0", " (fun x => x ^ b) =αΆ [𝓝 a] fun x => cexp (x.log * b)", " (fun x => x ^ b) x = (fun x => cexp (x.log * b)) x", " x ^ b = cexp (x.log * b)", " βˆ€αΆ  (x : β„‚) in 𝓝 a, x β‰  0", " (fun x =>...
import Mathlib.MeasureTheory.Group.GeometryOfNumbers import Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic #align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30" variable (K : Type*) [Field K] namespace NumberField.mixedEmbedding open NumberField NumberField.InfinitePlace FiniteDimensional local notation "E" K => ({w : InfinitePlace K // IsReal w} β†’ ℝ) Γ— ({w : InfinitePlace K // IsComplex w} β†’ β„‚) section convexBodySum open ENNReal MeasureTheory Fintype open scoped Real Classical NNReal variable [NumberField K] (B : ℝ) variable {K} noncomputable abbrev convexBodySumFun (x : E K) : ℝ := βˆ‘ w, mult w * normAtPlace w x theorem convexBodySumFun_apply (x : E K) : convexBodySumFun x = βˆ‘ w, mult w * normAtPlace w x := rfl theorem convexBodySumFun_apply' (x : E K) : convexBodySumFun x = βˆ‘ w, β€–x.1 wβ€– + 2 * βˆ‘ w, β€–x.2 wβ€– := by simp_rw [convexBodySumFun_apply, ← Finset.sum_add_sum_compl {w | IsReal w}.toFinset, Set.toFinset_setOf, Finset.compl_filter, not_isReal_iff_isComplex, ← Finset.subtype_univ, ← Finset.univ.sum_subtype_eq_sum_filter, Finset.mul_sum] congr Β· ext w rw [mult, if_pos w.prop, normAtPlace_apply_isReal, Nat.cast_one, one_mul] Β· ext w rw [mult, if_neg (not_isReal_iff_isComplex.mpr w.prop), normAtPlace_apply_isComplex, Nat.cast_ofNat] theorem convexBodySumFun_nonneg (x : E K) : 0 ≀ convexBodySumFun x := Finset.sum_nonneg (fun _ _ => mul_nonneg (Nat.cast_pos.mpr mult_pos).le (normAtPlace_nonneg _ _)) theorem convexBodySumFun_neg (x : E K) : convexBodySumFun (- x) = convexBodySumFun x := by simp_rw [convexBodySumFun, normAtPlace_neg] theorem convexBodySumFun_add_le (x y : E K) : convexBodySumFun (x + y) ≀ convexBodySumFun x + convexBodySumFun y := by simp_rw [convexBodySumFun, ← Finset.sum_add_distrib, ← mul_add] exact Finset.sum_le_sum fun _ _ ↦ mul_le_mul_of_nonneg_left (normAtPlace_add_le _ x y) (Nat.cast_pos.mpr mult_pos).le theorem convexBodySumFun_smul (c : ℝ) (x : E K) : convexBodySumFun (c β€’ x) = |c| * convexBodySumFun x := by simp_rw [convexBodySumFun, normAtPlace_smul, ← mul_assoc, mul_comm, Finset.mul_sum, mul_assoc] theorem convexBodySumFun_eq_zero_iff (x : E K) : convexBodySumFun x = 0 ↔ x = 0 := by rw [← normAtPlace_eq_zero, convexBodySumFun, Finset.sum_eq_zero_iff_of_nonneg fun _ _ => mul_nonneg (Nat.cast_pos.mpr mult_pos).le (normAtPlace_nonneg _ _)] conv => enter [1, w, hw] rw [mul_left_mem_nonZeroDivisors_eq_zero_iff (mem_nonZeroDivisors_iff_ne_zero.mpr <| Nat.cast_ne_zero.mpr mult_ne_zero)] simp_rw [Finset.mem_univ, true_implies]
Mathlib/NumberTheory/NumberField/CanonicalEmbedding/ConvexBody.lean
326
333
theorem norm_le_convexBodySumFun (x : E K) : β€–xβ€– ≀ convexBodySumFun x := by
rw [norm_eq_sup'_normAtPlace] refine (Finset.sup'_le_iff _ _).mpr fun w _ ↦ ?_ rw [convexBodySumFun_apply, ← Finset.univ.add_sum_erase _ (Finset.mem_univ w)] refine le_add_of_le_of_nonneg ?_ ?_ Β· exact le_mul_of_one_le_left (normAtPlace_nonneg w x) one_le_mult Β· exact Finset.sum_nonneg (fun _ _ => mul_nonneg (Nat.cast_pos.mpr mult_pos).le (normAtPlace_nonneg _ _))
[ " convexBodySumFun x = βˆ‘ w : { w // w.IsReal }, β€–x.1 wβ€– + 2 * βˆ‘ w : { w // w.IsComplex }, β€–x.2 wβ€–", " βˆ‘ x_1 ∈ Finset.subtype (fun x => x.IsReal) Finset.univ, ↑(↑x_1).mult * (normAtPlace ↑x_1) x +\n βˆ‘ x_1 ∈ Finset.subtype (fun x => x.IsComplex) Finset.univ, ↑(↑x_1).mult * (normAtPlace ↑x_1) x =\n βˆ‘ x_1 ∈ F...
[ " convexBodySumFun x = βˆ‘ w : { w // w.IsReal }, β€–x.1 wβ€– + 2 * βˆ‘ w : { w // w.IsComplex }, β€–x.2 wβ€–", " βˆ‘ x_1 ∈ Finset.subtype (fun x => x.IsReal) Finset.univ, ↑(↑x_1).mult * (normAtPlace ↑x_1) x +\n βˆ‘ x_1 ∈ Finset.subtype (fun x => x.IsComplex) Finset.univ, ↑(↑x_1).mult * (normAtPlace ↑x_1) x =\n βˆ‘ x_1 ∈ F...