chars
int64
40
24k
content_type
stringclasses
9 values
id
stringlengths
13
64
source
stringclasses
5 values
subset
stringclasses
31 values
text
stringlengths
40
24k
282
leanexplore_declaration
leanexplore:385852
leanexplore_sqlite
leanexplore_declarations
/-- **Bunyakovsky condition** A condition on polynomials in the Schinzel and Bunyakovsky conjectures. Holds for nonconstant irreducible polynomial with positive leading coefficient. -/ def BunyakovskyCondition (f : ℤ[X]) : Prop := 1 ≤ f.degree ∧ Irreducible f ∧ 0 < f.leadingCoeff
197
leanexplore_declaration
leanexplore:385853
leanexplore_sqlite
leanexplore_declarations
theorem Polynomial.hasseDeriv_map {R S : Type*} [Semiring R] [Semiring S] {f : R →+* S} {k : ℕ} {p : R[X]} : (p.map f).hasseDeriv k = (p.hasseDeriv k).map f := by ext; simp [hasseDeriv_coeff]
154
leanexplore_declaration
leanexplore:385854
leanexplore_sqlite
leanexplore_declarations
theorem Prime.powerfree [CommMonoidWithZero M₀] [IsCancelMulZero M₀] {m : M₀} (h : Prime m) (hk : 2 ≤ k) : Powerfree k m := h.irreducible.powerfree hk
163
leanexplore_declaration
leanexplore:385855
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem not_powerfree_zero [MonoidWithZero M₀] [Nontrivial M₀] (k : ℕ) : ¬ Powerfree k (0 : M₀) := by rw [Powerfree, not_forall] exact ⟨0, by simp⟩
348
leanexplore_declaration
leanexplore:385856
leanexplore_sqlite
leanexplore_declarations
theorem Irreducible.powerfree (h : Irreducible m) (hk : 2 ≤ k) : Powerfree k m := by rintro y ⟨z, hz⟩ induction k with | zero => grind | succ n ih => rw [← npow_eq_pow, Monoid.npow_succ, mul_assoc] at hz rcases h.isUnit_or_isUnit hz with (hu | hu) · exact (isUnit_pow_iff (by linarith)).1 hu · apply ...
93
leanexplore_declaration
leanexplore:385857
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem powerfree_one (hk : k ≠ 0) : Powerfree k (1 : M) := isUnit_one.powerfree hk
135
leanexplore_declaration
leanexplore:385858
leanexplore_sqlite
leanexplore_declarations
theorem IsUnit.powerfree (h : IsUnit m) (hk : k ≠ 0) : Powerfree k m := fun _ hx => (isUnit_pow_iff hk).1 (isUnit_of_dvd_unit hx h)
135
leanexplore_declaration
leanexplore:385859
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem powerfree_two {m : M} : Powerfree 2 m ↔ Squarefree m where mp h x hx := h (sq x ▸ hx) mpr h x hx := h x (sq x ▸ hx)
132
leanexplore_declaration
leanexplore:385860
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem powerfree_neg [HasDistribNeg M] : Powerfree k (-m) ↔ Powerfree k m := powerfree_congr (Associated.refl m).neg_left
139
leanexplore_declaration
leanexplore:385861
leanexplore_sqlite
leanexplore_declarations
theorem powerfree_congr (hrm : Associated r m) : Powerfree k r ↔ Powerfree k m := ⟨fun h => h.of_dvd hrm.dvd', fun h => h.of_dvd hrm.dvd⟩
112
leanexplore_declaration
leanexplore:385862
leanexplore_sqlite
leanexplore_declarations
theorem Powerfree.of_dvd (hrm : r ∣ m) (hm : Powerfree k m) : Powerfree k r := fun _ hx => hm (hx.trans hrm)
156
leanexplore_declaration
leanexplore:385863
leanexplore_sqlite
leanexplore_declarations
theorem Powerfree.of_le {a b : ℕ} (hab : a ≤ b) (hm : Powerfree a m) : Powerfree b m := fun x hx => hm (dvd_of_mul_right_dvd (pow_mul_pow_sub x hab ▸ hx))
73
leanexplore_declaration
leanexplore:385864
leanexplore_sqlite
leanexplore_declarations
def Powerfree (k : ℕ) (m : M) : Prop := ∀ ⦃x : M⦄, x ^ k ∣ m → IsUnit x
122
leanexplore_declaration
leanexplore:385865
leanexplore_sqlite
leanexplore_declarations
/-- `ℙ(n; S)` is the affine `S` indexed by `n` -/ scoped [AlgebraicGeometry] notation "ℙ("n"; "S")" => ProjectiveSpace n S
210
leanexplore_declaration
leanexplore:385866
leanexplore_sqlite
leanexplore_declarations
/-- The projective space over a scheme `S`, with homogeneous coordinates indexed by `n` -/ noncomputable def ProjectiveSpace : Scheme.{max u v} := pullback (terminal.from S) (terminal.from (Proj ℤ[n].{u, v}))
65
leanexplore_declaration
leanexplore:385867
leanexplore_sqlite
leanexplore_declarations
exists_vector_bundle_data : ∃ (D : M.FiniteRankVectorBundleData),
295
leanexplore_declaration
leanexplore:385868
leanexplore_sqlite
leanexplore_declarations
/-- A class for vector bundles of constant finite rank. -/ class IsVectorBundleWithRank (M : SheafOfModules R) (n : ℕ) where /-- The predicate that a sheaf of modules is locally free. -/ exists_vector_bundle_data : ∃ (D : M.FiniteRankVectorBundleData), ∀ i, Nat.card (D.BasisIndex i) = n
229
leanexplore_declaration
leanexplore:385870
leanexplore_sqlite
leanexplore_declarations
structure FiniteRankVectorBundleData (M : SheafOfModules R) extends VectorBundleData M where /-- The predicate that every local basis in the defining data of the vector bundle is finite. -/ finite : ∀ i, Finite (BasisIndex i)
75
leanexplore_declaration
leanexplore:385871
leanexplore_sqlite
leanexplore_declarations
locallyFree : ∀ i, (M.over <| opens i) ≅ SheafOfModules.free (BasisIndex i)
704
leanexplore_declaration
leanexplore:385876
leanexplore_sqlite
leanexplore_declarations
/-- A vector bundle is a sheaf of modules that is locally isomorphic to a free sheaf. -/ structure VectorBundleData (M : SheafOfModules.{v} R) where /-- The index type for the open cover on which the vector bundle is free. -/ OpensIndex : Type u /-- The indexed family of opens on which the vector bundle is free. ...
77
leanexplore_declaration
leanexplore:385877
leanexplore_sqlite
leanexplore_declarations
notation g " ≪ " f => Asymptotics.IsBigO Filter.atTop (g : ℕ → ℝ) (f : ℕ → ℝ)
77
leanexplore_declaration
leanexplore:385878
leanexplore_sqlite
leanexplore_declarations
notation f " ≫ " g => Asymptotics.IsBigO Filter.atTop (g : ℕ → ℝ) (f : ℕ → ℝ)
1,365
leanexplore_declaration
leanexplore:385879
leanexplore_sqlite
leanexplore_declarations
theorem HasFejerGaps.hasFabryGaps {f : ℕ → ℕ} (hf : HasFejerGaps f) : HasFabryGaps f := by refine ⟨hf.1, tendsto_atTop_mono' (f₁ := (· / 2) ∘ (·⁻¹) ∘ (∑' n : Set.Ici ·, (f n : ℝ)⁻¹) ∘ (· / 2)) _ ?_ <| (tendsto_div_const_atTop_of_pos (two_pos (α := ℝ))).2 <| tendsto_inv_nhdsGT_zero.comp <| .comp (ten...
251
leanexplore_declaration
leanexplore:385880
leanexplore_sqlite
leanexplore_declarations
/-- A sequence of natural numbers `n₀ < n₁ < ...` is said to have Fejér gaps if `∑' 1 / nₖ < ∞`. This is the terminology adopted in [Wa01] and some other sources. -/ def HasFejerGaps (n : ℕ → ℕ) : Prop := StrictMono n ∧ Summable (fun k => (n k : ℝ)⁻¹)
261
leanexplore_declaration
leanexplore:385881
leanexplore_sqlite
leanexplore_declarations
/-- A sequence of natural numbers `n₀ < n₁ < ...` is said to have Fabry gaps if `nₖ / k → ∞`. This is the terminology adopted in [Wa01] and some other sources. -/ def HasFabryGaps (n : ℕ → ℕ) : Prop := StrictMono n ∧ Tendsto (fun k => n k / (k : ℝ)) atTop atTop
799
leanexplore_declaration
leanexplore:385882
leanexplore_sqlite
leanexplore_declarations
theorem iteratedLog_four : Real.iteratedLog 4 = 2 := by simp [Real.iteratedLog] have : Real.log^[2] 4 ≤ 1 := by have h_ne_zero : Real.log √4 ≠ 0 := by simp; linarith [Real.sqrt_nonneg 4] have : Real.log 4 ≤ 2 := by have := mul_eq_of_eq_mul_inv₀ h_ne_zero <| div_eq_mul_inv _ (2 : ℝ) ▸ (Real.log_sqrt (s...
297
leanexplore_declaration
leanexplore:385883
leanexplore_sqlite
leanexplore_declarations
theorem iteratedLog_two : Real.iteratedLog 2 = 1 := by simp [Real.iteratedLog] have : Real.log 2 ≤ 1 := by convert Real.log_le_sub_one_of_pos (show 0 < 2 by norm_num) norm_num rw [Nat.sInf_def ⟨1, this⟩] exact (Nat.find_eq_iff _).2 ⟨this, fun n hn => by simp [Nat.lt_one_iff.1 hn]⟩
139
leanexplore_declaration
leanexplore:385884
leanexplore_sqlite
leanexplore_declarations
theorem Real.iteratedLog_eq_zero_of_neg {x : ℝ} (hx : x < 0) : Real.iteratedLog x = 0 := Real.iteratedLog_eq_zero_of_le (by linarith)
132
leanexplore_declaration
leanexplore:385885
leanexplore_sqlite
leanexplore_declarations
theorem Real.iteratedLog_eq_zero_of_le {x : ℝ} (hx : x ≤ 1) : Real.iteratedLog x = 0 := by simpa [iteratedLog] using Or.inl hx
307
leanexplore_declaration
leanexplore:385886
leanexplore_sqlite
leanexplore_declarations
/-- The iterated logarithm of `x` is the number of times the natural logarithm must be iteratively applied before the result is less than or equal to `1`. Reference: https://en.wikipedia.org/wiki/Iterated_logarithm -/ noncomputable def Real.iteratedLog (x : ℝ) : ℕ := sInf { (n : ℕ) | Real.log^[n] x ≤ 1 }
238
leanexplore_declaration
leanexplore:385887
leanexplore_sqlite
leanexplore_declarations
theorem nthRoot_mul_of_odd {n : ℕ} {a b : ℝ} (hn : Odd n) : nthRoot n (a * b) = nthRoot n a * nthRoot n b := by simp [Real.nthRoot_of_odd hn, sign_mul, SignType.coe_mul, abs_mul, Real.mul_rpow (abs_nonneg a) (abs_nonneg b)] ring
231
leanexplore_declaration
leanexplore:385888
leanexplore_sqlite
leanexplore_declarations
theorem nthRoot_mul_of_even_of_nonneg {n : ℕ} {a b : ℝ} (hn : Even n) (ha : 0 ≤ a) (hb : 0 ≤ b) : Real.nthRoot n (a * b) = Real.nthRoot n a * Real.nthRoot n b := by simp only [Real.nthRoot_of_even hn, Real.mul_rpow ha hb]
497
leanexplore_declaration
leanexplore:385889
leanexplore_sqlite
leanexplore_declarations
theorem nthRoot_pow {n : ℕ} (r : ℝ) (h : (n ≠ 0 ∧ 0 ≤ r) ∨ Odd n) : nthRoot n (r ^ n) = r := by cases Nat.even_or_odd n with | inl he => obtain ⟨hn, hr⟩ := h.resolve_right (Nat.not_odd_iff_even.mpr he) rw [nthRoot_of_even he, pow_rpow_inv_natCast hr hn] | inr ho => have hn : n ≠ 0 := Nat.ne_of_odd_add...
493
leanexplore_declaration
leanexplore:385890
leanexplore_sqlite
leanexplore_declarations
theorem pow_nthRoot {n : ℕ} (r : ℝ) (h : (n ≠ 0 ∧ 0 ≤ r) ∨ Odd n) : nthRoot n r ^ n = r := by cases Nat.even_or_odd n with | inl he => obtain ⟨hn, hr⟩ := h.resolve_right (Nat.not_odd_iff_even.mpr he) rw [nthRoot_of_even he, rpow_inv_natCast_pow hr hn] | inr ho => have hn : n ≠ 0 := by exact Nat.ne_of_...
384
leanexplore_declaration
leanexplore:385891
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem nthRoot_neg_of_odd {n : ℕ} (hn : Odd n) {r : ℝ} : nthRoot n (-r) = -nthRoot n r := by obtain hr | hr := le_total r 0 · rw [nthRoot_of_odd_of_nonpos hn hr, hn.neg_one_pow, neg_one_mul, neg_neg, nthRoot_of_nonneg (neg_nonneg.mpr hr)] · rw [nthRoot_of_odd_of_nonpos hn (neg_nonpos.mpr hr), h...
360
leanexplore_declaration
leanexplore:385892
leanexplore_sqlite
leanexplore_declarations
theorem nthRoot_of_nonneg {n : ℕ} {r : ℝ} (hr : 0 ≤ r) : nthRoot n r = r ^ (n⁻¹ : ℝ) := by cases Nat.even_or_odd n with | inl he => rw [nthRoot_of_even he] | inr ho => have hn0 : n ≠ 0 := Nat.ne_of_odd_add ho rw [nthRoot_of_odd ho, abs_of_nonneg hr] obtain rfl | hr := hr.eq_or_lt · simp [h...
373
leanexplore_declaration
leanexplore:385893
leanexplore_sqlite
leanexplore_declarations
theorem nthRoot_of_odd_of_nonpos {n : ℕ} (hn : Odd n) {r : ℝ} (hr : r ≤ 0) : nthRoot n r = (-1) ^ n * (-r) ^ (n⁻¹ : ℝ) := by rw [nthRoot_of_odd hn] obtain rfl | hr := hr.eq_or_lt · simp have hn0 : n ≠ 0 := Nat.ne_of_odd_add hn rw [zero_pow hn0, zero_rpow (inv_ne_zero <| mod_cast hn0)] right rf...
154
leanexplore_declaration
leanexplore:385894
leanexplore_sqlite
leanexplore_declarations
theorem nthRoot_of_odd {n : ℕ} (hn : Odd n) (r : ℝ) : nthRoot n r = SignType.sign r ^ n * abs r ^ (n⁻¹ : ℝ) := if_neg <| Nat.not_even_iff_odd.mpr hn
98
leanexplore_declaration
leanexplore:385895
leanexplore_sqlite
leanexplore_declarations
theorem nthRoot_of_even {n : ℕ} (hn : Even n) (r : ℝ) : nthRoot n r = r ^ (n⁻¹ : ℝ) := if_pos hn
124
leanexplore_declaration
leanexplore:385896
leanexplore_sqlite
leanexplore_declarations
noncomputable def nthRoot (n : ℕ) (r : ℝ) : ℝ := if Even n then r ^ (n⁻¹ : ℝ) else SignType.sign r ^ n * abs r ^ (n⁻¹ : ℝ)
295
leanexplore_declaration
leanexplore:385897
leanexplore_sqlite
leanexplore_declarations
/-- Define the largest possible size of a subset of a finset `s` that does not contain any non-trivial `k`-term arithmetic progression. -/ noncomputable def Finset.maxAPFreeCard (k : ℕ) (s : Finset α) : ℕ := (s.powerset.filter fun t : Finset α ↦ (t : Set α).IsAPOfLengthFree k).sup Finset.card
379
leanexplore_declaration
leanexplore:385898
leanexplore_sqlite
leanexplore_declarations
/-- A function `f : β → α` has a monotone `k`-term arithmetic progression if there exists a choice of indices `b 1 < b 2 < ... < b k` such that the subsequence `f (b i)` forms an increasing or decreasing arithmetic progression of length `k`. -/ def HasMonotoneAP {β : Type*} [Preorder β] (f : β → α) (k : ℕ) : Prop := ...
186
leanexplore_declaration
leanexplore:385899
leanexplore_sqlite
leanexplore_declarations
def ContainsMonoAPofLength {κ : Type} [Finite κ] {M : Set α} (coloring : M → κ) (k : ℕ) : Prop := ∃ c : κ, ∃ ap : Set M, ((·.1) '' ap).IsAPOfLength k ∧ ∀ m ∈ ap, coloring m = c
195
leanexplore_declaration
leanexplore:385900
leanexplore_sqlite
leanexplore_declarations
/-- A set `A` contains an arithmetic progression of length `k` with difference `d`. -/ def Set.ContainsAP (A : Set α) (k : ℕ) (d : α) : Prop := ∃ a, ∃ s, s ⊆ A ∧ s.IsAPOfLengthWith (k : ℕ∞) a d
164
leanexplore_declaration
leanexplore:385901
leanexplore_sqlite
leanexplore_declarations
theorem Set.IsAPOfLengthFree.maxCard_one (N : ℕ) : maxCard 1 N = N := by nth_rw 2 [← maxCard_zero N] simp [maxCard, isAPOfLengthFree_one, isAPOfLengthFree_zero]
328
leanexplore_declaration
leanexplore:385902
leanexplore_sqlite
leanexplore_declarations
theorem Set.IsAPOfLengthFree.maxCard_zero (N : ℕ) : maxCard 0 N = N := by simp only [maxCard, Nat.cast_zero, isAPOfLengthFree_zero, exists_const, exists_prop] apply IsGreatest.csSup_eq refine ⟨⟨Finset.Icc 1 N, Subset.rfl, Nat.card_Icc _ _⟩, ?_⟩ rintro n ⟨S, hS, rfl⟩ exact S.card_mono hS |>.trans_eq (Nat.card_...
304
leanexplore_declaration
leanexplore:385903
leanexplore_sqlite
leanexplore_declarations
/-- Define the largest possible size of a subset of $\{1, \dots, N\}$ that does not contain any non-trivial $k$-term arithmetic progression. -/ noncomputable def Set.IsAPOfLengthFree.maxCard (k : ℕ) (N : ℕ) : ℕ := sSup {Finset.card S | (S) (_ : S ⊆ Finset.Icc 1 N) (_ : (S : Set ℕ).IsAPOfLengthFree k)}
285
leanexplore_declaration
leanexplore:385904
leanexplore_sqlite
leanexplore_declarations
/-- Any non-trivial arithmetic progression cannot be free of arithmetic progressions. -/ theorem Set.IsAPOfLength.not_isAPOfLengthFree {s : Set α} {l : ℕ∞} (hs : s.IsAPOfLength l) (hl : 1 < l) : ¬s.IsAPOfLengthFree l := by simpa [Set.IsAPOfLengthFree] using ⟨s, le_rfl, ⟨hs, hl⟩⟩
203
leanexplore_declaration
leanexplore:385905
leanexplore_sqlite
leanexplore_declarations
/-- Any set is free of arithmetic progressions of length `0`, because such APs are all trivial. -/ theorem Set.isAPOfLengthFree_zero (s : Set α) : s.IsAPOfLengthFree 0 := by simp [Set.IsAPOfLengthFree]
202
leanexplore_declaration
leanexplore:385906
leanexplore_sqlite
leanexplore_declarations
/-- Any set is free of arithmetic progressions of length `1`, because such APs are all trivial. -/ theorem Set.isAPOfLengthFree_one (s : Set α) : s.IsAPOfLengthFree 1 := by simp [Set.IsAPOfLengthFree]
279
leanexplore_declaration
leanexplore:385907
leanexplore_sqlite
leanexplore_declarations
/-- We say that a set `s` is free of arithmetic progressions of length `l` if `s` contains no non-trivial arithmetic progressions of length `l`. Written as `Set.IsAPOfLengthFree s l`. --/ def Set.IsAPOfLengthFree (s : Set α) (l : ℕ∞) : Prop := ∀ t ⊆ s, t.IsAPOfLength l → l ≤ 1
234
leanexplore_declaration
leanexplore:385908
leanexplore_sqlite
leanexplore_declarations
/-- The empty set is not an arithmetic progression of positive length. -/ theorem Set.not_isAPOfLength_empty {l : ℕ∞} (hl : 0 < l) : ¬Set.IsAPOfLength (∅ : Set α) l := fun h ↦ by simp_all [h.congr <| Set.IsAPOfLength.zero.2 rfl]
132
leanexplore_declaration
leanexplore:385909
leanexplore_sqlite
leanexplore_declarations
theorem Nat.isAPOfLength_pair {a b : ℕ} (hab : a < b) : Set.IsAPOfLength {a, b} 2 := ⟨a, b - a, Nat.isAPOfLengthWith_pair hab⟩
177
leanexplore_declaration
leanexplore:385910
leanexplore_sqlite
leanexplore_declarations
theorem Set.isAPOfLength_pair {α : Type*} [DecidableEq α] [AddCommGroup α] {a b : α} (hab : a ≠ b) : Set.IsAPOfLength {a, b} 2 := ⟨a, b - a, Set.isAPOfLengthWith_pair hab⟩
242
leanexplore_declaration
leanexplore:385911
leanexplore_sqlite
leanexplore_declarations
/-- If a list is an arithmetic progression of lengths `l₁` and `l₂`, then the lengths are equal. -/ theorem congr {s : List α} {l₁ l₂ : ℕ} (h₁ : s.IsAPOfLength l₁) (h₂ : s.IsAPOfLength l₂) : l₁ = l₂ := by rw [← h₁.length, h₂.length]
152
leanexplore_declaration
leanexplore:385912
leanexplore_sqlite
leanexplore_declarations
/-- Only singletons are finite arithmetic progressions of length $1$. -/ @[simp] theorem one : s.IsAPOfLength 1 ↔ ∃ a, s = [a] := by simp [IsAPOfLength]
151
leanexplore_declaration
leanexplore:385913
leanexplore_sqlite
leanexplore_declarations
/-- Only the empty list is a finite arithmetic progression of length $0$. -/ @[simp] theorem zero : s.IsAPOfLength 0 ↔ s = [] := by simp [IsAPOfLength]
99
leanexplore_declaration
leanexplore:385914
leanexplore_sqlite
leanexplore_declarations
theorem length (h : s.IsAPOfLength l) : s.length = l := by obtain ⟨_, _, h⟩ := h exact h.length
237
leanexplore_declaration
leanexplore:385915
leanexplore_sqlite
leanexplore_declarations
/-- If a set is an arithmetic progression of lengths `l₁` and `l₂`, then the lengths are equal. -/ theorem congr {s : Set α} {l₁ l₂ : ℕ∞} (h₁ : s.IsAPOfLength l₁) (h₂ : s.IsAPOfLength l₂) : l₁ = l₂ := by rw [← h₁.card, h₂.card]
152
leanexplore_declaration
leanexplore:385916
leanexplore_sqlite
leanexplore_declarations
/-- Only singletons are finite arithmetic progressions of length $1$. -/ @[simp] theorem one : s.IsAPOfLength 1 ↔ ∃ a, s = {a} := by simp [IsAPOfLength]
153
leanexplore_declaration
leanexplore:385917
leanexplore_sqlite
leanexplore_declarations
/-- Only the empty set is a finite arithmetic progression of length $0$. -/ @[simp] theorem zero : s.IsAPOfLength 0 ↔ s = ∅ := by simp [Set.IsAPOfLength]
151
leanexplore_declaration
leanexplore:385918
leanexplore_sqlite
leanexplore_declarations
theorem eq (h : s.IsAPOfLength l) : ∃ a d : α, s = {a + n • d | (n : ℕ) (_ : n < l)} := ⟨h.choose, h.choose_spec.choose, h.choose_spec.choose_spec.2⟩
84
leanexplore_declaration
leanexplore:385919
leanexplore_sqlite
leanexplore_declarations
theorem card (h : s.IsAPOfLength l) : ENat.card s = l := h.choose_spec.choose_spec.1
242
leanexplore_declaration
leanexplore:385920
leanexplore_sqlite
leanexplore_declarations
/-- A list version of `Set.IsAPOfLength`. Useful when order preservation is required, for example when considering images under arbitrary functions. -/ def List.IsAPOfLength (s : List α) (l : ℕ) : Prop := ∃ a d : α, s.IsAPOfLengthWith l a d
305
leanexplore_declaration
leanexplore:385921
leanexplore_sqlite
leanexplore_declarations
/-- The predicate that a set `s` is an arithmetic progression of length `l` (possibly infinite). This predicate does not assert a specific value for the first term or the difference of the arithmetic progression. -/ def Set.IsAPOfLength (s : Set α) (l : ℕ∞) : Prop := ∃ a d : α, s.IsAPOfLengthWith l a d
427
leanexplore_declaration
leanexplore:385922
leanexplore_sqlite
leanexplore_declarations
/-- The set `{a, b} : Set ℕ` with `a < b` is an arithmetic progression of length `2` with first term `a` and difference `b - a`. -/ theorem Nat.isAPOfLengthWith_pair {a b : ℕ} (hab : a < b) : Set.IsAPOfLengthWith {a, b} 2 a (b - a) := by let ⟨n, h⟩ := Nat.exists_eq_add_of_lt hab simp [Set.IsAPOfLengthWith, h, a...
611
leanexplore_declaration
leanexplore:385923
leanexplore_sqlite
leanexplore_declarations
/-- In an abelian additive group `α`, the set `{a, b}` with `a ≠ b` is an arithmetic progression of length `2` with first term `a` and difference `b - a`. -/ theorem Set.isAPOfLengthWith_pair {α : Type*} [DecidableEq α] [AddCommGroup α] {a b : α} (hab : a ≠ b) : Set.IsAPOfLengthWith {a, b} 2 a (b - a) := by s...
212
leanexplore_declaration
leanexplore:385924
leanexplore_sqlite
leanexplore_declarations
/-- An arithmetic progression with first term `a` and difference `d` is of length one if and only if `s` is a singleton. -/ @[simp] theorem one : s.IsAPOfLengthWith 1 a d ↔ s = [a] := by simp [IsAPOfLengthWith]
207
leanexplore_declaration
leanexplore:385925
leanexplore_sqlite
leanexplore_declarations
/-- An arithmetic progression with first term `a` and difference `d` is of length zero if and only if `s` is empty. -/ @[simp] theorem zero : s.IsAPOfLengthWith 0 a d ↔ s = [] := by simp [IsAPOfLengthWith]
89
leanexplore_declaration
leanexplore:385926
leanexplore_sqlite
leanexplore_declarations
theorem length (h : s.IsAPOfLengthWith l a d) : s.length = l := by cases h <;> simp_all
222
leanexplore_declaration
leanexplore:385927
leanexplore_sqlite
leanexplore_declarations
/-- An arithmetic progression with first term `a` and difference `d` is of length one if and only if `s` is a singleton. -/ @[simp] theorem one : s.IsAPOfLengthWith 1 a d ↔ s = {a} := by simp +contextual [IsAPOfLengthWith]
204
leanexplore_declaration
leanexplore:385928
leanexplore_sqlite
leanexplore_declarations
/-- An arithmetic progression with first term `a` and difference `d` is of length zero if and only if `s` is empty. -/ @[simp] theorem zero : s.IsAPOfLengthWith 0 a d ↔ s = ∅ := by simp [IsAPOfLengthWith]
88
leanexplore_declaration
leanexplore:385929
leanexplore_sqlite
leanexplore_declarations
theorem eq (h : s.IsAPOfLengthWith l a d) : s = {a + n • d | (n : ℕ) (_ : n < l)} := h.2
68
leanexplore_declaration
leanexplore:385930
leanexplore_sqlite
leanexplore_declarations
theorem card (h : s.IsAPOfLengthWith l a d) : ENat.card s = l := h.1
320
leanexplore_declaration
leanexplore:385931
leanexplore_sqlite
leanexplore_declarations
/-- A list version of `Set.IsAPOfLengthWith`. Useful when order preservation is required, for example when considering images under arbitrary functions. -/ def List.IsAPOfLengthWith (s : List α) (l : ℕ) (a d : α) : Prop := s = (List.range l).map (fun n ↦ a + n • d) ∨ s = (List.range l).reverse.map (fun n ↦ a + n • d)
422
leanexplore_declaration
leanexplore:385932
leanexplore_sqlite
leanexplore_declarations
/-- A set $S$ is an arithmetic progression of length $l$ with first term $a$ and difference $d$ if $S = \{a, a + d, ..., a + (l - 1)d\}$, if $l$ if finite, else $S = \{a, a + d, a + 2d, ...\}. This can be written as `Set.IsAPOfLengthWith a l a d`, where `l : ℕ∞` may take the infinite value `⊤`. -/ def Set.IsAPOfLengthW...
130
leanexplore_declaration
leanexplore:385933
leanexplore_sqlite
leanexplore_declarations
@[to_additive /-- A weak additive basis of some order. -/] def IsWeakMulBasis (A : Set M) : Prop := ∃ n, A.IsWeakMulBasisOfOrder n
180
leanexplore_declaration
leanexplore:385934
leanexplore_sqlite
leanexplore_declarations
/-- A weak multiplicative basis of some order. -/ @[to_additive /-- A weak additive basis of some order. -/] def IsWeakMulBasis (A : Set M) : Prop := ∃ n, A.IsWeakMulBasisOfOrder n
252
leanexplore_declaration
leanexplore:385935
leanexplore_sqlite
leanexplore_declarations
@[to_additive /-- A set `A : Set M` is a weak additive basis of order `n` if for any element `a : M`, it can be expressed as a sum of at most `n` elements lying in `A`. -/] def IsWeakMulBasisOfOrder (A : Set M) (n : ℕ) : Prop := ∀ a, ∃ m ≤ n, a ∈ A ^ m
412
leanexplore_declaration
leanexplore:385936
leanexplore_sqlite
leanexplore_declarations
/-- A set `A : Set M` is a weak multiplicative basis of order `n` if any element `a : M` can be expressed as a product of at most `n` elements lying in `A`. -/ @[to_additive /-- A set `A : Set M` is a weak additive basis of order `n` if for any element `a : M`, it can be expressed as a sum of at most `n` elements lying...
177
leanexplore_declaration
leanexplore:385937
leanexplore_sqlite
leanexplore_declarations
@[to_additive] lemma isAsymptoticMulBasisOfOrder_iff_prod_atTop : IsAsymptoticMulBasisOfOrder A n ↔ ∀ᶠ a in atTop, ∃ f : Fin n → M, (∀ i, f i ∈ A) ∧ ∏ i, f i = a := by
242
leanexplore_declaration
leanexplore:385938
leanexplore_sqlite
leanexplore_declarations
@[to_additive] lemma isAsymptoticMulBasisOfOrder_iff_prod_atTop : IsAsymptoticMulBasisOfOrder A n ↔ ∀ᶠ a in atTop, ∃ f : Fin n → M, (∀ i, f i ∈ A) ∧ ∏ i, f i = a := by simp [isAsymptoticMulBasisOfOrder_iff_prod, cofinite_eq_atTop]
131
leanexplore_declaration
leanexplore:385939
leanexplore_sqlite
leanexplore_declarations
@[to_additive] lemma isAsymptoticMulBasisOfOrder_iff_atTop : IsAsymptoticMulBasisOfOrder A n ↔ ∀ᶠ a in atTop, a ∈ A ^ n := by
185
leanexplore_declaration
leanexplore:385940
leanexplore_sqlite
leanexplore_declarations
@[to_additive] lemma isAsymptoticMulBasisOfOrder_iff_atTop : IsAsymptoticMulBasisOfOrder A n ↔ ∀ᶠ a in atTop, a ∈ A ^ n := by rw [IsAsymptoticMulBasisOfOrder, cofinite_eq_atTop]
279
leanexplore_declaration
leanexplore:385941
leanexplore_sqlite
leanexplore_declarations
@[to_additive /-- For `M` equipped with a directed order, a set is an asymptotic additive basis of order `1` if it contains an infinite tail of consecutive naturals. -/] lemma isAsymptoticMulBasisOfOrder_one_iff_Ici : IsAsymptoticMulBasisOfOrder A 1 ↔ ∃ a, .Ici a ⊆ A := by
519
leanexplore_declaration
leanexplore:385942
leanexplore_sqlite
leanexplore_declarations
/-- For `M` equipped with a directed order, a set is an asymptotic multiplicative basis of order `1` if it contains an infinite tail of elements. -/ @[to_additive /-- For `M` equipped with a directed order, a set is an asymptotic additive basis of order `1` if it contains an infinite tail of consecutive naturals. -/] l...
277
leanexplore_declaration
leanexplore:385943
leanexplore_sqlite
leanexplore_declarations
@[to_additive /-- For `M` equipped with a directed order, a set is an asymptotic additive basis of order `1` if it contains an infinite tail of consecutive naturals. -/] lemma isAsymptoticMulBasisOfOrder_one_iff_Ioi : IsAsymptoticMulBasisOfOrder A 1 ↔ ∃ a, .Ioi a ⊆ A := by
517
leanexplore_declaration
leanexplore:385944
leanexplore_sqlite
leanexplore_declarations
/-- For `M` equipped with a directed order, a set is an asymptotic multiplicative basis of order `1` if it contains an infinite tail of elements. -/ @[to_additive /-- For `M` equipped with a directed order, a set is an asymptotic additive basis of order `1` if it contains an infinite tail of consecutive naturals. -/] l...
192
leanexplore_declaration
leanexplore:385945
leanexplore_sqlite
leanexplore_declarations
@[to_additive] lemma IsAsymptoticMulBasisOfOrder.mono [CanonicallyOrderedMul M] [IsCancelMul M] (hmn : m ≤ n) (hA : A.IsAsymptoticMulBasisOfOrder m) : A.IsAsymptoticMulBasisOfOrder n := by
949
leanexplore_declaration
leanexplore:385946
leanexplore_sqlite
leanexplore_declarations
@[to_additive] lemma IsAsymptoticMulBasisOfOrder.mono [CanonicallyOrderedMul M] [IsCancelMul M] (hmn : m ≤ n) (hA : A.IsAsymptoticMulBasisOfOrder m) : A.IsAsymptoticMulBasisOfOrder n := by cases finite_or_infinite M · simp obtain ⟨a, ha⟩ := hA.nonempty obtain ⟨n, rfl⟩ := Nat.exists_eq_add_of_le hmn refine...
197
leanexplore_declaration
leanexplore:385947
leanexplore_sqlite
leanexplore_declarations
@[to_additive (attr := simp) /--`A : Set M` is an asymptotic basis of order one iff it is cofinite. -/] lemma isAsymptoticMulBasisOfOrder_one_iff : IsAsymptoticMulBasisOfOrder A 1 ↔ Aᶜ.Finite := by
320
leanexplore_declaration
leanexplore:385948
leanexplore_sqlite
leanexplore_declarations
/-- `A : Set M` is an asymptotic basis of order one iff it is cofinite. -/ @[to_additive (attr := simp) /--`A : Set M` is an asymptotic basis of order one iff it is cofinite. -/] lemma isAsymptoticMulBasisOfOrder_one_iff : IsAsymptoticMulBasisOfOrder A 1 ↔ Aᶜ.Finite := by simp [IsAsymptoticMulBasisOfOrder, compl_def]
80
leanexplore_declaration
leanexplore:385949
leanexplore_sqlite
leanexplore_declarations
@[to_additive] protected lemma IsAsymptoticMulBasisOfOrder.nonempty [Infinite M]
265
leanexplore_declaration
leanexplore:385950
leanexplore_sqlite
leanexplore_declarations
@[to_additive] protected lemma IsAsymptoticMulBasisOfOrder.nonempty [Infinite M] (hA : A.IsAsymptoticMulBasisOfOrder n) : A.Nonempty := by by_contra! simp [this, IsAsymptoticMulBasisOfOrder, hA.ne_zero, finite_univ_iff, _root_.Infinite.not_finite] at hA
79
leanexplore_declaration
leanexplore:385951
leanexplore_sqlite
leanexplore_declarations
@[to_additive] protected lemma IsAsymptoticMulBasisOfOrder.ne_zero [Infinite M]
159
leanexplore_declaration
leanexplore:385952
leanexplore_sqlite
leanexplore_declarations
@[to_additive] protected lemma IsAsymptoticMulBasisOfOrder.ne_zero [Infinite M] (hA : IsAsymptoticMulBasisOfOrder A n) : n ≠ 0 := by rintro rfl; simp at hA
215
leanexplore_declaration
leanexplore:385953
leanexplore_sqlite
leanexplore_declarations
@[to_additive (attr := simp) /-- If `M` is infinite, then no set `A` is an asymptotic additive basis of order `0`. -/] lemma not_isAsymptoticMulBasisOfOrder_zero [Infinite M] : ¬IsAsymptoticMulBasisOfOrder A 0 := by
409
leanexplore_declaration
leanexplore:385954
leanexplore_sqlite
leanexplore_declarations
/-- If `M` is infinite, then no set `A` is an asymptotic multiplicative basis of order `0`. -/ @[to_additive (attr := simp) /-- If `M` is infinite, then no set `A` is an asymptotic additive basis of order `0`. -/] lemma not_isAsymptoticMulBasisOfOrder_zero [Infinite M] : ¬IsAsymptoticMulBasisOfOrder A 0 := by simpa [...
96
leanexplore_declaration
leanexplore:385955
leanexplore_sqlite
leanexplore_declarations
@[to_additive (attr := simp)] protected lemma IsAsymptoticMulBasisOfOrder.of_finite [Finite M] :
173
leanexplore_declaration
leanexplore:385956
leanexplore_sqlite
leanexplore_declarations
@[to_additive (attr := simp)] protected lemma IsAsymptoticMulBasisOfOrder.of_finite [Finite M] : IsAsymptoticMulBasisOfOrder A n := by simp [IsAsymptoticMulBasisOfOrder]