Arithmetic Progressions #
Main definitions:
Set.IsAPOfLengthWith (s : Set α) (l : ℕ∞) (a d : α): predicate asserting thatsis the set consisting of an arithmetic progression of lengthl(possibly infinite) with first termaand differenced. Useful for cases in which additional conditions need to be applied to the individual terms and/or difference.Set.IsAPOfLength (s : Set α) (l : ℕ∞): predicate asserting thatsis the set consisting of an arithmetic progression of lengthl, for some some first term and difference.
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 ⊤.
Equations
Instances For
A list version of Set.IsAPOfLengthWith. Useful when order preservation is required, for example
when considering images under arbitrary functions.
Equations
- s.IsAPOfLengthWith l a d = (s = List.map (fun (n : ℕ) => a + n • d) (List.range l))
Instances For
An arithmetic progression with first term a and difference d is of length zero if and only
if s is empty.
An arithmetic progression with first term a and difference d is of length one if and only
if s is a singleton.
An arithmetic progression with first term a and difference d is of length zero if and only
if s is empty.
An arithmetic progression with first term a and difference d is of length one if and only
if s is a singleton.
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.
The set {a, b} : Set ℕ with a < b is an arithmetic progression of length 2 with
first term a and difference b - a.
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.
Equations
- s.IsAPOfLength l = ∃ (a : α) (d : α), s.IsAPOfLengthWith l a d
Instances For
A list version of Set.IsAPOfLength. Useful when order preservation is required, for example
when considering images under arbitrary functions.
Equations
- s.IsAPOfLength l = ∃ (a : α) (d : α), s.IsAPOfLengthWith l a d
Instances For
Only the empty set is a finite arithmetic progression of length $0$.
Only singletons are finite arithmetic progressions of length $1$.
If a set is an arithmetic progression of lengths l₁ and l₂, then the lengths are
equal.
Only the empty list is a finite arithmetic progression of length $0$.
Only singletons are finite arithmetic progressions of length $1$.
If a list is an arithmetic progression of lengths l₁ and l₂, then the lengths are
equal.
The empty set is not an arithmetic progression of positive length.
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. -
Equations
- s.IsAPOfLengthFree l = ∀ t ⊆ s, t.IsAPOfLength l → l ≤ 1
Instances For
Any set is free of arithmetic progressions of length 1, because such APs are all trivial.
Any set is free of arithmetic progressions of length 0, because such APs are all trivial.
Any non-trivial arithmetic progression cannot be free of arithmetic progressions.
Define the largest possible size of a subset of $\{1, \dots, N\}$ that does not contain any non-trivial $k$-term arithmetic progression.
Equations
- Set.IsAPOfLengthFree.maxCard k N = sSup {x : ℕ | ∃ (S : Finset ℕ) (_ : S ⊆ Finset.Icc 1 N) (_ : (↑S).IsAPOfLengthFree ↑k), S.card = x}
Instances For
Equations
- ContainsMonoAPofLength coloring k = ∃ (c : κ) (ap : Set ↑M), ((fun (x : ↑M) => ↑x) '' ap).IsAPOfLength ↑k ∧ ∀ m ∈ ap, coloring m = c