Learning path
Each declaration appears after its prerequisites.
- Bulgaria1998P11.exists_prime_fac_mod_three_eq_two A natural number that is 2 mod 3 has a prime factor that is 2 mod 3
- Bulgaria1998P11.mod_three_ne_two_of_sq_eq_neg_three Documented declaration: mod_three_ne_two_of_sq_eq_neg_three
- Bulgaria1998P6.sq_mod_four_of_odd The square of an odd integer is
1modulo4 - Bulgaria1998P6.descent_aux Documented declaration: descent_aux
- Bulgaria1998P8.S helper function Sₙ₋₁(x,y) = (x + y)² - 1(x + 1)Pₙ₋₁(y+2, x+2)
- Bulgaria1998P8.T helper function Tₙ₋₁(x,y) = (y - y²)(x - x²)Pₙ₋₁(y, x)
- Bulgaria1998P8.U helper function Uₙ₋₁(x,y) = (x + y - 1) [(y + 1)(x - x²)Pₙ₋₁(y + 2, x) + (x + 1)(y - y²) Pₙ₋₁(y, x + 2)]
- CIIM2022P6.mul_le_self_pow If
p ≥ 2and1 ≤ vthenv * p ≤ p ^ v - CIIM2022P6.sum_div_pow_le_one Key combinatorial estimate
- CIIM2022P6.prod_factorization_le The multiplicative bound
∏_{p | n+1} (v_p(n!) + v_p(n+1) + 1) ≤ 2 ∏_{p | n+1} (v_p(n!) + 1) - Imo1959P1.imo1959_p1 IMO 1959 Problem 1: an irreducible fraction
- Imo1959P3.formedQuadratic Documented declaration: formedQuadratic
- Imo1959P3.formedQuadraticEval The formed quadratic evaluated at
t, i.e. the quadratic with coefficientsformedQuadratic a b capplied tot - Imo1959P3.sq_b_mul_cos Squaring the rearranged equation
b * cos x = -(a * cos x ^ 2 + c)eliminates the odd power ofcos x - Imo1959P3.formedQuadratic_cos_two_mul The formed quadratic evaluated at
cos (2 * x), expressed back in terms ofcos xviacos (2 * x) = 2 * cos x ^ 2 - 1 - Imo1959P3.imo1959_p3_comparison For
a = 4,b = 2,c = -1the formed equation incos 2xis four times the original equation incos x: the two equations are the same - Imo1960P1.not_zero Proving that three digit numbers are the ones in [100, 1000)
- Imo1960P1.SearchUpTo We do an exhaustive search to show that all results are covered by
SolutionPredicate - Imo1960P1.left_direction Now we just need to prove the equivalence, for the precise problem statement
- Imo1960Q2.IsGood The predicate says that
xsatisfies the inequality \[\dfrac{4x^2}{(1 - \sqrt {2x + 1})^2} < 2x + 9\] and belongs to the domain of the function on the left-hand side - Imo1961P2.weitzenbock_identity Helper lemma: The key algebraic identity for Weitzenböck's inequality
- Imo1961P2.imo1961_p2a IMO 1961 P2 (Inequality Case)
- Imo1961P2.imo1961_p2b IMO 1961 P2 (Equality Case)
- Imo1962P1.helper_5_digit Putting this inline causes a deep recursion error, so we separate it out
- Imo1962P1.case_more_digits
linarithfails on numbers this large, so this lemma spells out some of the arithmetic that normally would be automated - Imo1962P1.imo1962_p1 IMO 1962 Problem 1: moving the last digit 6 to the front
- Imo1962P4.altFormula The key to solving this problem simply is that we can rewrite the equation as a product of terms, shown in
alt_formula, being equal to zero - Imo1962P4.solve_cos2_half Now we can solve for
xusing basic-ish trigonometry - Imo1963P6.secondPrediction The second prediction "D, A, E, C, B", given as the function sending each student to the place in which it was predicted to finish
- Imo1963P6.classification The conditions of the problem determine the outcome uniquely: there are only `5!
- Imo1964P1.solution_set
- Imo1964P1.imo1964_p1a IMO 1964 Problem 1(a): when 7 divides 2^n - 1 after Imo1964P1.solution_set
- Imo1964P1.imo_1964_p1b' An alternative proof, heavily golfed
- Imo1964P2.schur TODO: get this into mathlib in some form
- Imo1964P4.lemma1 Smaller version of the problem, with 6 (or more) people and 2 topics
- Imo1967P6.MedalsProcess The process described in the problem, from the point of view of the medals remaining:
r kis the number of medals left at the start of dayk + 1(sor 0 = m) - Imo1967P6.rec_eq The day-
krule implies the recurrence7 * r k = 6 * (r (k - 1) - k) - Imo1967P6.closed_form Solving the recurrence: after
kdays the number of remaining medals is(6/7)^k * (m - 36) + 36 - 6k - Imo1967P6.key_eq Specializing the closed form at
k = n - 1(wherer (n - 1) = n) gives the key Diophantine relation betweenmandn - Imo1967P6.forward The forward direction: the Diophantine relation forces
n = 6andm = 36, because6 ^ (n - 1)must dividen - 6while growing much faster - Imo1967P6.backward The converse direction: with
m = 36andn = 6exactly six medals are awarded on each of the six days - Imo1968P6.term_telescope Lemma for the telescoping term structure
- Imo1968P6.n_ans The answer is n
- Imo1969P1.goodNats
goodNatsis the set of natural numbers satisfying the condition in the problem statement, namely thea : ℕsuch thatn^4 + ais not prime for anyn : ℕ - Imo1969P1.factorization The key to the solution is that you can factor $z$ into the product of two polynomials, if $a = 4*m^4$
- Imo1969P1.polynomial_not_prime Every natural number of the form
n^4 + 4*m^4is not prime - Imo1969P1.aChoice We define $a_{choice}(b) := 4*(2+b)^4$, so that we can take $m = 2+b$ in
polynomial_not_prime - Imo1969P1.aChoice_strictMono
aChoiceis a strictly monotone function; this is easily proven by chaining together lemmas in thestrictMononamespace - Imo1969P6.amgm_chain Documented declaration: amgm_chain
- Imo1969P6.eqCondition The condition for equality to hold
- Imo1970P2.value The real number whose base-
cdigit string isx m, x (m-1), ..., x 0, i.e.∑ i ≤ m, x i * c ^ i - Imo1970P2.pow_cross_lt For
i < nandb < awe havebⁿ aⁱ < aⁿ bⁱ - Imo1970P2.value_succ Splitting off the leading digit:
value x c n = value x c (n-1) + x n * cⁿ - Imo1970P2.value_pos The full number is positive since its leading digit is nonzero
- Imo1970P2.pow_mul_value_lt The crux:
bⁿ · B' < aⁿ · A', whereA'andB'are the numbers obtained by stripping the leading digit - Imo1970P2.value_mul_lt Cross-multiplied form of the inequality:
A' · B < B' · A - Imo1970P2.value_div_lt If
b < athenA'/A < B'/B - Imo1970P3.IncreasingSequenceFromOne A sequence of real numbers satisfying the given conditions
- Imo1970P3.b_seq The b_n sequence defined in terms of the a sequence
- Imo1970P3.c_seq Helper: c_k = √(a_k)
- Imo1970P3.seq_pos All elements of the sequence are positive
- Imo1970P3.term_bound Key lemma: each term is bounded by 2(1/c_{k-1} - 1/c_k)
- Imo1970P6.NC Abbreviation for the noncollinearity hypothesis on a triple of points
- Imo1970P6.Bad The triple of points
X,Y,Zhas an angle of at leastπ / 2(atX, atY, or atZrespectively) - Imo1970P6.hull_case If
Ais a combination ofB,C,Dwith positive weights (an interior point of the triangleB C D), then the angles∠ B A Cand∠ B A Dcannot both be acute - Imo1970P6.quad_case Documented declaration: quad_case
- Imo1970P6.crossing_lemma From an affine dependence with two positive and two negative weights, produce the crossing point of the two segments
- Imo1970P6.collinear_of_dependent An affine dependence between three points means they are collinear
- Imo1970P6.four_point_aux The core sign-analysis: given an affine dependence with all weights nonzero and the first one positive, some triple of the four points is
Bad - Imo1970P6.four_point Among four points in the plane, no three of which are collinear, some triple forms a triangle with an angle of at least
π / 2 - Imo1970P6.AcuteSet The predicate from the problem statement: the 3-element subset
wof indices spans an acute-angled triangle - Imo1970P6.exists_nonacute_triple Among any four of the points, some three of them form a non-acute triangle
- Imo1970P6.card_supersets The number of
(w.card + k)-element subsets ofscontaining a fixedw ⊆ sis(s.card - w.card).choose k - Imo1970P6.five_point_bound Among any five of the points, at least three of the ten 3-element subsets form a non-acute triangle
- Imo1970P6.global_bound Globally, at least
3 * (100.choose 5) / (97.choose 2) = 48510of the 3-element subsets form a non-acute triangle - Imo1971P1.prod_ne_eq_prod_ite This makes working with the sum easier and simp more powerful
- Imo1971P1.E_equiv_perm A proof that E a = E b, where b is obtained by permuting a's indices
- Imo1971P1.antitone_of_monotone_comp_rev This gets a permutation of the indices of a such that the resulting sequence is antitone
- Imo1971P6.rowSum Definitions of row sum, column sum, and total sum
- Imo1971P6.totalSum_eq_rowSum_sum Basic lemmas connecting total sum to row/col sums
- Imo1971P6.aux Auxiliary lemma: The inequality holds if there exists a row with sum
xsuch thatxis less than or equal to all row sums and column sums - Imo1974P3.im_pow The binomial sum is the coefficient of √8 in (√8 + 1)^(2n+1)
- Imo1974P4.Rect A rectangle on the chessboard, given by the coordinates
(r, c)of its top-left unit square, its heighth(number of rows) and its widthw(number of columns) - Imo1974P4.Rect.cells The unit squares making up a rectangle
- Imo1974P4.isWhite The white squares of the chessboard are those whose coordinates have even sum
- Imo1974P4.Rect.whiteCount The number of white squares of a rectangle
- Imo1974P4.Rect.blackCount The number of black squares of a rectangle
- Imo1974P4.board The 8 × 8 chessboard
- Imo1974P4.ValidDecomp Documented declaration: ValidDecomp
- Imo1974P4.maxCount The maximum possible number of white squares
- Imo1974P4.Rect.card_cells The number of unit squares of a rectangle is the product of its two side lengths
- Imo1974P4.Rect.whiteCount_add_blackCount White and black squares together make up all squares of a rectangle
- Imo1974P4.Rect.one_le_whiteCount A rectangle satisfying condition (i) has at least one white square
- Imo1974P4.card_mul_succ_le_two_mul_sum A finite set of
kdistinct positive integers has sum at least `1 + 2 + - Imo1974P4.sum_whiteCount The total number of white squares in a valid decomposition is 32
- Imo1974P4.seven_distinct_sum_32 The five sets of seven distinct positive integers summing to 32
- Imo1974P4.decomp₁ A decomposition realising the white-square counts {1, 2, 3, 4, 5, 7, 10} (rectangle sizes 2, 4, 6, 8, 10, 14, 20)
- Imo1974P4.decomp₂ A decomposition realising the white-square counts {1, 2, 3, 4, 5, 8, 9} (rectangle sizes 2, 4, 6, 8, 10, 16, 18)
- Imo1974P4.decomp₃ A decomposition realising the white-square counts {1, 2, 3, 4, 6, 7, 9} (rectangle sizes 2, 4, 6, 8, 12, 14, 18)
- Imo1974P4.decomp₄ A decomposition realising the white-square counts {1, 2, 3, 5, 6, 7, 8} (rectangle sizes 2, 4, 6, 10, 12, 14, 16)
- Imo1974P6.setOf_eval_eq_zero The integers
kwithQ.eval k = 0are exactly the roots ofQ - Imo1974P6.finite_eval_eq_zero A nonzero integer polynomial has only finitely many integer roots
- Imo1974P6.ncard_eval_eq_zero_le A nonzero integer polynomial has at most
natDegreedistinct integer roots - Imo1974P6.setOf_eval_eq_one
P k = 1means thatkis a root ofP - 1 - Imo1974P6.setOf_eval_eq_neg_one
P k = -1means thatkis a root ofP + 1 - Imo1974P6.sub_dvd_two Key divisibility: if
P r = 1andP k = -1, thenk - r ∣ 2 - Imo1974P6.ncard_le_of_exists_min Main step: if
ris a least integer withP r = ±1andP r = 1, then at mostdeg P + 2integers satisfyP k = ±1 - Imo1976P3.k The side length of a cube of volume 2: the real cube root of 2
- Imo1976P3.CubeInBox Documented declaration: CubeInBox
- Imo1976P3.NonOverlapping Two cubes of side
kplaced atpandqdo not overlap: their interiors are disjoint, i.e. they are separated along at least one axis - Imo1976P3.IsPacking Documented declaration: IsPacking
- Imo1976P3.maxNumCubes Documented declaration: maxNumCubes
- Imo1976P3.floor_div_k_mul_le The number of cubes that fit along an edge of integer length
n, times the cube side, is at most the edge length - Imo1976P3.fin_cast_k_add_k_le A cube whose left face is at
i * kwithi < ⌊n / k⌋₊lies within an edge of integer lengthn - Imo1976P3.floor_lt_floor_of_add_k_le A cube inside an edge of integer length
n, with left face atx, has⌊x / k⌋₊ < ⌊n / k⌋₊ - Imo1976P3.sub_lt_k_of_floor_eq Two positions with the same integer part of
x / kdiffer by less thank - Imo1976P3.cubeCode The code of a cube position: the integer parts of its coordinates divided by
k - Imo1976P3.packing_card_le The upper bound half of the maximal condition: no packing of the
a × b × cbox has more thanmaxNumCubes a b ccubes - Imo1976P3.gridPos The grid arrangement of cube positions: cubes at
(i * k, j * k, l * k)fori < ⌊a / k⌋₊,j < ⌊b / k⌋₊,l < ⌊c / k⌋₊ - Imo1976P3.separated_of_ne Two distinct grid indices give cubes separated along that axis
- Imo1976P3.exists_packing The attainment half of the maximal condition: the grid arrangement is a packing with exactly
maxNumCubes a b ccubes - Imo1976P3.floor_spec The defining property of
⌊n / k⌋₊, expressed with integers only:2 * n'^3 ≤ n^3 < 2 * (n' + 1)^3, obtained by cubingn' * k ≤ n < (n' + 1) * k - Imo1976P3.le_of_cube_le Comparing
x * kwith an integer by comparing cubes - Imo1976P3.lt_of_cube_lt Comparing an integer with
x * kby comparing cubes - Imo1976P3.floor_val Evaluating
⌊n / k⌋₊from the two inequalitiesc * k ≤ n < (c + 1) * k - Imo1976P3.det_of From here on everything is integer arithmetic
- Imo1976P3.two_le_of If
1 ≤ n'and2 * n'^3 ≤ n^3then2 ≤ n - Imo1976P3.five_cubed The key ratio bound: for
n ≥ 3,n^3 < 5 * n'^3 - Imo1976P3.key500 Auxiliary estimate:
343 * (m + 1)^3 ≤ 500 * m^3form ≥ 8 - Imo1976P3.seven_lt_ten The second ratio bound: for
n ≥ 11,7 * n < 10 * n' - Imo1976P3.main_nat The integer core of the problem: the only sorted triples satisfying the volume equation are
(2, 3, 5)and(2, 5, 6) - Imo1976P5.valueFinset The candidate values for the tuple of unknowns: integers between
-nandnin each coordinate - Imo1976P5.lhsFinset The possible values of the tuple of left-hand sides: each coordinate is an integer between
-2n²and2n² - Imo1976P5.lhs The tuple of left-hand sides of the equations, as a function of the tuple of unknowns
- Imo1976P5.card_lhs_lt_card_value The pigeonhole step: there are more candidate tuples than possible values of the left-hand sides
- Imo1976P5.mapsTo Each left-hand side is bounded by
2n²when every |xⱼ| ≤ n - Imo1977P3.Vn The set
Vₙof natural numbers of the form1 + k * nwithka positive integer - Imo1977P3.Indecomposable
mis indecomposable inVₙif it belongs toVₙbut cannot be written as a product of two members ofVₙ - Imo1977P3.vn_ge Every member of
Vₙis at leastn + 1 - Imo1977P3.mul_mem_vn
Vₙis closed under multiplication - Imo1977P3.indecomposable_sq
(n - 1)^2(written withn = c + 3) is indecomposable inVₙ: it is smaller than the square of the smallest member ofVₙ - Imo1977P3.not_dvd
(n - 1)^2does not divide(n - 1) * (2 * n - 1)(written withn = c + 3), sincen - 1does not divide2 * n - 1 = 2 * (n - 1) + 1 - Imo1977P3.exists_factorization Every member of
Vₙis a product of indecomposable members ofVₙ - Imo1977P5.sq_add_sq_eq 1009 is prime and
≡ 1 (mod 4), so its representation as a sum of two squares is unique:1009 = 15² + 28² - Imo1978P3.a The lower Wythoff sequence
⌊n·φ⌋, which is the functionfin the problem - Imo1978P3.a_add_eq
a n + n = ⌊n·φ²⌋, usingφ² = φ + 1 - Imo1978P3.ha_cover Every positive integer is
a kora k + kfor somek ≥ 1 - Imo1978P3.ha_disj The two sequences
a kanda k + kare disjoint - Imo1978P3.wythoff_unique A strictly increasing positive sequence
Fis uniquely determined by the property that{F k}and{F k + k}partition the positive integers - Imo1978P5.triangular_le_sum A finset of
mdistinct positive integers sums to at least1 + 2 + ⋯ + m - Imo1978P5.triangular_le_partial_sum The partial sums of a sequence of distinct positive integers dominate the partial sums of the identity
- Imo1978P5.abel_compare Abel summation comparison: if the partial sums of
hare dominated by the partial sums ofg, then the same holds for sums weighted by any nonnegative decreasing sequencew - Imo1979P2.eq_of_ne_of_ne In a two-element palette, any two elements that both differ from a third element are equal
- Imo1979P2.eq_or_eq_of_ne In a two-element palette, any element equals one of two distinct elements
- Imo1979P2.three_eq_of_five Among five booleans, some three (at pairwise distinct positions) coincide
- Imo1979P2.adjacent_of_three Any three pairwise distinct elements of
Fin 5contain two that are cyclically adjacent, i.e. of the formm, m + 1 - Imo1979P2.inter_of_three Two three-element subsets of the five-element set intersect
- Imo1979P2.all_eq_of_cycle If all cyclically adjacent values of a
Fin 5 → Boolare equal, then all its values are equal - Imo1979P2.one_color Key lemma
- Imo1981P3.ProblemPredicate N = 1981
- Imo1981P3.NatPredicate It will be convenient to have the lemmas above in their natural number form
- Imo1981P3.NatPredicate.imp_fib Now we can use induction to show that solutions must be Fibonacci numbers
- Imo1981P6.no_eval Wrapper to prevent the Lean kernel from eagerly trying to normalize the solution value, which happens to be way too large to normalize
- Imo1982P3.le_avg
x nis at most the average of all previous terms in the sequence - Imo1982P3.ineq The main inequality used for part a
- Imo1983P3.two_var Two-variable Chicken McNugget over
ℤ: for coprime positiveb c, every integerM > b*c - b - cis a nonnegative combination ofcandb - Imo1983P3.rep Every integer
n > 2*a*b*c - a*b - b*c - c*ais expressible asx * (b*c) + y * (c*a) + z * (a*b)with nonnegativex y z - Imo1983P6.cauchy_schwarz_equals Equality in Cauchy-Schwarz implies linear dependence
- Imo1984P3.aang The angle
a(X)from the problem statement: the measure in radians, counterclockwise fromOA, of the angle betweenOAandOX, taking values in[0, 2 * π) - Imo1984P6.two_pow_dvd_or If
2^mdivides(y - x) * (y + x)for oddx < y, then almost all of the factors of 2 land in one of the two factors, sincegcd (y - x) (y + x) = 2 - Imo1985P2.Condition The conditions on the problem's coloring
C - Imo1985P2.C_mul_mod For
1 ≤ k < n,k * j % nhas the same color asj - Imo1985P3.oddCount The number of odd coefficients of a polynomial with integer coefficients
- Imo1985P3.o
o Pis the number of nonzero coefficients of a polynomialPoverZMod 2 - Imo1985P3.support_X_pow_mul The support of
X ^ m * pis the support ofpshifted bym - Imo1985P3.o_add_X_pow_mul If
phas degree less thanm, the supports ofpandX ^ m * qare disjoint, henceo (p + X ^ m * q) = o p + o q - Imo1985P3.o_add_le Subadditivity of
o - Imo1985P3.o_le_o_add_add A convenient rearrangement of subadditivity
- Imo1985P3.natDegree_one_add_X_pow The degree of
(1 + X) ^ ioverZMod 2 - Imo1985P3.one_add_X_pow_two_pow The freshman's dream in characteristic $2$:
(1 + X) ^ (2 ^ k) = 1 + X ^ (2 ^ k) - Imo1985P3.oddCount_eq_o The number of odd coefficients of
P : ℤ[X]equalsoof its image in(ZMod 2)[X] - Imo1985P3.map_one_add_X_pow The image of a single power of
1 + Xin(ZMod 2)[X] - Imo1985P3.map_sum_one_add_X_pow The image of a sum of powers of
1 + Xin(ZMod 2)[X] - Imo1985P3.key The main inequality over
ZMod 2, proved by strong induction on the largest indexN - Imo1986P3.State State of the pentagon: an integer assigned to each vertex
- Imo1986P3.State.sum The sum of all integers on the pentagon
- Imo1986P3.move The operation performed at vertex
iwhens i < 0 - Imo1986P3.Step The transition relation
Step next currentasserts thatnextis obtained fromcurrentby applying the move operation at some vertexiwheres i < 0 - Imo1986P3.potential The potential function $V(s) = \sum (s_i - s_{i+2})^2$
- Imo1986P3.sum_invariant The sum of the integers is invariant under the move operation
- Imo1986P3.potential_diff The change in potential after a move operation
- Imo1986P3.potential_decreasing If $s_i < 0$ and the total sum is positive, the potential strictly decreases
- Imo1986P3.potential_nonneg The potential is always non-negative
- Imo1986P3.potential_measure_decreases Since the potential is non-negative and decreasing, its value as a natural number also decreases
- Imo1986P6.Balanced A signing of a set of points of the plane:
ε p = 1means thatpis colored white andε p = -1means thatpis colored red - Imo1986P6.balanced_image_swap The problem is symmetric under swapping the two coordinates
- Imo1986P6.balanced_of_alone_col Case A: some point
Pis the only point ofSin its column - Imo1986P6.balanced_of_alone_row Case A, symmetric version: some point
Pis the only point ofSin its row - Imo1986P6.AltPath Documented declaration: AltPath
- Imo1986P6.AltPath.snoc An alternating path can be extended by appending a fresh point, provided the new last step has the required direction
- Imo1986P6.AltPath.step_at The step condition of an alternating path, with the second index given separately (useful when it is not literally
i + 1) - Imo1986P6.AltPath.drop_step The step condition of an alternating path is inherited by a tail of the path, provided the tail starts at an even index
- Imo1986P6.AltPath.exists_max Among the alternating paths in
Sthere is one of maximal length - Imo1986P6.getElem_congr Helper: two elements of the same list at equal indices are equal
- Imo1986P6.pair_sum_zero Documented declaration: pair_sum_zero
- Imo1986P6.cycSign The sign function attached to an even-length cycle:
+1at even positions,-1at odd positions - Imo1986P6.cycle_balanced A cycle of even length, alternating horizontal and vertical steps and closed by a vertical step, admits a signing that is balanced on every row and column
- Imo1986P6.exists_cycle Case B: every point of the nonempty set
Shas another point ofSin its row and another one in its column - Imo1986P6.main_lemma Main induction: every finite set of points with integer coordinates admits a balanced signing
- Imo1986P6.imo1986_p6 IMO 1986, Problem 6
- Imo1987P1.fiber Given
α : Type*andk : ℕ,fiber α kis the set of permutations ofαwith exactlykfixed points - Imo1987P1.p
p α kis the number of permutations ofαwith exactlykfixed points - Imo1987P1.fixedPointsEquiv The set of pairs
(x : α, σ : Perm α)such thatσ x = xis equivalent to the set of pairs(x : α, σ : Perm {x}ᶜ) - Imo1987P1.fixedPointsEquiv' The set of triples
(k ≤ card α, σ ∈ fiber α k, x ∈ fixedPoints σ)is equivalent to the set of pairs(x : α, σ : Perm α)such thatσ x = x - Imo1987P1.main_fintype Main statement for any
(α : Type*) [Fintype α] - Imo1987P1.main₀ Main statement for permutations of
Fin n, a version that works forn = 0 - Imo1987P3.S The sum
∑ i, bᵢ * |x i|attached to a tupleb : Fin n → Fin kof coefficients - Imo1987P3.sum_abs_le_sqrt Cauchy-Schwarz:
∑ i, |x i| ≤ √nwhenever∑ i, x i ^ 2 = 1 - Imo1987P3.fin_coe_le Every coefficient of
b : Fin kis at mostk - 1, as a real number - Imo1987P3.fin_coe_le_int Every coefficient of
b : Fin kis at mostk - 1, as an integer - Imo1987P3.floor_min_sub_le Pure floor lemma: if
u, v ≤ mhave the same clamped floor, then|u - v| ≤ 1 - Imo1987P3.coef The choice of integer coefficients: take the differences
bᵢ - b'ᵢ, flipping the sign whereverx i < 0 - Imo1988P2.double_count Counting the pairs
(a, b)witha ∈ s,b ∈ tandr a b, fiberwise in either order - Imo1988P2.all_eq_one If finitely many terms, each at least
1, sum to the number of terms, then every term equals1 - Imo1988P2.other_unique Under the problem's hypotheses, every element of
A ilies in exactly one setA jwithj ≠ i - Imo1988P2.pair_eq The pair of indices of the sets containing a common element
bofA iandA j - Imo1988P2.colour Colour an edge
e = {p, q}of the complete graph onFin (K + 1)with0iff the difference of its endpoints, in one of the two directions, lies in[1, m] - Imo1988P2.count_good Documented declaration: count_good
- Imo1988P2.vertex_count With
n = 2 * m, colouring each element bycolour mof its index pair gives exactlynelements of colour0in eachA i - Imo1988P2.Edges The edges of the complete graph on
Fin N: two-element subsets - Imo1988P2.edgeSets The set of edges incident to the vertex
i - Imo1988P3.binaryReverse Reverse the base-two digits, dropping leading zeroes
- Imo1988P3.binaryReverse_pos Positive inputs have positive binary reversals
- Imo1988P3.pnatBinaryReverse Binary reversal on positive naturals
- Imo1988P3.BinaryPalindrome Binary palindromes
- Imo1988P3.SatisfiesRecurrence The five recurrence clauses from the problem
- Imo1988P3.digits_two_mul Append a binary zero
- Imo1988P3.digits_two_mul_add_one Append a binary one
- Imo1988P3.pnatBinaryReverse_satisfiesRecurrence Binary reversal satisfies the recurrence
- Imo1988P3.recurrence_step One binary-recursion step of uniqueness
- Imo1988P3.recurrence_unique The recurrence determines the function uniquely
- Imo1988P3.recurrence_unique_binaryReverse The recurrence solution is binary reversal
- Imo1988P3.pnatBinaryReverse_fixed_iff_palindrome Fixed points are binary palindromes
- Imo1988P3.binaryPalindrome_count_le_1988 Count binary palindromes up to
1988 - Imo1988P3.fixedPoint_count_from_recurrence Convert the finite count back to the problem statement
- Imo1988P4.component_atBot each singularity (at the integers) has the left side approaching bot and right side approaching top
- Imo1988P4.root_Ioi we can have a stronger condition by replacing ∃ with ∃!
- Imo1988P4.I the endpoints don't matter in the volume, so we don't need to know if they are in the solution or not
- Imo1988P6.constant_descent_vieta_jumping Constant descent Vieta jumping
- Imo1988P6.imo1988_p6 IMO 1988 Problem 6: Vieta jumping after Imo1988P6.constant_descent_vieta_jumping
- Imo1989P3.inner_sub_eq_zero_of_dist_eq If
PandQare both equidistant fromAandB, thenP - Qis orthogonal toB - A - Imo1989P3.collinear_of_dist_eq Three points that are all equidistant from two distinct points
A,Bare collinear (they lie on the perpendicular bisector ofAandB, which is a line) - Imo1990P2.IsGood Label the points by
ZMod (2 * n - 1) - Imo1990P2.bad_disjoint_translate A bad (i.e. not good) coloring and its translate by
n + 1are disjoint - Imo1990P2.card_range_filter_mod_eq Exactly
tof the numbers0, ..., 3 * t - 1are congruent tojmod 3 - Imo1990P2.card_univ_filter_val_mod_eq When
3 ∣ N, exactlyN / 3elements ofZMod Nhave a givenvalresidue mod 3 - Imo1990P2.val_mod_translate Translation by
n + 1preservesval % 3when3 ∣ n + 1and3 ∣ 2 * n - 1 - Imo1990P2.coprime_aux If
n % 3 ≠ 2then2 * n - 1andn + 1are coprime - Imo1990P2.card_le_of_bad Upper bound: a bad coloring has at most
solution n - 1black points - Imo1990P2.exists_bad Lower bound: there is a bad coloring with
solution n - 1black points - Imo1990P5.AMove A legal move of player A: from the number
njust chosen by B (or the initial numbern₀), A may choose anymwithn ≤ m ≤ n ^ 2(A wins by choosing 1990) - Imo1990P5.BMove A legal move of player B: from the number
mjust chosen by A, B may choose anym'such thatm / m'is a prime powerp ^ rwithr ≥ 1(B wins by choosing 1) - Imo1990P5.AWins
AWins n: it is A's turn and the current number isn(the initial position hasn = n₀), and A has a winning strategy - Imo1990P5.BWins
BWins m: it is B's turn and the current number ism, and B has a winning strategy - Imo1990P5.BWinsStart
BWinsStart n: B has a winning strategy from the initial position withn₀ = n(it is A's turn): whatever legal first movemA makes, it is not 1990 and B wins fromm - Imo1990P5.bmove_one_iff_isPrimePow B can win from the move
m(by choosing 1) iffmis a prime power - Imo1990P5.not_isPrimePow_of_dvd_of_dvd A number divisible by two distinct primes is not a prime power
- Imo1990P5.bResponses The legal responses available to B after A chooses
m - Imo1990P5.trap The finite trap used for the drawn starting positions
- Imo1990P5.return_to_trap Whatever B plays from a trap number, A can legally return to that same number
- Imo1990P5.exists_interval For
n ≥ 1992there is an exponentr ≥ 1with11 ^ r * 181 < n ≤ 11 ^ (r + 1) * 181, i.e. the intervals(11^r·181, 11^(r+1)·181]cover[1992, ∞) - Imo1990P5.awins_of_ge_8 A wins from every
n ≥ 8 - Imo1990P5.escape_le49 From any non-prime-power
m ∈ [2, 49], B has a legal move into[2, 7] - Imo1990P5.not_bwins_trap B has no winning strategy from a trap number: A can always restore it
- Imo1991P3.badSet The elements of
{1, ..., 280}divisible by2,3,5or7 - Imo1991P3.coprimeSet1
1together with all primes in{1, ..., 280}; pairwise coprime - Imo1991P3.coprimeSet2
{2·41, 3·37, 5·31, 7·29, 11·23, 13·19}; pairwise coprime - Imo1991P3.coprimeSet3
{2·37, 3·31, 5·29, 7·23, 11·19, 13·17}; pairwise coprime - Imo1991P3.coprimeSet4
{2·31, 3·29, 5·23, 7·19, 11·17, 13·13}; pairwise coprime - Imo1991P3.coprimeSet5
{2·29, 3·23, 5·19, 7·17, 11·13}; pairwise coprime - Imo1991P3.coprimeSet6
{2·23, 3·19, 5·17, 7·13, 11·11}; pairwise coprime - Imo1991P3.bigUnion The union of the six pairwise coprime families, all inside
{1, ..., 280} - Imo1991P3.five_of_subset If
P ∩ Thas at least5elements and the elements ofPare pairwise coprime, thenTcontains five pairwise coprime numbers - Imo1991P3.smallPrimeFactor A prime in
{2, 3, 5, 7}dividingx, whenever one exists - Imo1991P4.interiorVerts The vertices that a walk visits at an interior position: all
w.getVert (i + 1)withi + 1 < w.length - Imo1991P4.start_or_interior_or_end Every vertex of a walk is its start, an interior vertex, or its end
- Imo1991P4.exists_maximal_trail A maximal-length trail starting from
s₀, which exists whenevers₀has an incident edge - Imo1991P4.find_good Documented declaration: find_good
- Imo1991P4.mem_edgeSet_deleteEdges Membership in the edge set of a graph with deleted edges
- Imo1991P4.trailLabel The edge labeling given by a trail
w(whose edges get the labelsn + 1, …, n + w.length, in order) together with a labelingΦ'of the remaining edges - Imo1991P4.gcd_eq_one_of_consecutive If two elements of a finset have consecutive labels, the gcd of all labels is 1
- Imo1991P4.gcd_eq_one_of_eq_one If some element of a finset has label 1, the gcd of all labels is 1
- Imo1991P4.gcd_attach_val The gcd over the
attached finset, with the function applied to the underlying values, equals the gcd over the finset itself - Imo1991P4.gcd_interior At an interior vertex of a trail, two consecutive edges meet, so the gcd of the labels at that vertex is 1
- Imo1991P4.no_trail_edge_at If a vertex
vis neither the start, an interior vertex, nor the end of the trailw, then no edge of the trail is incident tov - Imo1991P4.degree_endpoint_le_one If all edges of the trail are incident to the endpoint
t(maximality) andtis neither the start nor an interior vertex, then at most one edge is incident tot - Imo1991P4.incidenceFinset_deleteEdges_of_none If no trail edge is incident to
v, deleting the trail edges does not change the incidence finset ofv - Imo1991P4.gcd_transfer Transfer of the gcd computation to the graph with the trail edges deleted
- Imo1991P4.exists_labeling Documented declaration: exists_labeling
- Imo1991P5.trigonometric_ceva Trigonometric Form of Ceva's Theorem
- Imo1992P3.EdgeColoring An edge coloring of the complete graph on 9 vertices by two colors (encoded as
Fin 2), where some edges may be left uncolored (none) - Imo1992P3.EdgeColoring.coloredEdges The colored edges of an edge coloring, represented as the set of edges that received a color
- Imo1992P3.EdgeColoring.uncoloredEdges The uncolored edges of an edge coloring, represented as the set of non-diagonal edges that were left uncolored
- Imo1992P3.EdgeColoring.HasMonoTriangle A coloring has a monochromatic triangle if there are three distinct vertices whose three connecting edges all have the same color
- Imo1992P3.fin2_eq_of_ne In
Fin 2, two elements different from a common one are equal - Imo1992P3.ramsey6 The Ramsey fact
R(3,3) ≤ 6: every red/blue coloring of the edges of the complete graph on 6 vertices contains a monochromatic triangle - Imo1992P3.minEndpoint The smaller endpoint of an edge, well-defined since
minis symmetric - Imo1992P3.mono_triangle_of_colored_ge First part: any coloring with at least 33 colored edges contains a monochromatic triangle
- Imo1992P3.auxColor The extremal coloring on 32 edges (Wöginger's construction): vertices
0,…,3form the red square,4,…,7the blue square, and8is the apex - Imo1992P3.auxColoring The extremal coloring, packaged as an
EdgeColoring - Imo1992P3.shrinkColor Uncoloring the edges of
Pin the extremal coloring - Imo1992P3.shrinkColoring The shrunk coloring, packaged as an
EdgeColoring - Imo1992P3.exists_avoiding Second part: for every
m ≤ 32there is a coloring with exactlymcolored edges and no monochromatic triangle - Imo1992P5.px Project onto yz-plane (zero out x)
- Imo1992P5.py Project onto xz-plane (zero out y)
- Imo1992P5.pz Project onto xy-plane (zero out z)
- Imo1992P5.zslice The slice of S at z-coordinate r
- Imo1992P5.card_sum_slices S is the disjoint union of its z-slices
- Imo1992P5.slice_le_prod Each z-slice injects into the product of its x- and y-projections
- Imo1992P5.slice_le_sz Each z-slice has size ≤ |S_z| (pz is injective on each slice)
- Imo1992P5.px_disjoint px-images of different z-slices are disjoint (px preserves z-coordinate)
- Imo1992P5.py_disjoint py-images of different z-slices are disjoint
- Imo1992P5.sum_px_le Sum of |px-image of slice| ≤ |Sx|
- Imo1992P5.sum_py_le Sum of |py-image of slice| ≤ |Sy|
- Imo1992P5.main Main inequality: |S|² ≤ |Sx| · |Sy| · |Sz|
- Imo1992P6.is_sum_of_pos_squares $z$ can be written as the sum of $k$ positive squares
- Imo1992P6.S_set Auxiliary definition: S(n) will be defined as the greatest integer of the set S_set(n)
- Imo1993P3.dirs The four unit directions in which a jump is allowed
- Imo1993P3.initPos The initial position: an n × n block of occupied squares
- Imo1993P3.IsMove A single move: the piece at
cjumps over the adjacent piece atc + donto the empty squarec + d + d; the jumped-over piece is removed - Imo1993P3.Solvable The game is solvable for
nif the n × n block can be reduced to a single piece, i.e. a one-piece position is reachable from the initial position by a sequence of moves - Imo1993P3.g1 Weight functions on the exponents: cells with
(i + j) % 3 = rget weight1for the two classes in question and0for the remaining one - Imo1993P3.Wt The total weight of a position
- Imo1993P3.Wt_move A move changes the weight by
g x + g (x+δ) + g (x+2δ) = 0 - Imo1993P3.gsum_interval The sum of a period-3 weight with zero triple-sum over
3mconsecutive integers is zero - Imo1993P3.Wt_init The weight of the initial
3m × 3mblock is zero - Imo1993P3.not_solvable_of_three_dvd If
3 ∣ nthe game cannot end with one piece: the two weights of the initial block are(0, 0), but the weights of a single piece are never(0, 0) - Imo1993P3.unit_facts Arithmetic facts about two perpendicular unit directions
- Imo1993P3.purge Documented declaration: purge
- Imo1993P3.stateA After clearing
kcolumns of the top strip: the board below rownplus columnsk, k+1, ...of the whole square - Imo1993P3.stateB After clearing
krows of the right strip - Imo1993P3.stateC After clearing the bottom of column
n + 2as well - Imo1993P3.stateD After clearing the bottom of columns
n + 1, n + 2 - Imo1993P3.phase1_step One step of phase 1: purge the vertical triple in column
kof the top strip, using the piece at(k+1, n)as catalyst - Imo1993P3.phase1 Phase 1: clear the top strip, one column at a time
- Imo1993P3.phase2a_step One step of phase 2a: purge the horizontal triple in row
n + 2 - kof the right strip, using the piece at(n, n + 1 - k)as catalyst - Imo1993P3.phase2a Phase 2a: clear the right strip rows from top to bottom, down to row 3
- Imo1993P3.phase2b Phase 2b: clear the remaining 3 × 3 corner, finishing with a purge whose catalyst lies inside the target n × n block
- Imo1993P3.reduction Reduction: if the game is solvable for
n ≥ 1, it is solvable forn + 3 - Imo1993P3.solvable_one The 1 × 1 board is trivially solved
- Imo1993P3.solvable_two The 2 × 2 board is solved in three moves
- Imo1993P6.State The state of the system: the on/off states of the lamps (
true= on), together with the position of the lamp that may be switched at the next step - Imo1993P6.step Documented declaration: step
- Imo1993P6.initial The initial state: all lamps on, and the next step happens at lamp
0 - Imo1993P6.lampsAfter The lamp states after
tsteps of the process - Imo1993P6.toggle_inj For a fixed condition
c, the mapv ↦ (if c then !v else v)is injective - Imo1993P6.bool_toggle Toggling a lamp according to condition
cis xor withc - Imo1993P6.step_lamps The lamp component of one step
- Imo1993P6.step_pos The position component of one step
- Imo1993P6.pos_after After
tsteps the position ist(modulon) - Imo1993P6.step_injective The step map is injective: a state has exactly one precursor
- Imo1993P6.step_periodic The process is periodic: some positive iterate of
stepfixes the initial state - Imo1993P6.all_on_of_last_only Generic final phase: if after
n * (n - 1)steps only the last lampL_{n-1}is on, then the lamps are turned on one by one and aftern² - 1steps they are all on again - Imo1993P6.step_lamps_eq_of_pred_off If the lamp checked at a step is off, the step leaves all lamps unchanged
- Imo1993P6.step_lamps_toggle If the lamp checked at a step is on, the step flips the current lamp
- Imo1993P6.all_on_of_lamp1_only Documented declaration: all_on_of_lamp1_only
- Imo1993P6.zstep The same process with lamp values in
ZMod 2: toggling is adding the predecessor - Imo1993P6.pos_lemma The position after
tsteps - Imo1993P6.glue Correspondence between the Bool process and the ZMod 2 process
- Imo1993P6.lasti The last index of
Fin n - Imo1993P6.L One full round of the process:
L x p = x last + ∑_{i ≤ p} x iinZMod 2 - Imo1993P6.tot Total parity of a lamp vector
- Imo1993P6.eFn The vector with only the last lamp on
- Imo1993P6.round One full round of the process applies
Land returns to position0 - Imo1993P6.cat Concatenation of two lamp vectors
- Imo1993P6.D Lamp
n-2is off at every positive roundm ≤ n-1 - Imo1993P6.cStateVec State of the
n'+1-lamp process of "shifted" form: lamp 0 off, lamp 1 on, and lamps2..n'given by the vectorxonFin n' - Imo1993P6.LcState Documented declaration: LcState
- Imo1993P6.L_one One round from the all-on state gives the alternating vector
- Imo1993P6.invC The round-level invariant of part (c): after
mrounds (1 ≤ m ≤ 2^k - 1), the(2^k+1)-process is in shifted form - Imo1993P6.cState_eFn The shifted state of
eFn (2^k)is exactly "only lamp 1 on" - Imo1994P3.ones The number of
1s in the binary representation ofn - Imo1994P3.f The function
fof the problem: the number of elements of{k+1, ..., 2k}whose binary representation has exactly three1s - Imo1994P3.ones_two_pow_add_one' Versions of the above with a hypothesis on the exponent
- Imo1994P3.g Cumulative count: the number of elements of
{1, ..., n}with exactly three1s - Imo1994P6.ω Number of distinct prime factors of x
- Imo1995P6.shift The cyclic shift
x ↦ x + 1on{1, ..., p}(sendingpback to1), extended by the identity on all other natural numbers - Imo1995P6.shiftSet The action of
shift pon sets of naturals: the elements ofAlying in{1, ..., p}are cyclically shifted and all other elements stay fixed - Imo1995P6.sum_shiftSet The key congruence: shifting a set once increases its sum by the number of its elements lying in
{1, ..., p}, modulop - Imo1995P6.low_card_bounds If
Ais ap-element subset of{1, ..., 2p}different from the two "interval" subsets, thenA ∩ {1, ..., p}has between1andp - 1elements - Imo1995P6.card_range_filter_eq_one For
Aas above, among thepsetsA, σ A, ..., σ^{p-1} Aexactly one has sum divisible byp(hereσisshiftSet p) - Imo1995P6.card_U_filter_eq Shifting
itimes is a bijection on the good subsets, so for each fixedithe number of goodAwithp ∣ ∑ σⁱ Aequals the number of goodBwithp ∣ ∑ B - Imo1996P1.OnBoard The predicate that
pis a square of the 20 × 12 board - Imo1996P1.Move A permitted move between two squares: both lie on the board and the squared distance between their centers equals
r - Imo1996P1.SqA The square with vertex
A - Imo1996P1.SqB The square with vertex
B - Imo1996P1.step_two If
ris even anda² + b² = r, thena ≡ b (mod 2), so a move preserves the parity ofp.1 + p.2 - Imo1996P1.step_three If
3 ∣ randa² + b² = r, then3 ∣ aand3 ∣ b, so a move preservesp.1 mod 3 - Imo1996P1.move97 The only ways to write
97as a sum of two squares are81 + 16and16 + 81, so each permitted move forr = 97is of the form(±9, ±4)or(±4, ±9) - Imo1996P1.step97 The invariant for part (c): row membership in the central strip
{5, 6, 7, 8}agrees with evenness of the column - Imo1997P3.sign_eq_of_contra For fixed nonempty
x, assuming the opposite of what is to be proven, the signs ofS x pare all the same - Imo1997P4.SilverMatrix An
n × nmatrixMis a silver matrix if its entries come fromS = {1, …, 2n - 1}and, for eachi, thei-th row and thei-th column together contain all ofS - Imo1997P6.f Documented declaration: f
- Imo1997P6.f_succ Unfolding equation for the recursive definition
- Imo1997P6.f_odd A representation of an odd number must contain a
1 - Imo1997P6.f_even The recurrence at even arguments
- Imo1997P6.f_even' The recurrence at even arguments, shifted form
- Imo1997P6.f_mono
fis monotone nondecreasing - Imo1997P6.f_sum Iterating the recurrence gives
f (2N)as a sum of values off - Imo1997P6.f_two_mul_lt The upper-bound engine:
f (2m)is strictly less than(m + 1) * f mas soon asm ≥ 2(the termf 0 = 1 < f mmakes the inequality strict) - Imo1997P6.f_pair_step The key pairing inequality for the lower bound: the pairs
f k + f (2r + 1 - k)are nonincreasing inkfor1 ≤ k ≤ r - Imo1997P6.f_pair_ge Every pair in the sum is at least
2 * f r - Imo1997P6.f_sum_pair The lemma `f 1 + f 2 +
- Imo1997P6.f_lower_step The two-step lower-bound recurrence:
f (2^(n+1)) > 2^n * f (2^(n-1)) - Imo1997P6.f_lower_main The lower bound in integer form:
(f (2^n))^4 > 2^(n²), proved by two-step induction; note4 * (n + 2) + (n + 1)² = (n + 3)² - Imo1997P6.f_sq_step One step of the upper-bound induction, in squared form
- Imo1997P6.f_sq_le The upper bound in integer form, nonstrict version (for the induction)
- Imo1997P6.f_sq_lt The upper bound in integer form, strict for
n ≥ 3 - Imo1997P6.f_gt_lower The lower bound with real powers:
2^(n²/4) < f (2^n) - Imo1997P6.f_lt_upper The upper bound with real powers:
f (2^n) < 2^(n²/2) - Imo1998P2.JudgePair An ordered pair of judges
- Imo1998P2.JudgePair.judge₁ The first judge from an ordered pair of judges
- Imo1998P2.JudgePair.judge₂ The second judge from an ordered pair of judges
- Imo1998P2.JudgePair.Distinct The proposition that the judges in an ordered pair are distinct
- Imo1998P2.JudgePair.Agree The proposition that the judges in an ordered pair agree about a contestant's rating
- Imo1998P2.agreedContestants The set of contestants on which two judges agree
- Imo1998P2.AgreedTriple A triple consisting of contestant together with an ordered pair of judges
- Imo1998P2.AgreedTriple.contestant The contestant from the triple consisting of a contestant and an ordered pair of judges
- Imo1998P2.AgreedTriple.judgePair The ordered pair of judges from the triple consisting of a contestant and an ordered pair of judges
- Imo1998P2.A All incidences of agreement
- Imo1998P3.d Define
d(n), the function counting the number of positive divisors ofn - Imo1998P3.d_multiplicative Proof that
dis multiplicative - Imo1998P3.prime_power_divisors Proof that
d(pᵏ) = k + 1forpprime - Imo1998P3.d_eq_dComputed Proof that
d n = ∏ᵢ(kᵢ + 1)wheren = ∏ᵢpᵢᵏᵢ(prime factorization), using the fact thatdis multiplicative andd(pᵏ) = k + 1forpprime - Imo1998P3.d_n2 Proof that
d(n²) = ∏ᵢ(2kᵢ + 1)forn = ∏ᵢpᵢᵏᵢ(prime factorization) - Imo1998P3.list_prod_odd Proof that if every number in a list is odd, the product of the list is odd
- Imo1998P3.k_is_odd We begin by first proving that every value of
kmust be an odd number - Imo1998P3.exists_distinct_primes Proof that we can pick
tnew and distinct primes given a list oftprimes - Imo1998P3.repeated_multiplicity_of_d Proof that
d(∏ᵢxᵢ) = ∏ᵢd(xᵢ)for coprimexᵢ's (repeated mulitiplicity) - Imo1998P3.d_of_factorization Proof that
d(∏ᵢpᵢᵏᵢ) = ∏ᵢ(kᵢ + 1) - Imo1998P3.odd_k_satisfies We now prove that every odd number satisifies the equation
- Imo1999P3.Adjacent Definition of adjacency: Two squares are adjacent if they share a common side
- Imo1999P3.IsValidMarking A set s is a valid marking if every square in the grid is adjacent to some square in s
- Imo1999P3.isSw Helper predicate for the internal logic of the construction
- Imo1999P3.sw The set "sw" (Marked squares with even coordinate sum)
- Imo1999P3.sb The set "sb" (Marked squares with odd coordinate sum, symmetric to sw)
- Imo1999P3.solutionSet The definition of the solution set based on the construction logic
- Imo1999P3.squaresEvenSum Set of all squares where the sum of coordinates is even
- Imo1999P3.squaresOddSum Set of all squares where the sum of coordinates is odd
- Imo1999P3.transform The transformation used to map the set
swto a triangular region inFin k × Fin k - Imo1999P3.sum_range_sub_eq_triangular Helper lemma for triangular number summation
- Imo1999P3.transform_inj_on_sw Lemma: The transformation is injective on the set sw
- Imo1999P3.transform_surjective_on_t Lemma: The transformation maps sw onto t (Surjectivity)
- Imo1999P3.card_sw_eq_triangular Calculate the cardinality of the 'sw' set (White squares in the construction)
- Imo1999P3.adjacent_parity_ne Lemma: Adjacent squares always have different parity of the sum of their coordinates
- Imo1999P3.IsIndependentPoint Condition for a set of points to be "independent" (pairwise distance > 2)
- Imo1999P3.independent_points_cant_share_neighbor Lemma: Independent points cannot share a common neighbor
- Imo1999P3.parityTransform Helper: A parity-dependent transformation
- Imo1999P3.parity_transform_injective Lemma: parityTransform is injective
- Imo1999P3.card_lower_bound_of_cover Lower Bound Lemma (Revised): If s covers all squares with a specific target parity (0 or 1), then |s| ≥ n(n+2)/8
- Imo1999P3.exists_adjacent_in_sw_of_odd_sum Lemma: For any square
qwhose coordinate sum is odd, there exists a marked square inswadjacent toq - Imo1999P3.disjoint_sw_sb Lemma: The sets sw and sb are disjoint
- Imo1999P3.card_sw_eq_card_sb Lemma: Symmetry implies |sw| = |sb|
- Imo2000P3.Move Documented declaration: Move
- Imo2000P3.Reachable
Reachable lam x ymeans that configurationycan be reached from configurationxby a finite sequence of moves with jump ratiolam - Imo2000P3.AllRightOf Documented declaration: AllRightOf
- Imo2000P3.rightmost The position of the rightmost flea
- Imo2000P3.leftmost The position of the leftmost flea
- Imo2000P3.potential Gerhard Woeginger's potential function: the sum of the distances of the fleas from the rightmost flea
- Imo2000P3.move_potential_bound The key inequality for the necessity direction: a single move decreases the potential by at least
(1 / lam - (n - 1))times the amount by which the rightmost flea advances - Imo2000P3.reachable_potential_bound The inequality of
move_potential_boundtelescopes along any sequence of moves - Imo2000P3.not_allRightOf_of_lt Necessity: if
0 < lam < 1 / (n - 1), then the rightmost flea stays bounded, so the fleas cannot all be moved arbitrarily far to the right - Imo2000P3.strat_step One step of Woeginger's strategy: move the leftmost flea over the rightmost flea
- Imo2000P3.phase1 Phase 1 of the strategy: after
tmoves ofstrat_step, the rightmost flea has advanced by at leastttimes the fixed positive amountlam * potential x / (n - 1) - Imo2000P3.phase2 Documented declaration: phase2
- Imo2000P3.allRightOf_of_ge Documented declaration: allRightOf_of_ge
- Imo2000P4.Good Documented declaration: Good
- Imo2000P4.Mod3 The mod-3 placements: the box of card
adepends only ona % 3 - Imo2000P4.Ends The "ends" placements: cards
1andnare alone in two boxes and all cards2, ..., n - 1are in the third box - Imo2000P4.good_mono If
n + 1shares its box with another card, then a good placement of1, ..., n + 1restricts to a good placement of1, ..., n - Imo2000P4.case_alone Case 1 of the induction step:
n + 1is alone in its box - Imo2000P4.case_mod3 Case 2a of the induction step: the restriction to
1, ..., nis a mod-3 placement; thenn + 1must go into the box of its own residue - Imo2000P4.case_ends Case 2b of the induction step: the restriction to
1, ..., nis anEndsplacement with4 ≤ n; then there is no room for the cardn + 1 - Imo2000P4.base_case Base case: every good placement of
1, 2, 3puts the three cards in three different boxes - Imo2000P4.ends3_mod3 For
n = 3the two families coincide - Imo2000P4.classify The classification: every good placement of
1, ..., n(3 ≤ n) is either by residue mod 3 or anEndsplacement - Imo2000P4.ValidPlacement Documented declaration: ValidPlacement
- Imo2000P4.GoodPlacement Combinatorial form of validity: whenever two pairs of cards from two different pairs of boxes have the same sum of indices, the pairs of boxes coincide
- Imo2000P4.third_box_iff_pair Two pairs of distinct boxes leave the same third box unselected if and only if the two pairs of boxes coincide
- Imo2000P4.valid_iff_good Documented declaration: valid_iff_good
- Imo2000P4.lift Extend a placement
g : Fin 100 → ZMod 3to all ofℕ(by0outside[1, 100]); cardacorresponds to indexa - 1 - Imo2000P4.T The box of card
iin an "ends" placement - Imo2000P4.mod3fun The mod-3 placements of the 100 cards
- Imo2000P4.endsfun The "ends" placements of the 100 cards
- Imo2000P4.bucket_of_ne For a pair of indices from two different
T-boxes, the sum determines the (unordered) pair ofT-values - Imo2000P4.mem_solutions Every valid placement is one of the twelve explicit placements
- Imo2000P4.card_valid The valid placements are exactly the good placements, so there are twelve of them
- Imo2001P3.Easy A problem is easy for a cohort (boys or girls) if at least three of its members solved it
- Imo2001P3.card_not_easy_le_five Every contestant solved at most five problems that were not easy for the other cohort
- Imo2001P3.card_not_easy_le_210 There are at most 210 girl-boy pairs who solved some problem in common that was not easy for a fixed cohort
- Imo2001Q4.S The function
Sin the problem - Imo2001Q4.sum_range_modEq_sum_of_contra Assuming the opposite of what is to be proved, the sum of
Sover all permutations is congruent to the sum of all residues modulon!, i.e. `n! - Imo2001Q4.sum_perm_add_one The sum over all permutations of
Icc 1 nof the entry at any fixed position is `(n - 1)! - Imo2001Q4.sum_modEq_zero_of_odd For odd
n, the sum ofSover all permutations is divisible byn! - Imo2001P5.Setup The problem's configuration
- Imo2001P5.Setup.x
x = ∠ABQ = ∠QBC - Imo2001P5.Setup.BP_by_AB
dist B Pin terms ofdist A B - Imo2001P5.Setup.AQ_by_AB
dist A Qin terms ofdist A B - Imo2001P5.Setup.QB_by_AB
dist Q Bin terms ofdist A B - Imo2001P5.Setup.key_x_equation The key trigonometric equation for
x - Imo2002P1.T The points (x, y) with nonnegative integer coordinates and x + y < n
- Imo2002P1.ChoiceCount The sets of n blue points in T whose coordinates are distinct in the dimension selected by
coord - Imo2002P1.downward_closed_iff_lt_card A downward-closed finite set of naturals is an initial segment
- Imo2002P1.blueCol The blue points in column
x - Imo2002P1.redCol The number of red points in column
x - Imo2002P1.redCol_swap The red count in row
yis the number of columns whose red count exceedsy - Imo2002P1.key_prod Documented declaration: key_prod
- Imo2002P1.choiceCount_fst A choice of n blue points with distinct x-coordinates amounts to a choice of one blue point in each column
- Imo2002P1.choiceCount_snd Reflecting across the diagonal swaps the roles of the two coordinates
- Imo2002P4.nthDiv The
i-th smallest positive divisor ofn(meaningful fori < n.divisors.card) - Imo2002P4.pairSum The sum `d₁d₂ + d₂d₃ +
- Imo2002P4.div_lt_div_of_dvd_of_lt Division is strictly antitone on the divisors of a positive integer
- Imo2002P4.nthDiv_pair Pairing of divisors: the
i-th smallest times thei-th largest equalsn - Imo2002P4.nthDiv_one The second smallest divisor of
n > 1is its least prime factor - Imo2002P4.tele Telescoping sum used in part (a)
- Imo2002P4.pairSum_lt Part (a): the sum is less than
n ^ 2 - Imo2002P4.pairSum_not_dvd_of_not_prime Composite
ndoes not work:n ^ 2 / n.minFac < d ≤ n ^ 2 / n.minFac - Imo2003P1.induction_lemma Proof by induction on the number of tᵢ's
- Imo2003P5.sum_coeff The coefficients
2i + 1 - nare centered: their sum vanishes - Imo2003P5.sum_coeff_mul The sum of the coefficients times the index
- Imo2003P5.sum_sq_coeff The sum of the squared coefficients
- Imo2003P5.sum_abs_diff The key identity for the sum of absolute differences of a nondecreasing sequence
- Imo2003P5.sum_sq_diff Expansion of the sum of squared differences
- Imo2003P5.imo2003_p5_equality The equality case: equality holds iff the sequence is an arithmetic progression
- Imo2004P3.rect The cells of an
m × nrectangle, as a finite subset ofℤ × ℤ - Imo2004P3.hookShapes The eight orientations of the hook (rotations and reflections of the figure in the problem statement)
- Imo2004P3.IsHook A hook is a translate of one of the eight orientations
- Imo2004P3.Tileable
Rcan be tiled by hooks: there is a finite family of pairwise disjoint hooks whose union isR - Imo2004P3.tileShapes The six orientations of the two-hook "tiles" (pairs of interlocking hooks): the
3 × 4rectangle, the4 × 3rectangle, and the four orientations of the zigzag shape - Imo2004P3.IsTile A tile is a translate of one of the six tile shapes
- Imo2004P3.lo The lower-left corner of the bounding box of a set of cells
- Imo2004P3.hole The "hole" (notch) of a hook: the centre cell of its bounding box
- Imo2004P3.hook_row3 Every hook orientation contains cells two apart in some row
- Imo2004P3.hook_col3 Every hook orientation contains cells two apart in some column
- Imo2004P3.pair_check The key local fact
- Imo2004P3.hookShapes_swap The hook orientations are closed under transposition (which is one of the eight symmetries of the square)
- Imo2004P3.tileable_3_4 Two hooks tile a
3 × 4rectangle - Imo2004P3.nat_3_4 Every natural number other than
1, 2, 5is a sum of3s and4s - Imo2004P3.tileable_12j A
12 × nrectangle withn ∉ {1, 2, 5}is tileable - Imo2004P3.tileable_of_conditions Sufficiency: every rectangle satisfying the conditions is tileable
- Imo2004P3.pair_general Documented declaration: pair_general
- Imo2004P3.tile_decomposition The main structural fact: any hook-tiling of a rectangle refines to a tiling by the six two-hook tiles
- Imo2004P3.tile_parities On every tile, exactly one of the two parity counts (cells in columns divisible by four, cells in rows divisible by four) is odd
- Imo2004P3.mod4_eq_two_of If
4 ∣ a * bbut4 ∤ aand4 ∤ b, thena ≡ b ≡ 2 (mod 4) - Imo2004P3.card_biUnion' Necessity of the divisibility condition on
4 - Imo2004P3.not_tileable_of_n_le_two A rectangle with a side of length at most
2cannot be tiled (a hook spans three consecutive rows and three consecutive columns) - Imo2004P3.cornerCell The second cell used in the corner propagation argument for the
5 × ncase: it is the cell just next to a tile placed in the corner which cannot be covered by any other tile - Imo2004P3.corner_check The corner propagation check: no tile covering
cornerCell τ₀within the bounds of a five-row strip is disjoint from the corner tileτ₀ - Imo2004P3.not_tileable_5 A
5 × nrectangle cannot be tiled - Imo2004P3.GoodRect The predicate characterising the rectangles that can be tiled by hooks
- Imo2004P4.exists_triangle If
a,b,csatisfy the strict triangle inequalities, then there is an (automatically nondegenerate) triangle in the plane with those side lengths - Imo2004P4.card_sq_le Cauchy–Schwarz / AM–HM: for positive reals indexed by a finset
s,(card s)² ≤ (∑ tᵢ)(∑ 1/tᵢ) - Imo2004P4.key The heart of the problem: any three of the values satisfy the triangle inequality
- Imo2004P6.Nice Digit lists (little-endian) whose entry at each position has the parity of the position, so that consecutive digits have different parity
- Imo2004P6.dvd_geom_sum If
uis coprime toxand2 ≤ x, thenudivides some sum1 + x + x ^ 2 + ⋯ + x ^ (t - 1)with0 < t - Imo2004P6.exists_alternating_multiple Repeating a
Nicedigit block of even length enough times produces an alternating multiple ofn * u, wherendivides the block anduis coprime to10 - Imo2004P6.exists_alt_multiple_of_dvd Any
ndividing2 ^ i * 5 ^ j * u, whereuavoids2and5and someNiceblock of even length is divisible by2 ^ i * 5 ^ j, has an alternating multiple - Imo2004P6.two_block For every
kthere is aNicedigit block of length2 * k + 2divisible by2 ^ (2 * k + 3) - Imo2004P6.five_block For every
bthere is aNicedigit block of lengthb + 1divisible by10 * 5 ^ b(its bottom digit is0) - Imo2005P2.abs_sub_lt Any two of the first
nterms differ by less thann - Imo2005P2.mem_of_between The first
nterms form a set ofnconsecutive integers, so any integer sandwiched between two of them is itself one of them - Imo2005P4.find_specified_factor Key lemma (a modular arithmetic calculation): Given a prime
pother than2or3, the(p - 2)th term of the sequence haspas a factor - Imo2005P6.arith_core The arithmetic heart of the problem: fifteen pair counts, each at least
(2 * n + 1) / 5, with sum6 * n + 4and satisfying ten congruences modulo 3, cannot exist - Imo2005P6.cong_aux Documented declaration: cong_aux
- Imo2005P6.pc2_univ The fifteen 2-subsets of
Fin 6, as a literal finset - Imo2005P6.exists_superset_card Any set of at most
k ≤ 6problems can be extended to a set of exactlykproblems - Imo2005P6.pairCount The number of contestants who solved both problems of the pair
P - Imo2005P6.sum_pairCount Double counting: the sum of the pair counts over all fifteen pairs equals the sum over contestants of the number of pairs of problems they solved
- Imo2005P6.pairCount_modEq Documented declaration: pairCount_modEq
- Imo2006P3.lhs_ineq Replacing
xandywith their average increases the left side - Imo2006P3.rhs_ineq Replacing
xandywith their average decreases the right side - Imo2006P3.subst_proof₁ Proof that
M = 9 * sqrt 2 / 32works with the substitution - Imo2006P3.imo2006_p3 IMO 2006 Problem 3: the least constant M
- Imo2006P5.Int.natAbs_eq_of_chain_dvd If every entry in a cyclic list of integers divides the next, then they all have the same absolute value
- Imo2006P5.Polynomial.isPeriodicPt_eval_two The main lemma in the proof: if $P^k(t)=t$, then $P(P(t))=t$
- Imo2006P5.imo2006_p5' We solve the problem for the specific case k = 2 first
- Imo2007P3.maxCliqueCard The largest size of a clique of the graph
Gall of whose vertices lie inA - Imo2008P4.PosReal.mul_two In mathlib3, mul_two automatically worked on PosReal
- Imo2008P5.fiber_ncard_of_mod_n If g reduces f mod n (mapping [0,n) to itself and [n,2n) to [0,n) by subtracting n), then the fiber of g at i < n is the disjoint union of the fibers of f at i and n+i
- Imo2009P1.telescope Telescoping: if
c j * c (j+1) = c jfor allj, then the product of any windowc i, c (i+1), …, c (i+m)collapses to its first termc i - Imo2009P1.const_of_cyclic If the relation
c j * c (j+1) = c jholds andcis periodic with periodk ≥ 1, thencis constant:c i = c (i+1)for alli - Imo2009P3.IsArithProg A sequence
f : ℕ → ℕis an arithmetic progression - Imo2009P5.final_solution_nat Final solution,
natversion - Imo2009P5.final_solution_pnat Final solution,
pnatversion - Imo2009P6.embedFinLE_map_Iic The image of the prefix
{j ≤ i'}ofFin munderembedFinLEis the prefix{j ≤ i}ofFin n, providedilies in the small range - Imo2009P6.embedFinLE_map_Iio The image of
{j : Fin m | j.val < c}underembedFinLEis the prefix{j ≤ ⟨c⟩}ofFin nwith the point⟨c⟩removed - Imo2009P6.imo2009_p6_aux2 The problem with an additional assumption that a is sorted
- Imo2010P3.injective_of_sq The square condition forces
gto be injective - Imo2010P3.step_one Documented declaration: step_one
- Imo2010P5.Reachable The predicate defining states of boxes reachable by the given moves
- Imo2010P5.Reachable.push Empty $B_i$ and add twice its coins to $B_{i+1}$ by repeatedly applying move 1
- Imo2010P5.Reachable.five_eleven
(0, 0, 5, 11, 0, 0)is reachable - Imo2010P5.Reachable.double Decrement $B_i$ and double $B_{i+1}$, assuming $B_{i+2} = 0$, by doing
push, move2 - Imo2010P5.Reachable.doubles
doubleas many times as possible, emptying $B_i$ and doubling $B_{i+1}$ that many times - Imo2010P5.Reachable.exp Empty $B_i$ and set $B_{i+1} = 2^{B_i}$, assuming $B_{i+1} = B_{i+2} = 0$
- Imo2010P5.Reachable.exp_mid From
(0, 0, k+1, n, 0, 0)withn > 0we can reach(0, 0, k, 2^n, 0, 0) - Imo2010P5.Reachable.reduce If all coins are in box 4, their number can be reduced by any desired amount
- Imo2010P5.Reachable.tower_inequality The key power tower inequality in the solution
- Imo2010P5.Reachable.quarter_target
(0, 0, 0, 2010 ^ 2010 ^ 2010 / 4, 0, 0)is reachable - Imo2011P1.pairCount The number of two-element subsets of
Awhose sum divides the sum ofA - Imo2011P1.not_dvd_between A natural number strictly between
mand2 * mis not divisible bym - Imo2011P1.filter_subset_target The two-element subsets of
{a, b, c, d}whose sum divides the total, viewed insidepairCount - Imo2011P1.dvds_of_four_le If the count is (at least) 4, then all four candidate pairs divide the sum
- Imo2011P1.pairCount_eq_four If all four candidate pairs divide the sum, the count is exactly 4
- Imo2011P1.classify The heart of the solution: if all four candidate pairs divide the sum, then the quadruple is
(a, 5a, 7a, 11a)or(a, 11a, 19a, 29a) - Imo2011P1.exists_sorted_four Any 4-element finset of naturals can be listed in increasing order
- Imo2011P4.Balance The imbalance (left pan minus right pan) after a sequence of placements
- Imo2011P4.ValidSeq A sequence of placements is valid if after every step the right pan is not heavier than the left pan
- Imo2011P4.Ways Documented declaration: Ways
- Imo2011P4.balance_map_succ Doubling all weights doubles the imbalance
- Imo2011P4.balance_map_pred Halving all weights halves the imbalance (all weights here are even)
- Imo2011P4.balance_ne_zero Key nonzero fact: a nonempty signed sum of distinct powers of two is nonzero
- Imo2011P4.prefix_append_cases A prefix of an append either lies in the first part or extends it
- Imo2011P4.removeIdx The position of the weight
2^0in a valid sequence - Imo2011P4.removePan The pan on which the weight
2^0was placed - Imo2011P4.ways_split A valid sequence splits around its
2^0weight - Imo2011P4.ways_fst_pos The weights before and after the
2^0weight are all even - Imo2011P4.removeList The list of placements with the
2^0weight removed and the remaining weights halved - Imo2011P4.insertList Inserting a fresh
2^0weight at positionkon panbinto a list of placements whose weights are all doubled - Imo2011P4.validSeq_remove Documented declaration: validSeq_remove
- Imo2011P4.validSeq_insert Documented declaration: validSeq_insert
- Imo2011P4.IData The insertion data: where and on which pan the weight
2^0is inserted - Imo2011P4.removePan_false_idx The weight
2^0cannot be the first placement if it goes on the right pan - Imo2011P4.removeZeroWays The valid sequence obtained by removing the weight
2^0and halving - Imo2011P4.removeZeroData The insertion data describing where the weight
2^0sits in a valid sequence - Imo2011P4.insertZeroWays The valid sequence obtained by inserting the weight
2^0according to the given insertion data - Imo2011P4.insertList_removeList Removal followed by insertion reconstructs the original sequence
- Imo2011P4.insertList_getElem The element of an inserted list at the insertion position is the new
2^0weight - Imo2011P4.insertList_findIdx The position of the
2^0weight in an inserted list is exactly the insertion position - Imo2011P4.stepEquiv The key bijection: valid sequences for
n + 1weights correspond to valid sequences fornweights together with insertion data for the weight2^0 - Imo2012P3.Move A move of player B: either stop and guess a set
X, or ask whetherx ∈ S - Imo2012P3.Strategy A strategy for player B: from the list of answers so far (in chronological order), decide the next move
- Imo2012P3.hist The answer history after
tquestions, when player A answers according toans - Imo2012P3.TruthfulAt The
i-th answer is truthful for the secretx: it matches the truth value ofx ∈ S, whereSis the question B asked at that point - Imo2012P3.ConsistentUpTo The play is consistent with the secret
xup to timeT: among anyk + 1consecutive answers within the firstT, at least one is truthful - Imo2012P3.GuaranteesWin Player B's strategy
σguarantees a win if 1 - Imo2012P3.BobWins Player B can guarantee a win with parameters
k, nwhen player A's bound isN - Imo2012P3.weightBase The base of the weights used by A's counter-strategy
- Imo2012P3.alicePlay A's counterplay against
σ: after each answer she records, for every candidate, the length of its current run of consecutive lies - Imo2012P3.aliceStreak The streak (length of the current run of consecutive lies) of each candidate after
tanswers of A's counterplay - Imo2012P3.aliceHist The answer history of A's counterplay after
tsteps - Imo2012P3.aliceAns The
t-th answer of A's counterplay - Imo2012P3.aliceWeight The total weight after
tanswers - Imo2012P3.aliceWeight_step_ask At an ask-step, the new total weight is at most
weightBase / 2times the old weight plusN - Imo2012P3.aliceWeight_le The total weight never exceeds
1000 * N - Imo2012P3.aliceStreak_le No candidate's streak ever reaches
k + 1, once1000 * N < (1.998) ^ (k+1) - Imo2012P3.alice_lie_streak If A's
i-th answer is a lie forx, thenx's streak increases by one - Imo2012P3.alice_consistent A's answer sequence is consistent with every candidate at all times: among any
k + 1consecutive answers, at least one is truthful forx - Imo2012P3.aliceWeightBase_bound The weight bound needed at
N = n + 1wheren = ⌈(1.99) ^ k⌉ - Imo2012P3.not_bobWins Under the weight bound, B has no winning strategy: A's counterplay is consistent with every candidate at all times, so B can never stop with a correct guess of size at most
n - Imo2012P3.one_le_pow_199 Helper:
1 ≤ (1.99) ^ k - Imo2012P3.exists_eventually_large For all sufficiently large
k,1000 * ((1.99) ^ k + 2) < (1.998) ^ (k + 1) - Imo2012P3.BobPhase Documented declaration: BobPhase
- Imo2012P3.BobState Bob's state: his current candidate pool together with the progress in the current elimination round
- Imo2012P3.BobPhase.answers The number of answers given so far in the current round
- Imo2012P3.bobEmbedding An embedding of the
2 ^ kbit patterns into the pool - Imo2012P3.exists_special There is an element of the pool outside the image of the bit patterns
- Imo2012P3.bobSpecial The distinguished candidate asked about in the probe phase: an element of the pool outside the image of the bit patterns
- Imo2012P3.bitQuestion The set of candidates whose
i-th bit is1 - Imo2012P3.bobQuestion Bob's question in a given phase: the singleton
{special}when probing, the|bs|-th bit question in the bit phase - Imo2012P3.bobStepPhase One round-step of Bob's state machine, in the case
2 ^ k < P.card - Imo2012P3.bobStep One step of Bob's state machine
- Imo2012P3.bobStrategy Bob's winning strategy for part (a)
- Imo2012P3.bobStateOf Bob's state after processing the first
tanswers - Imo2012P3.bob_backward_probe Backward step, probe phase with
j ≥ 1 - Imo2012P3.bob_backward_bits_nil Backward step, bit phase with no bit answers yet
- Imo2012P3.bob_backward_bits_snoc Backward step, bit phase with at least one bit answer
- Imo2012P3.bob_backward_probe_chain Iterated backward step through a probe phase
- Imo2012P3.bob_backward_bits_chain Iterated backward step through a bit phase
- Imo2012P3.bob_measure The termination measure: while the pool has more than
2 ^ kelements,tis bounded by(2k+1) * (eliminated so far) + (answers in current round) - Imo2012P3.bob_terminates B's strategy always stops: the pool shrinks by one every
2k + 1answers - Imo2012P3.bob_mem_pool The pool invariant: if the answers are consistent with
xup to timet, thenxis still in Bob's pool - Imo2012P3.bob_guaranteesWin B's strategy guarantees a win when
n ≥ 2 ^ k - cospherical_or_collinear_of_mul_dist_eq_mul_dist_of_sbtw The converse of the Intersecting Chords Theorem, stated with
Sbtw - Imo2012P5.Imo2012P5Cfg A configuration satisfying the conditions of the problem
- Imo2012P5.Imo2012P5Cfg.symm The symmetry of the configuration
- Imo2012P5.Imo2012P5Cfg.C' The reflection of
Cin lineAB - Imo2012P5.Imo2012P5Cfg.K' The second point on line
AXwithBC = BK' - Imo2012P5.Imo2012P5Cfg.L' The second point on line
BXwithAC = AL' - Imo2012P5.Imo2012P5Cfg.SphereWithKK'LL' A sphere containing
K,K',L,L' - Imo2012P6.ind_4k1_to_4k2 If n=4k+1 is a solution then n=4k+2 is also a solution
- Imo2012P6.ind_4k1_to_4k13 If n=4k+1 is a solution then n=4k+13 is also a solution
- Imo2013P2.ColombianConfiguration A configuration of 2013 red points and 2014 blue points in the plane, all distinct, such that no three points of the configuration are collinear
- Imo2013P2.GoodArrangement Documented declaration: GoodArrangement
- Imo2013P2.rot90 Rotation by 90 degrees
- Imo2013P2.e₁ The first standard basis vector
- Imo2013P2.perp The line
{x | ⟪n, x⟫ = c} - Imo2013P2.sOppSide_iff The fundamental characterization:
xandyare strictly on opposite sides of the line{z | ⟪n, z⟫ = c}iff their inner products withnstrictly sandwichc - Imo2013P2.exists_normal Every one-dimensional affine subspace of the plane is the level set of a nonzero linear functional
- Imo2013P2.exists_cut Cut a subset
ZofSoff from the rest ofSwith a single line, given a linear functional whose values onZall lie strictly below its values onS \ Z - Imo2013P2.exists_strip Cut a pair of points
{A, B}ofSoff from the rest ofSwith two lines parallel to the segmentAB - Imo2013P2.pair_strips Isolate an even-sized subset
CofSinto pairs, each pair confined to its own strip between two parallel lines - Imo2013P2.mtrick Documented declaration: mtrick
- Imo2013P2.exists_hull_edge Documented declaration: exists_hull_edge
- Imo2013P2.assemble Documented declaration: assemble
- Imo2013P2.upper_bound 2013 lines always suffice
- Imo2013P2.ang The angle of the
j-th vertex of a regular 4027-gon - Imo2013P2.pt The
j-th vertex of a regular 4027-gon inscribed in the unit circle - Imo2013P2.redPts The red points: vertices with odd indices
- Imo2013P2.bluePts The blue points: vertices with even indices
- Imo2013P2.lowerCfg The Colombian configuration witnessing the lower bound: the vertices of a regular 4027-gon, colored red at odd indices and blue at even indices
- Imo2013P2.sinusoid_roots A sinusoid
r ↦ n 0 * cos r + n 1 * sin rwithn ≠ 0takes any value at most twice on an interval shorter than a full period - Imo2013P2.exists_root_pair Documented declaration: exists_root_pair
- Imo2013P2.seps_card_le_two A single line strictly separates at most two of the 4026 adjacent vertex pairs of the regular 4027-gon
- Imo2013P2.lower_bound Documented declaration: lower_bound
- Imo2014P2.HasEmptySquare A peaceful configuration of
nrooks is a permutationσ: the rook in rowisits in columnσ i - Imo2014P2.hasEmptySquare_mono An empty
k × ksquare contains an emptyj × jsquare wheneverj ≤ k - Imo2014P2.sqrt_bounds
⌊√(n-1)⌋² < n ≤ (⌊√(n-1)⌋+1)² - Imo2014P2.exists_empty_square Existence (lower bound): every peaceful configuration has an empty
⌊√(n-1)⌋ × ⌊√(n-1)⌋square - Imo2014P2.HasRook
σplaces a rook in every axis-alignedK × Ksquare — exactly the negation ofHasEmptySquare - Imo2014P2.covering_restrict Restriction reduction: a rook-covering configuration on an
M × Mboard restricts (top-left, then completed arbitrarily) to one on any smallerN × Nboard - Imo2014P2.transpose_covering Base case of the construction: the grid-transpose
i ↦ K·(i % K) + i / Kis a permutation of theK² × K²board placing a rook in everyK × Ksquare - Imo2014P2.exists_config_no_square Optimality (upper bound): some peaceful configuration has no empty
(⌊√(n-1)⌋+1) × (⌊√(n-1)⌋+1)square - Imo2014P5.value The total value of a collection of coins, where a coin of denomination
nis worth(n : ℚ)⁻¹ - Imo2014P5.cap The capacity bound: any collection of total value at most
cap kcan be split intokor fewer groups each of value at most1 - Imo2014P5.greedy Documented declaration: greedy
- Imo2014P5.exists_partition_aux The main claim, proved by strong induction on the number of coins: a collection of total value at most
cap kadmits a partition into at mostkgroups each of value at most1 - Imo2014P6.Line A line in the plane
ℝ × ℝ, given by the equationa * x + b * y + c = 0with(a, b) ≠ (0, 0) - Imo2014P6.Line.val The affine function whose zero set is the line
- Imo2014P6.Line.set The line as a set of points
- Imo2014P6.Line.det The determinant of the two normals; nonzero iff the lines are not parallel
- Imo2014P6.Line.interPt The intersection point of two non-parallel lines
- Imo2014P6.GeneralPosition A set of lines is in general position if no two are parallel and no three pass through the same point
- Imo2014P6.sgn The sign
±1attached to a side of a line - Imo2014P6.Cell The cell of a sign vector
σ: the set of points lying on the prescribed side of every line ofL - Imo2014P6.Line.base A distinguished point on the line: the foot of the perpendicular from the origin
- Imo2014P6.Line.dir A direction vector of the line: the normal
(a, b)rotated by 90 degrees - Imo2014P6.Line.param The standard parametrization of the line by
ℝ - Imo2014P6.GP.eq_of_val_eq_zero Any line through the intersection of two distinct lines of
Lis one of them - Imo2014P6.closure_cell The closure of a nonempty cell is given by the corresponding weak inequalities
- Imo2014P6.frontier_cell The frontier of a cell: its closure minus itself
- Imo2014P6.mem_frontier_iff A point lies in the frontier of a nonempty cell iff all weak sign conditions hold and it lies on at least one line
- Imo2014P6.ValidBlue The working definition of "no finite region has a completely blue boundary": for every nonempty bounded cell, some line meeting the closure of the cell is not blue
- Imo2014P6.Line.crossT The parameter value where the standard parametrization of
ℓcrossesm - Imo2014P6.Line.constraint_iff The sign constraint on
malong the parametrization ofℓ, as a bound ont - Imo2014P6.lows The lines whose constraint is a lower bound on the parameter along
ℓ - Imo2014P6.upps The lines whose constraint is an upper bound on the parameter along
ℓ - Imo2014P6.EdgeCtx A bounded cell of an arrangement in general position, together with a distinguished boundary line
ℓ - Imo2014P6.EdgeCtx.exists_abs_le The parameters of points of the closure of the cell on the line
ℓform a bounded set - Imo2014P6.EdgeCtx.exists_param_mem Some parameter realizes a point of the closure on
ℓ - Imo2014P6.EdgeCtx.Tmin The lower endpoint of the edge, in parameter form
- Imo2014P6.EdgeCtx.Tmax The upper endpoint of the edge, in parameter form
- Imo2014P6.EdgeCtx.Tmin_lt_Tmax The two endpoints are distinct: they would otherwise give three concurrent lines
- Imo2014P6.EdgeCtx.val_ne_zero_of_mem_Ioo The pullback of the edge along the parametrization contains no crossing in its interior
- Imo2014P6.EdgeCtx.param_mem_closure_inter The parametrized points of the edge segment lie in the closure of the cell and on the line
- Imo2014P6.EdgeCtx.exists_line_at_Tmax At the upper endpoint, some other line of the arrangement passes: the line realizing the upper bound
- Imo2014P6.EdgeCtx.exists_line_at_Tmin At the lower endpoint, some other line of the arrangement passes
- Imo2014P6.EdgeCtx.eq_of_val_at_param At most one other line passes through an endpoint (general position)
- Imo2014P6.Witness A witness region for a red line
ℓ: a bounded cell of the arrangement whose boundary lines are all blue, exceptℓ, which does occur on the boundary - Imo2014P6.Witness.ectx The edge context of the red line
ℓ - Imo2014P6.Witness.rT The parameter of the red point
r: the endpoint of the red edge at which the clockwise traversal of the boundary leaves the red line - Imo2014P6.Witness.r The red point associated to
ℓ - Imo2014P6.Witness.exists_g1 The other line through
rexists - Imo2014P6.Witness.g1_unique The other line through
ris unique - Imo2014P6.Witness.g1 The other line through
r(a blue line) - Imo2014P6.Witness.g1ctx The edge context of the blue line
g₁ - Imo2014P6.Witness.exists_s_r The parameter of
rin the parametrization ofg₁ - Imo2014P6.Witness.r_eq_g1_param The consistency lemma:
ris the clockwise-first endpoint of theg₁-edge, i.e.bandrare two clockwise-consecutive vertices of the region - Imo2014P6.Witness.bT The parameter of the blue point
bin the parametrization ofg₁: the other endpoint of theg₁-edge - Imo2014P6.Witness.b The blue point associated to
ℓ: the next vertex of the region afterrin clockwise order - Imo2014P6.Witness.exists_g2 The other line through
bexists - Imo2014P6.Witness.g2 The other line through
b(another blue line) - Imo2014P6.Witness.eq_of_val_b_eq_zero The two blue lines through
bare exactlyg₁andg₂ - Imo2014P6.Witness.g2ctx The edge context of the blue line
g₂ - Imo2014P6.Witness.s_r The parameter of
rin the parametrization ofg₁ - Imo2014P6.Witness.s_b The parameter of
bin the parametrization ofg₁ - Imo2014P6.Witness.mem_Ioo_of_between A parameter strictly between
s_rands_blies in the interior of theg₁-edge - Imo2014P6.Witness.g1_edge_uncut The
g₁-edge contains no crossing of another line in its interior - Imo2014P6.Witness.g2_edge_uncut The
g₂-edge contains no crossing of another line in its interior - Imo2014P6.opp_sides Documented declaration: opp_sides
- Imo2014P6.turn_at_blue_pt The key turning argument: the region of the third red line must turn at
qtowards one of the two red points, forcing three concurrent lines - Imo2014P6.Line.eq_of_two_mem Two distinct points determine a line (in general position)
- Imo2014P6.assocB The association map from red lines to blue points, for a choice of witnesses
- Imo2014P6.Witness.s_b_eq_s_b On the same blue line through the same blue point, the parameter of
bis the same for two witnesses - Imo2014P6.fiber_card_le_two The key counting lemma: at most two red lines are associated to the same blue point
- Imo2014P6.exists_boundary_line Every bounded nonempty cell has a boundary line: follow a ray from an interior point; since the cell is bounded, some constraint must stop the ray
- Imo2014P6.validBlue_empty The empty blue set is valid
- Imo2014P6.exists_maximal_valid A maximal valid blue set exists
- Imo2014P6.exists_witness Every red line has a witness region
- Imo2014P6.redWitness The choice of a witness region for every red line
- Imo2014P6.bluePts The blue points: the intersection points of pairs of distinct blue lines
- Imo2014P6.two_mul_card_bluePts Each blue point has at least two preimages among the ordered pairs of blue lines
- Imo2014P6.assocB_mem_bluePts The association map sends red lines into the blue points
- Imo2014P6.card_red_le The number of red lines is at most twice the number of blue points
- Imo2014P6.main_counting The grand count:
n ≤ k² - Imo2014P6.not_frontier_subset_of_validBlue If no finite region has a completely blue boundary in the working sense, then no finite region has a completely blue boundary in the geometric sense
- Imo2014P6.main_result The main result: one can colour at least
√nlines - Condition The conditions on
ain the problem - pool The collection of ball heights in the solution
- pool_subset_Icc The ball heights are always within
[0, 2014] - card_pool The number of balls stays unchanged if there is a ball with height 0 and increases by 1 otherwise
- exists_max_card_pool There exists a point where the number of balls reaches a maximum (which follows from its monotonicity and boundedness)
- sum_sub_sum_eq_sub The key observation, one term of the telescoping sum for the problem's expression
- sum_telescope The telescoping sum giving the part of the problem's expression within the modulus signs
- Imo2016P2.Letter The three letters
I,M,O - Imo2016P2.Balanced A finite set of cells is balanced under the coloring
fif each of the three letters occurs on exactly one third of its cells - Imo2016P2.row The cells of row
r - Imo2016P2.col The cells of column
k - Imo2016P2.diagSum A diagonal of the first type: the cells
(i, j)withi + j = s - Imo2016P2.diagDiff A diagonal of the second type: the cells
(i, j)withi - j = d - Imo2016P2.MODTable The coloring
fof then × ntable satisfies all the required conditions: every row and column is balanced, and every diagonal whose length is a multiple of three is balanced - Imo2016P4.gcd_P_dvd_of_eq A common divisor of
P (b + k)andP bdividescwheneverP (b + k) - P b = 2 * c, since values ofPare odd - Imo2016P4.coprime_P_succ Adjacent values of
Pare coprime: a common divisor divides(P (b+1) - P b) / 2 = b + 1, hence dividesP b - b*(b+1) = 1 - Imo2016P4.gcd_P_add_two_dvd The gcd of values of
Pat distance two divides 7 - Imo2016P4.gcd_P_add_three_dvd The gcd of values of
Pat distance three divides 3 - Imo2016P4.seven_dvd_P_of_not_coprime If values of
Pat distance two have a common factor, that factor is 7 - Imo2016P4.three_dvd_P_of_not_coprime If values of
Pat distance three have a common factor, that factor is 3 - Imo2016P5.prod_repair_P Re-pairing of the left-hand product: isolate
1and2016, and group the remaining factors into pairs(4j+4, 4j+5) - Imo2016P5.prod_repair_Q Re-pairing of the right-hand product: isolate
2and2015, and group the remaining factors into pairs(4j+3, 4j+6) - Imo2016P5.key The two products remaining on the board never take the same real value: the left one is always strictly smaller than the right one
- Imo2016P5.prod_erase_aux After erasing the factors indexed by
n % 4 = 2, 3on the left and byn % 4 = 0, 1on the right, the resulting equation has no real solution - Imo2017P1.Rule The recurrence rule defining the sequence
- Imo2017P1.one_lt Every term of the sequence is greater than 1
- Imo2017P1.three_dvd_iff Divisibility by 3 is invariant along the sequence
- Imo2017P1.run_linear Once the sequence is 2 mod 3, it never again hits a perfect square, so it just increases by 3 forever
- Imo2017P1.finite_visits If the sequence is ever 2 mod 3, then it takes each value only finitely often
- Imo2017P1.climb Documented declaration: climb
- Imo2017P1.orbit_min_three If the sequence never hits the class 2 mod 3, then its minimum value is 3 (so that 3 divides every term, and in particular x)
- Imo2017P1.cycle Once the sequence hits 3, it cycles 3 → 6 → 9 → 3 forever
- Imo2017P2.good_special_equality (1)
- Imo2017P2.good_map_eq_zero_iff (2)
- Imo2017P2.good_shift (3)
- Imo2017P2.solution_of_map_zero_eq_one_imp_injective The general framework; reducing to injectivity
- Imo2017P2.case1_injective Injectivity for
char(D) ≠ 2,Da division ring - Imo2017P2.case2_injective Injectivity for
char(F) = 2 - Imo2017P2.map_zero_eq_one_imp_injective Injectivity
- Imo2017P2.final_solution Final solution
- Imo2017P3.Pt Points of the Euclidean plane
- Imo2017P3.totalRounds The number of rounds in the game
- Imo2017P3.Strategy A hunter strategy: given the list of points reported by the tracking device in rounds
1, ..., n(in chronological order), choose the hunter's positionBₙ - Imo2017P3.ValidStrategy A strategy is valid if the hunter starts at the common starting point
0and moves by exactly1in every round, whatever is reported - Imo2017P3.reportList The reports made in rounds
1, ..., n, as a list in chronological order - Imo2017P3.hunterPos The hunter's position after round
nwhen using strategyσagainst the reported pointsp 1, ..., p n - Imo2017P3.ValidRabbit A rabbit path is valid if it starts at the common starting point
0and moves by exactly1in every round - Imo2017P3.ValidReports The reported points are valid for a rabbit path if each report is within distance
1of the rabbit's actual position - Imo2017P3.norm_sq_frame Pythagoras in an orthonormal frame
- Imo2017P3.core_ineq The analytic heart of the phase lemma: with
n ≥ 4dsteps, the squared distance grows by at least1/2 - Imo2017P3.frame_exists An orthonormal frame adapted to the pair
(a, b):upoints frombtoa - Imo2017P3.phase_geom Phase lemma (geometry)
- Imo2017P3.sqrt_est Bounds for
√(n² - 1) - Imo2017P3.totalPhases Total number of phases:
20000phases of 400 rounds, one phase of 3600 rounds, then maintenance phases of 400 rounds; in total exactly10^9rounds - Imo2017P3.phaseLen The length of phase
j - Imo2017P3.PState The state of the adversary's construction at the start of a phase: the rabbit's position
a, the listLof reports made so far, and the phase indexj - Imo2017P3.maintSeq Running one maintenance round: the rabbit runs directly away from the hunter and the device reports the rabbit's position honestly
- Imo2017P3.escReps The reports made during an escape phase: the device reports the point on the line through the previous positions, at the same fractional distance as the rabbit
- Imo2017P3.escPath The rabbit's path during an escape phase when it chooses the point
a + t • u + w - Imo2017P3.escPathY The rabbit's path during an escape phase when it chooses the point
a + t • u - w - Imo2017P3.escStep Documented declaration: escStep
- Imo2017P3.phaseStep One phase of the construction
- Imo2017P3.States The state at the start of phase
j - Imo2017P3.Paths The rabbit's positions during phase
j(offsets0, ..., phaseLen j) - Imo2017P3.Reps The reports made during phase
j(offsets1, ..., phaseLen j) - Imo2017P3.startRound The first round of phase
j - Imo2017P3.phaseOf The phase containing round
n - Imo2017P3.rabbit The rabbit's position after round
n - Imo2017P3.reports The point reported in round
n - Imo2017P3.dist_strategy_append The hunter moves at most one list-element per round: chaining the validity condition over an appended list of reports
- Imo2017P3.escStep_spec Specification of one escape phase (with the frame made explicit)
- Imo2017P3.phaseStep_spec_escape Specification of one phase, escape case
- Imo2017P3.maintSeq_spec Specification of the maintenance iteration: honest reports, unit steps, and the distance from the hunter never decreases
- Imo2017P3.phaseStep_spec_maint Specification of one phase, maintenance case
- Imo2017P3.phaseStep_spec The branch-independent part of the phase specification
- Imo2017P3.invariant The invariant: after phase
jthe squared distance is at leastmin 10000 (j/2), and after phase20000it exceeds100 - Imo2017P3.hdm_of The maintenance mode hypothesis is always satisfiable
- Imo2017P3.adversary The adversary wins: for every valid hunter strategy, the rabbit and the tracking device can force the distance after
10⁹rounds to exceed100 - Imo2017P3.does_exist The answer to the question "can the hunter always ensure that the distance between her and the rabbit becomes at most 100?"
- Imo2017P5.prepend Prepend the kept pair
s₀ < t₀in front of the inductively chosen subsequenceg - Imo2017P5.aux Evan Chen's scan argument, by induction on the number of colours
- Imo2017P5.main_aux Colouring by height:
c iis the index of the block ofN + 1consecutive height ranks containing the player at positioni - Imo2017P6.HForm A homogeneous polynomial in two variables with integer coefficients, represented by its degree and coefficient function
- Imo2017P6.HForm.eval Evaluation of a homogeneous form at a point
- Imo2017P6.HForm.const The constant form
- Imo2017P6.HForm.linear The linear form
α * x + β * y - Imo2017P6.HForm.trunc Coefficient function truncated above the degree
- Imo2017P6.HForm.cauchy_sum The Cauchy product formula for finite sums with vanishing tails
- Imo2017P6.HForm.mul Multiplication of homogeneous forms (degrees add)
- Imo2017P6.HForm.pow Powers of a homogeneous form
- Imo2017P6.HForm.add Addition of two forms of the same degree
- Imo2017P6.HForm.neg Negation of a form
- Imo2017P6.HForm.sub Subtraction of two forms of the same degree
- Imo2017P6.HForm.cmul Scalar multiplication of a form by an integer
- Imo2017P6.HForm.sum Sum of a family of forms of the same degree
- Imo2017P6.HForm.exists_prod Products of families of homogeneous forms exist with the expected degree and evaluation
- Imo2017P6.HForm.eval_neg_of_even Evaluation at the antipode of a form of even degree
- Imo2017P6.canon Canonical orientation of a nonzero lattice point: exactly one of
s,-ssatisfiescanon s - Imo2017P6.rep Representative of the antipodal class of
s, chosen insideSwhenever possible - Imo2017P6.T The set of antipodal class representatives of
S - Imo2017P6.eq_or_neg_of_mul_eq If two primitive points have cross-product zero, they are equal or antipodal
- Imo2017P6.det_ne_zero Points of distinct classes in
Thave nonzero determinant - Imo2017P6.Xf The coordinate form
x - Imo2017P6.Yf The coordinate form
y - Imo2017P6.two_not_dvd_quad_zmod In
ZMod 2, the formx² + xy + y²does not vanish at a primitive point - Imo2017P6.odd_not_dvd_powsum_zmod In
ZMod pfor an odd primep, the formx^(p-1) + y^(p-1)does not vanish at a primitive point - Imo2017P6.Gform The local form used modulo the prime
p:x² + xy + y²forp = 2andx^(p-1) + y^(p-1)for oddp - Imo2017P6.exists_g Documented declaration: exists_g
- Imo2018P3.antipascal_triangle antipascal triangle with n rows
- Imo2018P3.NR Number of rows
- Imo2018P3.TN The total
1 + 2 + ⋯ + 2018 - Imo2018P3.tri The set of cells of an
NR-row triangle: row< NR, column≤ row - Imo2018P3.min_sum The sum of
ndistinct positive integers is at least1 + 2 + ⋯ + n - Imo2018P3.min_sum_eq
ndistinct positive integers with sum at most1 + 2 + ⋯ + nare exactly{1, …, n} - Imo2018P3.min_sum_ge The sum of
ndistinct integers each> mis at leastn·m + (1 + ⋯ + n) - Imo2018P3.bijection Every cell value lies in
[1, TN]andt.fis injective on the triangle - Imo2018P3.winner The child of
xholding the larger value - Imo2018P3.loser The child of
xholding the smaller value - Imo2018P3.winner_val The defining anti-Pascal relation, oriented:
winner = parent + loser - Imo2018P3.left_child_mem Children of a valid parent lie in the triangle
- Imo2018P3.chain The greedy "always go to the larger child" path starting at the apex
- Imo2018P3.losers The smaller children dropped along the apex path (the "losers")
- Imo2018P3.smallCells All cells holding a value
≤ NR: the apex together with the losers - Imo2018P3.not_small Every cell outside the band of small cells holds a value
> NR - Imo2018P3.walk A winner-path starting from an arbitrary cell
- Imo2018P3.inSub Membership in the downward sub-triangle with apex
(p, q) - Imo2018P3.corner_contra A downward sub-triangle disjoint from the small cells, reaching
≥ 1007rows down, yields a contradiction: its winner-path picks up≥ 1007distinct losers all> NR - Imo2018P4.Site A site on the board: the 0-indexed version of
{1, ..., 20}² - Imo2018P4.KnightAdj Two sites are at distance
√5iff they are a knight's move apart, i.e. their coordinate differences are(±1, ±2)or(±2, ±1) - Imo2018P4.amyMoves The sites on which Amy may place a stone: the unoccupied sites at distance different from
√5from every red stone - Imo2018P4.benMoves The sites on which Ben may place a stone: all unoccupied sites
- Imo2018P4.CanEnsure With
fuelrounds left to play, Amy can ensure from the position(red, blue)(with Amy to move) that she places at leastKstones in total - Imo2018P4.AmyEnsures Amy can ensure that she places at least
Kstones - Imo2018P4.blacks The black squares of the checkerboard coloring
- Imo2018P4.not_knightAdj_of_black No two black squares are at knight's move distance
- Imo2018P4.black_sdiff_subset_amyMoves Every unoccupied black square is a legal move for Amy
- Imo2018P4.lab The label (
0–3) of a cell within its4×4block, from the pattern1 2 3 4 3 4 1 2 2 1 4 3 4 3 2 1(read with 1-indexed labels in the official solution) - Imo2018P4.lab_le Each label is at most
3 - Imo2018P4.lab_opp Opposite cells of a
4×4block carry the same label - Imo2018P4.lab_eq_cases Two cells of a
4×4block with the same label are either equal, opposite, or a knight's move apart within the block - Imo2018P4.cyc The 4-cycle (one of 100) that a site belongs to: its
4×4block together with its label within the block - Imo2018P4.oppCoord The opposite coordinate within a
4×4block:i ↦ 3 − iwithin the block - Imo2018P4.opp The opposite site of a site in its 4-cycle: the two sites of the cycle that are not a knight's move apart
- Imo2018P4.eq_or_opp_or_adj_of_cyc_eq Two sites in the same 4-cycle are either equal, opposite, or a knight's move apart
- Imo2018P4.BenInv Ben's invariant: every 4-cycle contains at most one red stone, and the blue stones are exactly the opposite sites of the red stones
- Imo2018P4.card_le_100_of_benInv Under Ben's invariant there is at most one red stone per 4-cycle, hence at most 100 red stones
- Imo2018P4.canEnsure_of_card_le Once Amy has
Kstones she keeps them: the game can only add red stones - Imo2018P4.canEnsure_mono Ensuring more stones is harder
- Imo2018P4.canEnsure_of_black Amy's strategy: always play on a black square
- Imo2018P4.not_canEnsure_101_of_benInv Ben's strategy: always reply with the opposite site of the 4-cycle in which Amy just played
- Imo2018P5.S The sum `a₀/a₁ + a₁/a₂ +
- Imo2018P5.S_sub Difference of two consecutive sums: for
n ≥ 1,S (n+1) - S n = aₙ₋₁/aₙ + (aₙ - aₙ₋₁)/a₀ - Imo2018P5.step The key per-step relation
- Imo2018P5.val_rule The valuation rule
- Imo2018P5.bound Boundedness: for
n ≥ N - 1and every primep,v_p(aₙ) ≤ v_p(a₀) + v_p(a_{N-1}), proved by induction usingval_rule - Imo2018P5.dvd_bound Divisibility form of the bound:
aₙ ∣ a₀ · a_{N-1}forn ≥ N - 1 - Imo2018P5.walk_const No closed walk
- Imo2019P1.additive_to_int_linear proof of the following lemma suggested on Zulip by Riccardo Brasca
- Imo2019P1.solution_set
- Imo2019P1.imo2019_p1 IMO 2019 Problem 1: a functional equation on the integers after Imo2019P1.solution_set
- Imo2019P2.Imo2019q2Cfg A configuration satisfying the conditions of the problem
- Imo2019P2.someOrientation A default choice of orientation, for lemmas that need to pick one
- Imo2019P2.Imo2019q2Cfg.symm The configuration has symmetry, allowing results proved for one point to be applied for another (where the informal solution says "similarly")
- Imo2019P2.Imo2019q2Cfg.triangleABC
ABCas aTriangle - Imo2019P2.Imo2019q2Cfg.A₂
A₂is the second point of intersection of the rayAA₁with the circumcircle ofABC - Imo2019P2.Imo2019q2Cfg.B₂
B₂is the second point of intersection of the rayBB₁with the circumcircle ofABC - Imo2019P2.Imo2019q2Cfg.triangleQPA₂
QPA₂as aTriangle - Imo2019P2.Imo2019q2Cfg.trianglePQB₂
PQB₂as aTriangle - Imo2019P2.Imo2019q2Cfg.ω
ωis the circle containingQ,PandA₂, which will be shown also to containB₂,P₁andQ₁ - Imo2019P3.Toggle Documented declaration: Toggle
- Imo2019P3.toggle_adj Adjacency in a toggled graph
- Imo2019P3.sym2_ne A helper for
Sym2inequality: to shows(x, y) ≠ s(z, w)it suffices to discharge both pairings - Imo2019P3.toggle_adj_a Adjacency with
ain a toggled graph:akeeps exactly its neighbors different frombandc - Imo2019P3.toggle_adj_b Adjacency with
bin a toggled graph:blosesaand gainsc - Imo2019P3.toggle_adj_c Adjacency with
cin a toggled graph:closesaand gainsb - Imo2019P3.toggle_adj_of_ne Adjacency with a vertex different from
a,b,cis unchanged by a toggle - Imo2019P3.degree_eq_card_filter Degree as the cardinality of a filter
- Imo2019P3.Toggle.degree_parity A toggle preserves the parity of every degree
- Imo2019P3.Toggle.exists_odd_degree A toggle preserves the existence of a vertex of odd degree
- Imo2019P3.edgeSet_toggle The edge set of a toggled graph
- Imo2019P3.Toggle.edgeFinset_card A toggle removes exactly one edge
- Imo2019P3.Toggle.ne_top A graph obtained by a toggle is never complete:
aandbare no longer friends - Imo2019P3.reachable_of_forall_adj_reachable Lifting reachability along adjacencies that remain reachable
- Imo2019P3.connected_toggle If the endpoints
a, cof the deleted edges of a toggle remain reachable in the twice-deleted graph, then the toggle preserves connectedness - Imo2019P3.exists_adj_crossing A walk from outside a set
Sto insideScrosses the boundary ofS - Imo2019P3.isPath_transfer IsPath is preserved by
Walk.transfer - Imo2019P3.exists_isPath_of_snd_eq If the second vertex of a cycle
Catxisy, then deleting the first edge leaves a path fromxtoyavoiding it - Imo2019P3.exists_isPath_of_mem_edges_of_isCycle Removing an edge from a cycle leaves a path between its endpoints, avoiding that edge
- Imo2019P3.mem_edges_of_length_eq_one A length-1 walk from
xtoycontains the edges(x, y) - Imo2019P3.IsCycle.mem_edges_of_adj A cycle of length equal to the girth is chordless: every edge of
Gbetween two vertices of the cycle is already an edge of the cycle - Imo2019P3.degree_eq_two_of_forall_mem_support On a chordless cycle that spans all vertices, every vertex has degree
2 - Imo2019P3.isCycle_triangle Three pairwise adjacent vertices form a cycle of length
3 - Imo2019P3.exists_notMem_support_of_isCycle If
Ghas a vertex of odd degree, a girth-realizing cycle cannot span all vertices - Imo2019P3.exists_toggle_connected Key claim: a connected graph that is not a tree, has a vertex of odd degree, and is not complete admits a toggle after which it is still connected
- Imo2019P3.exists_isTree_of_connected Phase 1: any connected graph with a vertex of odd degree that is not complete can be toggled to a tree
- Imo2019P3.isAcyclic_toggle A toggle preserves acyclicity
- Imo2019P3.exists_matching_of_isAcyclic Phase 2: any forest can be toggled to a graph in which every vertex has degree at most
1 - Imo2019P5.numHeads The number of coins showing heads in a configuration of
ncoins - Imo2019P5.flipIx The index of the coin that Harry flips in configuration
c: thek-th coin from the left, wherekis the number of heads - Imo2019P5.step One step of Harry's process: if there are
k > 0heads, flip thek-th coin from the left; otherwise (all coins show tails) do nothing - Imo2019P5.weightedSum The sum of the 1-based positions of the coins showing heads
- Imo2019P5.meas The measure of a configuration: twice the sum of the 1-based positions of the heads minus the square of the number of heads
- Imo2019P5.L The number of steps that Harry's process takes starting from configuration
c - Imo2019P5.le_orderEmbOfFin The
j-th smallest element of a finsetSofFin nis at leastj - Imo2019P5.sum_range_card_le For a finset
SofFin n, the sum of the values of its elements is at leastcard S * (card S - 1) / 2(twice that sum, to stay inℕ) - Imo2019P5.numHeads_mul_succ_le The key combinatorial estimate: if a configuration has
kheads, then the sum of the 1-based positions of the heads is at leastk * (k + 1) / 2 - Imo2019P5.numHeads_cast The number of heads as a sum of indicators, in
ℤ - Imo2019P5.weightedSum_cast The weighted sum as a sum over all positions, in
ℤ - Imo2019P5.headsZ_update How the head-count sum changes when coin
pis flipped - Imo2019P5.weightedZ_update How the weighted sum changes when coin
pis flipped - Imo2019P5.step_meas The measure drops by exactly one at each step
- Imo2019P5.iter_meas After
msteps withm ≤ meas c, the measure has dropped by exactlym - Imo2019P5.iterate_L The process from
cstops after exactlyL csteps in the all-tails configuration - Imo2019P5.not_iterate_lt_L Before step
L c, the process has not stopped yet - Imo2019P5.card_filter_true_eq_card_filter_false Configurations with a head at position
iare in bijection with those with a tail at positioni, by flipping coini - Imo2019P5.card_filter_true Exactly half of all
2 ^ nconfigurations have a head at positioni - Imo2019P5.two_mul_card_filter_pair Twice the number of configurations with heads at both
iandjequals2 ^ (n - 1) - Imo2019P5.card_filter_pair The number of configurations with heads at both
iandjis2 ^ (n - 2) - Imo2019P5.sum_indicator The sum of the indicator of heads at position
iover all configurations - Imo2019P5.sum_four_L The total of
Lover all configurations is2 ^ n * n * (n + 1) / 4; we prove four times that value to stay inℤ - Imo2019P5.averageSteps The average number of steps over all
2 ^ ninitial configurations - Imo2019P5.imo2019_p5_parta Part (a): the process always terminates
- Imo2019P5.imo2019_p5_partb_definition Part (b): The number of steps that Harry's process takes starting from configuration
cis L - Imo2019P5.imo2019_p5_partb Part (b): the average number of steps over all
2 ^ nconfigurations isn * (n + 1) / 4 - Imo2020P3.conn In a pseudograph with endpoint functions
a b : E → V, the edgeeconnectsvandw - Imo2020P3.IsWalk A walk in a pseudograph: the vertex list has one more entry than the edge list
- Imo2020P3.mult The multiplicity of vertex
xas an endpoint of edgee - Imo2020P3.slotCount Total number of edge-slots of a list of edges at vertex
x - Imo2020P3.slotCount_eq In any walk, the slot count at
xequals twice the number of interior occurrences ofx, plus the endpoint contributions - Imo2020P3.slotCount_closed In a closed walk, the slot count at
xis twice the number of occurrences ofx - Imo2020P3.altCount_eq The alternating slot count along a walk, red at positions with parity
s - Imo2020P3.altCount_closed In a closed walk of even length, the alternating slot count at
xequals the number of occurrences ofxamong the positions - Imo2020P3.CTrail A closed trail in a pseudograph: a closed walk with no repeated edges
- Imo2020P3.CTrail.rotate Rotate a closed trail at position
k(an index of a vertex occurrence) - Imo2020P3.exists_max_walk A maximal walk from
vusing only edges ofU, with distinct edges - Imo2020P3.exists_closed_trail Any edge of
Ulies in a closed trail withinU, provided allU-degrees are even - Imo2020P3.decompose Decompose an even-degree edge set into edge-disjoint closed trails
- Imo2020P3.CTrail.append Append two closed trails that both start at the same vertex
v - Imo2020P3.merge_disjoint Merge trails sharing vertices until the family is vertex-disjoint
- Imo2020P3.two_factor Every 4-regular pseudograph has a 2-factor: a 2-coloring of its edges such that every vertex sees exactly two half-edges of each color
- Imo2020P3.apeb The lighter pebble of pair
k - Imo2020P3.bpeb The heavier pebble of pair
k - Imo2020P3.pairOf The pair (one of the
2ncomplementary pairs) that pebblejbelongs to - Imo2020P3.pgA The pseudograph on colors whose edges are the complementary pairs
- Imo2020P4.Car A cable car's starting and finishing points
- Imo2020P4.Company The cable cars of a company
- Imo2020P4.Company.linkage A linkage between two stations
- Imo2020P4.Company.linkage.start The first station in a linkage
- Imo2020P4.Company.linkage.finish The last station in a linkage
- Imo2020P4.Company.linked The property of two stations being linked (in the given order)
- Imo2020P4.instFintypeEdgeSetOfFinite
Fintype G.edgeSetpreviously resolved via a noncomputable instance derived from finiteness of the vertex type (as still happens forSetLiketypes such asConnectedComponent) - Imo2020P6.project Computes "how far along" the segment from
atobthe pointplies - Imo2020P6.card_le_of_separated_in_strip In a strip of width
1/2, if the points have pairwise distance at least1, then we can bound the number of points - Imo2021P1.exists_numbers_in_interval We will later make use of the fact that there exists (l : ℕ) such that n ≤ 2 * l ^ 2 - 4 * l and 2 * l ^ 2 + 4 * l ≤ 2 * n for n ≥ 100
- Imo2021P1.exists_finset_3_le_card_with_pairs_summing_to_squares Documented declaration: exists_finset_3_le_card_with_pairs_summing_to_squares
- Imo2021P3.imo2021_p3 IMO 2021 Problem 3: three concurrent lines (unsolved here)
- Imo2021P5.Position The arrangement of walnuts, as an equiv from holes to walnuts (0-based)
- Imo2021P5.Position.swapped The numbers of the walnuts swapped in move
k(0-based), given the position - Imo2021P5.move A single move, on a pair of position and move number
- Imo2021P5.Position.nth The position after
nmoves - Imo2021P5.coloring After
jmoves, color holexred iff the walnut in it has number< j; otherwise the hole is black - Imo2021P5.blackPairs The number (mod 2) of adjacent pairs of holes that are both black
- Imo2021P5.iterate_snd The second component of the iterated move state is the move number
- Imo2021P5.iterate_fst_succ One step of the move process on the position component
- Imo2021P5.blackPairs_update Flipping one black hole to red, where the two neighbors have the same color, does not change the number of black-black adjacent pairs, mod 2
- Imo2021P5.coloring_succ Documented declaration: coloring_succ
- Imo2022P1.Coin The two types of coins
- Imo2022P1.Row A row of coins
- Imo2022P1.Row.valid The property of a row having
nof each kind of coin - Imo2022P1.Row.chainLeft The first coin in the chain containing coin
k(zero-based) - Imo2022P1.Row.chainRight The last coin in the chain containing coin
k(zero-based) - Imo2022P1.Row.move Move coins
athroughbto the left of the row - Imo2022P1.Row.operation The operation moving the chain containing coin
k(zero-based) - Imo2022P1.Row.operationOneBased The operation moving the chain containing coin
k(one-based) - Imo2022P1.Row.leftmostNSame The property of a row having leftmost
ncoin with the same type - Imo2022P1.answer The answer to be determined
- Imo2022P3.Condition The condition of the problem on a placement of numbers round a circle
- Imo2022P3.good Auxiliary condition:
m * nis of the formx ^ 2 + x + kfor a nonnegative integerx - Imo2022P3.lt_of_good_of_lt A product below
M ^ 2that is good forces the witnessxto be belowM - Imo2022P3.add_eq_of_dvd_of_dvd Two distinct roots of
T ^ 2 + T + kbelow the primeMsum toM - 1 - Imo2022P3.dvd_sub_of_good_of_good Vieta for the two roots: their product is congruent to
kmoduloM - Imo2022P3.good_of_good_of_good The key multiplicativity lemma (Chen's Claim 2): if the prime
Mhas two distinct smaller good partnersqandr, thenq * ris itself good - Imo2022P3.card_roots_le_two A quadratic has at most two roots below a prime
M: the setTof solutionsx < MtoM ∣ x ^ 2 + x + khas at most two elements - Imo2022P3.card_good_le_two Chen's Claim 1: a prime
Mhas at most two good partners below it inside any set of smaller numbers - Imo2022P3.good_comm
goodis symmetric in the two factors - Imo2022P3.zmod_inj Injectivity of the
ZMod ncast onFin n - Imo2022P3.zmod_add The
ZMod ncast of a sum inFin n - Imo2022P3.zmod_one The
ZMod ncast of1 : Fin n - Imo2022P3.zmod_rev The
ZMod ncast ofFin.rev - Imo2022P3.succPerm The successor permutation of a placement: sends each element to its clockwise neighbor
- Imo2022P3.ValidPerm Validity of a permutation of
S: every element has a good product with its successor - Imo2022P3.ConnectedP Connectivity of a permutation of
S: it is a single cycle - Imo2022P3.iterate_conj Iteration of a conjugated map
- Imo2022P3.zmod_eq_of_add_key A permutation of
Fin ncommuting with+ 1is a rotation - Imo2022P3.zmod_eq_of_sub_key A permutation of
Fin nanti-commuting with+ 1is a reflection - Imo2022P3.rot_of_succPerm_eq If two placements have the same successor permutation, they differ by a rotation
- Imo2022P3.ref_of_succPerm_eq If the successor permutation of one placement is the inverse of the other's, they differ by a reflection composed with a rotation
- Imo2022P3.delPerm Deleting
Mfrom a permutation: the short-circuited permutation onS.erase M, sending the predecessor ofMto the successor ofM - Imo2022P3.delPerm_val The computation rule for
delPerm - Imo2022P3.validPerm_delPerm The deleted permutation stays valid: the one new edge is good by
good_of_good_of_good - Imo2022P3.connectedP_delPerm The deleted permutation stays connected (the "skip
M" argument) - Imo2022P3.not_connectedP_of_orbit_subset If an orbit stays inside a set missing an element, the permutation is not connected
- Imo2022P3.validPerm_inv Validity passes to the inverse permutation
- Imo2022P3.connectedP_inv Connectivity passes to the inverse permutation
- Imo2022P3.ne_of_connectedP A connected permutation on at least two elements has no fixed point
- Imo2022P3.perm_unique The core uniqueness statement: two valid connected permutations of
Sare equal or inverse to each other - Imo2022P6.Cell A cell of the board
- Imo2022P6.NordicSquare A Nordic square
- Imo2022P6.Adjacent Whether two cells are adjacent
- Imo2022P6.NordicSquare.Valley The definition of a valley from the problem
- Imo2022P6.NordicSquare.UphillPath The definition of an uphill path from the problem
- Imo2022P6.Adjacent.symm Adjacency is symmetric
- Imo2022P6.Adjacent.ne Adjacent cells are distinct
- Imo2022P6.NordicSquare.value_ne_of_adjacent Adjacent cells have different values
- Imo2022P6.NordicSquare.exists_smaller_neighbor In a Nordic square, any non-valley cell has an adjacent cell with a smaller value
- Imo2022P6.NordicSquare.valley_of_no_smaller_neighbor A cell with no smaller-valued adjacent cell is a valley
- Imo2022P6.NordicSquare.pathTo The path from a valley to a given cell, following decreasing values
- Imo2022P6.NordicSquare.pathTo_props The defining property of
pathTo: it is an uphill path ending atc - Imo2022P6.NordicSquare.uphillPathTo
pathTopackaged as an uphill path - Imo2022P6.NordicSquare.minCell The cell with value 1
- Imo2022P6.NordicSquare.trivialPath The trivial uphill path consisting of just the minimum cell
- Imo2022P6.NordicSquare.gapPath Given adjacent cells a, b, the uphill path ending with the edge {a,b} (obtained by extending the path to the smaller-valued cell by the larger one)
- Imo2022P6.UphillPath.lastTwo The last two cells of an uphill path, as a pair (second-to-last, last), with junk value for the second-to-last cell if the path has length 1
- Imo2022P6.NordicSquare.gapPath_lastTwo The last two cells of
gapPath a bare the two cells, smaller-valued first - Imo2022P6.GapDir A direction for a gap between two adjacent cells
- Imo2022P6.gapPair The ordered pair of cells of a gap: for
horiz,(i, j), (i, j+1); forvert,(j, i), (j+1, i) - Imo2022P6.gapPair_injective The unordered pair of cells of a gap determines the gap
- Imo2022P6.gapPathInj The injection from gaps (plus a point for the trivial path) to uphill paths
- Imo2022P6.gapDirEquivFin2
GapDiris equivalent toFin 2 - Imo2022P6.mk_gaps The number of gaps (plus one for the trivial path) as a cardinal
- Imo2022P6.answer_eq The answer expressed as
2 * ((n+1) * n) + 1 - Imo2022P6.lower_bound Lower bound: every Nordic square on an
(n+1) × (n+1)board has at least2 * ((n+1) * n) + 1uphill paths - Imo2022P6.lower_bound' Lower bound (general form): every Nordic square on an
m × mboard has at least2 * (m * (m - 1)) + 1uphill paths - Imo2022P6.NordicSquare.UphillPath.ext Two uphill paths with the same cells are equal
- Imo2022P6.NordicSquare.isChain_nodup An increasing chain of cells has no duplicates
- Imo2022P6.NordicSquare.uphillPath_length_le The list of cells of an uphill path has length at most the number of cells
- Imo2022P6.finiteBoundedList Bounded-length lists over a finite type form a finite type
- Imo2022P6.mk_uphillPath The cardinal of the type of uphill paths as a natural
- Imo2022P6.NordicSquare.UphillPath.dropLast The dropLast of an uphill path of length at least 2 is an uphill path
- Imo2022P6.NordicSquare.UphillPath.dropLast_getLast The last cell of the
dropLastof a path of length ≥ 2 is its second-to-last cell - Imo2022P6.NordicSquare.UphillPath.penultimate_props The penultimate and last cells of a path of length ≥ 2 are adjacent, with the value of the penultimate one smaller
- Imo2022P6.NordicSquare.Hill A "hill" in a Nordic square: a cell adjacent only to cells with smaller values
- Imo2022P6.NordicSquare.no_smaller_of_valley A valley has no smaller-valued neighbor
- Imo2022P6.NordicSquare.not_hill_of_exists_larger A valley is not a hill when it has a neighbor
- Imo2022P6.NordicSquare.not_valley_of_exists_smaller A cell with a smaller-valued neighbor is not a valley
- Imo2022P6.NordicSquare.Good The properties of a Nordic square implying the minimal number of uphill paths
- Imo2022P6.NordicSquare.cells_eq_pathTo_of_good In a good square, any uphill path ending at a non-hill cell
cequalspathTo ns c - Imo2022P6.NordicSquare.countTo_eq_one_of_not_hill The fiber of uphill paths ending at a non-hill cell has cardinality 1
- Imo2022P6.cellDegree The degree of a cell: the number of cells adjacent to it
- Imo2022P6.NordicSquare.length_ge_two_of_getLast_hill A path ending at a hill (which has a neighbor) has length at least 2
- Imo2022P6.NordicSquare.hillFiberEquiv The fiber of uphill paths ending at a hill is equivalent to its set of neighbors
- Imo2022P6.NordicSquare.countTo_eq_degree_of_hill The fiber of uphill paths ending at a hill has cardinality its degree
- Imo2022P6.gapCells Cells of a gap on an
n × nboard (ordered by position) - Imo2022P6.Adjacent.dist The arithmetic content of adjacency, unpacked
- Imo2022P6.gapOfPair The gap determined by an ordered pair of adjacent cells
- Imo2022P6.gapOfPair_swap
gapOfPairis invariant under swapping the two cells - Imo2022P6.gapOfPair_eq_horiz In the horizontal case,
gapOfPairis the horizontal gap of the two cells - Imo2022P6.gapOfPair_eq_vert In the vertical case,
gapOfPairis the vertical gap of the two cells - Imo2022P6.gapCells_gapOfPair The two cells of
gapOfPair ccare exactly the two cells ofcc(in some order) - Imo2022P6.gapOfPair_gapCells The gap of the cells of a gap is the gap itself
- Imo2022P6.decPairOfGap The decreasing orientation of the cells of a gap
- Imo2022P6.decPairEquivGaps The decreasing-adjacent-pairs are equivalent to the gaps
- Imo2022P6.card_decPair The number of decreasing adjacent pairs is the number of gaps
- Imo2022P6.exists_adjacent Every cell on a board of side at least 2 has an adjacent cell
- Imo2022P6.sum_smaller_eq_gaps The total number of "smaller neighbor" incidences equals the number of gaps
- Imo2022P6.NordicSquare.card_eq_sum_countTo The number of uphill paths as a sum over the last cell
- Imo2022P6.NordicSquare.good_count Counting theorem: a good Nordic square on an
n × nboard (withn ≥ 2) has exactly2 * n * (n - 1) + 1uphill paths - Imo2022P6.nat_card_uphillPath_one The number of uphill paths on a 1×1 board is 1
- Imo2022P6.pOffset The column offset of the construction (handles the case
m % 3 = 1) - Imo2022P6.isTreeJ Whether a cell with pattern-column residue
jm6 = j % 6and rowris a tree cell of the construction (its complement are the hills) - Imo2022P6.isTree Whether a cell of the board is a tree cell of the construction
- Imo2022P6.cspos The position of column-in-strip
cswithin its row in the strip order - Imo2022P6.cspos_le
csposis at most 2 - Imo2022P6.cspos_injective
csposis injective on{0, 1, 2} - Imo2022P6.subKey The within-strip order key of a cell (pattern column
j, rowr) - Imo2022P6.subKey_lt The within-strip key is less than
3 * m - Imo2022P6.keyFn The key function of the construction: tree cells come first (in strip order), then the hills (in column-major order)
- Imo2022P6.keyFn_tree_lt The tree key is less than
m * m + 3 * m - Imo2022P6.subKey_inj The subKey determines the row (within a strip, for tree cells)
- Imo2022P6.subKey_inj_both The subKey of a tree cell determines its row and column-in-strip jointly
- Imo2022P6.keyFn_injective The key function is injective
- Imo2022P6.cellOrder The linear order on cells induced by the key function
- Imo2022P6.OrderedCell The cell type equipped with the key order (a synonym to avoid instance clashes)
- Imo2022P6.OrderedCell.of The identity map from cells to ordered cells
- Imo2022P6.keyFn_injective' The key function is injective for all
m - Imo2022P6.OrderedCell.instLinearOrder The linear order on ordered cells given by the key function
- Imo2022P6.nsOfIso The order isomorphism between all cells (with the key order) and
Fin (m ^ 2) - Imo2022P6.nsOf The constructed Nordic square: values are positions in the key order plus one
- Imo2022P6.nsOf_lt_iff Comparison of values in the constructed square is comparison of keys
- Imo2022P6.isTreeJ_true_iff Characterization of tree cells by column residue and row
- Imo2022P6.rootCell The root cell of the construction (its global key minimum)
- Imo2022P6.keyFn_lt_of_strip_lt A tree cell in an earlier strip has a smaller key
- Imo2022P6.cspos_one
csposat1 - Imo2022P6.cspos_two
csposat2 - Imo2022P6.subKey_even_zero
subKeyat row0of an even strip - Imo2022P6.subKey_even_of_ne_zero
subKeyat a positive row of an even strip - Imo2022P6.subKey_odd_zero
subKeyat row0of an odd strip - Imo2022P6.subKey_odd_one
subKeyat row1of an odd strip - Imo2022P6.subKey_odd_of_ge_two
subKeyat a row≥ 2of an odd strip - Imo2022P6.keyFn_lt_of_same_strip Between two tree cells in the same strip, the key order is the
subKeyorder - Imo2022P6.parent_exists A tree cell in an earlier strip has a smaller key
- Imo2022P6.subKey_even_pos
subKeyin an even strip, row0 - Imo2022P6.rule_down If the tree cell
ydirectly below the tree cellxhas smaller key, thenxhas pattern column5(mod 6) and row0 - Imo2022P6.rule_up Documented declaration: rule_up
- Imo2022P6.rule_left If the tree cell
ydirectly left of the tree cellxhas smaller key, then the pattern column and row ofxsatisfy one of six mutually exclusive signatures - Imo2022P6.rule_right If the tree cell
ydirectly right of the tree cellxhas smaller key, thenxhas pattern column0(mod 6) and row at least2, or pattern column3and row at least3 - Imo2022P6.adjacent_dir Two adjacent cells differ by one in exactly one coordinate
- Imo2022P6.nordicSquare_good Documented declaration: nordicSquare_good
- Imo2022P6.answer_val The answer expressed as
2 * n * (n - 1) + 1 - Imo2023P1.PrimePow_ne Powers of distinct primes are never equal
- Imo2023P1.dvd_ne_zero If a number divides some non-zero number, it is also nonzero
- Imo2023P1.dvd_n_fact_ne_zero If a prime
pdividesn, thenn.factorization p ≠ 0 - Imo2023P1.mul_cmp_compl Complementary factors are inversely ordered
- Imo2023P1.p_succ_fact_zero Given prime
p, the factorization ofp + 1is0atp - Imo2023P1.not_pow_cons_factors_other_prime If
p ^ e < c < p ^ (e + 1), then∃ qprime that dividesc - Imo2023P1.inv_cons_factors The inverse factors of consecutive factors of
nare themselves consecutive factors ofn - Imo2023P1.factorization_prime If
n.factorization p ≠ 0, thenpis prime - Imo2023P1.ordCompl_of_non_prime_pow If
nis not a prime power, then itsordCompl[p]with respect to anypis> 1 - Imo2023P1.minFac_cons_factor If
nis not a prime power, andpis its minimum factor, then the second smallest prime factorqis consecutive topto some power> 0 - Imo2023P1.PrimePow_cons_are_p_apart The consecutive factors of prime powers of
pare a factorpapart - Imo2023P1.PrimePow_is_dividable Proof that all prime powers are
Dividable - Imo2023P1.dividable_is_PrimePow Proof that all
Dividablenumbers> 1are prime powers - Imo2023P2.aux₁ alternate version of Real.Angle.abs_toReal_add_abs_toReal_eq_pi_of_two_nsmul_add_eq_zero_of_sign_eq
- Imo2023P2.aux₂ alternate version of Real.Angle.sign_pi_sub
- Imo2023P2.parallel_of_two_zsmul_oangle_eq reverse of EuclideanGeometry.two_zsmul_oangle_of_parallel
- Imo2023P3.apPoly The polynomial
P(x) = ∏_{i=1}^{k} (x + i·d)attached to an arithmetic progression with common differenced - Imo2023P3.pnat_prod_coe Coercion of a
ℕ+-valued product toℤ - Imo2023P3.le_of_pow_le For naturals,
x ^ k ≤ y ^ kimpliesx ≤ y - Imo2023P3.pow_ge_add_mul First two terms of the binomial expansion bound the power below
- Imo2023P3.eval_eq Expansion of
P.evalfor a monicPof degreek - Imo2023P3.eval_pos
P.evalis positive at positive integers - Imo2023P3.eval_strictMono
P.evalis strictly increasing on positive integers - Imo2023P3.key_recurrence The key recurrence obtained by dividing two consecutive instances of the functional equation:
a_{n+k+1}·P(a_n) = a_{n+1}·P(a_{n+1}) - Imo2023P3.seqA The sequence reindexed by
ℕ:seqA a m = a_{m+1} - Imo2023P3.hA_of The functional equation restated for the
ℕ-indexed sequence - Imo2023P3.Csum
Csum P k = Σ_{j<k} P.coeff j, the total mass of the lower coefficients - Imo2023P3.eval_lower Lower bound:
x ^ k ≤ P.eval xforx ≥ 1 - Imo2023P3.eval_upper Upper bound:
P.eval x ≤ x ^ k + C·x ^ (k-1)forx ≥ 1 - Imo2023P3.chain_le_nat Chaining one-step inequalities over an interval
- Imo2023P3.seq_monotone The sequence is non-decreasing
- Imo2023P3.diff_le Bounded consecutive differences:
A (m+1) ≤ A m + CwhereC = (Csum P k).toNat - Imo2023P3.shift_bounds The shifts
A (m+i) - A mlie in[0, i·C] - Imo2023P3.monic_prod_linear A product of linear factors is monic
- Imo2023P3.coeff_prod_linear_bound Coefficients of a product of linear factors
X + C σᵢare bounded by(1 + S) ^ (number of factors)when every|σᵢ| ≤ S - Imo2023P3.Fpoly
Fpoly P A k m := ∏_{i=1}^{k} (X + C (A (m+i) - A m)) - P; it vanishes atA m - Imo2023P3.root_bound An integer root
x ≥ 1of a nonzero integer polynomial is bounded bynatDegree × (coefficient bound) - Imo2023P3.eval_sum_eq Once
A mexceeds the root bound,F_mvanishes, and comparing theX ^ (k-1)-coefficients yields the key relationΣ_{i<k} A (m+1+i) = k·A m + c_{k-1} - Imo2023P3.Dif The consecutive difference
Dif A j = A (j+1) - A jas an integer - Imo2023P3.diff_eventually_const Documented declaration: diff_eventually_const
- Imo2023P3.backward_bounded The bounded case: a bounded monotone sequence of naturals stabilizes, and the functional equation forces it to be constant
- Imo2023P3.backward_unbounded The unbounded case: once the sequence exceeds the root bound, it is an arithmetic progression
- Imo2023P3.backward_main The backward direction: any sequence satisfying the functional equation is an arithmetic progression
- Imo2023P5.redPos Position of the red dot in row
m, as a natural number (0if out of range) - Imo2023P5.pathPos Position of a ninja path in row
m, as a natural number (0if out of range) - Imo2023P5.f
f j i pis the maximum number of red dots on a ninja path from the top row to positionpof rowi(and0if the position is invalid) - Imo2023P5.redsUpto Number of red dots of the path
Pin rows1, ..., i - Imo2023P5.zeroPath The path that stays at position
0forever - Imo2023P5.spliceSteps The steps of a path that follows
Pup to rowiand then stays atp - Imo2023P5.splicePath A path that follows
Pup to rowi(wherePis at positionq) and then moves to positionp(withq = porq + 1 = p) and stays there - Imo2023P5.exists_good_path For every valid position
pin rowithere is a ninja path reaching it with at leastf j i pred dots in the firstirows - Imo2023P5.S_rec The key recurrence:
S (i+1) ≥ S i + ⌈S i / i⌉ + 1whereS iis the sum of thef-values over rowi - Imo2023P5.S_lower The lower bound on the row sums of
f: writingi = 2 ^ c + rwithr < 2 ^ c, we haveS i ≥ c * i + 2 * r + 1 - Imo2023P5.lower_bound The main lower bound: every Japanese triangle admits a ninja path with at least
⌊log₂ n⌋ + 1red dots - Imo2023P5.extremal The extremal triangle: red dot of row
iat position2 ^ (clog₂ (i+1)) - 1 - i - Imo2023P5.upper_bound In the extremal triangle, every ninja path contains at most
clog₂ (n+1)red dots - Imo2024P2.Condition The condition of the problem
- Imo2024P2.Condition.g The value of
gin the problem (determined byaandb) - Imo2024P2.Condition.N The value of
Nin the problem (any sufficiently large value) - Imo2024P2.Condition.large_n A sufficiently large value of n, congruent to
-1modφ (a * b + 1) - Imo2024P2.Condition.large_n_0 A sufficiently large value of n, congruent to
0modφ (a * b + 1) - Imo2024P2.solutionSet
- Imo2024P2.imo2024_p2 IMO 2024 Problem 2: eventually constant gcd after Imo2024P2.solutionSet
- Imo2024P3.M A number greater than any of the initial terms
a 0througha N(otherwise arbitrary) - Imo2024P3.Condition.k The largest number to appear infinitely often
- Imo2024P3.Condition.Small Small numbers are those that are at most
k(that is, those that appear infinitely often) - Imo2024P3.Condition.finite_setOf_k_lt_card There are only finitely many
mthat appear more thanktimes - Imo2024P3.Condition.l The largest number to appear more than
ktimes - Imo2024P3.Condition.Medium Medium numbers are those that are more than
kbut at mostl(and include all numbers appearing finitely often but more thanktimes) - Imo2024P3.Condition.Big Big numbers are those greater than
l(thus, appear at mostktimes) - Imo2024P3.Condition.N'aux
N'auxis such that, by positionN'aux, every medium number has made all its appearances and every small number has appeared more than max(k, N+1) times - Imo2024P3.Condition.N' Documented declaration: N'
- Imo2024P3.Condition.N_lt_N'
Nis less thanN' - Imo2024P3.Condition.small_apply_N'
a (N' a N)is a small number - Imo2024P3.Condition.apply_add_one_eq_card_small_le_card_eq Lemma 1 from the informal solution
- Imo2024P3.Condition.apply_eq_card_small_le_card_eq_of_small Similar to Lemma 1 from the informal solution, but with a
Smallhypothesis instead ofBigand considering a range one larger (the form needed for Lemma 2) - Imo2024P3.Condition.exists_apply_sub_two_eq_of_apply_eq Lemma 2 from the informal solution
- Imo2024P3.Condition.pSet The indices, minus
n, of small numbers appearing for the second or subsequent time at or aftera n - Imo2024P3.Condition.p The index, minus
n, of the second appearance of the first small number to appear twice at or aftera n - Imo2024P5.Cell A cell on the board for the game
- Imo2024P5.InteriorRow A row that is neither the first nor the last (and thus contains a monster)
- Imo2024P5.MonsterData Data for valid positions of the monsters
- Imo2024P5.MonsterData.monsterCells The cells with monsters as a Set, given an injection from rows to columns
- Imo2024P5.Adjacent Whether two cells are adjacent
- Imo2024P5.Path A valid path from the first to the last row
- Imo2024P5.Path.firstMonster The first monster on a path, or
none - Imo2024P5.Strategy A strategy, given the results of initial attempts, returns a path for the next attempt
- Imo2024P5.Strategy.play Playing a strategy, k attempts
- Imo2024P5.Strategy.WinsIn The predicate for a strategy winning within the given number of attempts
- Imo2024P5.Strategy.ForcesWinIn Whether a strategy forces a win within the given number of attempts
- Imo2024P5.Cell.reflect Reflecting a cell of the board (swapping left and right sides of the board)
- Imo2024P5.row1 The row 1, in the form required for MonsterData
- Imo2024P5.row2 The row 2, in the form required for MonsterData
- Imo2024P5.MonsterData.reflect Reflecting monster data
- Imo2024P5.Path.findFstEq The first path element whose row is at least
r - Imo2024P5.Path.findFstEq_fst_and_sub_one_mem Documented declaration: findFstEq_fst_and_sub_one_mem
- Imo2024P5.Path.ofFn Convert a function giving the cells of a path to a
Path - Imo2024P5.Path.reflect Reflecting a path
- Imo2024P5.baseMonsterData An arbitrary choice of monster positions, which is modified to put selected monsters in desired places
- Imo2024P5.monsterData12 Positions for monsters with specified columns in the second and third rows (rows 1 and 2)
- Imo2024P5.fn0 The first attempt in a winning strategy, as a function: first pass along the second row to locate the monster there
- Imo2024P5.path0 The first attempt in a winning strategy, as a
Path - Imo2024P5.fn1OfNotEdge The second attempt in a winning strategy, as a function, if the monster in the second row is not at an edge: pass to the left of that monster then along its column
- Imo2024P5.path1OfNotEdge The second attempt in a winning strategy, as a function, if the monster in the second row is not at an edge
- Imo2024P5.fn2OfNotEdge The third attempt in a winning strategy, as a function, if the monster in the second row is not at an edge: pass to the right of that monster then along its column
- Imo2024P5.path2OfNotEdge The third attempt in a winning strategy, as a function, if the monster in the second row is not at an edge
- Imo2024P5.fn1OfEdge0 Documented declaration: fn1OfEdge0
- Imo2024P5.path1OfEdge0 The second attempt in a winning strategy, as a
Path, if the monster in the second row is at the left edge - Imo2024P5.path1OfEdgeN The second attempt in a winning strategy, as a
Path, if the monster in the second row is at the right edge - Imo2024P5.fn2OfEdge0 Documented declaration: fn2OfEdge0
- Imo2024P5.path2OfEdge0 The third attempt in a winning strategy, as a
Path, if the monster in the second row is at the left edge and the second (zigzag) attempt encountered a monster - Imo2024P5.path2OfEdge0Def Documented declaration: path2OfEdge0Def
- Imo2024P5.path2OfEdgeNDef The third attempt in a winning strategy, as a
Path, if the monster in the second row is at the right edge and the second (zigzag) attempt encountered a monster - Imo2024P5.path1 The second attempt in a winning strategy, given the column of the monster in the second row, as a
Path - Imo2024P5.path2 The third attempt in a winning strategy, given the column of the monster in the second row and the row of the monster (if any) found in the second attempt, as a
Path - Imo2024P5.winningStrategy A strategy that wins in three attempts
- Imo2024P6.General.Aquaesulian The condition on functions in the problem (for a general
AddCommGroupand in symmetric form) - Imo2024P6.fExample An example of a function achieving the maximum number of values of
f(r)+f(-r) - Imo2025P1.xAxis The
x-axis, as an affine subspace - Imo2025P1.yAxis The
y-axis, as an affine subspace - Imo2025P1.linexy0 The line
x+y=0, as an affine subspace - Imo2025P1.Sunny The condition on lines in the problem
- Imo2025P1.sunnyPred The decidable predicate
Sunny - Imo2025P1.Plane The 2-dimensional plane
- Imo2025P1.AffSubOfPlane Affine subspaces of the plane (i.e. ∅, point, line, plane)
- Imo2025P1.vec_eq Two vectors are equal iff their x and y coordinates are equal
- Imo2025P1.vec_repr_x Get the x coordinate of a vector
- Imo2025P1.vec_repr_y Get the y coordinate of a vector
- Imo2025P1.vec_repr Represent a vector as a pair of real numbers
- Imo2025P1.vec_mul Multiply a vector by a scalar
- Imo2025P1.vec_sub Compute the difference of two vectors
- Imo2025P1.line The "line"
ax + by + c = 0 - Imo2025P1.point_on_line Check if a point
(x, y)belongs to the linea * x + b * y + c = 0 - Imo2025P1.line_nonempty The line
a * x + b * y + c = 0is nonempty whenaandbare not both zero - Imo2025P1.line_direction
(-b, a)is the direction of the linea * x + b * y + c = 0whenaandbare not both zero - Imo2025P1.line_rank The rank of the line
a * x + b * y + c = 0is1whenaandbare not both zero - Imo2025P1.LineCoeffs The coeffecients of a line a * x + b * y + c = 0
- Imo2025P1.line' Build a line from a
LineCoeffs - Imo2025P1.edgeLine The three lines on the edges of the triangular integer grid, each side having n points:
x - 1 = 0;y - 1 = 0;x + y - (n + 1) = 0 - Imo2025P1.y_ax_line The y axis is the line
x = 0 - Imo2025P1.x_ax_line The x axis is the line
y = 0 - Imo2025P1.xy0_line The line
x + y = 0 - Imo2025P1.line_para' Preparation lemma for checking if two lines are parallel
- Imo2025P1.line_para Two non-degenerate lines
a * x + b * y + c = 0anda' * x + b' * y + c = 0are parallel iffa * b' = a' * b - Imo2025P1.line_para_two_points If the line
a * x + b * y + cis parallel toL, and both lines go through(x1, y1),(x2, y2), thena * (x2 - x1) + b * (y2 - y1) = 0 - Imo2025P1.line_eq_check If the lines
a * x + b * y + c = 0anda' * x + b' * y + c = 0are equal, thena * b' = a' * b ∧ a * c' = a' * c ∧ b * c' = b' * c - Imo2025P1.line_contains Preparation lemma for
get_line_eq - Imo2025P1.get_line_eq If both of the two non-degenerate lines
LandL'go through two different pointsaandb, thenL = L' - Imo2025P1.eqAffSubOfPlane The decidable equality predicate
L = L'for(L L' : AffSubOfPlane) - Imo2025P1.sunny_slope Check if the line
a * x + b * y + c = 0is sunny or not - Imo2025P1.grid The integer grid consisting of (a, b), where a, b are positive integers and a + b ≤ n + 1
- Imo2025P1.point_in_grid Check if (a, b) is in
grid nfor natural numbers a, b - Imo2025P1.coverConfig The configuration of a finise set of lines going through a set of points in the plane
- Imo2025P1.shiftSet
shiftSet v gis the result of shifting every point ingby the vectorv - Imo2025P1.grid_shift After removing an edge from
grid (n + 1)and appropriate shifting, the resulting set isgrid n - Imo2025P1.grid_remove_diag After removing the diagonal edge from
grid (n + 1), the resulting set isgrid n - Imo2025P1.shiftLineMap
shiftLineMap v Lshifts the line L by the vectorv - Imo2025P1.affine_trans The preparation lemma on composing two line-shifts
- Imo2025P1.shiftLine
shiftLineMap vis the injective mapAffSubOfPlane ↪ AffSubOfPlanethat shifts by the vectorv - Imo2025P1.shift_para The shift of a line is parallel to the original line
- Imo2025P1.shiftLines
shiftLines v linesis the collection ofshiftLine v LforL ∈ lines - Imo2025P1.shift_line_inv
shiftLine (-v)is the inverse ofshiftLine v - Imo2025P1.shift_sunny If
Lis sunny, then so is its shift - Imo2025P1.coverConfig.shift Shift a
coverConfigby the vectorv - Imo2025P1.coverConfig.removeLine Remove a line
Lfrom acoverConfig - Imo2025P1.coverGridConfig A
coverConfigwith the additional requirement that the set of points to be covered isgrid n - Imo2025P1.coverGridConfig.edgeLine The three edge lines of a the grid point to be covered in a
coverGridConfig - Imo2025P1.reduce If a
coverGridConfigcontains a line on the edge, remove the edge and shift it to a smallercoverGridConfig - Imo2025P1.coverGridConfig.reduce_count Applying
coverGridConfig.reducedecrementsnby1and doesn't changenS - Imo2025P1.not_colinear Given reals numbers
M > 0anda, b, c ∈ (0, M), the points(1, a + 1),(b + 1, 1),(c + 1, M - c + 1)are not colinear - Imo2025P1.not_colinear_nat Given natural numbers
M > 0anda, b, c ∈ (0, M), the points(1, a + 1),(b + 1, 1),(c + 1, M - c + 1)are not colinear - Imo2025P1.n_minus_plus If
n : ℕandn > 1, ifn' : ℕandn' = n - 1, then(n' : ℝ) + (1 : ℝ) = (n : ℝ) - Imo2025P1.line_sunny_two_points If
Lgoes through(x1, y1)and(x2, y2), andx1 ≠ x2,y1 ≠ y2,x2 - x1 ≠ y1 - y2, thenLis sunny - Imo2025P1.coverGridConfig.findLine
coverGridConfig.findLinechooses a line inlinesthat goes throughx - Imo2025P1.coverGridConfig.find_line_correct
coverGridConfig.findLinechooses a line inlinesthat goes throughx - Imo2025P1.coverGridConfig.find_same_line Documented declaration: find_same_line
- Imo2025P1.coverGridConfig.edgePoint The points on the three edges of a
coverGridConfig - Imo2025P1.coverGridConfig.edge_point_in_grid The points on the three edges of a
coverGridConfigare in its grid - Imo2025P1.coverGridConfig.edge_point_on_line The points on the three edges of a
coverGridConfigare on their edge lines - Imo2025P1.coverGridConfig.findLineEdge
coverGridConfig.findLineEdgechooses a line inlinesthat goes throughC.edgePoint d iusing the functioncoverGridConfig.findLine - Imo2025P1.coverGridConfig.find_line_edge_correct
coverGridConfig.findLineEdgechooses a line inlinesthat goes throughC.edgePoint d i - Imo2025P1.coverGridNoEdgeConfig A
coverGridConfigwith the additional requirements thatn > 1andlinesdoesn't contain an edge - Imo2025P1.coverGridNoEdgeConfig.cover_no_edge_line_inj If
linesdoes not contain an edge line ofgrid n, then on every edge, the lines chosen byfindLineEdgeare distinct - Imo2025P1.coverGridNoEdgeConfig.cover_no_edge_line_surj If
linesdoes not contain an edge line ofgrid n, then for every edge, every line inlinesmust be chosen by a point on that edge - Imo2025P1.coverGridNoEdgeConfig.cornerPoint The points on the three corners of
grid n - Imo2025P1.coverGridNoEdgeConfig.corner_point_on_edge Every corner of
grid nbelongs to two edgle lines - Imo2025P1.coverGridNoEdgeConfig.findLineCorner
coverGridNoEdgeConfig.findLineCorner C cchooses a line inlinesthat goes throughC.cornerPoint cusing the functionfindLine - Imo2025P1.coverGridNoEdgeConfig.find_line_corner_correct
coverGridNoEdgeConfig.findLineCorner C cchooses a line inlinesthat goes throughC.cornerPoint c - Imo2025P1.coverGridNoEdgeConfig.find_line_corner_eq_edge The line chosen by
findLineCornerat each of the three corners equals to the line chosen byfindLineEdgeat corresponding points on two edge lines - Imo2025P1.coverGridNoEdgeConfig.cover_no_edge_corner_distinct The three points chosen by
findLineCornerare distinct - Imo2025P1.coverGridNoEdgeConfig.cover_no_edge_corner_inj
findLineCorneris injective - Imo2025P1.coverGridNoEdgeConfig.corner_set The image set of
findLineCorner - Imo2025P1.coverGridNoEdgeConfig.corner_set_members The members of the
corner_set, i.e., The image set offindLineCorner - Imo2025P1.coverGridNoEdgeConfig.corner_set_card The cardinality of the
corner_set, i.e., The image set offindLineCorner - Imo2025P1.coverGridNoEdgeConfig.corner_set_subset_lines
corner_set(i.e., The image set offindLineCorner) is a subset oflines - Imo2025P1.coverGridNoEdgeConfig.cover_no_edge_3_lines If a
coverGridNoEdgeConfighasn = 3, thennS = 3 - Imo2025P1.coverGridNoEdgeConfig.cover_no_edge_4_impossible It is impossible to have a
coverGridNoEdgeConfigwithn ≥ 4 - Imo2025P1.coverGridNoEdgeConfig.cover_edge A
coverGridNoEdgeConfigmust satisfyn = 3 ∧ nS = 3 - Imo2025P1.coverGridConfig.any_cover A
coverGridNoEdgeConfigmust satisfynS ≤ nandnS ∈ {0, 1, 3} - Imo2025P1.strongCoverGridConfig A
coverGridConfigwith the additional requirements every line inlinesgoes through at least one point ing - Imo2025P1.zeroSunny A
strongCoverGridConfigwithn = 0andnS = 0 - Imo2025P1.oneSunny A
strongCoverGridConfigwithn = 1andnS = 1 - Imo2025P1.threeSunnyLineCoeffs The
LineCoeffsof a 3 sunny solution - Imo2025P1.threeSunnyLine The lines of a 3 sunny solution
- Imo2025P1.threeSunnyLineInj The lines of a 3 sunny solution are distinct
- Imo2025P1.threeSunnyLines The set of lines of a 3 sunny solution
- Imo2025P1.threeSunnyLinesMem The members of the set of lines of a 3 sunny solution
- Imo2025P1.grid3Points The points in
grid 3 - Imo2025P1.threeSunny A
strongCoverGridConfigwithn = 3andnS = 3 - Imo2025P1.strongCoverGridConfig.extend Add a diagonal line
x + y = n + 2to acountAndStrongCover - Imo2025P1.existsStrongCover It is possible to have a
strongCoverGridConfig, whenevernS ≤ nandnS = 0 ∨ nS = 1 ∨ nS = 3 - Imo2025P1.imo2025_p1 The final theorem: answer is {0, 1, 3}
- Imo2025P5.ValidSeq Whether all the numbers chosen are valid
- Imo2025P5.Wins Whether a sequence of numbers chosen is a win for the given player (expressed as the 0-based numbers of that player's moves, mod 2): the other player makes the first invalid move
- Imo2025P5.Strategy Documented declaration: Strategy
- Imo2025P5.Strategy.play Playing a strategy, k turns, against a given sequence of opponent moves (possibly not valid)
- Imo2025P5.Strategy.Winning Whether a strategy wins for the given player, against all possible opponent moves
- Imo2025P5.answer The answer to be determined
- Imo2025P5.ValidAt Validity of the move at (0-based) index
jof the infinite sequencex, as a statement about natural-number-indexed sequences - Imo2025P5.validSeq_iff
ValidSeqfor a length-nwindow of an infinite sequence, in terms ofValidAt - Imo2025P5.wins_iff
Winsfor a length-nwindow of an infinite sequence, in terms ofValidAt - Imo2025P5.Strategy.playSeq The infinite sequence of moves of a play
- Imo2025P5.respSeq The sequence of moves arising when the player with parity
pplays the strategysand the opponent always responds according tor - Imo2025P5.exists_first_invalid A first invalid index exists as soon as any invalid index does
- Imo2025P5.le_of_sq_le_sq' If
0 ≤ banda ^ 2 ≤ b ^ 2thena ≤ b - Imo2025P5.sum_le_sqrt_two_mul Cauchy-Schwarz bound: if a sequence vanishes at even indices below
2 * k, is nonnegative there, and its squares sum to at most2 * k, then its sum is at most√2 * k - Imo2025P5.sqrt_two_le_add If
a, b ≥ 0anda² + b² = 2thena + b ≥ √2 - Imo2025P5.bazza_step Documented declaration: bazza_step
- Imo2025P5.bazza_invariant Documented declaration: bazza_invariant
- Imo2025P5.bazza_validAt_odd When
c ≤ √2/2and Bazza plays greedily, no odd index is ever the first invalid one - Imo2025P5.bazzaStrategy Bazza's greedy strategy: spend the entire quadratic budget
- Imo2025P5.zeroStrategy The all-zeros strategy
- Imo2025P5.alice_not_wins If
c ≤ √2/2then Alice has no winning strategy: Bazza survives greedy play forever - Imo2025P5.bazza_wins If
c < √2/2then Bazza's greedy strategy wins - Imo2025P5.zeros_sum_le The partial-sum bound coming from Cauchy-Schwarz, for play in which Alice has played all zeros so far
- Imo2025P5.zeros_validAt_even If
c ≥ √2/2and all of Alice's moves up to an even index2 * tare0, then her move at2 * tis valid - Imo2025P5.bazza_not_wins If
c ≥ √2/2then Bazza has no winning strategy: Alice survives forever by playing all zeros - Imo2025P5.alice_wins If
c > √2/2then Alice wins: she plays zeros until indexN, then spends her whole linear budget, which by then exceeds√(N + 2), so Bazza cannot answer - Imo2026P1.Board A board is a finite multiset of natural numbers
- Imo2026P1.IsInitial An initial board: exactly
2026entries, each strictly greater than1 - Imo2026P1.Move Documented declaration: Move
- Imo2026P1.IsTerminal A board is terminal when at most one entry is
> 1, so no move is possible - Imo2026P1.HasUniqueLarge A board has a unique large entry when exactly one entry is
> 1 - Imo2026P1.Reachable
Reachable B B':B'can be obtained fromBby a finite sequence of moves (the reflexive–transitive closure ofMove) - Imo2026P1.gExp The exponent
g_pfor a primepand boardB: thegcdof thep-adic valuations of the entries ofB - Imo2026P1.Mval The claimed invariant terminal value
M = ∏_{p ∣ ∏ B} p ^ gExp p B, the product over all primes dividing some entry ofBofpraised to the gcd of thep-adic valuations - Imo2026P1.move_ge_one Moves preserve the property that all entries are
≥ 1 - Imo2026P1.ge_one_reachable Reachable boards have all entries
≥ 1, provided the start board does - Imo2026P1.large_count_pos_of_move A move always produces at least one entry
> 1 - Imo2026P1.large_count_pos_of_reachable Reachable boards have at least one entry
> 1, provided the start board does - Imo2026P1.gcd_min_sub_max
gcd(min a b, max a b - min a b) = gcd(a, b) - Imo2026P1.gExp_move For a prime
p, the quantitygExp pis preserved by a move - Imo2026P1.Mval_move
Mvalis invariant under a move, for boards whose remaining entries are≥ 1 - Imo2026P1.Mval_reachable
Mvalis invariant along any finite play - Imo2026P1.Mval_terminal On a terminal board with entries
≥ 1,Mvalequals the unique large entry - Imo2026P1.unique_large_of_reachable_terminal Any terminal board reachable from an initial board
B₀has exactly one entry> 1 - Imo2026P1.large_mem_eq_Mval Any entry
> 1of a terminal board reachable from an initial boardB₀equalsMval B₀ - Imo2026P1.imo2026_p1a_termination Statement (a), part 1 — termination
- Imo2026P1.imo2026_p1a_unique_large Statement (a), part 2 — unique large entry
- Imo2026P1.imo2026_p1b_invariance Statement (b) — invariance of
M - Imo2026P3.pieceLengths The multiset of piece lengths obtained by cutting
[0,1]at the points of a finite setS ⊆ (0,1) - Imo2026P3.firstPlayerShare The sum of the entries of a list
Lat the (0-indexed) even positions, after sortingLin non-increasing order - Imo2026P3.L
L(A,B): Liu Bang's total length, given Liu Bang's marksAand Xiang Yu's marksB - Imo2026P3.AdmissibleMark The set of admissible markings for a player: a finite subset of
(0,1)of size at mostn - Imo2026P3.V The value Liu Bang can guarantee
- Imo2026P3.pieceLengths_sum The piece lengths of an admissible cut set sum to
1(the total stick length) - Imo2026P3.pieceLengths_length There are
|S| + 1pieces - Imo2026P3.L_mem_Icc Basic sanity bound: Liu Bang's share lies in
[0, 1]for admissible cut sets (it is a subset-sum of the piece lengths, which are nonnegative and sum to1) - Imo2026P3.surplus The "greedy surplus" of a list: sum of adjacent pair differences, plus the last entry if the length is odd
- Imo2026P3.evenSum The sum of entries at even (0-indexed) positions
- Imo2026P3.two_mul_evenSum_sub_sum For any list,
2 * evenSum - sum = surplus - Imo2026P3.firstPlayerShare_eq_evenSum
firstPlayerShareof a list equalsevenSumof its decreasing sort - Imo2026P3.firstPlayerShare_congr
firstPlayerShareis invariant under permutation: both mergeSorts are decreasing-sorted perms of each other, hence equal - Imo2026P3.geom_two Geometric sum of powers of two over
range m - Imo2026P3.pow_two_punch The discrete punchline: a signed sum of distinct powers of two, with at least one nonzero sign, has absolute value at least one
- Imo2026P3.lower_bound_aux Auxiliary form of the lower bound, declared before
V_eqso that the main reduction can refer to it - Imo2026P3.upper_bound_aux Auxiliary form of the upper bound, declared before
V_eqso that the main reduction can refer to it - Imo2026P3.lower_bound Lower bound
- Imo2026P3.upper_bound Upper bound / optimality
- Imo2026P4.IsTriangle A triangle, viewed as the multiset of its three interior angles (in degrees): positive reals summing to
180 - Imo2026P4.HasAngle A triangle
shas an interior angle equal toθ - Imo2026P4.IsCut One admissible cut of the triangle
s, producing childrenLandR - Imo2026P4.MulanWins The set of triangles from which Mulan can force, in finitely many steps, a triangle with an interior angle equal to
θ, no matter how Shan-Yu discards - Imo2026P4.MulanCanGuarantee Mulan can guarantee victory for the value
θ: from every valid starting triangle she wins in finitely many steps regardless of Shan-Yu's play - Imo2026P4.mem3 Membership in a triple, as a disjunction
- Imo2026P4.rot3 Rotation of a triple
- Imo2026P4.triple_sum Sum of a triple
- Imo2026P4.triple_card Card of a triple
- Imo2026P4.exists_nat_mul_in An open interval of length exceeding
θ, with positive left endpoint, contains a positive integer multiple ofθ - Imo2026P4.good_wins Documented declaration: good_wins
- Imo2026P4.find_cut Documented declaration: find_cut
- Imo2026P4.invariant Documented declaration: invariant
- Imo2026P4.not_wins Hence no sum-
180multiset without integer multiples ofθis winning - Imo2026P5.PositiveReal The subtype of positive real numbers, representing
\mathbb{R}_{>0} - Imo2026P5.IsAdmissible The two-sided inequality defining admissible functions on positive real numbers
- Imo2026P5.fdef The defect
f x - xof a function on the positive reals - Imo2026P5.hB Squared form of the right inequality:
4 x f(y) ≤ (f(x) + y)^2 - Imo2026P5.hA Squared form of the left inequality:
(f(x) + y)^2 ≤ 2 (x^2 + f(y)^2) - Imo2026P5.fcomp Iterating
ftwice shifts by the defect:f(f(y)) = 2 f(y) - y - Imo2026P5.orbit The orbit of
fis an arithmetic progression with differencefdef f y - Imo2026P5.g_nonneg The defect is nonnegative:
f y ≥ y - Imo2026P5.cross Cross inequality on orbit points, with
p = fdef f b,q = fdef f a - Imo2026P5.absurd_lt Two positive defect values cannot be strictly ordered
- Imo2026P5.eq_of_pos All positive values of the defect coincide
- Imo2026P5.ball Near a zero of the defect, the defect vanishes
- Imo2026P5.ascend Everything strictly above a zero of the defect is a zero
- Imo2026P5.zero_contra A zero of the defect cannot coexist with a positive value
- Imo2026P5.imo2026_p5 The admissible functions are exactly the translations
f(x) = x + cwith a nonnegative constantc - Imo2026P6.IsValidSeq Documented declaration: IsValidSeq
- Imo2026P6.imo2026_p6 For any sequence satisfying Definition 1, there exist positive integers
TandLsuch thata (n + T) = a n + Lfor everyn - KolmogorovStreams.break_into_words_cons Dropping the first word is equivalent to dropping
first_lengthsymbols of the original stream - KolmogorovStreams.exists_break_into_words Documented declaration: exists_break_into_words
- UK2024R1P1.uk2024_r1_p1 Since OLYMPIADS has no duplicate letters, then the set of spellings is just a subset of the permutations of 9 elements
- UK2024R1P4.two_pow_sub_two_gt For n ≥ 5, n + 1 < 2^(n-2)
- UK2024R1P4.sq_bound Key inequality (*): if n·2ⁿ + 1 is a perfect square and n ≥ 2, then 2^(n-1) ≤ 2n + 2
- UK2024R1P4.not_square_ge_five For n ≥ 5, n·2ⁿ + 1 is not a perfect square: the bound (*) combined with
two_pow_sub_two_gtis immediately contradictory - UpperLowerContinuous.tᵤ Generate the toplogy on ℝ by intervals of the form (a, b]
- UpperLowerContinuous.tₗ Generate the toplogy on ℝ by intervals of the form [a, b)
- UpperLowerContinuous.tₛ This should be equivalent to the default instance for
TopologicalSpace ℝ, which goes throughUniformSpace, but for now I don't want to bother with proving that equivalence - UpperLowerContinuous.real_induction Let S be a set of real numbers such that: 1
- UpperLowerContinuous.infinite_interval_lower_open [x, ∞) is open in tₗ
- UpperLowerContinuous.infinite_interval_upper_open (-∞, x) is open in tᵤ
- Usa1972P3.card_good_balance Inclusion-exclusion on the bad events
- Usa1972P4.IsSolution Documented declaration: IsSolution
- Usa1972P4.rat_cube_ne_two There is no rational number whose cube equals
2 - Usa1972P4.ratCast_ne_of_cube_eq_two A rational number is never equal to the real cube root of
2 - Usa1972P4.cube_eq_two_factor The key factorization, using
k³ = 2:(2x² + 2x + 2) − (x² + 2x + 2)k = (x − k)((2 − k)x + 2 − k²) - Usa1972P4.main_inequality With
(A, B, C, a, b, c) = (2, 2, 2, 1, 2, 2), the required inequality holds for every non-negative rational numberx - Usa1973P2.a reindexed to start at 0
- Usa1973P5.cbrt_cubed Cubing a real cube root
- Usa1973P5.factorization_pqr The prime
poccurs with multiplicity exactly one in a product of three pairwise distinct primesp,q,r - Usa1973P5.not_cube_mul_cube Documented declaration: not_cube_mul_cube
- Usa1973P5.cube_root_pqr_ne_rat The cube root of a product of three pairwise distinct primes is irrational: it cannot be written as a quotient of two integers
- Usa1973P5.key_algebra The algebraic heart of the argument
- Usa1973P5.usa1973_p5 Documented declaration: usa1973_p5
- Usa1974P4.Player The three players of the series
- Usa1974P4.third The player who sits out a game between
xandy - Usa1974P4.probWinA Documented declaration: probWinA
- Usa1974P4.probFirstAB The probability that A wins the series when the first game is A against B
- Usa1974P4.probFirstAC The probability that A wins the series when the first game is A against C
- Usa1974P4.probFirstBC The probability that A wins the series when the first game is B against C
- Usa1974P4.probFirstAB_eq Documented declaration: probFirstAB_eq
- Usa1974P4.probFirstAC_eq Expanding the game tree when the first game is A against C: A wins the series exactly via the outcome sequences AbC · AbB, AbC · BbA · CbB · AbC, and CbA · BbC · AbB · AbC
- Usa1974P4.probFirstBC_eq Expanding the game tree when the first game is B against C: A wins the series exactly via the outcome sequences BbC · AbB · AbC and CbB · AbC · AbB
- Nat.Prime.multiplicity_factorial Documented declaration: multiplicity_factorial
- Usa1975P3.natDegree_prod_X_sub_C The degree of
∏_{i < m} (X - i)ism - Usa1975P3.prod_range_add_one_cast
∏_{i < m} (i + 1) = m!, cast to the reals - Usa1975P3.eval_prod_X_sub_C_neg_one
∏_{i < m} (X - i)evaluated at-1equals(-1)^m * m! - Usa1975P3.eval_prod_X_sub_C_self
∏_{i < m} (X - i)evaluated atmequalsm! - Usa1975P5.aceSets The sample space: the 3-element subsets of the positions
{1, ..., n}; each such subset records the positions of the three aces in the pack - Usa1975P5.reflect Reflection of the pack about its middle: the card in position
xof a pack ofncards moves to positionn + 1 - x - Usa1975P5.minD The minimum of a set of naturals, defaulting to
0for the empty set - Usa1975P5.maxD The maximum of a set of naturals, defaulting to
0for the empty set - Usa1975P5.mid The middle element of a 3-element set of natural numbers, computed as the sum minus the minimum minus the maximum
- Usa1975P5.reflect_mem A card in position
x ∈ {1, ..., n}reflects to a position in{1, ..., n} - Usa1975P5.reflect_injOn Reflection is injective on positions that are at most
n - Usa1975P5.reflect_reflect Reflection is an involution on positions that are at most
n - Usa1975P5.min_image_reflect The minimum of the reflected set is the reflection of the maximum
- Usa1975P5.max_image_reflect The maximum of the reflected set is the reflection of the minimum
- Usa1975P5.sum_image_reflect The sum of the reflected set is
3 * (n + 1)minus the sum of the set - Usa1975P5.mid_image_reflect Reflecting every position turns the middle element
minton + 1 - m: this is the heart of the reflection argument - Usa1975P5.image_mem_aceSets Reflecting the positions of the aces yields another valid set of positions
- Usa1975P5.image_image_reflect Reflection of position sets is an involution on the sample space
- Usa1975P5.image_reflect_injOn Reflection of position sets is injective on the sample space
- Usa1975P5.image_reflect_aceSets Reflecting the position sets permutes the sample space
- Usa1975P5.sum_mid_image_reflect Reindexing the sum over the sample space by reflection
- Usa1975P5.two_mul_sum_mid Twice the total of the middle positions equals
(n + 1)times the number of position sets: the average middle position is(n + 1) / 2 - Usa1975P5.expected The expected number of cards that must be turned over to reach the second ace
- Usa1976P1.HasMonoRectangle Documented declaration: HasMonoRectangle
- Usa1976P1.counterexample A 4 x 6 coloring with no monochromatic rectangle
- Usa1976P1.monoTriples The monochromatic pairs of rows in column
j, tagged with their color:(r1, r2, b)meansr1 < r2and both squares(r1, j)and(r2, j)have colorb - Usa1976P1.two_le_card_monoTriples Documented declaration: two_le_card_monoTriples
- Usa1976P1.card_colored_rowPairs There are
6pairs of distinct rows and2colors, hence12colored pairs of rows - Usa1976P5.ω A primitive fifth root of unity in
ℂ - Usa1977P1.dvd_iff_map_dvd Divisibility over
ℤtransfers to divisibility overℂ, since the divisor is monic - Usa1977P1.not_dvd_of_gcd_ne_one If
gcd (m+1) n ≠ 1, divisibility fails: the(m+1)/gcd-th power of a primitive(m+1)-th root of unity is a root of the divisor but not of the dividend - Usa1977P1.dvd_of_gcd_eq_one If
gcd (m+1) n = 1, divisibility holds: the remainder of the division vanishes at allmnontrivial(m+1)-th roots of unity, and has degree< m, hence is zero - Usa1977P3.sextic_of_zero_remainder Documented declaration: sextic_of_zero_remainder
- Usa1977P5.le_max_endpoint Documented declaration: le_max_endpoint
- Usa1977P5.cornerMax Documented declaration: cornerMax
- Usa1977P5.le_cornerMax The product
(r + Σ f i) * (s + Σ 1 / f i), where eachf i ∈ [h, k], is bounded above by the corresponding corner maximum - Usa1978P3.Expressible A natural number
nis expressible if it can be written as a sum of positive integers whose reciprocals sum to1 - Usa1978P3.expressible_two_mul_add Documented declaration: expressible_two_mul_add
- Usa1978P3.expressible_two_mul_add_eight Adjoining two
4s: ifnis expressible, so is2 * n + 8 - Usa1978P3.expressible_two_mul_add_nine Adjoining
3and6: ifnis expressible, so is2 * n + 9 - Usa1978P5.Share Delegate
aand delegatebspeak a common language - Usa1978P5.SharedWith The delegates other than
dthat share a language withd - Usa1978P5.card_sharedWith_le Documented declaration: card_sharedWith_le
- Usa1979P1.MultisetNatOfLen14 A type representing assignments to the variables $n_1$, $n_2$, ..., $n_{14}$, quotiented by permutations of indices
- Usa1979P3.res The residue of
a imodulo3 - Usa1979P3.cnt The number of entries of
ahaving residuexmodulo3 - Usa1979P3.patterns The "good" residue patterns: triples of residues that sum to
0 - Usa1979P3.dvd_iff_res Divisibility by
3in terms of residues inZMod 3 - Usa1979P3.sum_univ_zmod3 Summing over
ZMod 3gives three terms - Usa1979P3.cnt_sum The residues split
Fin ninto the three fibers ofres a - Usa1979P3.fiber_card The fiber of triples with prescribed residues is a product of fibers
- Usa1979P3.good_card The number of good triples, grouped by their residue pattern
- Usa1979P3.sum_over_patterns Summing over the good patterns by reindexing with the first two entries
- Usa1979P3.pattern_sum The good triple count in terms of the residue counts
- Usa1979P3.ineq_max The key inequality in the case where
xis a maximum ofx, y, z - Usa1979P3.ineq3 The key inequality:
4 * (p³ + q³ + r³ + 6pqr) ≥ (p + q + r)³forp q r ≥ 0 - Usa1979P5.card_inter_eq_two_of_good Documented declaration: card_inter_eq_two_of_good
- Usa1979P5.mem_third_of_inter If
u,v = {w, x, y}are members of a "good" family,w ∈ u ∩ vandx ∉ u, theny ∈ u: otherwiseu ∩ v = {w}would be a singleton intersection - Usa1979P5.sum_card_filter_eq_three_mul Double counting of the incidences between
Xand a family of 3-element subsets ofX - Usa1979P5.card_le_of_good Main step: a "good" family of 3-element subsets of an
n-element set has at mostnmembers - Usa1980P1.ne_of_balance The two objects have unequal weights, so the weights
AandBthat balance them from the left pan must differ - Usa1980P1.h_sq Eliminating the true weights
x₁andx₂givesa - b = h ^ 2 * (A - B) - Usa1980P1.offset_eq The offset
kis determined by(h + 1) * k = a - h ^ 2 * A - Usa1980P2.apPairs For a sequence
a : ℕ → ℝand an indexj, the finset of pairs(i, k)withi < j < k < nsuch thata i, a j, a kforms a three-term arithmetic progression - Usa1980P2.apCount The number of three-term arithmetic progressions among the first
nterms ofa, counted by their middle index - Usa1980P2.card_apPairs_le Documented declaration: card_apPairs_le
- Usa1980P2.sum_min_step The per-index bounds telescope in steps of two:
∑ j < n + 2, min j (n + 1 - j) = ∑ j < n, min j (n - 1 - j) + n - Usa1980P2.sum_min_closed Closed form of the total bound:
∑ j < n, min j (n - 1 - j) = (n - 1)² / 4 - Usa1980P2.strictMonoOn_cast The sequence
a i = iis strictly increasing onSet.Iio n - Usa1980P2.card_apPairs_cast Documented declaration: card_apPairs_cast
- Usa1980P2.apCount_cast The bound is achieved by the sequence
a i = i - Usa1980P2.apCount_le The bound holds for every strictly increasing sequence
- Usa1981P2.Link The three possible link types between two towns
- Usa1981P2.colorsAt The set of link types that town
vhas to other towns - Usa1981P2.Valid Documented declaration: Valid
- Usa1981P2.three_le_card_colorsAt If a town
uis linked to three other towns by three pairwise distinct link types, thenuhas at least three link types - Usa1981P2.fiber_card_le_two Key local fact: no town is linked to three other towns by the same link type
- Usa1981P2.card_neighbors_le_four Every town is directly linked to at most four other towns: at most two link types, at most two links of each type
- Usa1981P2.pair The ten unordered pairs of towns of
Fin 5, in a fixed order - Usa1981P2.edgeIdx The position of the unordered pair
{i, j}in the listpair - Usa1981P2.mkColor A symmetric link assignment on five towns, reconstructed from its restriction to the ten unordered pairs
- Usa1981P2.valid_mkColor Any valid assignment on five towns restricts to a valid assignment reconstructed from the ten unordered pairs
- Usa1981P2.seesAll3 Boolean check: does a town whose four links have these types see all three link types?
- Usa1981P2.monoE Boolean check: is the triangle with these three link types monochromatic?
- Usa1981P2.usesC Boolean check: is link type
xused by the assignmentu? - Usa1981P2.validB A kernel-efficient Boolean version of
Valid (mkColor u) - Usa1981P2.mkU Bundle ten link types into a function
Fin 10 → Link - Usa1981P2.card_le_two_iff A town has at most two link types unless it has all three of them
- Usa1981P2.tri6 The six orderings of the monochromatic-triangle condition on three link types, derived from the canonical one
- Usa1981P2.validB_iff The Boolean check
validBdecides validity of the reconstructed assignment - Usa1981P2.check5B The finite check over all
3^10assignments, evaluated by kernel reduction - Usa1981P2.check5 A brute-force check: no link assignment on five towns satisfies all the criteria
- Usa1982P1.FourPointProperty The hypothesis of the problem: among any four vertices of the graph, some vertex is adjacent to the other three
- Usa1982P1.IsUniversal A vertex is universal if it is joined to all 1981 other vertices
- Usa1982P1.card_four_of_distinct A finset of four distinct vertices has cardinality four
- Usa1982P1.card_universal_ge Lower bound: in any graph satisfying
FourPointProperty, at most three vertices fail to be universal, so at least 1979 vertices are universal - Usa1982P1.card_three The finset
{0, 1, 2}of vertices has three elements - Usa1982P1.extremalAdj Adjacency in the extremal graph: all pairs of distinct vertices except
0—1and0—2 - Usa1982P1.extremalGraph The extremal graph: the complete graph on
Fin 1982with the two edges0—1and0—2removed - Usa1982P1.extremal_universal_iff In the extremal graph, the universal vertices are exactly those outside
{0, 1, 2} - Usa1982P1.extremal_fourPoint The extremal graph satisfies the four-point condition: any four vertices contain one outside
{0, 1, 2}, and that vertex is joined to all others - Usa1982P1.extremal_count The extremal graph has exactly 1979 universal vertices
- Usa1982P2.auxPoly The polynomial
1 + X^k + (-1 - X)^koverℝ - Usa1982P2.auxPoly_eq Rewrite
(-1 - X)^kas(-1)^k (1 + X)^k - Usa1982P2.auxPoly_mul_eq The polynomial identity obtained from the functional equation by substituting
x = 1, y = t, z = -1 - tand clearing denominators - Usa1982P2.coeff_eq Comparison of the coefficients of
X ^ (m + n - 1)inauxPoly_mul_eq - Usa1982P2.final_odd With
n = 2andmodd, evaluating the equation at(x, y, z) = (1, 1, -2)forcesm ∈ {3, 5} - Usa1983P1.Ordering Documented declaration: Ordering
- Usa1983P1.Favorable The event that the triangle formed by the first three points is disjoint from the triangle formed by the last three points
- Usa1983P1.card_favorable Documented declaration: card_favorable
- Usa1983P1.card_orderings The total number of cyclic orders of the six points
- Usa1983P2.vieta follows https://artofproblemsolving.com/wiki/index.php/1983_USAMO_Problems/Problem_2 vieta formulas for a and b only, done very similarly to
Usa2014P1.lean - Usa1983P3.mem_leftMax_or_rightMin Documented declaration: mem_leftMax_or_rightMin
- Usa1983P5.fracs Rationals in the interval with reduced denominator at most
n - Usa1983P5.dist_lt_interval_length Openness of the interval gives strict spacing
- Usa1983P5.one_div_den_le_dist_of_dvd_den Spacing for denominators related by divisibility
- Usa1983P5.no_dvd_between_occurring_denoms Occurring denominators form a divisibility antichain
- Usa1983P5.twoPart Decompose
ainto its power-of-two factor and the remaining odd factor - Usa1983P5.card_le_half_of_no_dvd Largest-odd-divisor pigeonhole step
- Usa1984P1.eq_X_sq_add_of_monic_of_natDegree_eq_two A monic quadratic polynomial is determined by its lower coefficients
- Usa1984P2.factorization_eq_of_pow Documented declaration: factorization_eq_of_pow
- Usa1984P4.sum_ite_erase Number of ordered pairs
(q₁, q₂)withq₂ ∈ sandq₁ ≠ q₂, for a fixed questionq₁, expressed as a sum of indicators over all questions - Usa1984P4.card_ordered_pairs The number of ordered pairs of distinct questions in
s, written as a double sum of indicators over all questions - Usa1984P4.sum_pupils_pair For fixed questions
q₁ ≠ q₂, the number of pupils that attempted both is2, expressed as a sum of indicators over all pupils - Usa1984P4.sum_two_distinct For a fixed question
q₁, the number of questionsq₂ ≠ q₁is27, so summing the constant2over them gives54 - Usa1984P4.card_pupils Double counting ordered pairs of distinct questions attempted by the same pupil shows there are
36pupils - Usa1984P4.card_attempters Double counting the pairs
(p, q₂)withqandq₂both attempted bypshows every question was attempted by exactly9pupils - Usa1984P5.fwdDiff The forward difference operator on real sequences
- Usa1984P5.fwdDiff_iter_zero The
m-fold forward difference at0is the alternating binomial sum - Usa1984P5.poly_fwdDiff The
m-fold forward difference of a polynomial of degree< mvanishes - Usa1985P2.quartic_eq The quartic of the problem rewrites as
(x² - N - 1/2)² - x - 5/4; this is the key observation of the solution (see https://prase.cz/kalva/usa/usoln/usol852.html) - Usa1985P2.f The function whose zeros are the real roots of the quartic
- Usa1985P2.exists_root_of_sign_change A sign change of
f Non an interval locates a root in its interior - Usa1985P2.f_pos_of_nonpos Documented declaration: f_pos_of_nonpos
- Usa1985P2.f_lt_f_of_lt
f Nis strictly antitone on{x ≥ 0 | x² ≤ N + 1/2} - Usa1985P2.eq_of_region1 Hence there is at most one root in
{x ≥ 0 | x² ≤ N + 1/2} - Usa1985P2.region2_key Two roots
x < ylying in{x² ≥ C}would force(y + x) * ((y² - C) + (x² - C)) = 1 - Usa1985P2.region2_aux But for
N = 10^10two roots in{x² ≥ N + 1/2}are impossible: the left side of the identity above exceeds2 * 10^5 * 316 - Usa1985P2.eq_of_region2 At most one root in
{x ≥ 0 | x² ≥ N + 1/2} - Usa1985P2.answer The two real roots, correct to 4 decimal places
- Usa1985P4.mixedRel
mixedRel n G X psays that the vertexXis distinct from the two endpoints of the pairpand is adjacent to exactly one of them - Usa1985P4.badPair The "bad" vertices for a pair
p: the remaining vertices that are joined to exactly one of the two endpoints ofp - Usa1985P4.neighborFinset_subset_erase The neighbourhood of
Xdoes not containX - Usa1985P4.degree_le The degree of a vertex is at most
n - 1 - Usa1985P4.fiber_card Documented declaration: fiber_card
- Usa1985P4.double_count Double counting: summing the number of bad vertices over all ordered pairs
(Y, Z)withY ≠ Zequals the sum over verticesXof2 * (d_X * (n - 1 - d_X)) - Usa1985P4.two_mul_sum_badPair_le Twice the total number of bad incidences is at most
n * (n - 1)^2, since for each vertexXof degreedwe have4 * d * (n - 1 - d) ≤ (n - 1)^2(AM-GM) - Usa1985P4.exists_pair_le Averaging: some ordered pair
(A, B)withA ≠ Bhas at most⌊(n - 1)/2⌋bad remaining vertices - Usa1985P4.answer_card The vertices joined to both or neither endpoint of
pare the remaining vertices that are not bad; there are(n - 2) - (#bad)of them - Usa1985P5.c The first index
i(0-based) such thatn ≤ a i - Usa1985P5.sum_indicator_left
∑ j ∈ range 85, (if j < a i then 1 else 0)counts the elements ofrange (a i)whena i ≤ 85 - Usa1985P5.sum_indicator_right
∑ i ∈ range 19, (if i < c a hu (j+1) then 1 else 0)counts the elements ofrange (c a hu (j+1))whenc a hu (j+1) ≤ 18 - Usa1985P5.sum_eq The key identity: the sum is constant
- Usa1986P1.prime_lt_thirteen_ne_two A prime less than
13that is not2is one of3, 5, 7, 11 - Usa1986P1.eq_of_dvd Documented declaration: eq_of_dvd
- Usa1986P1.not_all_divisible_of_three Documented declaration: not_all_divisible_of_three
- Usa1986P1.not_all_divisible Among any seven consecutive odd numbers
a, a + 2, …, a + 12, at least one is divisible by none of the primes3, 5, 7, 11 - Usa1986P2.Asleep Each professor
p : Fin 5takes two naps, and napk : Fin 2of professorpis the closed interval[s p k, e p k] - Usa1986P2.pairs The ten pairs of professors, as the 2-element subsets of
Fin 5 - Usa1986P2.PairSet The type of pairs of professors
- Usa1986P2.cands Candidate "first moments" for a set
Aof professors: nap-start times of members ofAat which every member ofAis asleep - Usa1986P2.mem_cands Membership in
cands: a nap-start time of a member ofAat which every member ofAis asleep - Usa1986P2.exists_mem_cands_le Documented declaration: exists_mem_cands_le
- Usa1986P2.f The first moment at which all members of
Aare simultaneously asleep - Usa1986P2.f_asleep All members of
Aare asleep at the first common moment - Usa1986P2.f_mem The first common moment is a nap-start time of some member of
A - Usa1986P2.f_le The first common moment is at most any moment at which all members of
Aare asleep - Usa1986P2.cands_nonempty Pairs of professors have candidate first moments
- Usa1986P2.F The first moment when both members of a pair
Aare asleep - Usa1986P2.F_asleep Both members of a pair are asleep at the pair's first common moment
- Usa1986P2.F_mem A pair's first common moment is a falling-asleep event: it is the start time of a nap of one of the two members
- Usa1986P3.six_mul_sum_sq Six times the sum of the first
nnon-zero squares - Usa1986P3.isUnit_gcd_of_coprime The
GCDMonoidgcd of coprime naturals is a unit - Usa1986P3.eq_sq_of_coprime_mul_eq_sq If coprime naturals have a square product, the left factor is a square
- Usa1986P3.no_small_solution Finite check: the Pell-type equation
4u² = 3w² + 1has no solution with2 ≤ u ≤ 12andw ≤ 13 - Usa1986P3.ge_337 Minimality: if
n > 1and(n+1)(2n+1) = 6m², then337 ≤ n - Usa1986P5.numPartitions The number of partitions of
n - Usa1986P5.card_partitions_containing The partitions of
ncontainingmas a part are in bijection with the partitions ofn - m(erase one occurrence ofm), so there arenumPartitions (n - m)of them - Usa1986P5.sum_count_one_succ Documented declaration: sum_count_one_succ
- Usa1986P5.sum_count_one Summing the number of
1s over all partitions ofngivesπ(0) + π(1) + ⋯ + π(n - 1) - Usa1986P5.sum_distinct_parts Summing the number of distinct parts over all partitions of
nalso givesπ(0) + π(1) + ⋯ + π(n - 1): count the pairs(p, m)withm ∈ pin two ways - Usa1987P3.InX Documented declaration: InX
- Usa1987P3.InX.eval_mem_Ioo Every polynomial of
Xmaps the open interval(0, 1)into itself - Usa1987P3.InX.trichotomy The key trichotomy: two elements of
Xare either equal as polynomials, or one of them is strictly smaller than the other throughout the whole open interval(0, 1) - Usa1987P5.eqBefore The set of positions
j < iwitha j = a i - Usa1987P5.neqAfter The set of positions
j > iwitha j ≠ a i - Usa1987P5.f The quantity
f(i)from the problem statement - Usa1987P5.numGoodTriples The quantity
Tfrom the problem statement: the number of triples of indicesi < j < kwhose values are not(0, 1, 0)or(1, 0, 1) - Usa1987P5.altSeq The alternating sequence
0, 1, 0, 1, ... - Usa1987P5.good_iff A triple of bits is good (not alternating) iff two adjacent values agree
- Usa1987P5.choose_add_two Vandermonde's identity at
k = 2 - Usa1987P5.tripsA Triples
i < j < kwitha i = a j = a k - Usa1987P5.tripsB Triples
i < j < kwitha i = a j ≠ a k - Usa1987P5.tripsC Triples
i < j < kwitha i ≠ a j = a k - Usa1987P5.sum_f The sum of the
fvalues depends only onn - Usa1987P5.key_div Divisibility:
n * (n - 1) * (n - 3) = 8 * (n * C((n-1)/2, 2))forn = 2k + 1 - Usa1987P5.cast_key Cast of the product
n * (n - 1) * (n - 3)to the integers, for oddn - Usa1987P5.lower_bound The lower bound: every sequence on
2k + 1positions has at least(2k + 1) * C(k, 2)good triples - Usa1987P5.T_alt The alternating sequence attains the bound
- Usa1988P1.not_ten_dvd_num The numerator
a * (10 ^ s - 1) + bof the unreduced fraction is congruent tob - amodulo 10, so it is not divisible by 10 when the last digits ofaandbdiffer - Usa1988P2.vieta Vieta's formulas for a and b, obtained by differentiating the polynomial identity once resp. twice and evaluating at 0
- Usa1988P3.card_bad_pairs_le Documented declaration: card_bad_pairs_le
- Usa1988P5.prodForm The polynomial
p(x) = ∏_{i = 1}^{32} (1 - X^i) ^ (a i) - Usa1988P5.nextA The effect of one doubling step
p(x) ↦ p(x) p(-x)on the exponents: ifp = ∏ (1 - X^i) ^ (a i)thenp(x) p(-x) = q(x²)whereq = ∏ (1 - X^i) ^ (nextA a i) - Usa1988P5.Good
Good p c mexpressesp = 1 + c * X + O(X^(m+1)) - Usa1988P5.coeff_one_sub_pow Binomial expansion of the coefficients of
(1 - X^n)^a - Usa1988P5.prod_double The doubling step, at the level of the product representation:
(∏ (1 - X^i)^(a i)) · (∏ (1 - X^i)^(a i)).comp (-X)equals(∏ (1 - X^i)^(nextA a i)).comp (X^2) - Usa1988P5.good_transport The doubling step preserves the
1 + c * X + O(X^(m+1))shape, squaring the linear coefficient and halving the range of vanishing - Usa1988P5.extract Reading off the two lowest coefficients of a product
∏ (1 - X^i)^(b i): the exponent of1 - Xis65536and the exponent of1 - X^2is its binomial coefficient - Usa1989P2.incidenceFinset_nonempty_of_degree_pos Every vertex of positive degree is incident to at least one edge
- Usa1989P2.exists_pairwise_disjoint_edges In a finite simple graph with minimum degree at least one, there is a set of pairwise vertex-disjoint edges of size at least
|V| - |E| - Usa1989P3.star_eval Evaluating a polynomial whose coefficients are all real at the conjugate of
zis the same as conjugating its value atz - Usa1989P3.normSq_I_sub_mul_normSq_I_add For a complex number
r, the product of the squared distances fromrtoiand to-iequals(r.re² + r.im² + 1)² - 4 r.im² - Usa1989P3.prod_normSq_sub_roots The squared distances from the roots of a monic polynomial to a point
zmultiply to the squared norm of the value of the polynomial atz - Usa1989P3.prod_normSq_add_roots The squared distances from the roots of a monic polynomial to a point
z, with signs flipped, again multiply to the squared norm of the value of the polynomial at-z - Usa1990P1.Plate A license plate: six digits, each from 0 to 9 (leading zeros allowed)
- Usa1990P1.IsValid A collection of plates is valid if any two distinct plates in it differ in at least two places
- Usa1990P1.extend The checksum construction: given five digits
f : Fin 5 → ZMod 10, build a six-digit plate whose last digit makes the total digit sum congruent to zero modulo ten - Usa1990P1.sum_extend The digit sum of a plate built by
extendis zero modulo ten - Usa1990P1.extend_injective The first five digits determine a plate built by
extend - Usa1990P1.hammingDist_ge_two_of_sum_eq Two plates with the same digit sum modulo ten cannot differ in exactly one place; hence distinct plates of equal sum differ in at least two places
- Usa1990P1.card_le_of_valid Upper bound: a valid collection of plates has at most
10 ^ 5members - Usa1990P3.ValidCircle Documented declaration: ValidCircle
- Usa1990P3.coprime_succ_self' Consecutive integers are coprime
- Usa1990P3.coprime_succ_gen
n + cis coprime to its successor - Usa1990P3.coprime_add_prime_right If
pis prime and does not dividen + c, thenn + candn + c + pare coprime (any common divisor divides their differencep) - Usa1990P3.coprime_add_prime_left The symmetric version of
coprime_add_prime_right - Usa1990P3.coprime_add_two Two odd numbers at distance
2are coprime - Usa1990P3.offA1 Offsets of the first circle when
13 ∤ n:[n, n+1, …, n+13] - Usa1990P3.offB1a Offsets of the second circle when
13 ∤ nandn ≢ 2 [MOD 17]:[n+15, n+14, n+16, n+17, …, n+32] - Usa1990P3.offB1b Offsets of the second circle when
13 ∤ nandn ≡ 2 [MOD 17]:[n+14, n+15, …, n+30, n+32, n+31] - Usa1990P3.offA2 Offsets of the first circle when
13 ∣ n:[n+19, n+20, …, n+32] - Usa1990P3.offB2a Offsets of the second circle when
13 ∣ nandn ≢ 16 [MOD 17]:[n+1, n, n+2, n+3, …, n+18] - Usa1990P3.offB2b Offsets of the second circle when
13 ∣ nandn ≡ 16 [MOD 17]:[n, n+1, …, n+16, n+18, n+17] - Usa1990P3.a1 First circle when
13 ∤ n - Usa1990P3.b1a Second circle when
13 ∤ nandn ≢ 2 [MOD 17] - Usa1990P3.b1b Second circle when
13 ∤ nandn ≡ 2 [MOD 17] - Usa1990P3.a2 First circle when
13 ∣ n - Usa1990P3.b2a Second circle when
13 ∣ nandn ≢ 16 [MOD 17] - Usa1990P3.b2b Second circle when
13 ∣ nandn ≡ 16 [MOD 17] - Usa1990P3.injective_n_add Adding the same constant preserves injectivity
- Usa1990P3.image_add_off_subset_Icc If all offsets are at most
32, the image offun i ↦ n + off ilies inFinset.Icc n (n + 32) - Usa1990P3.disjoint_add_off If the offsets of two families are separated by a constant
c, their images (after shifting byn) are disjoint - Usa1990P3.image_union_eq_Icc Two disjoint injective families of
14and19elements inside the33-element setFinset.Icc n (n + 32)must cover it - Usa1990P3.case1a Case
13 ∤ n,n ≢ 2 [MOD 17] - Usa1990P3.case1b Case
13 ∤ n,n ≡ 2 [MOD 17] - Usa1990P3.case2a Case
13 ∣ n,n ≢ 16 [MOD 17] - Usa1990P3.case2b Case
13 ∣ n,n ≡ 16 [MOD 17] - Usa1990P4.DiffByOne Documented declaration: DiffByOne
- Usa1990P4.IV Documented declaration: IV
- Usa1990P4.IV.cons_iff Inversion principle for
IVon a cons list - Usa1990P4.IV.diffByOne
IVlists satisfy condition (2) of the problem - Usa1990P4.IV.of_diffByOne Lists with distinct entries satisfying condition (2) are exactly the
IVlists - Usa1990P4.IV.unique_indices The interval endpoints of an
IVlist are uniquely determined - Usa1990P4.ValidLists Documented declaration: ValidLists
- Usa1990P4.W Valid digit lists whose digits form exactly the interval
[a, b] - Usa1990P4.IVSet Lists whose digits form exactly the interval
[a, b] - Usa1990P4.descend The decreasing list
b, b-1, ..., 1, 0 - Usa1990P4.eq_descend Among
IV 0 blists, only the decreasing list ends in0 - Usa1990P4.finite_and_ncard_IVSet The number of
IVlists over the interval[a, a + k]is2 ^ k - Usa1990P4.geom2 Geometric series with ratio
2 - Usa1990P4.ncard_biUnion Finite disjoint unions of sets of lists have the sum of the cardinalities
- Usa1990P4.ncard_W The number of valid digit lists with digit interval
[a, b] - Usa1990P4.validLists_eq_biUnion The valid digit lists are the disjoint union of the
W a bover0 ≤ a ≤ b < n - Usa1990P4.ncard_inner The number of valid digit lists whose largest digit is exactly
b - Usa1990P4.ncard_validLists The total number of valid digit lists in base
n - Usa1990P4.ncard_numbers_eq Positive integers satisfying the conditions of the problem correspond to valid digit lists via
Nat.digits - Usa1991P2.icc_one_succ
{1, ..., n+1}is{1, ..., n}withn + 1adjoined - Usa1991P2.sum_div_prod_insert Splitting the quantity attached to
insert (n + 1) TforT ⊆ {1, ..., n}: the sum of the elements increases byn + 1while the product is multiplied byn + 1 - Usa1991P2.prod_one_add_inv The telescoping product
∏ (1 + 1/i) = n + 1 - Usa1991P2.sum_powerset_one_div_prod The sum of
1 / ∏over all subsets of{1, ..., n}(the empty set contributes1) telescopes ton + 1 - Usa1991P2.main_sum_succ Induction step for the main sum: a subset of
{1, ..., n+1}either is a subset of{1, ..., n}or has the forminsert (n+1) TwithT ⊆ {1, ..., n} - Usa1991P3.f The tower-of-exponents function of the problem, with the index shifted by one:
f 0 = 2andf (n + 1) = 2 ^ f n, so that the problem'sf nis ourf (n - 1) - Usa1991P3.le_f The tower grows at least linearly
- Usa1991P3.two_pow_dvd_f Eventually
f nis divisible by any prescribed power of two - Usa1991P3.eventually_constant_mod Main step: strong induction on the modulus
- Usa1992P1.digits_pow TODO add a generalization of this mathlib?
- Usa1992P1.ofDigits_sub_ofDigits_eq_ofDigits_zipWith The subtraction of ofDigits of two lists is equal to ofDigits of digit-wise subtraction of them
- Usa1992P3.monotone_of_consec_lt If the values
a 0, …, a 10are strictly increasing, thenais monotone on the interval[0, 10] - Usa1992P3.gap The key gap lemma: writing
s jfor the sum of thejsmallest elements, ifs j < 1500then the next element satisfiesa j ≤ s j + 1 - Usa1992P3.pow_bound Induction using the gap lemma: the sum of the
ksmallest elements is at most2 ^ k - 1, for everyk ≤ 10 - Usa1992P3.Good Documented declaration: Good
- Usa1992P3.answer The answer to the problem
- Usa1992P5.pseq The iterated polynomial sequence of the problem:
pseq [z₁, …, zₙ]is the polynomialpₙ, wherep₁(z) = z - z₁andpₖ(z) = pₖ₋₁(z)² - zₖ - Usa1992P5.exists_pseq_eval_eq_zero The combinatorial heart of the solution: for any nonempty set
Sof at mostncomplex numbers one can choosez₁, …, zₙso thatpₙvanishes on all ofS - Usa1993P3.lemma1 This lemma was proved automatically by Kimina-Prover 72B
- Usa1993P3.lemma2 This lemma was proved by GPT5, with some help from dwrensha to fix up some errors
- Usa1993P4.constant_value The constant value that the sequence eventually takes
- Usa1993P4.ordCompl_two_mul Dividing out all factors of two from
2 * myieldsmwhenmis odd - Usa1993P4.odd_and_pos Every term of the sequence is odd and positive
- Usa1993P4.le_half Each term is at most half the sum of the two previous terms
- Usa1993P4.descent If two consecutive terms differ, the maximum of the pair strictly decreases two steps later
- Usa1993P4.eventual_eq Some two consecutive terms are eventually equal
- Usa1993P4.stable Once two consecutive terms agree, the sequence is constant from then on
- Usa1993P4.gcd_invariant The gcd of two consecutive terms is preserved by the recurrence
- Usa1993P4.gcd_eq The gcd of any two consecutive terms equals
gcd r s - Usa1993P5.a_avg
a_avg x nis the average of the termsx 0, x 1, ..., x n - Usa1993P5.b_avg
b_avg x nis the average of the termsx 1, x 2, ..., x n - Usa1993P5.two_mul_sqrt_le_add Two-variable AM–GM
- Usa1993P5.ratio_antitone The consecutive ratios are nonincreasing
- Usa1993P5.prod_le_of_le Moving two indices apart weakly decreases the product
- Usa1993P5.x0_mul_xn_le Symmetric products:
x 0 * x n ≤ x i * x (n - i) - Usa1993P5.pair_ge Each paired sum
x i + x (n - i)is at least2 * √(x 0 * x n) - Usa1993P5.sum_pair_ge The key estimate:
k ≥ (n - 1) * √(x 0 * x n), in doubled form - Usa1993P5.sum_decomp Peeling off the first and last terms of a range sum
- Usa1993P5.final_algebra The algebraic heart of the proof
- Usa1993P5.key_ineq The inequality
k * (k + x 0 + x n) ≥ (n ^ 2 - 1) * x 0 * x n - Usa1994P1.gap_lemma If consecutive terms of
adiffer by more than one, then terms that arekindices apart differ by at least2 * k - Usa1994P1.sum_bound The sum of the first
n + 1terms is at most(n + 1) * (a n + 1) - (n + 1)^2; we state it in an addition-only form - Usa1994P1.key The key estimate:
4 * bₙ ≤ (aₙ + 1)² - Usa1994P2.Val The three values that may appear in the sequence
- Usa1994P2.Config A configuration of the sequence, indexed by
ZMod 99(indices are interpreted modulo 99, as in the problem statement) - Usa1994P2.initial The initial configuration: 1, 2, 1, 2, ..., 1, 2, 3
- Usa1994P2.targetPat Documented declaration: targetPat
- Usa1994P2.target Documented declaration: target
- Usa1994P2.Move An allowed move: change the value at some index
nto another valuevthat differs from both neighbors - Usa1994P2.pairWeight Documented declaration: pairWeight
- Usa1994P2.totalWeight The invariant: the total weight around the cycle
- Usa1994P2.pairWeight_local A case analysis on
ZMod 3: the key local identity behind the invariance oftotalWeight - Usa1994P2.succ_ne_self In
ZMod 99, an index and its successor are distinct - Usa1994P2.pred_ne_self In
ZMod 99, an index and its predecessor are distinct - Usa1994P2.move_preserves_distinct A move preserves the property that every two consecutive values are distinct
- Usa1994P2.totalWeight_move The total weight is invariant under allowed moves, provided the configuration has distinct consecutive values
- Usa1994P2.initial_distinct In the initial configuration, consecutive values are distinct
- Usa1994P2.totalWeight_initial The total weight of the initial configuration is
3 - Usa1994P2.totalWeight_target_zero The total weight of the target configuration with base
0is-3 - Usa1994P2.totalWeight_target_eq Shifting the base index of the target configuration does not change the total weight: the sum is over a full cycle
- Usa1994P2.reachable_invariant Every reachable configuration has the same total weight as the initial configuration, and has distinct consecutive values
- Usa1994P2.does_exist The answer to the question "is there a sequence of allowed moves to a target configuration?" is no
- Usa1994P4.y The telescoping comparison sequence
y i = √(i+1) - √i - Usa1994P4.sum_sq_y_le Abel-summation comparison: the partial sums of
xdominate those ofyandyis decreasing, so∑ i, (y i)^2 ≤ ∑ i, x i * y i - Usa1994P5.altSum The alternating sum
∑_{U ⊆ s} (-1)^{|U|} (m - σ(U)).choose k, viewed as an integer - Usa1994P5.altSum_insert Splitting off the element
x: summing over subsets ofinsert x sseparates the subsets not containingxfrom those containing it - Usa1994P5.altSum_sub_one Pascal's rule applied termwise: the forward difference of
altSum s (k+1)atmequalsaltSum s k (m-1) - Usa1994P5.telescope Telescoping the forward differences over
j ∈ range x - Usa1994P5.altSum_card The main identity, by induction on the finite set
s - Usa1995P1.HasAp Documented declaration: HasAp
- Usa1995P1.DigitFree A natural number is
(p)-digit-free if no digit of its base-pexpansion equalsp - 1 - Usa1995P1.bSeq
bSeq p nis the number obtained by writingnin basep - 1and reading the result in basep - Usa1995P1.phi
phi p mreads the base-pdigits ofmin basep - 1 - Usa1995P1.digits_ofDigits_ne If every entry of
lis< band different fromc, then every base-bdigit ofNat.ofDigits b lis different fromc - Usa1995P1.digits_getD The
k-th digit ofmin baseb(with0padding) - Usa1995P1.digit_add_mul_eq Adding a multiple of
d = e * p^(k+1) + c * p^konly affects thek-th base-pdigit throughc(no carries into that digit from below) - Usa1995P1.phi_strictMono_on_digitFree The key monotonicity fact:
phiis strictly increasing on digit-free numbers - Usa1995P1.digits_bSeq The base-
pdigits ofbSeq p nare exactly the base-(p-1)digits ofn - Usa1995P1.exists_mem_digits_pred The non-existence part: among the values
bSeq p ithere is no arithmetic progression of lengthp - Usa1995P1.not_hasAp If all candidate values are digit-free (here: values of
bSeq p), there is no arithmetic progression of lengthp - Usa1995P1.hasAp_of_mem_digits_pred Documented declaration: hasAp_of_mem_digits_pred
- Usa1995P1.usa1995_p1 USA Mathematical Olympiad 1995, Problem 1
- Usa1995P2.TrigMap The six trigonometric maps allowed by the problem
- Usa1995P2.TrigMap.apply Evaluate a trigonometric map at a real number
- Usa1995P2.run Apply a finite sequence of trigonometric maps to a starting value
- Usa1995P2.chainInv The chain
arctan, sin, arccos, tanof trigonometric maps - Usa1995P2.chainSqrt The chain
arctan, cos, arctan, sin, arccos, tanof trigonometric maps - Usa1995P2.run_chainInv Documented declaration: run_chainInv
- Usa1995P2.run_chainSqrt The chain
arctan, cos, arctan, sin, arccos, tansendsxto√(1 + x²): it is the previous chain applied tocos (arctan x) = 1 / √(1 + x²) - Usa1995P2.reachable_sqrt_div Every number of the form
√(m / n)withm, npositive naturals can be reached from0by a finite sequence of trigonometric maps - Usa1995P4.gcd_lcm_dvd_prod_gcd
gcd (lcm over s) xdivides the product of the individual gcds - Usa1995P4.prod_eq_lcm_mul_gcd_prod Exact factorization: a product of naturals equals their lcm times the product of the gcds of the successive partial lcms with the next factor
- Usa1995P4.gcd_lcm_le_pow Each step gcd is at most
N ^ (j + 1), sincegcd (m - i) (m - (j+1))divides(j + 1) - i ≤ Nfor everyi < j + 1 - Usa1995P4.prod_le_lcm_mul_pow A lower bound for the lcm of the
N + 1consecutive integersm, m - 1, ..., m - N: their product is at mostN ^ (N * (N + 1))times their lcm - Usa1995P4.interpolate_exists Lagrange interpolation (over ℚ): the first
N + 1values of an integer sequence are interpolated by a rational polynomial of degree at mostN - Usa1995P4.denomProd The product of the denominators of the coefficients of
qof degree at mostN - Usa1995P4.clearCoeff The (integer) coefficients of
denomProd q N • q - Usa1995P4.clearPoly The integer polynomial obtained from
q : ℚ[X]by clearing denominators: its coefficients areclearCoeff q N, so it agrees withdenomProd q N • qon all evaluations - Usa1995P4.clearCoeff_spec The defining property of
clearCoeff: as rationals,clearCoeff q N iequalsdenomProd q N * q.coeff i(fori ≤ N) - Usa1995P4.clearPoly_eval_cast Evaluating the cleared polynomial gives
denomProd q Ntimes the evaluation ofq(as rational numbers) - Usa1995P4.clearPoly_node At the interpolation nodes
i ≤ N, the cleared polynomial takes the valuedenomProd q N * a i - Usa1995P4.clearPoly_dvd The difference
clearPoly q N ⬝ m - denomProd q N * a mis divisible bym - ifor everyi ≤ N - Usa1995P4.sum_pow_abs_le A sum of the form
∑ c i * m ^ iwithm ≥ 1grows at most likem ^ N - Usa1995P4.abs_eval_le The evaluation of an integer polynomial at
m ≥ 1is bounded by a constant timesm ^ natDegree - Usa1995P4.clearPoly_eq_of_large Key step: for large
m, the cleared polynomial agrees withdenomProd q N * a m - Usa1995P4.clearPoly_eq_all Documented declaration: clearPoly_eq_all
- Usa1995P5.not_adj_and_adj_of_mem_edgeFinset In a triangle-free graph, no edge can have two distinct endpoints that are both adjacent to
P: together withPthey would form a triangle - Usa1995P5.sum_degree_neighborFinset_eq_card Double counting: the sum of the degrees of the neighbors of
Pequals the number of edges ofGhaving an endpoint adjacent toP - Usa1995P5.card_far_add_sum_degree The edges of
Gsplit into those with no endpoint adjacent toPand those with a (unique) endpoint adjacent toP, counted insum_degree_neighborFinset_eq_card - Usa1995P5.sum_sum_degree_neighborFinset Summing
∑ Q ∈ N(P), deg Qover all verticesPcountsdeg Qonce for each neighbor ofQ, giving the sum of the squares of the degrees - Usa1996P2.SubsetSums The set of all sums of one or more distinct elements of
S - Usa1996P2.prefixSum The sum of the
msmallest elements ofS, taken in increasing order - Usa1996P2.sum_eq_sum_filter The sum over a subset
AofSreindexed by the increasing enumeration ofS - Usa1996P2.prefixSum_succ_lt_two_mul_sum Documented declaration: prefixSum_succ_lt_two_mul_sum
- Usa1996P4.sget The
i-th term of a binary sequencex : Fin n → Bool, orfalseifiis out of range - Usa1996P4.GoodA Documented declaration: GoodA
- Usa1996P4.GoodB A binary sequence of length
nisB-good if it contains no four consecutive terms equal to0, 0, 1, 1or1, 1, 0, 0in that order - Usa1996P4.diff The sequence of successive differences (XORs) of
y - Usa1996P4.buildAux Auxiliary for
build: thek-th term of the sequence with first termcand successive differences given byx - Usa1996P4.build The sequence of length
n + 1with first termcwhose successive differences are given byx - Usa1996P4.pattern_transfer A block
0,0,1,1or1,1,0,0inyat positionicorresponds exactly to a block0,1,0in the difference sequence ofyat positioni - Usa1996P4.seqEquiv Documented declaration: seqEquiv
- Usa1997P1.seq The recursion from the problem, parametrized by the sequence
p : ℕ → ℕof positive integers used as numerators, wherep kis used at stepk + 1 - Usa1997P1.solution_set The answer to the problem: the sequence eventually becomes zero exactly for the rational numbers in the open interval (0, 1)
- Usa1997P1.seq_shift Shifting the starting value by one step is the same as shifting the sequence of numerators
- Usa1997P1.terminates_of_rat First direction: starting from a positive rational
a / b, the sequence reaches zero, because the numerator strictly decreases at each nonzero step - Usa1997P1.rat_cast_of_seq_succ Second direction: if the term at step
k + 1is rational, then so is the term at stepk - Usa1997P1.rat_cast_of_seq If some term of the sequence is rational, then the starting value is rational (by downward induction)
- Usa1997P3.digit The unique digit in
{0, …, 9}congruent toumodulo 2 and tovmodulo 5 (which exist and are unique by the Chinese remainder theorem) - Usa1997P3.step_props Documented declaration: step_props
- Usa1997P3.polyOfDigits The polynomial whose coefficients are the given list of digits, in little-endian order
- Usa1997P3.build Runs the extraction algorithm for at most
fuelsteps, returning the list of extracted digits if the pair(0, 0)is reached in time - Usa1997P3.build_correct Any digit list produced by
buildfrom a pair(u, v)withu ≡ v (mod 3)indeed represents(u, v) - Usa1997P3.build_region_all On the finite region
|u| ≤ 9,|v| ≤ 2the algorithm always terminates in at most 8 steps (checked here by exhaustive computation over the 95 pairs withu ≡ v (mod 3)) - Usa1997P3.Good The specification of the problem:
Qhas coefficients in{0, …, 9}and takes the valuesuat-2andvat-5 - Usa1997P3.good_of_good_step If the successor pair of
(u, v)is representable, so is(u, v): prepend the extracted digit as the new constant coefficient - Usa1997P3.exists_good_region Documented declaration: exists_good_region
- Usa1997P3.exists_good Documented declaration: exists_good
- Usa1997P3.good_unique Uniqueness: the difference
Dof two good polynomials has coefficients in{-9, …, 9}and vanishes at-2and-5 - Usa1997P5.bound Bounding the individual fraction
- Usa1997P5.main_sum Add the three bounds together
- Usa1998P1.mod2_diff For integers M,N we have |M-N| ≡ M-N ≡ M+N MOD 2
- Usa1998P1.usa1998_p1
ab 0 iis aᵢ andab 1 iisbᵢ - Usa1998P4.rectColor The indicator coloring of a rectangle
- Usa1998P4.cellValue Extend a coloring by zero outside the board
- Usa1998P4.cornerDelta The sum of the values of the four cells touching a grid-line corner
- Usa1998P4.quietCorners The two board corners where the corner delta of
constAddStart cvanishes - Usa1999P1.gridGraph Use the full grid graph and the subgraph induced by the checkers
- Usa1999P1.pathGraph_degree_le_two A path vertex has at most one neighbor on each side
- Usa1999P1.gridGraph_degree_le_four A square has at most four side-neighbors
- Usa1999P1.checkerGraph_preconnected The path hypothesis makes the checker graph preconnected
- Usa1999P1.preconnected_twice_card_le_sum_degrees_add_two A preconnected finite graph has internal degree sum at least twice its vertex count minus two
- Usa1999P1.checkerGraph_degree_eq_inter Count checker-neighbors inside the full grid neighborhood
- Usa1999P1.gridGraph_degree_eq_checkerGraph_degree_add_boundary Split each checker degree into internal and boundary neighbors
- Usa1999P1.emptySquares_card_le_boundary_sum Every empty square is covered by a boundary-neighbor set of some checker
- Usa1999P1.emptySquares_card_add_checker_card Empty squares and checker squares partition the board
- Usa1999P3.rt The primitive
p-th root of unity used throughout the proof - Usa1999P3.chi The additive character
ZMod p → ℂgiven byj ↦ ζ ^ j.val - Usa1999P3.Sw The weighted character sum
∑ k, k.val * χ (j * k) - Usa1999P3.sum_zmod_val Sums over
ZMod pof a function of the residue can be written as sums overFinset.range p - Usa1999P3.Sw_mul_sub_one The key identity
(χ j - 1) * Sw j = pfor nonzeroj, obtained by reindexing the sum definingSwalongk ↦ k + 1 - Usa1999P3.alg_symm The symmetric-polynomial identity obtained by clearing denominators in
∑ 1 / (xᵢ - 1) = -2 - Usa1999P4.sum_sq_le_sq_sum_of_nonpos If every value of
fonsis nonpositive, then the sum of the squares is at most the square of the sum: the cross terms are nonnegative - Usa1999P5.Piece The two letters that can be written in a square
- Usa1999P5.Board The board: square
icontainsb ifori < 2000; anything outside is irrelevant - Usa1999P5.BOK Well-formed board: nothing written outside the 2000 squares
- Usa1999P5.HasSOS The board contains three consecutive squares spelling S O S
- Usa1999P5.HasThreat The player to move can win immediately: some legal move produces SOS
- Usa1999P5.ThreatFree No immediate winning move is available
- Usa1999P5.IsLosing A losing square: an empty square such that playing either letter there allows the opponent to win on the following move
- Usa1999P5.TrapAt A "trap": the pattern S _ _ S with both middle squares empty
- Usa1999P5.HasTrap The board contains a trap
- Usa1999P5.empties The empty squares of the board
- Usa1999P5.letters The occupied squares of the board
- Usa1999P5.losing The losing squares of the board
- Usa1999P5.trapEnds The left ends of traps on the board
- Usa1999P5.Outcome The outcome of a game: first player wins, second player wins, or draw
- Usa1999P5.Strategy A strategy chooses a square and a letter given a board
- Usa1999P5.play Playing out the game with two strategies;
fuelbounds the number of moves (2001 always suffices) - Usa1999P5.three_le_card_letters_of_hasSOS A board with SOS has at least three occupied squares
- Usa1999P5.two_le_card_letters_of_hasTrap A board with a trap has at least two occupied squares
- Usa1999P5.not_hasSOS_update_of_threatFree On a threat-free board, no move can produce SOS (else that move would have won)
- Usa1999P5.threat_shapes The shape of any immediate win created by playing letter
l₀at squarexof a threat-free board - Usa1999P5.trap_middle The middle squares of a trap are losing squares
- Usa1999P5.losing_char A losing square of a threat-free board is the middle of a trap
- Usa1999P5.trap_disjoint Middle pairs of distinct traps are disjoint
- Usa1999P5.losing_eq_biUnion The losing squares are exactly the middle squares of the traps
- Usa1999P5.even_card_losing Losing squares come in pairs, hence there is an even number of them
- Usa1999P5.SafeMove A safe move: a legal move that is not on a losing square and that creates neither SOS nor an immediate winning opportunity for the opponent
- Usa1999P5.exists_safe_move Documented declaration: exists_safe_move
- Usa1999P5.SecondSetupOk A good second setup move: playing an S at
tcreates a trap without giving the opponent an immediate win - Usa1999P5.p2strat The second player's strategy
- Usa1999P5.Inv Documented declaration: Inv
- Usa1999P5.hasTrap_update A trap survives any move that avoids its middle squares (which are losing squares)
- Usa1999P5.main_induction The heart of the argument: from an invariant position the second player wins
- Usa1999P5.exists_second_setup A good second setup move exists after the second player's first move, whatever the first player does (that is not immediately losing)
- Usa2000P3.Card The three colors of cards
- Usa2000P3.score The score accumulated when playing the sequence of cards
l, listed in the order they are played - Usa2000P3.canonicalPlay The canonical play: all blue cards, then all red cards, then all white cards
- Usa2000P3.plays The finite set of all plays with
Ablue,Bred andCwhite cards - Usa2000P3.fewestWays The number of different ways the lowest score can be achieved
- Usa2000P3.optPlays The set of plays that achieve the lowest score
- Usa2000P4.Good Documented declaration: Good
- Usa2000P4.rowFiber The squares of
Slying in rowr - Usa2000P4.colFiber The squares of
Slying in columnc - Usa2000P4.Good.mono Any subset of a good set is good
- Usa2000P4.alone_of_good Documented declaration: alone_of_good
- Usa2000P4.good_of_alone Documented declaration: good_of_alone
- Usa2000P4.card_le_of_good Upper bound: a good set on an
m × nboard withm, n ≥ 2has at mostm + n - 2squares - Usa2000P4.construction The extremal configuration: every square of row
0or of column0, except the corner square(0, 0) - Usa2000P4.card_construction Documented declaration: card_construction
- Usa2000P4.good_construction See the comment at
card_constructionfor the disabled linter - Usa2000P5.collinear_perpBisector_eq A line intersects a nondegenerate perpendicular bisector at most once
- Usa2000P5.centers_eq_of_oangle_eq Equal side angles force equal centers
- Usa2000P5.shared_vertex_sbtw The shared vertex lies strictly between tangent centers
- Usa2000P5.directed_angle_step One straight-center step for directed angles
- Usa2000P5.directed_angle_recurrence One tangency advances the side angle
- Usa2000P6.key_identity The key algebraic identity: the difference of the two min-terms of a pair of indices factors as a sign times a nonnegative min-kernel entry
- Usa2000P6.min_kernel_nonneg The min kernel
Kᵢⱼ = min (s i) (s j)is positive semidefinite: its quadratic form is nonnegative for every real vectorz - Usa2000P6.kernel_nonneg The generalized min kernel
Mᵢⱼ = min (u i * w j) (u j * w i), withuandwnonnegative, is positive semidefinite - Usa2001P1.usa2001_p1_lemma if a₁,
- Usa2001P5.Shifty An integer
dis shifty for a setSif shifting byddoes not change membership inS - Usa2001P5.shifty_sq_sub_sq If
uandvbelong toS, thenv^2 - u^2is shifty forS - Usa2001P5.not_prime_dvd_three The number-theoretic core: no prime divides all three of
a^2 - b^2,a^3 * (a - 2)andb^3 * (b - 2) - Usa2001P5.gcd_gcd_eq_one The gcd of the three shifty integers
a^2 - b^2,a^3 * (a - 2),b^3 * (b - 2)is1 - Usa2001P5.bezout_three Bézout's identity for three integers whose gcd is
1 - Usa2002P1.Finset.subtype_union Seems like this maybe belongs in mathlib?
- Usa2002P3.injOn_range_of_step If
ξis strictly increasing at consecutive arguments belown, then it is injective onFinset.range n - Usa2002P3.card_roots_eq_n A nonzero real polynomial of degree
nthat hasndistinct real roots has exactlynroots (counted with multiplicity), and in particular it splits - Usa2002P3.card_roots_eq_n_of_intervals Documented declaration: card_roots_eq_n_of_intervals
- Usa2002P3.exists_root_of_eval_mul_neg Intermediate value theorem for polynomials: if
pchanges sign betweenaandb, thenphas a root in the open interval(a, b) - Usa2002P3.card_roots_and_splits Let
pbe a nonzero real polynomial of degreenwhose values at the integers1, ..., nalternate in sign, so thatphas a root in each of then - 1intervals(i, i+1) - Usa2002P3.exists_eval_pos A monic real polynomial of positive degree takes arbitrarily large positive values
- Usa2002P3.exists_eval_neg_one_pow_pos A monic real polynomial
pof degreen, multiplied by(-1)^n, takes arbitrarily large positive values at large negative arguments - Usa2002P4.f_zero f(0)=0
- Usa2002P4.squarish f(x^2) = xf(x)
- Usa2002P4.square_additive f(x^2) = f(x^2)-f(y^2)
- Usa2002P4.f_odd f is odd
- Usa2002P4.additive_pos f(x+y) = f(x)+f(y) with x,y ≥ 0 first
- Usa2002P4.additive Now show Cauchy FE holds with x,y not necessarily positive (lots of cases)
- Usa2002P4.four_additive Apply Cauchy four times to f
- Usa2002P4.main_proof Show the FE implies f(x) = f(1)*x
- Usa2002P5.Linked
Linked a bmeans thatacan be connected tobby a finite chain of positive integers in which any two consecutive termsx, ysatisfyx + y ∣ x * y - Usa2002P5.link_pred_mul Basic link:
t ~ t * (t - 1)for1 < t, ast + t * (t - 1) = t ^ 2 - Usa2002P5.link_two_mul_pred Basic link:
2 * t ~ t * (t - 2)for2 < t, as2 * t + t * (t - 2) = t ^ 2 - Usa2002P5.link_mul_left Scaling:
a ~ bimpliesm * a ~ m * bfor0 < m - Usa2002P5.link_two_mul Doubling: every
2 < tlinks to2 * t - Usa2002P5.link_pred Reduction: every
3 < tlinks tot - 1 - Usa2002P5.linked_to_three Every integer
≥ 3links to3 - Usa2002P5.linked_any Any two integers greater than
2are linked (via3) - Usa2002P5.exists_seq_of_linked Unfold
Linkedinto an explicit sequence - Usa2002P6.hblock A horizontal block: three adjacent stamps in a single row
- Usa2002P6.vblock A vertical block: three adjacent stamps in a single column
- Usa2002P6.IsBlock A block that can be torn out of the n×n sheet
- Usa2002P6.IsMaximalTearing A tearing-out of pairwise disjoint blocks from the n×n sheet which makes it impossible to tear out any more blocks
- Usa2002P6.trivialTearing A wasteful maximal tearing: fill the sheet with vertical blocks, column by column, and fill the leftover bottom rows with horizontal blocks
- Usa2002P6.phase The phase of row
iin the efficient tearing pattern: in rowi, the torn blocks start at columns congruent tophase imodulo 5 - Usa2002P6.patRowTearing The blocks torn out of row
iin the efficient tearing pattern - Usa2002P6.patTearing The efficient maximal tearing, with asymptotic density n²/5
- Usa2002P6.cov
cov n i jmeans that cell(i, j)is torn out by the efficient pattern - Usa2002P6.b Documented declaration: b
- Usa2002P6.segsH The set of all horizontal
1 × 3block positions on then × nsheet - Usa2002P6.segsV The set of all vertical
3 × 1block positions on then × nsheet - Usa2002P6.lower_card_filter_le_fourteen Every block meets at most
14of the possible block positions - Usa2002P6.counting_lower_bound The lower bound
b(n) ≥ n(n - 2)/7: double-counting pairs of a possible block position and a torn-out block meeting it - Usa2002P6.mem_patRowTearing Membership in a row of the efficient tearing pattern, in a usable form
- Usa2002P6.fst_eq_of_mem_patRowTearing Every block of row
iof the pattern lies entirely within rowi - Usa2002P6.cov_covered Every cell satisfying
covis torn out by the pattern - Usa2002P6.row_cov Every three consecutive cells of a row of the sheet contain a torn-out cell
- Usa2002P6.col_cov Every three consecutive cells of a column of the sheet contain a torn-out cell
- Usa2002P6.usa2002_p6 USAMO 2002, Problem 6
- Usa2003P3.t The transformation
t:t a iis the number of terms ofathat precede thei-th term and are different from it - Usa2003P3.le_t If
ais admissible at positioni, thena i ≤ t a i - Usa2003P3.iter_congr The values
t^[m] a jforj ≤ ionly depend on the valuesa jforj ≤ i - Usa2003P3.iter_stable_add Once a whole initial segment is stable, it stays stable
- Usa2003P3.iter_eq_zero If the first
kterms ofaare all zero, they stay zero forever - Usa2003P3.range_add_filter_card Counting elements
m < j + kwithp m, whenpholds on all of[0, k) - Usa2003P3.comm1 The key commutation relation for the case
a₁ = 1: withbⱼ = t a (j+1) - 1, iteratingtonbsimulates iteratingtona, shifted by one index - Usa2003P3.comm2 The key commutation relation for the case
a₀ = a₁ = ⋯ = aₖ₋₁ = 0 < aₖ: withcⱼ = t^[2] a (j+k) - k, iteratingtoncsimulates iteratingtona, shifted bykindices - Usa2003P3.main_aux The main induction: after
n-1applications oft, the sequence is stable - Usa2003P3.usa2003_p3 USA Mathematical Olympiad 2003, Problem 3
- Usa2003P6.Conf A configuration of six integers at the vertices of a hexagon
- Usa2003P6.step One move at vertex
j: replace the number atjby the absolute value of the difference of the numbers at the two neighboring vertices - Usa2003P6.Moves
Moves f gmeans that configurationgcan be reached fromfby a sequence of moves - Usa2003P6.cmax The maximum entry of a configuration
- Usa2003P6.step2 The move on parity vectors: in
ZMod 2the absolute difference becomes a sum - Usa2003P6.cands The candidate move sequences used to reach a configuration with exactly one odd entry
- Usa2003P6.phase1_decide Machine-checked parity verification: from every parity vector with odd sum, one of the candidate sequences leads to a parity vector with exactly one odd entry
- Usa2003P6.stepN One move at vertex
j, phrased on natural numbers - Usa2004P2.bezout Bézout's identity for finitely many integers: the gcd of the values of
aon a finsetTis an integer linear combination of them - Usa2004P2.neg_mem From (b) with
i = jwe get0 ∈ S, and then (c) withx = 0shows thatSis closed under negation - Usa2004P2.add_mem_iff_sub_mem The key reformulation of condition (c): for
x, y ∈ S, the membership ofx + yand ofx - yinSare equivalent - Usa2004P2.nat_mul_mem Any natural multiple of a generator lies in
S - Usa2004P2.sub_one_mem Any number of the form
c * a i - a jwithc : ℕlies inS - Usa2004P2.nat_add_mem Any combination
c * a i + d * a jwithc d : ℕlies inS - Usa2004P2.nat_sub_mem Any combination
c * a i - d * a jwithc d : ℕlies inS - Usa2004P2.two_term_mem First lemma of the informal proof: any two-term integer linear combination
c * a i + d * a jlies inS - Usa2004P2.even_split Documented declaration: even_split
- Usa2004P2.all_linear_comb Second lemma of the informal proof: every integer linear combination of the generators lies in
S - Usa2004P4.Cell A cell of the 6×6 grid:
(row, column), both inFin 6 - Usa2004P4.colMate The pairing of columns: each column is paired with the column three places away
- Usa2004P4.mate The pairing of the cells of the first two rows: the cell
(0, j)is paired with(1, colMate j)and vice versa; all other cells are paired with themselves - Usa2004P4.Adj Two cells are adjacent if their squares share a vertex (Chebyshev distance at most 1)
- Usa2004P4.IsBlack A cell is black if it contains the greatest number in its row
- Usa2004P4.AliceWins Alice wins a finished board: there is a chain of black cells, consecutive cells sharing a vertex, from the top row to the bottom row
- Usa2004P4.IsBlack.unique The black cell of a row is unique (for an injective filling)
- Usa2004P4.exists_isBlack Every row has a black cell
- Usa2004P4.not_aliceWins Documented declaration: not_aliceWins
- Usa2004P4.exists_fresh_rat_avoiding There is always a rational number outside any finite set
- Usa2004P4.exists_rat_between_avoiding Documented declaration: exists_rat_between_avoiding
- Usa2004P4.Play A play of the game: the sequence of 36 moves, each a cell together with the rational number written in it
- Usa2004P4.prefBoard The board after the first
nmoves of a play - Usa2004P4.finalBoard The final board of a play: after 36 moves every cell is filled (see
prefBoard_finalBoard), and this is the number written in each cell - Usa2004P4.FollowsStrategy A play follows Bob's strategy
σif each of Bob's moves (the odd-numbered moves) is the move prescribed byσon the current board - Usa2004P4.filled The set of cells filled after the first
nmoves of a play - Usa2004P4.even_card_of_mate_closed A set of cells of the first two rows closed under the pairing has even cardinality: it is a union of pairs
{c, mate c} - Usa2004P4.orderIso_update Updating two order-isomorphic functions at a fresh point with values occupying the same relative position preserves the order-isomorphism
- Usa2004P4.Rows01Closed The board is closed under the pairing on the first two rows: a cell of the first two rows is filled iff its mate is filled
- Usa2004P4.SameRowIso The entries of each of the first two rows are ordered in the same way as the entries of the paired cells
- Usa2004P4.Inv The invariant Bob maintains after each of his moves
- Usa2004P4.GoodMateValue Documented declaration: GoodMateValue
- Usa2004P4.exists_GoodMateValue Documented declaration: exists_GoodMateValue
- Usa2004P4.bobMateValue The number Bob writes in the mate of Alice's cell when he answers in the first two rows
- Usa2004P4.bobCell2 The cell Bob plays in when Alice plays in rows 3 to 6: some empty cell of rows 3 to 6 (one always exists at that point by a parity argument, see
inv_prefBoard) - Usa2004P4.bobFreshValue A rational number not appearing on the board
- Usa2004P4.bobMove Documented declaration: bobMove
- Usa2004P4.inv_update_rows2 The invariant is preserved when Alice plays in rows 3 to 6 and Bob answers in rows 3 to 6 (the first two rows are untouched)
- Usa2004P4.inv_update_mate The invariant is preserved when Alice plays in the first two rows and Bob answers in the mate of her cell with a good value
- Usa2004P4.inv_prefBoard Bob's invariant holds after each of his moves in every play that follows his strategy
- Usa2004P4.usa2004_p4 USAMO 2004, Problem 4
- Usa2004P5.poly_bound Main estimate that lets us convert into Holder
- Usa2004P5.poly_nonneg Documented declaration: poly_nonneg
- Usa2004P5.multiplied_bound Multiply these all together to get to the intermediate (a³+2)(b³+2)(c³+2)
- Usa2004P5.holder_conjugate_3 3-variable Holder inequality (the painful part...)
- Usa2005P1.R The adjacency condition required of neighboring divisors in the circle: they must not be relatively prime
- Usa2005P1.GoodCircle
GoodCircle nsays that all divisors ofnthat are greater than1can be arranged in a circle so that no two adjacent divisors are relatively prime - Usa2005P1.SolutionSet The answer: all composite positive integers other than products of two distinct primes
- Usa2005P1.R_of_dvd_of_dvd Numbers sharing a common factor
≥ 2are not coprime - Usa2005P1.R_of_dvd If
2 ≤ aanda ∣ b, thenaandbare not coprime - Usa2005P1.R_of_dvd_left
Rtransfers along divisibility on the left - Usa2005P1.R_of_dvd_right
Rtransfers along divisibility on the right - Usa2005P1.R_symm
Ris symmetric - Usa2005P1.isChain_append Appending two chains gives a chain when the boundary elements are related
- Usa2005P1.isChain_of_forall_dvd A list whose elements are all divisible by some
r ≥ 2is anR-chain - Usa2005P1.powChain The list
[d, d*q, d*q^2, ..., d*q^e] - Usa2005P1.eq_of_mul_pow_eq If
d * q^j = d' * q^j'withd, d'dividingmandq ∤ mprime, thend = d'andj = j' - Usa2005P1.isChain_flatMap_powChain Chains, heads and lasts of
flatMap (powChain · q e)over a chainl - Usa2005P1.goodCircle_mul_prime_pow Documented declaration: goodCircle_mul_prime_pow
- Usa2005P1.goodCircle_prime_pow The divisors
> 1of a prime powerp ^ awith2 ≤ aadmit a good circle: any arrangement works, since every such divisor is divisible byp - Usa2005P1.two_le_length_of_composite_circle A circle for a composite number has at least two elements
- Usa2005P1.not_pq_of_factorization_ge_two If
mhas a prime factor whose exponent inmis at least2, thenmis not a product of two distinct primes - Usa2005P1.not_pq_of_three_le_card If
mhas at least three distinct prime factors, thenmis not a product of two distinct primes - Usa2005P1.mul_ne_self For
anon-zero andb ≥ 2, neithera * bnorb * aequalsa - Usa2005P1.mul_ne_mul_of_ne Cancelling a common positive factor on the right preserves inequality
- Usa2005P1.ne_of_prime_mul A prime cannot equal a product with another prime on the left
- Usa2005P1.ne_of_prime_mul_mul A prime cannot equal a product of three numbers when the first is a different prime
- Usa2005P1.dvd_mul_prime_prime For distinct primes
pandq, the divisors ofp * qgreater than1are exactlyp,qandp * q - Usa2005P1.not_goodCircle_mul For distinct primes
p q, no circle exists: in any circle the coprime pairp, qwould have to be adjacent - Usa2005P1.goodCircle_three_primes For pairwise distinct primes
p q r, the circle[p*q, q, q*r, r, r*p, p, p*q*r]works - Usa2005P1.goodCircle_of_not_pq Main induction: every composite
nthat is not a product of two distinct primes admits a good circle - Usa2005P1.usa2005_p1 Documented declaration: usa2005_p1
- Usa2005P4.tuples The admissible 4-tuples, as a
Finset - Usa2005P4.pairCount
pairCount n rcounts pairs(a, b)of natural numbers witha, b ≤ nanda + b = r - Usa2005P4.pairCount_eq_of_le For
r ≤ n, the constrainta, b ≤ nis automatic froma + b = r - Usa2005P4.pairCount_symm The symmetry
(a, b) ↦ (n - a, n - b)showspairCount n r = pairCount n (2 * n - r) - Usa2005P4.tuples_card_eq_sum The number of admissible 4-tuples is
∑ r, (pairCount n r)^2: group the 4-tuples according to the common valuerofk₁ + k₃ = k₂ + k₄ - Usa2005P4.sum_pairCount_sq Evaluating the sum: the values of
pairCount n rforr = 0, …, 2nare1, 2, …, n, n + 1, n, …, 1 - Usa2005P4.key_arith Three times the count equals
(n + 1) * (2 * n ^ 2 + 4 * n + 3) - Usa2005P6.s The sum of the decimal digits of
m - Usa2005P6.IsStable A set
Sof positive integers isk-stable if the sum of the elements of any nonempty subsetX ⊆ Shas digit sum equal tok - Usa2005P6.f
f nis the minimalkfor which there exists ak-stable set withnintegers - Usa2005P6.s_eq The defining recurrence of the digit sum, valid for all
m - Usa2005P6.s_concat The digits of a concatenation are the concatenation of the digits: if
c < 10 ^ ethens (10 ^ e * a + c) = s a + s c - Usa2005P6.s_complement If
a + b = 10 ^ e - 1then the digits ofaandbare complementary, sos a + s b = 9 * e - Usa2005P6.s_add_le Subadditivity of the digit sum
- Usa2005P6.s_pos_of_pos The digit sum of a positive integer is positive
- Usa2005P6.nine_le_s_of_dvd Every positive multiple of
10 ^ e - 1has digit sum at least9 * e - Usa2005P6.sum_Icc_id The Gauss sum `1 + 2 +
- Usa2005P6.construction Upper bound (construction).* If
n * (n + 1) / 2 < 10 ^ ethen{10^e - 1, 2 * (10^e - 1), ..., n * (10^e - 1)}is a9 * e-stable set ofnpositive integers - Usa2005P6.stable_lower Documented declaration: stable_lower
- Usa2005P6.stable_exists The set defining
f nis nonempty: the construction withe = Nat.log 10 (n * (n + 1) / 2) + 1works - Usa2005P6.one_le_f Every stable set has stability constant at least
1, hence1 ≤ f n - Usa2005P6.f_lower The lower bound for
f ncoming from the pigeonhole argument - Usa2005P6.f_upper The upper bound for
f ncoming from the explicit construction - Usa2006P1.residue_ne_zero If
pis prime and0 < s, k < p, thens * k ≢ 0 (mod p) - Usa2006P1.g The residue of
1 + k * tmodulop - Usa2006P1.fract_iff_mod The fractional part inequalities are equivalent to inequalities of residues
- Usa2006P1.mod_iff_not_dvd Core statement: suitable residues exist iff
sdoes not dividep - 1 - Usa2006P2.two_mul_sum_ge Documented declaration: two_mul_sum_ge
- Usa2006P2.two_mul_sum_le Documented declaration: two_mul_sum_le
- Usa2006P2.two_mul_sum_Icc_one Twice the sum `1 + 2 +
- Usa2006P2.usa2006_p2 We formalise "every subset of size k has sum at most N / 2" as
2 * ∑ x ∈ t, x ≤ N, which is equivalent for natural numbers - Usa2006P3.gpd The greatest prime divisor of an integer
m, with the conventiongpd (±1) = 1 - Usa2006P3.BddCond The condition that the sequence
p(f(n²)) − 2nis bounded above (and defined for everyn) - Usa2006P3.Classification The classification:
fis a nonzero constant times a (possibly empty) product of factors4X − a²withaan odd integer - Usa2006P3.Pbound An auxiliary formulation of boundedness: every prime divisor of
f(n²)is at most2n + B - Usa2006P3.bddCond_iff The two formulations of the boundedness condition agree
- Usa2006P3.pbound_of_classification The easy direction: every polynomial of the classified form satisfies the boundedness condition
- Usa2006P3.schur Schur's theorem: a nonconstant polynomial with integer coefficients takes some value divisible by a prime outside any given finite set of primes
- Usa2006P3.Fs The integer-valued function
Fs f t = 4^d · f(t²/4), whered = f.natDegree; the powers of4clear the denominators - Usa2006P3.exists_root_of_pbound If
fis nonconstant and satisfies the prime bound, thenfhas a root of the form(2k+1)²/4overℚ - Usa2006P3.isPrimitive_factor
4X − a²withaodd is a primitive polynomial overℤ - Usa2006P3.factor_dvd_of_root If
fhas the root(2k+1)²/4overℚ, then4X − (2k+1)²dividesfoverℤ(Gauss's lemma) - Usa2006P3.pbound_of_mul_factor The cofactor of a
4X − a²factor still satisfies the prime bound - Usa2006P3.classification_of_pbound Documented declaration: classification_of_pbound
- Usa2006P3.classification_iff_pbound The full classification, in the prime-bound formulation
- Usa2006P4.not_isSquare_five_nat
5is not the square of a natural number - Usa2006P4.rat_mul_self_ne_five
5is not the square of a rational number - Usa2006P4.sum_eq_sum_get Summing the entries of a list of rationals via
Fin-indexed access - Usa2006P4.prod_eq_prod_get Multiplying the entries of a list of rationals via
Fin-indexed access - Usa2006P4.prod_le_sum_div_pow AM–GM, raised to the
k-th power, for positive rationals indexed byFin k: the product is at most thek-th power of the arithmetic mean - Usa2006P5.nu The exponent of the largest power of
2dividing the integerx(the 2-adic valuation ofx) - Usa2006P5.ValidPath Documented declaration: ValidPath
- Usa2006P5.Reachable The frog can reach position
min exactlyjjumps starting from1 - Usa2006P5.minJumps The minimum number of jumps the frog needs to reach position
m - Usa2006P5.BigBound
BigBound m c x ssholds when every jump ofss(performed starting from positionx) that ends at a position greater thanchas length at most2 ^ m - Usa2006P5.filt Documented declaration: filt
- Usa2006P5.nu_eq_of The 2-adic valuation is characterized by divisibility
- Usa2006P5.nu_congr Shifting by a multiple of
2 ^ edoes not change the 2-adic valuation, as long as the valuation is smaller thane - Usa2006P5.ValidPath.pow_two Every jump of a valid path is a power of two
- Usa2006P5.eq_two_pow_of Documented declaration: eq_two_pow_of
- Usa2006P5.filt_valid The key validity lemma: after deleting jumps divisible by
2 ^ (e + 1)that land beyondc, the remaining path is still valid - Usa2006P5.filt_count Counting lemma: the total length deleted by
filtis a multiple of2 ^ (e + 1), and the number of deleted jumps equals that multiple - Usa2006P5.filt_lower Documented declaration: filt_lower
- Usa2006P5.filt_bigbound Transfer lemma: after
filthas removed the jumps of length2 ^ (e + 1), every remaining jump landing beyondchas length at most2 ^ e - Usa2006P5.base_prefix Base case of the main induction: if every jump landing beyond
2 ^ ihas length1, then some prefix of the path ends exactly at2 ^ i - Usa2006P5.key_lemma The main induction
- Usa2006P5.reachable_all_ones Every position
m ≥ 1is reachable, by jumping+1every time - Usa2007P1.s The partial sums `s n k = a n 0 + a n 1 +
- Usa2007P1.a The sequence of the problem, with indices shifted by one so that
a n 0 = n: fork ≥ 1,a n kis the unique integer in[0, k]for whichk + 1divides `s n k = a n 0 + - Usa2007P1.b The average `b n k = (a n 0 +
- Usa2007P1.sum_a The partial sums of
a nare indeed given bys n - Usa2007P1.dvd_sum_a
a nsatisfies the divisibility requirement of the problem statement - Usa2007P1.a_le
a nsatisfies the range requirement of the problem statement - Usa2007P3.exists_disjoint_family Any finite set
Swithk * n ≤ S.cardcontainskpairwise disjointn-element subsets (here1 ≤ n) - Usa2007P3.color_eq Documented declaration: color_eq
- Usa2007P3.main Documented declaration: main
- Usa2007P4.gridAdj Two cells of the integer lattice are adjacent when they share an edge, i.e. their Manhattan distance is
1 - Usa2007P4.gridGraph The infinite grid graph on
ℤ × ℤ: vertices are cells, edges join edge-adjacent cells - Usa2007P4.IsAnimal An animal is a nonempty finite set of cells whose induced subgraph of the grid graph is connected
- Usa2007P4.IsDinosaur A dinosaur is an animal with at least
2007cells - Usa2007P4.IsDinoPartition
partsis a partition of the animaldinto two or more dinosaurs: at least two pairwise disjoint dinosaurs whose union isd - Usa2007P4.IsPrimitive A dinosaur is primitive if its cells cannot be partitioned into two or more dinosaurs
- Usa2007P4.gridAdj_cases A cell adjacent to
ais one of its four neighbours - Usa2007P4.neighbors4 The explicit four-element finset of neighbours of a cell
- Usa2007P4.preconnected_of_forall_reachable If every cell of
Treaches a fixed cellv ∈ Tin the induced subgraph onT, then that subgraph is preconnected - Usa2007P4.dw The depth of a cell: length of a shortest walk from the root
rinsideD(defined to be0outsideD) - Usa2007P4.parent_exists Any cell
c ≠ rofDhas a neighbour of strictly smaller depth: the penultimate cell of a shortest walk fromrtoc - Usa2007P4.parent The parent map: for
c ∈ D,c ≠ ra chosen neighbour ofcof smaller depth; anything else is mapped to itself - Usa2007P4.exists_iterate_parent_eq_root Following parents from any cell of
Deventually reaches the root - Usa2007P4.subtree The subtree rooted at
v: all cells ofDwhose parent chain hitsv - Usa2007P4.children The children of
v: cells ofDwhose parent isv - Usa2007P4.subtree_eq The subtree of
vdecomposes asvtogether with the subtrees of its children - Usa2007P4.disjoint_subtree_children The subtrees of distinct children of
vare disjoint - Usa2007P4.card_subtree The size of a subtree is one more than the sum of the sizes of the subtrees of its children
- Usa2007P4.reachable_of_chain If the parent chain from
cstays insideTand reachesv, thencreachesvin the induced subgraph onT - Usa2007P4.isAnimal_subtree The subtree rooted at any cell of
Dis an animal - Usa2007P4.isAnimal_sdiff_subtree Removing a rooted subtree (with
v ≠ r) fromDleaves an animal - Usa2007P4.exists_split Splitting lemma
- Usa2007P4.crossAux The body of
cross, kept reducible so that membership and cardinality can be unfolded in the auxiliary lemmasmem_auxandcard_aux - Usa2007P4.cross The cross with center
(0,0)and four arms of length2006 - Usa2007P4.cross_def Unfolding lemma for
cross - Usa2007P4.mem_aux Coordinate characterization of membership in
crossAux - Usa2007P4.mem_cross_iff Coordinate characterization of membership in
cross - Usa2007P4.mem_cross_of_nat The four arm points at distance
nfrom the center lie incrosswhenn ≤ 2006 - Usa2007P4.reach_right Walking down the positive x-arm:
((n,0))reaches the center - Usa2007P4.reach_left Walking down the negative x-arm:
((-n,0))reaches the center - Usa2007P4.reach_up Walking down the positive y-arm:
((0,n))reaches the center - Usa2007P4.reach_down Walking down the negative y-arm:
((0,-n))reaches the center - Usa2007P4.InSameArm
blies in the same arm of the cross asa(meaningful whenais not the center) - Usa2007P4.inSameArm_of_gridAdj A step along the cross between two cells, the target not being the center, stays in the same arm
- Usa2007P4.inSameArm_walk Any walk inside a center-free subset of the cross stays in one arm
- Usa2007P4.answer The answer to USAMO 2007 Problem 4
- Usa2008P1.kseq Define the two main sequences
- Usa2008P1.quartic_polynomial_identity Main identity k₀k₁...kₙ - 1 = xₙ (xₙ + 1)
- Usa2008P1.kseq_succ_eq kₙ₊₁ = xₙ² - xₙ + 1
- Usa2008P1.gcd_quad_identity gcd(x² + x + 1, x² - x + 1) = 1
- Usa2008P1.gcd_quad_identity_nat we also need an ℕ version of the previous identity
- Usa2008P1.k_coprime_with_product kₙ₊₁ is coprime to the product k₀...kₙ
- Usa2008P1.k_are_coprime Show the main coprime lemma Strategy: kⱼ is coprime to product P := k₀...kⱼ₋₁, and kseq i divides that product
- Usa2008P3.rowK The half-width of the row of
S nat heighty: the row consists of the points(x, y)with|x| ≤ rowK n y - Usa2008P3.S The set
Sₙof the problem, namely the integer points(x, y)with|x| + |y + 1/2| < n - Usa2008P3.Adj Two lattice points are adjacent when their (Manhattan) distance is 1
- Usa2008P3.f The auxiliary potential: blue points are those with
f p ≡ 2n - 1 (mod 4) - Usa2008P3.blue The blue predicate
- Usa2008P3.chi The colour of a point as
±1(+1for blue,-1for red) - Usa2008P3.sig The sum of colours along a list of points
- Usa2008P3.b0 The number of blue points on the axis
y = 0in a list - Usa2008P3.GH The "good head" condition on a list: either the head is red, or it lies in
B₀(blue,y = 0) and the second point (if any) is red - Usa2008P3.adj_cases Adjacent points differ by a unit step in exactly one coordinate
- Usa2008P3.f_diff Along an edge,
fchanges by±2, except for the vertical pairs crossing the axisy = -1/2, where it does not change - Usa2008P3.blue_adj Two adjacent blue points form a vertical pair crossing the axis
- Usa2008P3.Icc_neg_eq_map The symmetric integer interval
[-K, K]as a map ofrange (2K+1) - Usa2008P3.row_sum The
±1alternating sum over a symmetric interval equals1(each row ofS nhas one more blue point than red points) - Usa2008P3.chi_eq The colour of
(x, y)as an explicit parity test - Usa2008P3.inner_sum The colour sum over the row at height
yequals1 - Usa2008P3.sum_chi There are
2nmore blue points than red points inS n - Usa2008P3.card_B0 Exactly
npoints ofS nare blue and lie on the axisy = 0 - Usa2008P3.path_bound Every path's colour sum exceeds its number of blue axial points by at most one; moreover, if the path has a "good head" (
GH), the sum is at most the count itself - Usa2008P3.usa2008_p3 USAMO 2008, Problem 3: any partition of
Sₙinto paths uses at leastnpaths - Usa2008P5.Step One legal operation of the game: choose two distinct positions
iandjwithr j ≤ r i, erase the numberr iand writer i - r jin its place - Usa2008P5.weight The weight of a coefficient vector: the sum of the absolute values
- Usa2008P5.move_lemma One step of the first phase of the strategy: if
r k ≤ r i, we may eraser iwritingr i - r k, and update the coefficients accordingly - Usa2008P5.phase1_pos Documented declaration: phase1_pos
- Usa2008P5.phase1_core The first phase of the strategy: as long as no coefficient is zero, there is a legal move after which the weight of the coefficients strictly decreases
- Usa2008P5.euclid The subtractive Euclidean algorithm on one pair of positions
- Usa2008P5.phase2 Documented declaration: phase2
- Usa2008P5.key The key lemma, proved by strong induction on the weight of the coefficient vector: one can always reach a board containing
0 - Usa2008P6.lap The Laplacian of the friendship graph as a
ZMod 2-linear map:(lap G x) v = deg(v) * x v + ∑_{u ∼ v} x u - Usa2008P6.degVec The degree vector, modulo 2
- Usa2008P6.ite_eq_one_add In
ZMod 2the indicator ofa = bequals1 + a + b - Usa2008P6.even_card_filter_iff The combinatorial condition "an even number of friends share the room of
v" is the linear equation(lap G x) v = deg(v)inZMod 2 - Usa2008P6.sum_neighbor_mul_comm Swapping the order of summation over ordered pairs of adjacent vertices
- Usa2008P6.lap_inner The Laplacian is symmetric with respect to the dot product
- Usa2008P6.inner_self_lap The key identity:
xᵀ (L x) = ∑ v, deg(v) * x voverZMod 2 - Usa2008P6.Tmap Pairing with
d, restricted to the kernel oflap G, as a linear map into the dual of the kernel - Usa2008P6.range_lap_le_ker_Tmap The range of
lap Gis contained in the "orthogonal complement" of its kernel - Usa2008P6.degVec_mem_ker_Tmap The degree vector is orthogonal to the kernel of
lap G - Usa2008P6.Tmap_surjective Every functional on the kernel of
lap Gis realized by a dot product: extend it by zero on a complement and read off the coordinates - Usa2008P6.range_lap_eq_ker_Tmap A symmetric matrix over
ZMod 2has range equal to the orthogonal complement of its kernel; here this is phrased viaTmap - Usa2008P6.exists_solution There is at least one valid room assignment
- Usa2008P6.solutionEquiv The valid assignments form a coset of the kernel of
lap G - Usa2009P2.IsGood A set of integers is called good if it does not contain three elements
a,b,c(not necessarily distinct) satisfyinga + b + c = 0 - Usa2009P2.injOn_min_sub The pairing map
x ↦ min x (c - x)is injective on any set containing no two elements summing toc: equality of the images forcesx = yorx + y = c - Usa2009P2.card_le_of_pair Pairing counting lemma
- Usa2009P2.card_le_case2 Case (ii) of the induction step: if both
2mand-(2m)lie inA(withm ≥ 1), thenAhas at most2melements - Usa2009P2.card_le_case3 Case (iii) of the induction step: if
2m,2m-1and-(2m-1)lie inAbut-(2m)does not (withm ≥ 1), thenAhas at most2melements - Usa2009P2.card_le_even The upper bound for even
n: any good subset of[-2m, 2m]has at most2melements, by strong induction onm - Usa2009P4.sum_mul_sum_inv_ge Cross-paired Cauchy–Schwarz: for any two distinct indices
pandq, the product(∑ aᵢ)(∑ 1/aᵢ)is bounded below by(√(a p / a q) + √(a q / a p) + (n - 2))² - Usa2009P4.entry_le_four_mul_entry Any entry is at most
4times any other entry - Usa2009P6.IsInt The predicate that a rational number is an integer
- Usa2009P6.IsInt.val_nonneg An integer has nonnegative
p-adic valuation - Usa2009P6.isInt_of_val_nonneg A rational number whose
p-adic valuation is nonnegative for every primepis an integer - Usa2009P6.isInt_of_mul_add_int Key integrality step: if
a * bandn * a + bare integers (withna nonzero integer), thenb(and hencen * a) is an integer - Usa2009P6.seqGcd The gcd of
|T 0|, |T 1|, ..., |T k| - Usa2009P6.gcd_seq Documented declaration: gcd_seq
- Usa2009P6.s_val_ge The key valuation bound: if
tⱼis a nonzero integer ofp-adic valuatione(the minimum among thet's), then everysᵢhasp-adic valuation at least-e - Usa2009P6.normalized The heart of the problem, for normalized sequences:
s a = t a = 0,s b = 1andt b = nfor a nonzero integern - Usa2010P2.Legal A sequence of permitted switches starting from configuration
e - Usa2010P2.evPairs The sequence of pairs of students that switch places: each entry is
(student in front, student behind), with front rank<behind rank - Usa2010P2.StateA The cyclic-order state of a triple of students: going backwards from
awe meetbbefore meetingc - Usa2010P2.stateA_of_pair L1: if
bis directly behinda, then going backwards fromawe meetbbefore any third studentc - Usa2010P2.not_stateA_of_pair L2: if
bis directly behindc, the triple is not in state A - Usa2010P2.not_stateA_swap L3: after
b(behind) anda(front) switch, the triple is not in state A - Usa2010P2.stateA_swap L4: after
b(behind) andc(front) switch, the triple is in state A - Usa2010P2.stateA_swap_iff L5: a permitted switch that involves neither the pair
(a, b)nor the pair(c, b)preserves the cyclic-order state of the triple{a, c, b} - Usa2010P2.fsucc The student of rank one higher than
a(well-defined whenais not the tallest student) - Usa2010P2.evPairs_le Every recorded switch has front rank + 2 ≤ behind rank
- Usa2010P2.evPairs_lt Every recorded switch has front rank < behind rank
- Usa2010P2.length_eq_sum_count The length of a list of pairs with
fst < sndequals the sum of the counts over all such pairs - Usa2010P2.alternation The key alternation lemma
- Usa2010P2.count_bound The number of times a fixed pair of students
(a, b)can switch is at mostb.val - a.val - 1 - Usa2010P2.usa2010_p2 USAMO 2010 Problem 2
- Usa2010P3.prod_range_pair Split a product over
Finset.range (2 * n)into a product of consecutive pairs - Usa2010P3.mul_sqrt_eq_sqrt_mul For
0 ≤ Cand0 ≤ Z:C * √Z = √(C² * Z) - Usa2010P3.key₁ Key inequality for the "even index, odd index" case: the difference factors as
(q - p) * (4 * (p + 1) * (q + 1) - (2 * p + 1) ^ 2), which is nonnegative for0 ≤ p ≤ q - Usa2010P3.key₂ Documented declaration: key₂
- Usa2010P3.key₃ Key inequality for the "even index, even index" case
- Usa2010P3.key₄ Key inequality for the "odd index, odd index" case (AM–GM)
- Usa2010P3.constr The extremal sequence (zero-based): at index
2kthe value is(4k+3) / (2 * √(k+1)), and at index2k+1it is2 * √(k+1) - Usa2010P3.constr_pair The product of two consecutive terms is exactly
4k + 3 - Usa2010P3.ineq_ee Validity of the construction: case both indices even
- Usa2010P3.ineq_eo Validity of the construction: case even index, odd index
- Usa2010P3.ineq_oe Validity of the construction: case odd index, even index
- Usa2010P3.ineq_oo Validity of the construction: case both indices odd
- Usa2010P3.constr_ineq The construction satisfies
aᵢaⱼ ≤ (i+1) + (j+1)for alli < j - Usa2010P5.sum_range_triple Summation of three consecutive terms in blocks of three: the sum of
f (3i+2) + f (3i+3) + f (3i+4)overi ∈ range tequals the sum off joverj ∈ Icc 2 (3t+1) - Usa2010P5.sum_one_div_eq_div_prod A sum of reciprocals as a single fraction with the product of all denominators as denominator
- Usa2010P6.ValidErase A choice of integers to erase is valid if no two erased integers sum to zero
- Usa2010P6.score The score obtained by erasing the set
Tfrom the boardL: one point for each ordered pair with at least one erased entry - Usa2010P6.ValidBoard A valid board: 68 ordered pairs of nonzero integers such that for no
kdo both(k, k)and(-k, -k)appear - Usa2010P6.N The maximum score the student can guarantee
- Usa2010P6.qProb The probability weight: rational
309/500approximating(√5-1)/2, satisfyingq² + q ≤ 1and68 * q > 42 - Usa2010P6.w weight of a strategy
t(the set of vertices where we pick the "a" side) - Usa2010P6.cond_weight Conditional marginal: total weight of strategies containing all of
S₀and disjoint fromS₁, whenS₀ ∩ S₁ = ∅ - Usa2010P6.total_weight total weight = 1
- Usa2010P6.V The set of absolute values appearing on the board
- Usa2010P6.nV number of distinct absolute values
- Usa2010P6.kE enumeration of the absolute values
- Usa2010P6.aE the "a" side representative: if the negative loop
(-k,-k)appears, we take-kas the representative (making all loops "positive"); otherwisek - Usa2010P6.Tof the erased set for strategy
t - Usa2010P6.L0 The extremal board: five loops
(i,i)for eachi ∈ {1,…,8}and one negative edge(-i,-j)for each1 ≤ j < i ≤ 8(aK₈on the negative side) - Usa2010P6.upperLoopList The loop part of
L0: five loops (i,i) for each i ∈ {1,…,8} - Usa2010P6.upperNegList The negative part of
L0: one edge (-i,-j) for each 1 ≤ j < i ≤ 8 - Usa2010P6.upper_sum_map_range Bridge between
List.sumoverList.rangeandFinset.sumoverFinset.range - Usa2010P6.upper_filter_length_eq_card For a list without duplicates, the length of a filtered list equals the cardinality of the corresponding filtered finset
- Usa2010P6.upper_mem_loopList Elements of the loop part of
L0are diagonal pairs (i+1, i+1) with i < 8 - Usa2010P6.upper_not_mem_negList_diag No diagonal pair (k,k) occurs in the negative part of
L0: its entries (-(i+1), -(j+1)) always have j < i, hence distinct components - Usa2010P6.upper_card_choose_le Documented declaration: upper_card_choose_le
- Usa2010P6.upper_loopScore The loop part contributes exactly
5 * a, whereacounts the indices i ∈ {1,…,8} with i ∈ T - Usa2010P6.upper_negUnscored The number of unscored negative edges is at least
a choose 2: for each i ∈ A, all edges (-(i+1), -(j+1)) with j ∈ A, j < i are unscored - Usa2010P6.upper_arith Case check: for a ≤ 8,
5a + 28 - a(a-1)/2 ≤ 43 - Usa2011P1.AMGM AM-GM: yz/x² + xz/y² + xy/z² ≥ 3 when x,y,z > 0
- Usa2011P2.Config A configuration of the game: an integer at each vertex of the pentagon
- Usa2011P2.Reachable Reachability of configurations
- Usa2011P2.WinAt The game is won at vertex
vfrom the configurationaif the configuration with value 2011 atvand 0 at the other four vertices is reachable froma - Usa2011P2.invariant The invariant of the game: the weighted sum of the values, where the value at vertex
ihas weighti - Usa2011P2.key_identity The key identity behind the invariance of
invariant: the weight of a turn at edgei, i + 1isi + (i + 1) = 2 * (i + 3) - 5 - Usa2011P2.invariant_eq_of_reachable The invariant is preserved by any sequence of turns
- Usa2011P2.invariant_single The invariant of the configuration won at vertex
v; since2011 ≡ 1 (mod 5), it equalsv - Usa2011P2.win_at_zero The core existence lemma: a configuration with sum 2011 and vanishing invariant can be won at vertex 0
- Usa2011P6.sum_card_filter_comm Documented declaration: sum_card_filter_comm
- Usa2011P6.card_powersetCard_filter_mem Documented declaration: card_powersetCard_filter_mem
- Usa2011P6.card_powersetCard_filter_mem₂ Documented declaration: card_powersetCard_filter_mem₂
- Usa2011P6.sum_multiplicity The sum of the multiplicities of the elements of the union equals the sum of the sizes of the eleven sets,
11 * 45 = 495 - Usa2011P6.sum_inter_card The sum of the intersection sizes over all ordered pairs of indices equals
11 * 45 + 11 * 10 * 9 = 1485 - Usa2011P6.sum_sq_multiplicity_eq The sum of the squares of the multiplicities equals the sum of the intersection sizes over all ordered pairs of indices
- Usa2011P6.sum_sq_multiplicity The sum of the squares of the multiplicities equals
11 * 45 + 11 * 10 * 9 = 1485 - Usa2012P1.IsAcuteTriple Documented declaration: IsAcuteTriple
- Usa2012P1.IsGood Documented declaration: IsGood
- Usa2012P1.sq_add_sq_le_of_not_isAcuteTriple For a sorted triple
x ≤ y ≤ zof positive reals, failing to be the side lengths of an acute triangle impliesz ^ 2 ≥ x ^ 2 + y ^ 2 - Usa2012P1.sq_lt_fib The Fibonacci numbers outgrow the squares from index 13 on
- Usa2012P1.fib_mul_sq_le Documented declaration: fib_mul_sq_le
- Usa2012P1.isGood_of_thirteen_le Every
n ≥ 13has the required property - Usa2012P1.counterexSeq The counterexample for
n ≤ 12: the numbers√F₁, √F₂, ...whereFis the Fibonacci sequence - Usa2012P1.not_isGood_of_le_twelve No
nwith3 ≤ n ≤ 12has the required property - Usa2012P2.arcDist The arc distance between two of the 432 points: the number of unit arcs in the shorter of the two arcs joining them
- Usa2012P2.arcDist_add Arc distance is invariant under rotations
- Usa2012P2.disjoint_color Different color classes are disjoint
- Usa2012P2.exists_rotation Pigeonhole over rotations
- Usa2012P3.mulSeq A completely multiplicative sequence built from values assigned on a finite set of primes:
mulSeq P c j = ∏ r ∈ P, c r ^ (Nat.factorization j r) - Usa2012P3.condition_of_sum_eq_zero If the sum
∑ j ∈ [1, n], j * a jvanishes for a completely multiplicative sequencea, thenasatisfies all the required identities - Usa2012P3.bezout_nonzero Bézout's identity, arranged so that both coefficients are nonzero
- Usa2012P3.not_property_two The case
n = 2is impossible: the relationa k + 2 * a (2 * k) = 0forces2 ^ j ∣ a 1for everyj, soa 1 = 0 - Usa2012P3.cfun The coefficient function assigning
xtop,ytoq, and1to everything else - Usa2012P3.term_eq_zero Terms
j * (a j - 1)vanish whenj ∈ [1, n]is none ofp, 2p, 3p, q: such ajis divisible by neitherpnorq, soa j = 1 - Usa2012P3.sum_mulSeq_cfun_sub_one The correction terms in
∑ j ∈ [1,n], j * (a j - 1): the only nonzero contributions come fromj ∈ {p, 2p, 3p, q} ∩ [1, n] - Usa2012P3.exists_good_seq_of_nine_le Documented declaration: exists_good_seq_of_nine_le
- Usa2012P3.small_case The small cases
3 ≤ n ≤ 8, each given by an explicit completely multiplicative sequence - Usa2012P4.IsSolution The conditions of the problem on a function
f : ℕ → ℕ - Usa2012P4.eq_one_or_two_of_factorial_eq_self If a positive integer equals its own factorial, then it is
1or2 - Usa2012P4.lt_of_dvd_factorial_sub If
d ≥ 2divides `(t ! - Usa2012P4.iterFac Iterated factorials starting at
3:iterFac 0 = 3anditerFac (r + 1) = (iterFac r)! - Usa2012P4.f_iterFac Every iterated factorial of
3is a fixed point off, oncef 3 = 3 - Usa2012P4.eq_one_const_of_f_two_eq_one Case
f 2 = 1: thenfis identically1on positive integers - Usa2012P4.eq_two_const_of_f_one_two_eq_two Case
f 1 = f 2 = 2: thenfis identically2on positive integers - Usa2012P4.eq_id_of_f_one_eq_one Case
f 1 = 1andf 2 = 2: thenfis the identity on positive integers - Usa2012P4.solution_set The answer: the constant functions
1and2, and the identity (on positive integers) - Usa2012P6.equality_cases Equality holds iff
xis a permutation of(1 / √2, -1 / √2, 0, ..., 0)andλ = 1 / √2 - Usa2012P6.card_powerset_filter_subset The number of subsets of
scontaining a fixed sub-finsettis2 ^ (s.card - t.card) - Usa2012P6.two_pow_sub Bridge between natural-number powers
2 ^ (n - k)and integer powers(2 : ℝ) ^ ((n : ℤ) - k) - Usa2012P6.sum_subsetSum_sq Master identity: the sum of
S_A ^ 2over all subsetsAequals2 ^ (n - 2) - Usa2012P6.sum_pos_subsetSum_sq Pairing each subset with its complement: the sum of
S_A ^ 2over the subsets with positive sum equals2 ^ (n - 3) - Usa2012P6.subsetSum_eq_of_card_eq Forward direction of the equality case: if equality holds, then every positive subset sum equals
λ - Usa2012P6.equality_case_of_card_eq Forward direction of the equality case: if equality holds, then
xis a permutation of(1 / √2, -1 / √2, 0, ..., 0)andλ = 1 / √2 - Usa2012P6.card_eq_of_equality_case Backward direction of the equality case: if
xis a permutation of(1 / √2, -1 / √2, 0, ..., 0)andλ = 1 / √2, then equality holds - Usa2013P2.ColSeq A sequence of
n+1columns, each column one of the three symbols ofFin 3(0 = u,1 = v,2 = w) - Usa2013P2.AdjDistinct Adjacent columns are distinct
- Usa2013P2.countCol The number of column sequences of length
n+1with distinct adjacent columns starting withsand ending witht - Usa2013P2.a Documented declaration: a
- Usa2013P2.permEquiv Relabeling columns by a permutation of
Fin 3does not change the counts - Usa2013P2.card_eq_swap Swapping two column symbols does not change the counts
- Usa2013P2.dropLastEquiv Deleting the last column: sequences of length
n+2ending intcorrespond to sequences of lengthn+1ending in somer ≠ t - Usa2013P2.countCol_succ The count recurrence obtained from
dropLastEquiv - Usa2013P2.card_drop_ne Dropping a decidable side condition from a column count
- Usa2013P2.card_eq_zero_of_ne A column count with contradictory side conditions is zero
- Usa2013P2.x_succ First recursion:
x_{n+1} = y_n + x_n - Usa2013P2.y_succ Second recursion:
y_{n+1} = 2 * x_n - Usa2013P2.x_zero Base value: there is no sequence starting with
uand ending withvwhenn = 0 - Usa2013P2.y_zero Base value: exactly one sequence starts and ends with
wwhenn = 0 - Usa2013P2.two_x_add_y The total number of sequences with fixed first column:
2 * x_n + y_n = 2^n - Usa2013P2.key The key identity:
a_{n+1} + a_n = 2 ^ (n+1) - Usa2013P3.Token The tokens are indexed by pairs
(a, b)of natural numbers witha + b < n - Usa2013P3.Moves A choice of lines to flip: for each of the three directions and each
i < n, whether thei-th line in that direction is flipped - Usa2013P3.applyMoves Documented declaration: applyMoves
- Usa2013P3.Admissible A configuration is admissible if it can be obtained from the initial configuration by a finite number of operations
- Usa2013P3.weight The number of operations in a
Moves: the total number of flipped lines - Usa2013P3.f
f Cis the smallest number of operations required to obtainC - Usa2013P3.Moves.vxor Pointwise xor of two
Moves - Usa2013P3.e The "even-length line" indicator: the
i-th line of any direction containsn - itokens, which is even iffi ≡ n (mod 2) - Usa2013P3.sp The element of the move-span indexed by three bits
- Usa2013P3.theta_aux The key property of
θ = (e,e,e): every token lies on an even number of even-length lines - Usa2013P3.applyMoves_sp Every element of the span acts trivially on configurations
- Usa2013P3.sp_vxor The span elements are closed under xor, componentwise on the bits
- Usa2013P3.zeroMove The zero move
- Usa2013P3.Count.card_filter_range_periodic Count of a periodic (period 4) predicate over
Finset.range (4 * k + r) - Usa2013P3.Count.card_fin_filter Bridge: counting a
ℕ-predicate onFin nvs onFinset.range n - Usa2013P3.Count.count_eval Combined: count of a 4-periodic predicate over
Fin (4 * k + r) - Usa2013P3.Count.card_range_modeq Number of
i < nwithi % 2 = n % 2 - Usa2013P3.bv Documented declaration: bv
- Usa2013P3.pon Number of ones of
αon odd-length lines - Usa2013P3.qon Number of ones of
αon even-length lines - Usa2013P3.Ocard Number of odd-length lines in one direction
- Usa2013P3.Ecard Number of even-length lines in one direction
- Usa2013P3.card_e_true Counting ones of
α ^^ con the even-length lines - Usa2013P3.card_e_false Counting ones of
α ^^ con the odd-length lines - Usa2013P3.bv_eq Master formula for the block values
- Usa2013P3.bv_ff The four block values
- Usa2013P3.pair_id Pair identity: the two values obtained by flipping a whole direction sum to
n - Usa2013P3.weight_vxor_sp The weight of a coset element splits into the three block values
- Usa2013P3.sum_weights The weights of the eight coset elements sum to
12n - Usa2013P3.pair_weight_y Pairing to isolate the
y-block - Usa2013P3.pair_weight_z Pairing to isolate the
z-block - Usa2013P3.graph_of Documented declaration: graph_of
- Usa2013P3.upper_bound The upper bound: every coset contains an element of weight at most
6 * (n / 4) + n % 4 - Usa2013P3.lt_n2 Proof-producing helpers for token indices (kept as term-mode applications so that indices are syntactically reproducible)
- Usa2013P3.convFin Converting between
Fin nindices with equal values - Usa2013P3.kernel_of_reduction Documented declaration: kernel_of_reduction
- Usa2013P3.kernel_eq_span The kernel classification: a move that flips every token an even number of times is one of the eight span elements
- Usa2013P3.P12 The four line-flipping patterns used for the extremal configuration: flip the lines whose index is
1or2modulo4 - Usa2013P3.P03 Indices
0or3modulo4 - Usa2013P3.P23 Indices
2or3modulo4 - Usa2013P3.P01 Indices
0or1modulo4 - Usa2013P3.v0of Moves built from three periodic patterns
- Usa2013P3.pon_eval Evaluating
ponof a pattern move - Usa2013P3.qon_eval Evaluating
qonof a pattern move - Usa2013P3.lower_bound The lower bound: an explicit move all of whose coset elements have weight at least
6 * (n / 4) + n % 4 - Usa2013P3.f_le
f Cis at most the weight of any move producingC - Usa2013P3.f_spec The minimum is attained: some move produces
Cwith weightf C - Usa2013P3.f_le_answer The upper bound for
f - Usa2013P3.answer_le_f The lower bound for
f: some admissible configuration needs at leastanswer noperations - Usa2013P4.Distinguished Documented declaration: Distinguished
- Usa2013P4.key_identity The key algebraic identity: the difference between
(1+u)(1+(1+v)(1+w))and(√u + √v + √w)²is a sum of two squares - Usa2013P4.eq_conds Equality conditions: if
(1+u)(1+(1+v)(1+w)) = (√u + √v + √w)²for nonnegativeu, v, w, thenv * w = 1andu * (√v + √w)² = 1 - Usa2013P4.min_eq_of_conds The conditions
v * w = 1andu * (√v + √w)² = 1imply the equation, with the minimum attained at the term corresponding tou - Usa2013P4.solution_of_conds Backward direction for one distinguished coordinate: the conditions
v * w = 1andu * (√v + √w)² = 1implyu, v, w > 0and the equation - Usa2013P5.digitCount Documented declaration: digitCount
- Usa2013P5.mod_pow_div_mod The
j-th decimal digit ofxonly depends onx % 10^(j+1), hence takingxmodulo a higher power of10does not change that digit - Usa2013P5.digitCount_mul_ten_mod Multiplication by
10modulo10^t - 1rotates the (padded)t-digit representation ofxby one place, so it preserves all digit counts - Usa2013P5.digitCount_pow_ten_mul_mod Iterating the one-place rotation: multiplication by
10^emodulo10^t - 1preserves all digit counts - Usa2013P5.count_digits_eq_digitCount For a nonzero digit
d, the number of occurrences ofdin the decimal representation ofxequalsdigitCount t x dwhenevertis large enough - Usa2014P1.construction_for_16 For construction, set all roots to 1 and check it gives 16
- Usa2014P1.vieta Vieta formulas for b and d (we don't actually need them for a and c)
- Usa2014P1.main_bound Now use Vieta relation to prove the key bound
- Usa2014P3.f Our construction (valid for x ∈ ℝ) is P_x := (x-2014/3, (x-2014/3)^3)
- Usa2014P3.f_injective f is in an injective function (needed for Finset later)
- Usa2014P4.Cell A cell of the hexagonal grid, given in axial coordinates
- Usa2014P4.offsets The six unit steps between adjacent cells of the grid
- Usa2014P4.Adj Two cells are adjacent when their difference is one of the six unit steps
- Usa2014P4.Dirs The three (undirected) line directions of the grid
- Usa2014P4.step The cell reached from
pby makingisteps in directiond - Usa2014P4.Winning
Ahas won on the boards: some line ofkconsecutive cells all carry a counter - Usa2014P4.AMove A move of player
A: place counters on two empty adjacent cells - Usa2014P4.BMove A move of player
B: remove one counter from the board - Usa2014P4.AForce
AForce k smeans that from the boards, withAto move,Acan force a win in finitely many moves regardless of howBplays - Usa2014P4.ACanWin
Acan win the game with parameterkin finitely many moves - Usa2014P4.shaded The shading of the grid used in
B's defense strategy fork = 6: every third cell is shaded - Usa2014P4.mem_offsets Membership in
offsetsas an explicit case distinction - Usa2014P4.mem_Dirs Membership in
Dirsas an explicit case distinction - Usa2014P4.adj_not_both_shaded Adjacent cells are never both shaded: adjacent cells have different colors
- Usa2014P4.step_eq_of_eq The cells of a line are distinct
- Usa2014P4.two_shaded_of_line Any six consecutive cells in a line contain two distinct shaded cells
- Usa2014P4.not_ACanWin_six Player
Bhas a strategy preventingAfrom ever getting six consecutive cells in a line:Balways removes a counter on a shaded cell - Usa2014P4.winning_of_neg A line traversed in the opposite direction is still a line
- Usa2014P4.AForce_image Generic transport of
AForcealong a map preserving the game structure - Usa2014P4.rot Rotation by 60 degrees about the origin
- Usa2014P4.AForce_image_rotpow Rotation by an arbitrary multiple of 60 degrees
- Usa2014P4.transl Translation by a fixed cell
- Usa2014P4.mirror The point reflection swapping the two distinguished cells
x₀ = (1, 0)andy₀ = (4, 0)of the strategy below - Usa2014P4.x₀ The first distinguished cell of the strategy
- Usa2014P4.y₀ The second distinguished cell of the strategy
- Usa2014P4.xSlots The neighbor slots of
x₀(other than(0, 0)and the central cell(2, 0)) that the strategy fills one by one - Usa2014P4.ySlots The neighbor slots of
y₀(other than(5, 0)and the central cell(3, 0)) that the strategy fills one by one - Usa2014P4.winning_row0 Five consecutive cells on the first axis give a win
- Usa2014P4.winning_diag The diagonal line through
(1, 1)in direction(1, -1) - Usa2014P4.win_now0 Completing the first five cells of row 0 wins immediately
- Usa2014P4.win_now1 Completing the cells
(1, 0)to(5, 0)of row 0 wins immediately - Usa2014P4.endgame_x_Bturn The endgame position with
x₀completely surrounded and filled: whatever counterBremoves,Awins - Usa2014P4.endgame_y_Bturn The mirrored endgame with
y₀completely surrounded and filled - Usa2014P4.midphase The midgame invariant: with
(0, 0)and(5, 0)occupied, exactly one ofx₀,y₀missing, and the filled neighbor slotsNx ⊆ xSlots,Ny ⊆ ySlots,Acan force a win - Usa2014P4.canonical_pair With counters on two adjacent cells of a line,
Aplaces the mirror pair two spaces down the same line, reaching the midgame invariant - Usa2014P4.adjacent_pair With two counters on adjacent cells,
Awins (transport of the canonical configuration along a grid symmetry) - Usa2014P4.ACanWin_five
Awins fork = 5, following the official solution: after two rounds a pair of adjacent counters remains, from which the strategy above wins - Usa2014P4.AForce_mono If
Acan force a win with targetl,Acan also force a win with any smaller targetk ≤ l(a line oflconsecutive cells contains a line ofk) - Usa2014P6.sum_range_one_div_le_aux Dyadic bound for harmonic sums: the sum of
1/(k+1)fork < 2^m - 1is at mostm - Usa2014P6.sum_Icc_one_div_le_clog The harmonic sum
∑ k ∈ Icc 1 M, 1/kis at mostNat.clog 2 (M + 1) - Usa2014P6.primesum_inv_sq_le The sum of
1/p^2over the primesp ≤ Mis bounded away from1/2(with room to spare for lower order terms) - Usa2014P6.card_filter_dvd_le The number of
i < Nwithp ∣ a + iis at mostN / p + 1, as a rational inequality - Usa2014P6.two_hundred_mul_succ_le_pow Auxiliary exponential bound used in the estimate
100 * clog 2 (n^2) ≤ n - Usa2014P6.hundred_clog_le For
n ≥ 2^15andM + 1 ≤ n^2we have100 * Nat.clog 2 (M + 1) ≤ n - Usa2014P6.pow_gt_final The final numerical inequality: for
n ≥ 2^15,(n^2/1000)^((n+3)/2) > (n/65536)^n + n - Usa2014P6.row_bound Documented declaration: row_bound
- Usa2015P3.Coloring A coloring of the subsets of
Fin n;truemeans blue,falsemeans red - Usa2015P3.blueCard
blueCard c Tis the number of subsets ofTthat are colored blue byc; this is the functionfof the problem statement - Usa2015P3.IsValid A coloring is valid if it satisfies the multiplicative condition of the problem
- Usa2015P3.ValidColorings The colorings that the problem asks to count
- Usa2015P3.X The intersection of all blue sets of a coloring
- Usa2015P3.B The elements
ioutsideX csuch thatX c ∪ {i}is blue - Usa2015P3.blueCard_ne_zero_inter If two sets contain a blue subset each, so does their intersection
- Usa2015P3.blueCard_ne_zero_inter_all The intersection of a nonempty family of sets each containing a blue subset itself contains a blue subset
- Usa2015P3.blueCard_ne_zero_X The intersection
X cof all blue sets contains a blue subset - Usa2015P3.X_blue The intersection
X cof all blue sets is itself blue - Usa2015P3.blueCard_X
X cis the only blue subset of itself - Usa2015P3.blueCard_union Multiplicativity of
blueCardover pairs of sets whose intersection isX c - Usa2015P3.blueCard_singleton
X c ∪ {i}has one blue subset if it is red (X citself) and two if it is blue - Usa2015P3.blueCard_prod
blueCardis multiplicative over the elements of a set disjoint fromX c - Usa2015P3.blueCard_pow For
Udisjoint fromX c, the number of blue subsets ofX c ∪ Uis a power of two determined by which of theX c ∪ {i}are blue - Usa2015P3.blue_of_mem_interval Every set in the interval
[X c, X c ∪ B c]is blue - Usa2015P3.interval_of_blue Every blue set lies in the interval
[X c, X c ∪ B c] - Usa2015P3.blue_iff A nontrivial valid coloring is exactly the interval
[X c, X c ∪ B c] - Usa2015P3.colorOf The coloring whose blue sets are exactly the sets
TwithX₀ ⊆ T ⊆ X₀ ∪ B₀ - Usa2015P3.DisjointPairs The type of disjoint pairs
(X₀, B₀)of finsets ofFin n; these parametrize the nontrivial valid colorings - Usa2015P3.X_colorOf The blue interval
[X₀, X₀ ∪ B₀]of a disjoint pair determines a valid coloring, and conversely every nontrivial valid coloring arises this way - Usa2015P3.fromColoring The map from a valid coloring to its parametrizing data:
nonefor the all-red coloring, and the disjoint pair(X c, B c)otherwise - Usa2015P3.toColoring The valid coloring associated to a parameter: the all-red coloring for
none, and the interval coloringcolorOf X₀ B₀for a disjoint pair(X₀, B₀) - Usa2015P3.mainEquiv The valid colorings are in bijection with the parameters
- Usa2015P3.disjointPairEquiv Disjoint pairs of finsets of
Fin ncorrespond to ternary functions: each element is inX₀, inB₀, or in neither - Usa2015P4.Piling A way of piling stones on the
n × ngrid is a multiset of(row, column)pairs, one pair per stone - Usa2015P4.StoneMove A single stone move: two stones lying in distinct rows and distinct columns swap their columns
- Usa2015P4.EquivPilings Two pilings are equivalent if they are related by a sequence of stone moves
- Usa2015P4.StoneMove.fst The multiset of rows is invariant under a single stone move
- Usa2015P4.StoneMove.snd The multiset of columns is invariant under a single stone move
- Usa2015P4.StoneMove.cons A stone move can be performed in the presence of an extra fixed stone
- Usa2015P4.EquivPilings.fst The multiset of rows is invariant under equivalence of pilings
- Usa2015P4.EquivPilings.snd The multiset of columns is invariant under equivalence of pilings
- Usa2015P4.EquivPilings.cons Equivalent pilings remain equivalent after adding an extra fixed stone
- Usa2015P4.equivPilings_of_signature The hard direction: two pilings with the same signature (the same multiset of rows and the same multiset of columns) are equivalent
- Usa2015P4.pilingOf Every signature is realized by at least one piling: sort the rows and the columns and pair them up
- Usa2015P4.pilingSetoid The equivalence relation on pilings of
mstones, as aSetoid - Usa2015P4.quotientEquivSignatures The non-equivalent pilings of
mstones are in bijection with the pairs(X, Y)of multisets of rows and columns of sizem - Usa2015P6.sum_Icc_one_eq_sum_range_add Rewrite a sum over
Finset.Icc 1 nas a sum overFinset.range n - Usa2015P6.sum_elements_sub_card Abel summation identity: the sum of the elements of the multiset
Anot exceedingnequalsn + 1times their number minus the sum of the counts - Usa2015P6.harmonic_large The partial sums of the harmonic series grow past any bound
- Usa2015P6.recurrent_averages_absurd Core analytic lemma
- Usa2016P1.HasChain Documented declaration: HasChain
- Usa2016P1.witness An explicit chain of 100 subsets of an 8-element set
- Usa2016P1.hasChain_eight The explicit witness verifies that
HasChain 8holds - Usa2016P1.not_hasChain_of_le_six Any chain on an
n-element set uses at most2 ^ n - 1nonempty subsets, son ≤ 6is impossible since2 ^ 6 - 1 < 100 - Usa2016P1.not_hasChain_seven The main combinatorial estimate: no chain exists on a 7-element set
- Usa2016P2.period_mul If
Fis periodic with periodq, then it is also periodic with perioda * q - Usa2016P2.sum_range_period_mul The sum of a
q-periodic function overrange (a * q)splits intoacopies of the full-period sum - Usa2016P2.sum_range_period The sum of a
q-periodic function overrange (a * q + b)splits into full periods plus a remainder sum - Usa2016P2.sum_range_period_shift The sum of a
q-periodic function over one full period is shift invariant - Usa2016P2.sum_range_mod_add_ge For
b ≤ qandm ≤ q, the sum ofioverrange bis at most the sum of(i + m) % q - Usa2016P2.sum_mod_le_sum_add_mod The sum of the remainders of
0, 1, …, k-1moduloqis at most the sum of the remainders ofn, n+1, …, n+k-1moduloq - Usa2016P2.sum_add_div_le For each
q > 0,∑ j ∈ range k, (j + k) / q ≤ k ^ 2 / q + ∑ j ∈ range k, j / q - Usa2016P4.ha_zero if a ≠ 0 and f a = 0 then wlog a > 0
- Usa2016P4.f_eq_zero_if_not_sq The main part, proving that if there is some nonzero a such that f a = 0 then we must have f b = 0 for all b
- Usa2016P6.Arrangement An arrangement of the
2ncards: the label shown at each position - Usa2016P6.Arrangement.Valid An arrangement is valid when each of the
nlabels appears exactly twice - Usa2016P6.Observation An observation made by the player: the set of queried positions, together with the labels that were revealed (
noneoutside the queried set) - Usa2016P6.Strategy A player strategy: from the list of past observations, choose the next set of positions to query
- Usa2016P6.Strategy.Valid A strategy is valid for the parameter
kif it always queries exactlykcards - Usa2016P6.reveal The revealed labels, hidden (
none) outside the queried set - Usa2016P6.Wizard A wizard: an initial arrangement of the cards, and a way to permute the queried cards after each unsuccessful query
- Usa2016P6.Wizard.Valid A wizard plays legitimately if the initial arrangement has two cards of each label and each permutation only moves the currently queried cards
- Usa2016P6.PlayState The state of play: the current arrangement, the past observations, and whether the player has already won
- Usa2016P6.step One round of the game
- Usa2016P6.play The state after
mrounds of play - Usa2016P6.Winnable The game is winnable if some valid strategy guarantees a win within
mmoves against every legitimate wizard - Usa2016P6.obsValues The labels revealed in an observation on a given set of positions
- Usa2016P6.window The window of
kconsecutive positions starting atj(the empty set if it does not fit) - Usa2016P6.midWindow The
k - 1positions strictly betweeniandi + k(the empty set if they do not fit) - Usa2016P6.labelAt The label the player can deduce at position
i, computed from observationsiandi + 1(junk value0when those observations are not available) - Usa2016P6.posOf The position in the row corresponding to a deduced-label index
- Usa2016P6.pairSet A set of
kpositions containing the two given (distinct) positions - Usa2016P6.winStrat The winning strategy: slide a window of
kpositions across the row, then query two positions that are known to carry the same label - Usa2016P6.slideStrat The winning strategy specialized to
k < n - Usa2016P6.slide_play_facts Facts about the play of the sliding strategy, while no win has occurred
- Usa2016P6.slide_arr_step The arrangement one step later, while no win has occurred
- Usa2016P6.slide_arr_frozen Once determined, the label at position
xnever changes again - Usa2016P6.slide_labelAt_eq The label computed from the observations is the actual label
- Usa2016P6.slideStrat_wins The sliding strategy wins within
2n - k + 2moves - Usa2016P6.initEquiv₁ The equivalence between the first query and the labels
- Usa2016P6.initEquiv₂ The equivalence between the complement of the first query and the labels
- Usa2016P6.initArr The wizard's initial arrangement: a bijection of each of
σ []and its complement onto the labels - Usa2016P6.permOf The permutation the wizard uses in response to the query
σ l: it keeps the next query free of matches - Usa2016P6.wizArrAux Auxiliary for
wizArr, recursing on the reversed history - Usa2016P6.wizArr The arrangement after the given history, when the wizard plays
permOf - Usa2016P6.evasiveWizard The wizard that evades the player forever when
k = n - Usa2016P6.evasiveHist The history after
jrounds against the evasive wizard - Usa2016P6.evasive_inv The invariant maintained by the evasive wizard: the current arrangement is valid, and injective both on the last query and on the next query
- Usa2016P6.evasive_play Playing against the evasive wizard, the player never wins
- Usa2016P6.not_winnable_of_eq When
k = n, no strategy can guarantee a win: the game is not winnable - Usa2017P2.invPair The
A-inversion relation on a pair of entries:xis the left entry (at positioni, with thresholdc = a_i) andyis the right entry - Usa2017P2.ainvCount The number of
A-inversions of the permutationσ - Usa2017P2.genFun The generating function
∑ σ, X ^ (ainvCount m A σ)of theA-inversion statistic - Usa2017P2.qq The geometric sum
1 + X + ⋯ + X^(t-1) - Usa2017P2.valMul The multiset of values of the entries
- Usa2017P2.eCnt The multiplicity of the value
vamong the entries - Usa2017P2.cntP The number of entries satisfying
p - Usa2017P2.frontContrib The number of inversions contributed by the first position when it has entry
xand thresholdc, over the remaining entriesw - Usa2017P2.skipEmb The embedding
Fin n ↪ Fin (n+1)whose range is everything exceptp, as used inEquiv.Perm.decomposeFin - Usa2017P2.invPair_iff Compact characterization of
invPair: the pair is an inversion iff the truth values "clies in the half-open interval between the entries" and "x > y" differ - Usa2017P2.sum_univ_add_skipEmb Splitting a sum over
Fin (n+1)into the term atpand the rest - Usa2017P2.ainvCount_comp Relabeling the entries by a permutation does not change the number of
A-inversions (thresholds are positional) - Usa2017P2.ainvCount_decompose Documented declaration: ainvCount_decompose
- Usa2017P2.genFun_rec The first-position recurrence for the generating function
- Usa2017P2.valMul_comp_skipEmb Deleting one occurrence of a value from the entry multiset
- Usa2017P2.exists_perm_of_valMul_eq Two entry functions with the same multiset of values differ by a permutation of the indices
- Usa2017P2.genFun_eq_of_valMul_eq The generating function only depends on the multiset of values
- Usa2017P2.frontContrib_eval Explicit evaluation of
frontContribin terms of the full entry multiset - Usa2017P2.gc The contribution of the first position, as a function of its value
- Usa2017P2.multiset_card_filter_finset_sum The cardinality of a filter of a finite sum of multisets
- Usa2017P2.multiset_filter_replicate Filtering a replicated multiset
- Usa2017P2.list_map_sum_eq_sum_range Reindexing the sum of a mapped list as a sum over
range - Usa2017P2.list_sum_eq_sum_range The sum of a list of naturals as a sum over
range - Usa2017P2.list_sum_take_eq_sum_range The sum of an initial segment of a list of naturals
- Usa2017P2.sorted_filter_eq_take In a sorted list of integers, the elements
≤ cform an initial segment - Usa2017P2.sorted_get_lt_iff A sorted list of distinct integers is strictly increasing
- Usa2017P2.sorted_getElem!_lt_iff
getElem!version ofsorted_get_lt_iff - Usa2017P2.sorted_getElem!_le_iff In a sorted list of distinct integers, the elements at positions
< kare exactly those≤ c, wherekis the number of elements≤ c - Usa2017P2.sum_image_eq_sort_map_sum A sum over the image finset reindexed as a list sum over the sorted distinct values
- Usa2017P2.pureId_value The pure polynomial identity in value form: the key combinatorial input behind both the ratio identity and the main induction
- Usa2017P2.sum_eq_sum_image_card Grouping a sum over positions by the value of the entry
- Usa2017P2.image_skipEmb The image of
skipEmb pis everything exceptp - Usa2017P2.repr A chosen representative index for a value
- Usa2017P2.eCnt_comp_skipEmb_of_ne Deleting an index whose value
wdoes not match does not change the count ofw - Usa2017P2.genFun_skipEmb_congr Deleting two different indices with the same value gives the same generating function
- Usa2017P2.QL The ratio identity, by induction on
n - Usa2017P2.PL The main induction: the
A-inversion generating function does not depend onA - Usa2017P2.coeff_genFun The coefficient of
X^kin the generating function counts permutations with exactlykA-inversions - Usa2017P2.usa2017_p2 USA Mathematical Olympiad 2017, Problem 2
- Usa2017P4.shift Shift
pforward (counterclockwise) bydpositions, cyclically - Usa2017P4.cdist The cyclic (counterclockwise) distance from
atob; it is0iffa = b - Usa2017P4.wrap
wrap r bis1when the counterclockwise arc fromrtobpasses through the cut point (1, 0), and0otherwise - Usa2017P4.avail The set of blue points that have not been used yet
- Usa2017P4.nb The nearest available blue point to
r, going counterclockwise fromr(if one exists; otherwise, arbitrarily,ritself) - Usa2017P4.wraps The total number of arcs through (1, 0) produced when the red points listed in
lare processed in order, starting from the setusedof already-taken blue points - Usa2017P4.wrap_eq_of_mem_arc Key fact for the swapping argument: if
plies on the open counterclockwise arc fromytox, thenwrap p yandwrap p xdiffer by an amount that does not depend onp - Usa2017P4.nb_eq_of Uniqueness of the nearest available blue point
- Usa2017P4.wraps_swap_pair The heart of the proof: processing two consecutive red points in either order produces the same number of arcs through (1, 0) and the same set of used blue points
- Usa2017P4.wraps_perm The wrap count is invariant under permuting the processing order of the red points (given that enough blue points remain available at every step)
- Usa2017P4.usa2017_p4 USAMO 2017 Problem 4
- Usa2017P5.label_dist For the normal case, following the bound of √2 ^ i < dist p₁ p₂
- Usa2017P5.label_dist_max For the last case, where all of the rest of the unfilled squares are marked with the same label
- Usa2018P2.jensen_bounded_eq_zero If
hsatisfies Jensen's functional equation on[0, 1], vanishes at the endpoints and is bounded there, thenhis identically zero on[0, 1] - Usa2018P2.g The normalized function $g(s) = f(1/s - 1)$, mapping $(0, 1)$ to $(0, 1)$
- Usa2018P2.hfn The discrepancy between
gand its linear interpolant on[1/8, 3/8], rescaled to parameters in[0, 1] - Usa2018P2.f_lt_one Every value
f twitht > 0is less than1(plug(x, y, z) = (t / 2, 2 / t, 1)into the equation) - Usa2018P2.arg_pos For
s ∈ (0, 1)the argument1 / s - 1offingis positive - Usa2018P2.g_eq The functional equation rewritten in terms of
gvia the substitution(x, y, z) = (b / c, c / a, a / b) - Usa2018P2.g_eq_one For
a + b + c = 1this readsg a + g b + g c = 1 - Usa2018P2.g_jensen Jensen's functional equation for
gon pairs summing to less than1 - Usa2018P2.g_linear_mid_exp
gagrees with a linear function on[1/8, 3/8] - Usa2018P2.kl_sum With
3 g (1/3) = 1and1/3 ∈ [1/8, 3/8], the coefficients satisfyk + 3 l = 1 - Usa2018P2.g_linear_ext_low Linearity extends from
[1/8, 3/8]down to(0, 1/8)using Jensen - Usa2018P2.g_linear_low
gis linear on all of(0, 3/8] - Usa2018P2.g_linear_ext_high Linearity extends from
(0, 3/8]up to(0, 1)using the equation with(x, (1 - x) / 2, (1 - x) / 2) - Usa2018P2.g_linear
gis linear on all of(0, 1) - Usa2018P2.l_nonneg Since
gis positive, the constant term of the linear function is nonnegative - Usa2018P2.kl_nonneg Since
gis positive, the value of the linear function at1is nonnegative - Usa2018P2.k_mem The slope of the linear function lies in
[-1/2, 1] - Usa2018P2.f_formula Transfer the linear formula for
gback tof - Usa2018P2.forward Forward direction: every solution belongs to the one-parameter family
- Usa2018P2.backward Backward direction: every function of the one-parameter family solves the problem
- Usa2018P3.coprimeSet The set of integers in
[0, n)that are coprime ton - Usa2018P3.powSum The sum of the
k-th powers of the elements ofcoprimeSet n - Usa2018P3.coprime_mod_left' Coprimality is preserved when taking a value modulo the left argument
- Usa2018P3.add_mul_inj The map
(a, h) ↦ a + n * his injective whena, a' < n - Usa2018P3.powSum_mul_prime_of_dvd Key identity, case
q ∣ n: the reduced residues modn*qare exactly{a + n*h | a ∈ coprimeSet n, h < q} - Usa2018P3.powSum_mul_prime_of_not_dvd Key identity, case
q ∤ n: the reduced residues modn*qare{a + n*h | a ∈ coprimeSet n, h < q}with the multiplesq * aremoved - Usa2018P3.sum_add_pow_eq Binomial expansion of the double sum
- Usa2018P3.pow_pred_dvd_powSum_prime_pow The prime power case:
p^(e-1) ∣ powSum (p^e) k - Usa2018P3.sum_range_pow_eq_sum_Icc Helper:
∑ h ∈ range q, h^(j+1) = ∑ h ∈ Icc 1 (q-1), h^(j+1) - Usa2018P3.pow_pred_dvd_sum_pow_Icc Corollary:
p^(c-1) ∣ 1^j + ⋯ + t^jwhenp^c ∣ t,c ≥ 1,j ≥ 1 - Usa2018P3.pow_padicValNat_totient_dvd_powSum The main claim: for
pprime withp ∣ n,p ^ ν_p (φ n) ∣ powSum n k - Usa2018P4.card_filter_ne_product The number of ordered pairs of distinct elements of a finset, in additive form
- Usa2018P4.f The values
aᵢ + ik(computed inZMod p) produced by the shiftk - Usa2018P4.phi The unique residue
kmodpfor which the pair(i, j)collides (this is well-defined wheni ≠ jandpis prime) - Usa2018P4.F Ordered pairs of distinct indices whose values collide for the shift
k - Usa2018P4.S All ordered pairs of distinct indices
- Usa2018P4.im The set of values attained by the shift
k - Usa2018P4.fib The fiber over
vof the value map of the shiftk - Usa2018P4.f_eq_iff_phi_eq The pair
(i, j)collides for the shiftkiffk = phi a (i, j) - Usa2018P4.card_S_add There are
p * (p - 1)ordered pairs of distinct indices (additive form) - Usa2018P4.sum_card_F_add Every ordered pair collides for exactly one shift
k, hence the collision counts over all shifts sum to the number of ordered pairs - Usa2018P4.exists_F_card_lt Pigeonhole: some shift
khas fewer thanpcolliding ordered pairs - Usa2018P4.two_mul_le_card_F_add Documented declaration: two_mul_le_card_F_add
- Usa2018P4.usa2018_p4 Documented declaration: usa2018_p4
- Usa2018P6.ratio The ratio
x_k / kattached to positionkof a permutation of{1, ..., n}, with positions and values encoded byFin nvia·.val + 1 - Usa2018P6.Valid A permutation is valid if all its ratios are distinct
- Usa2018P6.nums The numerators of an involution: positions sent to a strictly larger value
- Usa2018P6.label The label of the edge
{k, σ k}as seen from its smaller endpointk: the rational(k+1)/(σ k + 1) - Usa2018P6.Fantastic An involution is fantastic if its edges have pairwise distinct labels
- Usa2018P6.IsVertex A vertex is an involution with at most one fixed point (equivalently, a maximal matching of the complete graph)
- Usa2018P6.IsSwitch A switching involution on a vertex
σ: an involutionφsupported on the numerators ofσwhich preserves labels - Usa2018P6.WPairs The type of pairs
(σ, φ)withσa vertex andφa switching involution ofσ - Usa2018P6.even_card_of_involutive_ne A fixed-point-free involution on a fintype forces the cardinality to be even
- Usa2018P6.card_modEq_of_involutive For an involution
fon a fintype, the cardinality of the whole type is congruent modulo two to the cardinality of the fixed-point subtype - Usa2018P6.nat_mul_eq_of_label_eq Cross-multiplied form of an equality of labels
- Usa2018P6.lt_of_mul_eq_mul_lt If
A * D = C * BwithA < CthenB < D(natural numbers) - Usa2018P6.eq_of_mul_eq_mul_eq If
A * D = C * BwithA = Cand0 < AthenB = D - Usa2018P6.label_order_transfer Label equality transfers the order of numerators to the order of denominators
- Usa2018P6.valid_inv A permutation is valid iff its inverse is (one direction)
- Usa2018P6.fixed_or_num_or_denom For an involution, every element is fixed, a numerator, or a denominator
- Usa2018P6.valid_iff_of_involutive A valid involution has at most one fixed point and distinct edge labels; the converse also holds
- Usa2018P6.list_prod_swap_apply_left A product of swaps of pairwise disjoint pairs sends
u itov i - Usa2018P6.list_prod_swap_apply_right A product of swaps of pairwise disjoint pairs sends
v itou i - Usa2018P6.list_prod_swap_apply_of_not_mem A product of swaps fixes any point avoided by all the swaps
- Usa2018P6.reps The representatives of the pairs switched by
φ: the smaller element of each transposed pair of numerators - Usa2018P6.conjPerm The conjugating permutation: the product of the swaps
(σ x, φ x)over the representatives - Usa2018P6.newSwitch The new switching involution: the product of the swaps
(x, σ x)over the representatives - Usa2018P6.switch_mapsTo_nums A switching involution maps numerators to numerators
- Usa2018P6.denom_not_mem_nums The image of a numerator is not a numerator
- Usa2018P6.reps_four_distinct The pairs
(σ x, φ x)for distinct representatives are pairwise disjoint - Usa2018P6.reps_four_distinct' The pairs
(x, σ x)for distinct representatives are pairwise disjoint - Usa2018P6.reps_four_distinct'' The pairs
(x, φ x)for distinct representatives are pairwise disjoint - Usa2018P6.flip1_involutive The flipped involution
π σ πis involutive - Usa2018P6.flip1_fixed_iff Fixed points of the flipped involution are the
π-images of fixed points ofσ - Usa2018P6.flip1_fixed_card The flipped involution has the same number of fixed points as
σ - Usa2018P6.flip1_apply_of_mem_reps On a representative
x, the flipped involution acts asφ - Usa2018P6.flip1_apply_denom_of_mem_reps On the denominator
σ xof a representative, the flipped involution acts asσ ∘ φ - Usa2018P6.newSwitch_mem_nums_flip Points moved by the new switching involution are numerators of the flipped involution
- Usa2018P6.flip2_label The new switching involution preserves labels of the flipped involution
- Usa2018P6.reps_flip The representatives of the flipped pair are the original representatives
- Usa2018P6.conjPerm_flip The conjugating permutation of the flipped pair is the original one
- Usa2018P6.eq_prod_swap_self A switching involution is the product of its own transpositions
- Usa2018P6.newSwitch_flip The new switching involution of the flipped pair is the original switching involution
- Usa2018P6.flipPair The flip on pairs
(σ, φ) - Usa2018P6.flipPair_involutive_on The flip is an involution on valid pairs
- Usa2018P6.flipPair_mem The flip preserves membership in the vertex-switching set
- Usa2018P6.flipPair_eq_self_iff A fixed point of the flip has trivial switching involution
- Usa2018P6.flipPair_eq_self_of_eq_one Any pair with trivial switching involution is a fixed point of the flip
- Usa2018P6.isSwitch_id The identity is a switching involution
- Usa2018P6.Perm_mul_self_eq_one_of_involutive An involution squares to one
- Usa2018P6.card_switch_eq_one_of_fantastic A fantastic vertex admits only the trivial switching involution
- Usa2018P6.conj_isSwitch Conjugating a switching involution by the swap of two equal-labelled numerators yields a switching involution
- Usa2018P6.rho The involution obtained from
σby removing the two edges throughaandb - Usa2018P6.permOfInvolutive Package an involutive function as a permutation
- Usa2018P6.fixed_perm_ab If
c * ψ = ψ * cforc = swap a b, thenψpreserves the pair{a, b} - Usa2018P6.perm_compl_of_perm_ab A permutation preserving a two-element set also preserves its complement
- Usa2018P6.restrictAb The restriction of an involution to a preserved pair
{a, b} - Usa2018P6.restrictCompl The restriction of an involution to the complement of a preserved pair
{a, b} - Usa2018P6.mul_restrictAb_restrictCompl An involution decomposes as the product of its two restrictions
- Usa2018P6.restrictAb_eq_one_or_c On a preserved pair
{a, b}, an involution is either the identity or the swap - Usa2018P6.isSwitch_rho_of_restrictCompl The complement restriction of a fixed switching involution is a switching involution of the reduced vertex
ρ - Usa2018P6.isSwitch_mul The product of a permutation of
{a, b}(identity or swap) with a switching involution of the reduced vertexρis a switching involution ofσ - Usa2018P6.switch_rho_fix_of_mem_ab A switching involution of the reduced vertex fixes both
aandb - Usa2018P6.perm_ab_of_fixed A fixed switching involution preserves the pair
{a, b}(bundled form) - Usa2018P6.commute_c_of_mem The product
ψ₀ * ψ₁commutes withswap a bwhenψ₀ ∈ {1, swap a b}andψ₁is a switching involution of the reduced vertex - Usa2018P6.fixedDecompEquiv The fixed points of the conjugation involution decompose as a choice on
{a, b}(identity or swap) times a switching involution of the reduced vertex - Usa2018P6.even_card_switch_of_not_fantastic A non-fantastic vertex admits an even number of switching involutions
- Usa2018P6.usa2018p6_aux.decInvol Decidability of being an involution on
Fin n - Usa2018P6.usa2018p6_aux.fpfSubtype Fixed-point-free involutions of
Fin n - Usa2018P6.usa2018p6_aux.vtxSubtype Involutions of
Fin nwith at most one fixed point - Usa2018P6.usa2018p6_aux.fcard The number of fixed-point-free involutions of
Fin n - Usa2018P6.usa2018p6_aux.vcard The number of involutions of
Fin nwith at most one fixed point - Usa2018P6.usa2018p6_aux.partner The partner of
0under a permutation that moves0, seen as an element ofFin (n + 1)viaFin.pred - Usa2018P6.usa2018p6_aux.partner_symm_succ The partner of
0underdecomposeFin.symm (j.succ, e)isjitself - Usa2018P6.usa2018p6_aux.involutive_symm_succ Involutivity of
decomposeFin.symm (j.succ, e)corresponds to involutivity ofetogether withe j = j - Usa2018P6.usa2018p6_aux.fpf_symm_succ
decomposeFin.symm (j.succ, e)is fixed-point-free iffehas no fixed point other thanj - Usa2018P6.usa2018p6_aux.card_fp_symm_succ The fixed points of
decomposeFin.symm (j.succ, e)are in bijection with the fixed points ofedifferent fromj - Usa2018P6.usa2018p6_aux.involutive_symm_zero Involutivity of
decomposeFin.symm (0, e)corresponds to involutivity ofe - Usa2018P6.usa2018p6_aux.fp_symm_zero The fixed points of
decomposeFin.symm (0, e)are0together with the successors of fixed points ofe - Usa2018P6.usa2018p6_aux.card_le_one_symm_zero_iff
decomposeFin.symm (0, e)has at most one fixed point iffeis fixed-point-free - Usa2018P6.usa2018p6_aux.restrictPerm Restriction of a permutation fixing
jto the complement ofj, transported toFin nalongfinSuccAboveEquiv - Usa2018P6.usa2018p6_aux.card_fp_restrictPerm The fixed points of
restrictPerm e hejare in bijection with the fixed points ofedifferent fromj - Usa2018P6.usa2018p6_aux.extendPerm Extension of a permutation of
Fin ntoFin (n + 1)fixingj, via the identificationFin n ≃ {x // x ≠ j} - Usa2018P6.usa2018p6_aux.fpfDecomposeEquiv Fixed-point-free involutions of
Fin (n + 2)are in bijection with pairs of an elementj : Fin (n + 1)(the partner of0) and a fixed-point-free involution ofFin n - Usa2018P6.usa2018p6_aux.vtxSplitType The two cases of involutions of
Fin (n + 2)with at most one fixed point, according to whether0is fixed - Usa2018P6.usa2018p6_aux.splitZeroEquiv Split involutions of
Fin (n + 2)according to whether0is a fixed point - Usa2018P6.usa2018p6_aux.vtxZeroEquiv Involutions of
Fin (n + 2)with at most one fixed point that fix0are in bijection with fixed-point-free involutions ofFin (n + 1) - Usa2018P6.usa2018p6_aux.vtxSuccEquiv Documented declaration: vtxSuccEquiv
- Usa2018P6.usa2018p6_aux.vtxDecomposeEquiv The full decomposition for involutions with at most one fixed point
- Usa2018P6.odd_card_vertex The number of involutions of
Fin nwith at most one fixed point is odd - Usa2018P6.sum_modEq_of_forall Summed
Nat.ModEqover a finset - Usa2018P6.usa2018_p6 USAMO 2018, Problem 6: the number of permutations of
(1, …, n)whose ratiosxₖ/kare all distinct is odd for everyn ≥ 1 - Usa2019P3.K The set of positive integers whose decimal representation does not contain the digit 7
- Usa2019P3.solution_set The polynomials that map
KintoK: the constants with value inK, and the polynomials10^e * x + kwithk < 10^eandk ∈ K ∪ {0} - Usa2019P3.digits_len_le_of_lt_pow The decimal digits of
ahave length at mostkwhena < 10 ^ k - Usa2019P3.digits_mul_pow_add Documented declaration: digits_mul_pow_add
- Usa2019P3.seven_mem_digits_of_le_lt Any natural number in
[7 * 10 ^ E, 8 * 10 ^ E)contains the digit 7 (in fact, as its leading digit) - Usa2019P3.digits_ten_pow_sub_one The decimal digits of
10 ^ s - 1are exactlysnines - Usa2019P3.seven_pow_sub_one_mem_K The number
7 * 10 ^ s - 1(i.e. a six followed bysnines) lies inK - Usa2019P3.dropTrailingZeros Remove the trailing (i.e. most significant) zeros of a digit list
- Usa2019P3.not_mem_ofDigits_of_not_mem If all entries of
Lare digits and7does not occur in the digits ofNat.ofDigits 10 L, then7does not occur inLeither - Usa2019P3.ofDigits_flatMap_digits_pad The base-10 value of the digit list obtained by concatenating the padded blocks of
b 0, b 1, …, b (n - 1)(each block padded to widthE) equals∑ i, b i * 10 ^ (E * i) - Usa2019P3.coeff_stable Reduction to monomials: if
fmapsKintoKand itsi-th coefficient is nonzero, thenf.coeff i * m ^ i ∈ Kfor everym ∈ K - Usa2019P3.eq_ten_pow_of_stable Linear classification: if
x ↦ c * xmapsKintoKandc ≠ 0, thencis a power of ten - Usa2019P3.coeff_zero_pow_linear The constant coefficient of
(a * x + b) ^ disb ^ d - Usa2019P3.coeff_one_pow_linear The coefficient of
xin(a * x + b) ^ disd * a * b ^ (d - 1) - Usa2019P3.not_stable_of_degree_two_le Higher-degree classification: no monomial
c * x ^ dwithd ≥ 2mapsKintoK - Usa2019P3.const_lt_of_linear_stable If
x ↦ 10 ^ e * x + kmapsKintoKandk ≠ 0, thenk < 10 ^ e - Usa2019P3.stable_of_form Documented declaration: stable_of_form
- Usa2019P4.Cell The grid cells indexing the sets
Sᵢⱼ - Usa2019P4.target The cardinality required at cell
(i, j) - Usa2019P4.Fillings Documented declaration: Fillings
- Usa2019P4.colZero The cells of column
0in rows≤ j - Usa2019P4.topRow The cells of row
nin columns1..i - Usa2019P4.intCols The interior cells (rows
< n) in columns1..i - Usa2019P4.colPart The interior cells of column
kin rows `n - r - Usa2019P4.cell_ext Cell equality in terms of coordinate values
- Usa2019P4.fillings_empty The only filling of the empty set of cells
- Usa2019P4.restrict_mem Restricting a filling of
insert s Dto a filling ofDby resetting the value atsto∅ - Usa2019P4.extend_mem Extending a filling of
Dby an admissible valueXats - Usa2019P4.card_between The sets between
AandCwith cardinalitytare counted by a binomial coefficient - Usa2019P4.Fiber The possible values of a filling at a fresh cell
s, given the valuesA fandC fforced by the neighbors ofs - Usa2019P4.ncard_fillings_insert Adding one cell to the domain multiplies the number of fillings by a binomial coefficient
- Usa2019P4.stageA Counting the fillings of the leftmost column: after
jsteps there are∏ i ∈ range j, (2 * n - i)fillings - Usa2019P4.stageB Counting the fillings of the left column together with the top row
- Usa2019P4.stageC_inner Filling the interior column
k + 1from the top down: each of thencells doubles the number of fillings - Usa2019P4.stageC Counting the fillings of everything except the right column of the grid
- Usa2019P4.main_count The full count: the number of valid configurations is `(2 * n)!
- Usa2019P5.Writable The rational numbers that Evan can write on the board, starting from
m / nandn / m - Usa2019P5.sum_dvd_cong If
p ∣ a + bandp ∣ c + d, thena * d + b * c ≡ -2 * b * d (mod p) - Usa2019P5.dvd_two_mul_mul_of_dvd If
p ∣ a * d + b * canda * d + b * c ≡ -2 * b * d (mod p), thenp ∣ 2 * b * d - Usa2019P5.not_dvd_two_mul_mul An odd prime dividing neither
bnorddoes not divide2 * b * d - Usa2019P5.Writable.exists_rep The key invariant: if an odd prime
pdividesm + n, then every number that Evan can write has a representationa / bwithp ∣ a + bandp ∤ b - Usa2019P5.exists_odd_prime_dvd Any natural number
≥ 2that is not a power of two has an odd prime factor - Usa2019P5.writable_combo Any dyadic weighted average of two writable numbers is writable (using arithmetic means alone)
- Usa2019P6.Qfun The polynomial equation, multiplied through by
xyz - Usa2019P6.PhiPoly Documented declaration: PhiPoly
- Usa2019P6.qfun_eq_sum
Qfunexpanded as a sum over the coefficients ofP - Usa2019P6.phiPoly_eval Evaluating
PhiPolyat a pair(x, y)with2xy ≠ 1gives the cleared value ofQfunat the surface point(x, y, (x+y)/(2xy−1)) - Usa2019P6.phiPoly_eq_zero If
Qfun Pvanishes at every nonzero real triple on the surface2xyz = x+y+z, thenPhiPoly Pis the zero polynomial - Usa2019P6.comp_neg_X_of_phiPoly_eq_zero
Pis even: fromPhiPoly P = 0we getQfun P t 0 (-t) = 0for all realt, hencet * (P(t) − P(−t)) = 0for allt, soP.comp (-X) = P - Usa2019P6.Fk_natDegree_le The second finite difference
(X+h)^k + (X−h)^k − 2X^khas degree at mostk−2(in natural subtraction) - Usa2019P6.Fk_coeff The leading coefficient of the second finite difference
(X+h)^k + (X−h)^k − 2X^kat degreek−2isk * (k−1) * h² - Usa2019P6.phiPoly_map_ofReal
PhiPolycommutes with mapping the reals into the complexes - Usa2019P6.natDegree_le_two The degree bound: if
PhiPoly P = 0andPis even, thenP.natDegree ≤ 2 - Usa2020P2.Dir The three possible orientations of a beam
- Usa2020P2.Beam Documented declaration: Beam
- Usa2020P2.Beam.dir The orientation of a beam
- Usa2020P2.Beam.covers
covers b x y zmeans that beambcontains the unit cube at coordinates(x, y, z) - Usa2020P2.DisjointBeams The non-intersection condition: two distinct beams do not share a unit cube
- Usa2020P2.xSupp The four side-face support conditions for
xBeam j k: faces aty = j,y = j+1,z = k,z = k+1 - Usa2020P2.ySupp The four side-face support conditions for
yBeam i k: faces atx = i,x = i+1,z = k,z = k+1 - Usa2020P2.zSupp The four side-face support conditions for
zBeam i j: faces atx = i,x = i+1,y = j,y = j+1 - Usa2020P2.Supp The face-support condition for every beam in
S - Usa2020P2.zLayer The
z-layer of a beam (dummy value forzBeams, which span all layers) - Usa2020P2.xLayer The
x-layer of a beam (dummy value forxBeams) - Usa2020P2.yLayer The
y-layer of a beam (dummy value foryBeams) - Usa2020P2.fill1d Documented declaration: fill1d
- Usa2020P2.fill_xBeam_y An
xBeamin a cube withoutzBeams fills its whole row alongy - Usa2020P2.fill_yBeam_x A
yBeamin a cube withoutzBeams fills its whole column alongx - Usa2020P2.fill_yBeam_z A
yBeamin a cube withoutxBeams fills its whole column alongz - Usa2020P2.fill_xBeam_z An
xBeamin a cube withoutyBeams fills its whole row alongz - Usa2020P2.fill_zBeam_x A
zBeamin a cube withoutyBeams fills its whole row alongx - Usa2020P2.fill_zBeam_y A
zBeamin a cube withoutxBeams fills its whole row alongy - Usa2020P2.zFull Layer
k(in thez-direction) is completely filled - Usa2020P2.xFull Layer
i(in thex-direction) is completely filled - Usa2020P2.yFull Layer
j(in they-direction) is completely filled - Usa2020P2.card_ge_sq_of_no_zBeam If there are no
zBeams, every layer is filled andn² ≤ S.card - Usa2020P2.card_ge_sq_of_no_xBeam If there are no
xBeams, every layer is filled andn² ≤ S.card - Usa2020P2.card_ge_sq_of_no_yBeam If there are no
yBeams, every layer is filled andn² ≤ S.card - Usa2020P2.n_le_of_mem_nonZ If some beam is not a
zBeam, everyz-layer contains anxBeamor ayBeam, hencen ≤ Nx + Ny - Usa2020P2.n_le_of_mem_nonX If some beam is not an
xBeam, everyx-layer contains ayBeamor azBeam, hencen ≤ Ny + Nz - Usa2020P2.n_le_of_mem_nonY If some beam is not a
yBeam, everyy-layer contains azBeamor anxBeam, hencen ≤ Nz + Nx - Usa2020P2.lower_bound The lower bound: any supported nonempty configuration has
3 * n ≤ 2 * S.card - Usa2020P2.zPart The
zBeams of the construction:(2t, 2t)fort = 0, …, 1009 - Usa2020P2.yPart The
yBeams of the construction:(2t+1, 2t)fort = 0, …, 1009 - Usa2020P2.xPart The
xBeams of the construction:(2t+1, 2t+1)fort = 0, …, 1009 - Usa2020P2.halfBeams The construction: 3030 beams forming a staircase
- Usa2020P4.det The determinant
aᵢ bⱼ − aⱼ bᵢof two ordered pairs of nonnegative integers, viewed as an integer - Usa2020P4.goodSets The good two-element subsets of a set of points: those
{P, Q}with|det P Q| = 1 - Usa2020P4.goodPairs The good index pairs of a choice
vof 100 points - Usa2020P4.eq_zero_of_eq_add_mul If
(u, v) = (u', v') + t • (a, b)witht ≥ 1, all ofu' v' a bnonnegative, andu² + v² ≤ a² + b², then(u', v') = (0, 0) - Usa2020P4.eq_of_det_eq_of_le Two points of the first quadrant having the same determinant of absolute value
1with a primitive pointP, and both at most as far from the origin asP, must coincide - Usa2020P4.gcd_dvd_det The gcd of the coordinates of
Pdivides every determinantdet P Q - Usa2020P4.card_partners_le_two A farthest point
PofSforms good pairs with at most two points ofS - Usa2020P4.card_goodSets_le A set of
n ≥ 2points determines at most2 * n - 3good pairs - Usa2020P4.card_goodPairs_eq For an injective choice
vof points, the good index pairs and the good two-element subsets of the image are equinumerous - Usa2020P4.usa2020_p4 USA Mathematical Olympiad 2020, Problem 4
- Usa2020P5.Overdetermined Documented declaration: Overdetermined
- Usa2020P5.two_pow_ge_succ
k + 1 ≤ 2 ^ kfor every natural numberk - Usa2020P5.roots_card_bound A nonzero polynomial that vanishes on every element of a finite set of reals has degree at least the cardinality of that set
- Usa2020P5.poly_unique Documented declaration: poly_unique
- Usa2020P5.eq_of_overdetermined_of_flooded A flooded (i.e. not overdetermined) set of
m + 2points has at most one overdetermined subset of sizem + 1 - Usa2020P5.card_flooded_subsets A flooded set of
t ≥ 3points has at leastt - 1flooded subsets of sizet - 1 - Usa2020P5.card_supersets A set
Uofmpoints ofAis contained in at mostA.card - msubsets ofAof sizem + 1 - Usa2020P5.double_count Double counting of the incidence relation between flooded
m-subsets and flooded(m+1)-subsets ofA - Usa2020P5.flooded_count A flooded set
Ahas at least(A.card - 1).choose (m - 1)flooded subsets of sizem, for every2 ≤ m ≤ A.card - Usa2020P5.sum_choose_Icc The sum of
(n - 1).choose moverm ∈ Icc 2 nequals2 ^ (n - 1) - n - Usa2020P5.overdetermined_bound An
n-element flooded set of points has at most2 ^ (n - 1) - noverdetermined subsets - Usa2020P5.card_powerset_filter_two_le A finite set
shas exactly2 ^ s.card - s.card - 1subsets of cardinality at least two - Usa2020P5.tail The "tail" of the extremal construction: the points
(i, 2)for2 ≤ i ≤ n - Usa2020P5.constrSet The extremal construction: the points
(1, 1)and(i, 2)for2 ≤ i ≤ n - Usa2020P5.overdetermined_subset_constrSet_iff The overdetermined subsets of the extremal construction are exactly the subsets of its tail with at least two elements
- Usa2020P5.count_constrSet The extremal construction has exactly
2 ^ (n - 1) - noverdetermined subsets - Usa2020P6.card_fiber_eq Documented declaration: card_fiber_eq
- Usa2020P6.card_fiber Each fiber of the evaluation map
σ ↦ σ ihas cardinality(n-1)! - Usa2020P6.sum_perm_apply Summing
f (σ i)over all permutations gives(n-1)!times the sum off - Usa2020P6.card_fiber₂_eq The fibers of
σ ↦ (σ i, σ j)over pairs(a₁, b)and(a₂, b)have the same cardinality, via left multiplication byEquiv.swap a₁ a₂ - Usa2020P6.card_fiber₂ Each fiber of
σ ↦ (σ i, σ j)over a pair(a, b)witha ≠ bhas cardinality(n-2)! - Usa2020P6.sum_perm_apply₂ Summing
g (σ i) (σ j)over all permutations, fori ≠ j - Usa2020P6.sum_S_eq_zero
∑ σ, S σ = 0whereS σ = ∑ i, x i * y (σ i) - Usa2020P6.sum_S_sq The second moment `∑ σ, (S σ)² = (n-1)!
- Usa2020P6.variance_bound The variance bound: if
S σlies in[m, M]for allσ, then2/√(n-1) ≤ M - m - Usa2020P6.fin_strictMono_ge A strictly monotone function
Fin m → ℕdominates the identity - Usa2020P6.topsum The sum of an antitone function over any finset is at most the sum over an initial segment of the same cardinality
- Usa2020P6.topsum' The sum of a monotone function over any finset is at most the sum over a terminal segment of the same cardinality
- Usa2020P6.bottomsum The sum of an antitone function over any finset is at least the sum over a terminal segment of the same cardinality
- Usa2020P6.abel_nonneg Summation by parts: if
zhas zero sum and nonnegative partial sums, andxis decreasing onrange n, then∑ x i * z i ≥ 0 - Usa2020P6.rearr_upper Rearrangement inequality (upper bound): for two decreasing sequences, the "identity" pairing maximizes
∑ x i * y (σ i)over all permutationsσ - Usa2020P6.rearr_lower Rearrangement inequality (lower bound): for two decreasing sequences, the "reversed" pairing minimizes
∑ x i * y (σ i)over all permutationsσ - Usa2020P6.usa2020_p6 USA Mathematical Olympiad 2020, Problem 6
- Usa2021P2.Park Documented declaration: Park
- Usa2021P2.Park.turn Leaving junction
v(having arrived fromu) by the trail on the left (p = true) or on the right (p = false) - Usa2021P2.Park.turn_ne The visitor never leaves a junction by the trail she arrived on
- Usa2021P2.Park.turn_inv_turn Turning one way and then, from the same junction, the other way undoes the turn:
rotandrot ∘ rotare inverse 3-cycles on the neighbours - Usa2021P2.Park.turn_not_two_cycle A turn and its mirror image cannot both be turns in the same direction: the 3-cycle
turn v · phas no 2-cycle - Usa2021P2.Park.Valid The states of the visitor that occur in a walk: the junction she came from and the junction she has just entered are joined by a trail
- Usa2021P2.Park.step One step of the walk: turn at the current junction and traverse the chosen trail; the next turn has the opposite direction
- Usa2021P2.Park.stepInv The inverse step: the process is deterministic in both directions
- Usa2021P2.Park.parity_walk The direction of the turns alternates between left and right
- Usa2021P2.Park.eq_of_walk_eq If two iterates of the walk agree, the orbit has closed up with period
j - i - Usa2021P2.Park.exists_period The walk is periodic: some positive iterate returns to the initial state
- Usa2021P2.Park.period The (minimal) period of the walk from
σ₀ - Usa2021P2.Park.walk_inj_of_lt_period The iterates of the walk within one period are pairwise distinct
- Usa2021P2.Park.one_lt_period The period is at least two: one step never returns to the initial state
- Usa2021P2.Park.return_at_period_sub_one The walk enters the starting junction again one step before the period
- Usa2021P2.Park.exists_return The visitor always gets back to the junction where she started
- Usa2021P2.Park.retTime The first time (
> 0) at which the walk re-enters the starting junction - Usa2021P2.Park.entries Documented declaration: entries
- Usa2021P2.Park.no_mirror The key lemma: a trajectory never contains a turn and its mirror image, i.e. turns
a → b → candc → b → athrough the same junction - Usa2021P2.Park.arrivals_le_three Documented declaration: arrivals_le_three
- Usa2021P2.Park.entries_le_three The visitor enters any junction at most three times during her walk
- Usa2021P2.Park.wangEdges Documented declaration: wangEdges
- Usa2021P2.Park.wangRotN The cyclic order of the trails at each junction of
wangPark - Usa2021P2.Park.wang_entries Documented declaration: wang_entries
- Usa2021P2.numberOfEntries The set of all possible numbers of times the visitor could have entered a junction during her walk, over all parks and all choices of starting junction and first trail
- Usa2021P3.Board A board state: the set of cells that currently hold a stone
- Usa2021P3.trominoCells The three cells of the L-tromino with anchor
(i, j), as in the figure of the problem statement:(i, j),(i + 1, j)and(i + 1, j + 1) - Usa2021P3.Step One legal move of the game: either place a stone on each cell of an empty L-tromino, or clear a full row, or clear a full column
- Usa2021P3.Reach A sequence of legal moves
- Usa2021P3.Solvable The goal of the game: the board can be emptied after a non-zero number of moves
- Usa2021P3.gains
gains a n r ccounts how many times cell(r, c)receives a stone, given that a tromino was placed with anchor(i, j)exactlya i jtimes - Usa2021P3.Support Trominoes may only be placed at anchors
(i, j)withi + 1 < nandj + 1 < n; counts at other anchors vanish - Usa2021P3.gains_single The gains coming from a single tromino placed at the legal anchor
(i, j)are exactly the indicator function of its three cells - Usa2021P3.extract_step A single move, seen through the counting functions: the gains and losses of every cell can be expressed with suitable counts
- Usa2021P3.extract A whole sequence of moves, seen through the counting functions
- Usa2021P3.extract_solvable In particular, a successful game yields the cell equations together with at least one tromino that was actually placed
- Usa2021P3.sum_range_shift Shifting a sum by one, provided the boundary terms vanish
- Usa2021P3.key_identity The key identity: evaluated at
n-th roots of unityζ, η ≠ 1, the cell equations imply that(1 + ζ + ζ * η)times the tromino generating function vanishes - Usa2021P3.one_add_ne_zero If
3 ∤ nandζ, ηaren-th roots of unity withζ ≠ 1, then1 + ζ + ζ * η ≠ 0 - Usa2021P3.count_eq_zero A polynomial of degree
< mwith coefficients coming from the tromino counts vanishes on thempoints of the grid, hence is zero - Usa2021P3.not_solvable_of_not_three_dvd The obstruction: the board cannot be emptied when
3 ∤ n - Usa2021P3.reach_place Documented declaration: reach_place
- Usa2021P3.reach_clearRows Clearing full rows, one at a time
- Usa2021P3.reach_clearCols Clearing full columns, one at a time
- Usa2021P3.solvable_of_three_dvd The construction: the board can be emptied whenever
3 ∣ n - Usa2021P3.usa2021_p3 USAMO 2021 Problem 3: the board can be emptied after a non-zero number of moves if and only if
3 ∣ n - Usa2021P4.IsValid Documented declaration: IsValid
- Usa2021P4.card_eq_card_divisors For
s ∈ S, the mapt ↦ Nat.gcd s tis a bijection fromSonto the divisors ofs; in particular#S = τ(s) - Usa2021P4.card_filter_dvd The same bijection identifies the elements of
Sdivisible bypwith the divisors ofsdivisible byp(forp ∣ s) - Usa2021P4.card_divisors_filter_dvd The divisors of
sdivisible by a primep ∣ sare in bijection (viad ↦ d / p) with the divisors ofs / p - Usa2021P4.card_divisors_div_mul The ratio identity for the divisor counting function: if
p ∣ sis prime ande = νₚ(s), then(e + 1) * τ(s / p) = e * τ(s) - Usa2021P4.factorization_le_one The key claim: in a valid set every element is squarefree, i.e. every prime appears with exponent at most one
- Usa2021P4.card_eq_two_pow Any valid nonempty set has cardinality a power of two:
#S = τ(x) = 2^{ω(x)}for anyx ∈ S - Usa2021P4.constr_r The
2kprimes used in the construction: in sloti, the "true" choice is the(2 * i)-th prime and the "false" choice is the(2 * i + 1)-th prime - Usa2021P4.constr_b' The flipped choice function: keep
b iexactly when thei-th prime dividesd - Usa2021P4.constr_r_prime Every value of
constr_ris prime - Usa2021P4.constr_r_inj The primes in different slots are distinct:
constr_r k b₁ i = constr_r k b₂ jforcesi = j - Usa2021P4.constr_r_inj_bool Equal primes in the same slot force equal Booleans
- Usa2021P4.constr_bool_not_ne No Boolean equals its own negation
- Usa2021P4.constr_prod_inj The product map
b ↦ ∏ i, constr_r k b iis injective - Usa2021P4.constr_r_flip The flipped prime equals the original one exactly when the original divides
d - Usa2021P4.constr_prod_dvd_of_forall If every slot prime in
Jdividesd, then so does their product - Usa2021P4.constr_dvd_eq_prod_filter Support representation: a divisor of the full product is the product over the slots whose primes divide it
- Usa2021P4.constr_gcd The gcd of the full product with the flipped product is exactly
d - Usa2021P4.constr_gcd_unique Uniqueness: any product of slot primes having gcd
dwith the full product must be the flipped product - Usa2021P4.exists_isValid Construction: for
2kdistinct primesp₁, q₁, …, pₖ, qₖ, the set of all productsr₁ * … * rₖwithrᵢ ∈ {pᵢ, qᵢ}is valid and has cardinality2ᵏ - Usa2021P5.even_relation Eliminating the odd-indexed variables from the system yields a relation among the even-indexed variables alone:
a k = 1 / a (k - 1) + 2 / a k + 1 / a (k + 1) - Usa2021P5.solution The unique solution of the system: the even-indexed terms equal
2and the odd-indexed terms equal1, i.e.(a₁, a₂, a₃, a₄, …) = (1, 2, 1, 2, …) - Usa2022P1.colorCount_swap_le_add_two Adjacent permutations in the transposition graph differ in at most two rows
- Usa2022P1.exists_transversal_with_exact_or_succ_color_count Walking from a color-rich transversal to a color-poor one gives count a or a+1
- Usa2022P1.neighborCols Columns containing a good cell in one of the rows in
R - Usa2022P1.dummyCols The dummy columns used to turn "at least
kreal matches" into a full matching - Usa2022P1.hallTargets Hall targets for row
r: good real columns, plus all dummy columns - Usa2022P1.line_count_le_of_hall_failure If Hall fails on rows
R, then the rows outsideRtogether with the neighboring columns ofRform at mostk - 1covering lines - Usa2022P1.good_cells_card_le_of_neighbor_line_count Any good cells covered by at most
k - 1rows/columns number at most(k - 1) * N - Usa2022P1.exists_transversal_with_many_good_cells Hall step: more than (k-1)N good cells force a transversal with k good cells
- Usa2022P1.exists_intermediate_transversal_of_card_bounds The density hypotheses give a transversal with exactly
aora+1amber cells - Usa2022P1.exists_cells_of_intermediate_transversal A transversal with
aora+1amber cells contains the required amber/bronze choices - Usa2022P5.EssentiallyIncreasing A function
f : ℝ → ℝis essentially increasing iff s ≤ f twhenevers ≤ tare real numbers such thatf s ≠ 0andf t ≠ 0 - Usa2022P5.Good Documented declaration: Good
- Usa2022P5.essentiallyIncreasing_zero The identically zero function is essentially increasing
- Usa2022P5.Good.mono If
kfunctions suffice, then so do anym ≥ kfunctions, by padding with zero functions - Usa2022P5.not_good_ten The lower bound: ten functions do not suffice
- Usa2022P5.lvl The level of
n: forn ≥ 1this is the uniqueℓ ≥ 1with2^(ℓ-1) ≤ n < 2^ℓ - Usa2022P5.cval The complement of
ninside its level - Usa2022P5.xe Extension of the target tuple to all naturals (zero outside
[1, 2022]) - Usa2022P5.Bnd A constant dominating all values and all consecutive differences of
xe - Usa2022P5.gval Documented declaration: gval
- Usa2022P5.gval_step_corrector Within one level, the corrector values strictly increase from
mtom + 1, becauseBnd xdominates the consecutive differences ofxe - Usa2022P5.gval_mono The constructed values are monotone at integer points (on their support); this is the heart of the essentially increasing property
- Usa2022P5.sum_range_testBit Binary expansion: a natural number is the sum of its bit values
- Usa2022P5.sum_range_testBit_real Real version of the binary expansion
- Usa2022P5.ffun The
j-th constructed function on the real line; it is nonzero only at the integers1, …, 2047 - Usa2022P5.sum_ffun The sum identity: at every integer point
n ∈ [1, 2047]the eleven constructed functions sum to the target valuexe x n - Usa2022P5.good_eleven Eleven functions suffice: the explicit construction works for every choice of target values
- Usa2022P6.CanAdd A new friendship may be formed between
uandv: they are distinct, not yet friends, and have at least two common friends - Usa2022P6.Reachable
Reachable G Hmeans that the graphHcan be obtained fromGby a sequence of legal moves (each adding one friendship between users with two common friends) - Usa2022P6.Completable The graph
Gcan be completed so that every user becomes friends with every other user - Usa2022P6.reachable_eq_of_no_canAdd If no legal move is possible from
G, then any graph reachable fromGisGitself - Usa2022P6.reachable_add_edge_of_common Adding a single friendship between two users with two distinct common friends is a legal move (or a no-op if they are already friends)
- Usa2022P6.Sym2.toFinsetV The vertex set of an element of
Sym2 V, as aFinset - Usa2022P6.completeOn The complete graph on the finite set
Sof vertices, seen as a graph onV - Usa2022P6.Cover Documented declaration: Cover
- Usa2022P6.initialCover The initial cover of
G: oneK₂per edge - Usa2022P6.card_biUnion_toFinsetV_ge Any family
Fof at most three of the four edges of the 4-cycleabcdhas at least|F| + 1distinct endpoints - Usa2022P6.Cover.merge Documented declaration: merge
- Usa2022P6.exists_terminal_cover Documented declaration: exists_terminal_cover
- Usa2022P6.lower_bound_of_terminal Documented declaration: lower_bound_of_terminal
- Usa2022P6.lower_bound Lower bound: any completable graph on 2022 vertices has at least 3031 edges
- Usa2022P6.xi The
i-th "even" vertex2i + 2of the construction - Usa2022P6.yi The
i-th "odd" vertex2i + 3of the construction - Usa2022P6.constrEdges Documented declaration: constrEdges
- Usa2022P6.constrGraph The graph of the construction
- Usa2022P6.phase1 Phase 1 of the completion: for each
i, add the friendships0-xᵢand1-yᵢ(each has two common friends) - Usa2022P6.reachable_connect_vertex Documented declaration: reachable_connect_vertex
- Usa2022P6.reachable_complete_aux If every vertex of
Tis friends with both0and1, we may makeTinto a clique - Usa2022P6.hnb After phase 1, every vertex other than
0and1is of the formxᵢoryᵢand is friends with both0and1 - Usa2022P6.constr_completable The graph of the construction is completable: after phase 1, complete the remaining
2020vertices to a clique using0, 1as common friends - Usa2022P6.constr_edgeSet All edges of the construction are non-diagonal, so its edge set is exactly
constrEdges - Usa2022P6.sym2_ne_of_fst If the first endpoint of
s(a, b)differs from both endpoints ofs(c, d), the two edges are distinct - Usa2022P6.sym2_ne_of_snd If the second endpoint of
s(a, b)differs from both endpoints ofs(c, d), the two edges are distinct - Usa2022P6.constr_edge_ncard The construction has exactly
3031friendships - Usa2023P2.val_div Should this be in mathlib as
Positive.val_div? - Usa2023P4.lemma1 The N=1 case is degenerate
- Usa2023P4.EndInevitableIn end is inevitable in M moves
- Usa2023P4.lemma2' When N ≥ 2, if ν2(x) < ν2(a) for all x ∈ S, the game must terminate in ∑_{x∈S} ν2(x) moves, no matter what either player does
- Usa2023P4.lemma2 When N ≥ 2, if ν2(x) < ν2(a) for all x ∈ S, the game must terminate no matter what either player does
- Usa2023P4.lemma7 Key fact: when ν₂(x) = ν₂(a), ν₂(x+a) ≥ ν₂(a) + 1
- Usa2023P4.alice_prevents_end When N ≥ 2, if ∃ i with ν₂(b i) ≥ ν₂(a) (+ offset by turn), then ¬BobCanForceEnd
- Usa2023P5.trygub The Anton Trygub counterexample construction for composite
nwith prime divisorq, at the level of natural number values - Usa2023P5.trygub_mid_bounds Rows
1 ≤ r ≤ qcontain values in[n, n*q+n) - Usa2023P5.trygub_top_bound Rows
r > qcontain values in[n*q+n, n^2) - Usa2023P5.div_lt_of_mem The quotient of an element of
Fin (n^2)bynis again inFin n - Usa2023P5.ap_k_pos The common difference of a permuted arithmetic progression of length at least 2 of elements of
Fin (n^2)is positive - Usa2023P5.ap_res_inj For prime
n, an arithmetic progression of lengthnwhose common difference is not divisible bynhits every residue class modnat most once - Usa2023P5.trygubArr The Trygub arrangement, packaged as a grid of elements of
Fin (n^2) - Usa2024P1.Good The property required of
n: writing the divisors ofn !in increasing order as1 = d₁ < d₂ < ⋯ < dₖ = n !, the consecutive gaps are non-decreasing - Usa2024P1.mul_dvd_factorial_of_ne If
aandbare distinct positive integers witha, b ≤ n, thena * b ∣ Nat.factorial n: both occur as distinct factors in `n ! - Usa2024P1.good_three The divisors of `3 !
- Usa2024P1.good_four The divisors of `4 !
- Usa2024P1.not_good_five
n = 5fails:15, 20, 24are consecutive divisors of `5 ! - Usa2024P1.not_good_six
n = 6fails:90, 120, 144are consecutive divisors of `6 ! - Usa2024P1.not_good_of_seven_le Documented declaration: not_good_of_seven_le
- Usa2024P1.not_good_of_thirteen_le Every
n ≥ 13fails - Usa2024P2.InAtLeastKSubsets z is in at least k of the sets S
- Usa2024P2.signatureOf The membership signature of an integer with respect to the family
S - Usa2024P2.SignatureIntersectionCount Counts elements whose signature contains
u - Usa2024P2.SignatureCountCondition Divisibility condition in signature-count form
- Usa2024P2.SignatureObjective Number of realized points lying in at least
50sets - Usa2024P2.canonicalHighCount Canonical high-rank counts used by the construction
- Usa2024P2.superset_layer_card Count supersignatures of
uwith exactlyjnew indices - Usa2024P2.SignatureIntersectionCount_canonicalHighCount_grouped Group the high-count intersection sum by rank difference
- Usa2024P2.canonicalHighCount_grouped_sum_eq The binomial identity after grouping by rank
- Usa2024P2.SignatureIntersectionCount_canonicalHighCount_closed_form Closed form for canonical high-rank intersections
- Usa2024P2.pushDown Move one full block from
vto its immediate sub-signatures - Usa2024P2.strictSupersetContribution Strict-superset part of an intersection count
- Usa2024P2.fillRank Fill one rank with the least residue making divisibility hold
- Usa2024P2.dvd_complement_mod_add The chosen residue makes
residue + sdivisible byd - Usa2024P2.strictSupersetContribution_eq_canonical_of_strict Canonical strict supersets give the canonical strict contribution
- Usa2024P2.SignatureIntersectionCount_eq_self_add_strict Split an intersection count into exact and strict-superset terms
- Usa2024P2.modEq_self_of_split_divisibilities Divisibility after adding the same tail gives a congruence
- Usa2024P2.le_of_modEq_of_lt_modulus A small representative is a lower bound for congruent naturals
- Usa2024P2.fillRank_satisfies_rank Filling rank
kmakes rankkvalid - Usa2024P2.fillRank_preserves_completed_ranks Filling rank
kpreserves completed higher ranks - Usa2024P2.fillRank_extends_completed_ranks After filling rank
k, all ranks at leastkare valid - Usa2024P2.SignatureObjective_fillRank_of_low Low-rank filling does not change the high-rank objective
- Usa2024P2.lower_rank_filling_exists Fill ranks
49, ..., 1 - Usa2024P2.extend_canonical_high_counts Construct a valid signature count model extending the canonical high ranks
- Usa2024P2.realize_signature_counts Realize finite signature counts by finite integer sets
- Usa2024P2.signatureCount Exact signature counts extracted from an actual family
- Usa2024P2.rankSignatures Signatures of rank
k - Usa2024P2.normalizeSignature Push
vdown to its canonical high-rank residue - Usa2024P2.normalize_rank_subset Normalize a finite subset of one rank
- Usa2024P2.normalize_rank Normalize all signatures of one rank
- Usa2024P2.smooth_high_signatures_by_ranks Normalize high ranks from
100down to50 - Usa2024P2.signature_model_lower_bound Smoothing gives the signature-model lower bound
- Usa2024P2.construction_attains_solution The signature construction realizes the claimed value
- Usa2024P2.at_least_solution_elements Lower bound for any good family
- Usa2024P4.Necklace A circular necklace with
m * nbeads, each red (true) or blue (false) - Usa2024P4.blockCount The number of red beads in the block of
nconsecutive beads starting at positions + i * n(positions are taken modulom * n) - Usa2024P4.AllCutsDistinct Documented declaration: AllCutsDistinct
- Usa2024P4.blockCount_le Each block contains
nbeads, so its red bead count is at mostn - Usa2024P4.le_of_allCutsDistinct Necessity: the
mdistinct block counts all lie in{0, 1, ..., n}, which has onlyn + 1elements - Usa2024P4.rowRed Documented declaration: rowRed
- Usa2024P4.rowRed_eq Evaluating
rowRedon the beadt * n + ain rowt, columna - Usa2024P4.rowRed_self Evaluating
rowRedon a bead in row0 - Usa2024P4.constr The necklace constructed for the
m ≤ n + 1direction: writingp = q * n + jwithj < n, beadpis red iffn + 1 - m ≤ j < n - q - Usa2024P4.blockCount_constr_eq Documented declaration: blockCount_constr_eq
- Usa2024P4.sum_rowRed Documented declaration: sum_rowRed
- Usa2024P4.sum_rowRed_last Documented declaration: sum_rowRed_last
- Usa2024P4.blockCount_constr The complete formula for the block counts of the constructed necklace when the cut starts at
s' < n - Usa2024P4.blockCount_add_period The block count is periodic in the block index with period
m - Usa2024P4.blockCount_add_mul Iterated version of
blockCount_add_period - Usa2024P4.blockCount_mod The block count only depends on the block index modulo
m - Usa2024P4.blockCount_shift Shifting the starting position of the cut by
nbeads shifts the blocks by one - Usa2024P4.allCutsDistinct_constr The constructed necklace satisfies the property of the problem
- Usa2024P4.solution The answer: the required necklaces exist exactly for the pairs
(m, n)withm ≤ n + 1 - Usa2024P6.solution The answer:
c = (n + ℓ² - 2ℓ)/(n(n-1)) - Usa2024P6.Works Documented declaration: Works
- Usa2024P6.vvv The quantity
v_{p,q}from the official solution: the total normalized weight of the sets containing bothpandq - Usa2024P6.card_inter_cast Intersection cardinality as a sum of indicators
- Usa2024P6.sum_swap4 Swapping the order of a quadruple sum
- Usa2024P6.lhs_eq_sum_v_sq The key rewriting step: the left-hand side of the inequality equals the sum of the squares of the
v_{p,q} - Usa2024P6.sum_diag The "diagonal" sum:
∑ p, v_{p,p} = ∑ i, x i - Usa2024P6.sum_sigma_erase Sums over the off-diagonal pairs as double sums
- Usa2024P6.sum_offdiag The "off-diagonal" sum:
∑ p ≠ q, v_{p,q} = ∑ i, (|Aᵢ| - 1)·xᵢ - Usa2024P6.sum_sq_split Splitting
∑ p, ∑ q, (v_{p,q})²into diagonal and off-diagonal parts - Usa2024P6.solution_eq The answer in split form:
c·S² = S²/n + (ℓ-1)²·S²/(n(n-1)) - Usa2024P6.solution_works The claimed constant works (first part of
IsGreatest) - Usa2024P6.diag_count Counting the elements of a finset with a weight of
1each - Usa2024P6.pair_filter_eq The pairs
(p, q)withp ≠ qinsideB × B, as a sigma finset - Usa2024P6.card_pairs Counting ordered pairs of distinct elements of
B - Usa2024P6.exists_perm_eq A permutation of
[n]mappingp ↦ p'andq ↦ q'simultaneously - Usa2024P6.finsetCongr_mem_powersetCard The image of an
ℓ-subset under a permutation is still anℓ-subset - Usa2024P6.cntS_single The number of
ℓ-subsets containing a given point does not depend on the point - Usa2024P6.cntS_pair The number of
ℓ-subsets containing two given distinct points does not depend on the pair of points - Usa2024P6.cnt_bridge Reindexing: counting indices
iwithp, q ∈ A iequals counting sets of the family containingp, q, whenAenumerates the family - Usa2024P6.cnt_bridge1 Reindexing, single-point version
- Usa2024P6.solution_le_of_works Documented declaration: solution_le_of_works
- Usa2025P1.residue_mod For odd
nand1 ≤ ℓ ≤ k, the residue ofn ^ kmodulo(2 * n) ^ ℓhas the formc * n ^ ℓfor an oddc(so in particular1 ≤ c) - Usa2025P1.digit_of_mod The
i-th base-bdigit ofm(counting from the right, starting at0) equalsE / b ^ i, whereE = m % b ^ (i + 1)is the residue ofmmodulo the next power ofb - Usa2025P2.coeff_iterate_derivative_factor The coefficients of an iterated formal derivative are the shifted coefficients of the original polynomial, up to a natural-number factor
- Usa2025P2.natDegree_iterate_derivative_eq The degree of an iterated formal derivative, as long as it is nonzero
- Usa2025P2.good_derivative Rolle's theorem: if a real polynomial has all of its roots real and distinct, then so does its derivative
- Usa2025P2.good_iterate Iterated derivatives of a polynomial with distinct real roots still have distinct real roots
- Usa2025P2.dvd_X_pow_two_iterate_derivative If the coefficients of
x^(t-1)andx^tofRboth vanish, thenX^2divides the(t-1)-st derivative ofR - Usa2025P2.not_nodup_roots_of_X_pow_two_dvd A nonzero polynomial divisible by
X^2has0as a multiple root, so its root multiset is duplicate-free nowhere - Usa2025P2.core_pigeonhole The combinatorial heart of the problem
- Usa2025P2.roots_real_aux If every complex root of a squarefree real polynomial
Pis real, then the real roots ofPare distinct and there aredeg Pmany of them (i.e.Psplits overℝ) - Usamo2025P4.vsub_smul_of_mem_pair A point on line
RSdiffers fromRby a multiple ofS -ᵥ R - Usa2025P5.sum_range_mul Split a sum over
range (p * M)intoMblocks ofpconsecutive terms - Usa2025P5.filter_dvd_succ_range The elements
jofrange iwithp ∣ j + 1are exactly the numbersp * (ℓ + 1) - 1withℓ ∈ range (i / p) - Usa2025P5.injOn_mul_succ_sub_one The map
ℓ ↦ p * (ℓ + 1) - 1is injective onrange M - Usa2025P5.choose_mul_prod_filter_eq Splitting `n.choose i * (i)!
- Usa2025P5.choose_cast_zmod The key congruence: if the prime power
p ^ edividesn + 1andp * M = n + 1, thenn.choose i ≡ (-1) ^ (i - i / p) * (M - 1).choose (i / p)modulop ^ e - Usa2025P5.sum_modEq Documented declaration: sum_modEq
- Usa2025P5.dvd_sum_of_even Sufficiency: for even
k,n + 1divides∑ i ∈ range (n + 1), (n.choose i) ^ kfor every positiven - Usa2025P5.even_of_dvd Necessity: taking
n = 2, the divisibility3 ∣ 2 + 2 ^ kforceskto be even - Usa2025P6.arcSet An arc of length
lstarting atcon the circleZMod m - Usa2025P6.CirclePartition A partition of the circle
ZMod mintokconsecutive nonempty arcs, described by a basepoint and the list of arc lengths - Usa2025P6.CirclePartition.off The offset of arc
i: total length of the preceding arcs - Usa2025P6.CirclePartition.start The starting point of arc
i - Usa2025P6.CirclePartition.arcOf The
i-th arc as a finset - Usa2025P6.CirclePartition.offExt Periodic extension of the offsets: the total length of the first
aarcs (going around the circle repeatedly) - Usa2025P6.CirclePartition.len_congr Helper: evaluating the periodic length at an explicitly given index
- Usa2025P6.CirclePartition.perW The periodic weight function on
ℕassociated to a score function - Usa2025P6.CirclePartition.exists_Ico_of_mono Every position in
[0, m)lies in a unique arc interval; existence part - Usa2025P6.CirclePartition.pos The position of a point relative to the basepoint
- Usa2025P6.CirclePartition.gapSize The distance to the next point outside
D(a positive number of steps) - Usa2025P6.CirclePartition.nextD The successor of
xin the circle withDdeleted - Usa2025P6.CirclePartition.CircleEmb A circular embedding: an enumeration of the complement of
Dthat respects the successor structure of the circle - Usa2025P6.CirclePartition.skipMap The enumeration of the complement of an arc, starting right after the arc
- Usa2025P6.CirclePartition.circleEmb_skipMap The circular embedding given by skipping a single arc
- Usa2025P6.CirclePartition.skipMap_nextD The intertwining lemma: skipping an arc commutes with the deleted successor
- Usa2025P6.CirclePartition.circleEmb_comp_skipMap Composition of a circular embedding with
skipMap - Usa2025P6.CirclePartition.circleEmb_factor Factorization of a circular embedding through
skipMap - Usa2025P6.CirclePartition.transport_arc Transport of an arc disjoint from the skipped arc into the smaller circle
- Usa2025P6.CirclePartition.surgeryMany Surgery: deleting a family of disjoint arcs yields a circular embedding of the complement, built by composing
skipMaps - Usa2025P6.CirclePartition.mergeOne The single-arc merge lemma: deleting an arc of value
< 1from the circle yields a smaller circle with a partition intok - 1arcs of value≥ 1 - Usa2025P6.CirclePartition.cast Reindexing a circular partition along an equality of the number of arcs
- Usa2025P6.CirclePartition.mergeValues The multi-arc merge lemma: deleting
tdisjoint arcs, each of value< 1, yields a smaller circle with a partition intok - tarcs of value≥ 1 - Usa2025P6.CirclePartition.usa2025_p6_main The main theorem: USAMO 2025 Problem 6
- Usa2025P6.usa2025_p6 The USAMO 2025 Problem 6: distributing cupcakes to people so that everybody gets total score at least one in their own ranking
- Usa2026P2.IsPow2 A positive integer which is a power of two (in particular
1 = 2 ^ 0counts) - Usa2026P2.Move One legal turn of the game: the two adjacent entries
xandyare erased and replaced by a power of twozwhich is strictly larger than both of them - Usa2026P2.innerSum For
l = [b₁, ..., bₘ],innerSum lis `4 * b₁ + 4 * b₂ + - Usa2026P2.S The target bound for a row
a = [a₁, ..., aₙ]:a₁ifn = 1, and `2 * a₁ + 4 * a₂ + - Usa2026P2.S_lt_four_mul_sum The bound
S ais always less than four times the sum of the row - Usa2026P2.two_mul_last_le_innerSum The last entry of a nonempty row, doubled, is at most
innerSumof the row - Usa2026P2.two_mul_getLast_le_S The last entry of a row with at least two entries, doubled, is at most
Sof the row - Usa2026P2.innerSum_cons Expanding
innerSumat the head of a nonempty tail: the head entry is counted with coefficient4ininnerSumbut with coefficient2inS - Usa2026P2.S_cons_cons_append Expanding
Sat the two leftmost entries of a row - Usa2026P2.S_append Documented declaration: S_append
- Usa2026P2.exists_split The key combinatorial step: any row with at least two entries can be cut into a nonempty prefix and a nonempty suffix whose
S-values are both at mostS a / 2 - Usa2026P2.Reduces
Reduces a mmeans that the rowacan be reduced to the single numbermby a sequence of legal moves - Usa2026P2.reduces_isPow2 A number reachable from a row of powers of two is again a power of two
- Usa2026P2.exists_reduces_le The main induction: every nonempty row of powers of two can be reduced to a single number which is at most
Sof the row - Usa2026P2.Move.append_right Moves can also be performed with an additional row appended on the right
- Usa2026P2.Move.append_left Moves can also be performed with an additional row appended on the left
- Usa2026P2.reflTransGen_map Pushing a chain of moves through a context map
- Usa2026P2.reduces_moves A
Reducesderivation yields an actual sequence of legal moves: reduce the left block, then the right block, then combine the two remaining adjacent numbers - Usa2026P2.IsPow2.pos Powers of two are positive
- Usa2026P2.usa2026_p2 The answer is yes: from any starting row of powers of two, Annie can always reach a single number which is less than four times the sum of the starting row
- Usa2026P4.leading_ne_one by lemma 2, we know that 2 is not the leading digit of m
- Usa2026P6.FibPair The classification of solutions of
a^2 + b^2 + 1 = 3 * a * b: eithera = b = 1, or{a, b} = {F_{2k-1}, F_{2k+1}}for somek ≥ 1 - Usa2026P6.quotient_eq_three_aux Vieta jumping step: if
a * b ∣ a^2 + b^2 + 1with0 < a ≤ b, then the quotient equals3 - Usa2026P6.quotient_eq_three If
a * b ∣ a^2 + b^2 + 1for positive naturalsa, b, then the quotient is3 - Usa2026P6.fib_add_four The Fibonacci recurrence over four steps:
F_{n+4} + F_n = 3 * F_{n+2} - Usa2026P6.fib_pair_aux Vieta jumping for the equation
a^2 + b^2 + 1 = 3 * a * bwith0 < a ≤ b: the pair is aFibPair - Usa2026P6.fib_pair The solutions of
a^2 + b^2 + 1 = 3 * a * bin positive integers are exactly the pairs{F_{2k-1}, F_{2k+1}}(and(1, 1)) - Usa2026P6.fibPair_fib Every entry of a
FibPairis a Fibonacci number - Usa2026P6.sq_mod_two Parity helper: a square has the same parity as its root
- Usa2026P6.sq_mod_four_of_odd Odd squares are
1 mod 4 - Usa2026P6.sq_mod_four_of_even Even squares are
0 mod 4 - generateAll TODO: split this into collect ⇒ Data ⇒ generate maybe serialize and reuse when no content change
- ContestIndex Index for identifying individual problems within a contest
- WriteupLink A link to an external resource (solution writeup, official site, etc.)
- Contest.problemCount All problems listed (including not yet formalized ones)
- ProblemExtraction.Entry An entry in the state of the Problem Extraction environment extension
- ProblemExtraction.findModuleImports Helper function for
extractFromExt - ProblemExtraction.getDeclsInPackage Gets the declarations that originate in modules beneath
package - ProblemExtraction.extractProblems Using the data in the problem extraction environment extension, constructs a map from module name to problem source code
- ProblemExtraction.extractSolutions Using the data in the solution extraction environment extension, constructs a map from module name to solution source code
- ProblemExtraction.extractMetadata Using the data in the solution extraction environment extension, constructs a map from module name to problem metadata
- copyAsset Copy a single asset
- writePage Write a single page
- buildSite Build the entire site
- Page A page to be generated
- Page.static Helper: create a page from static content
- Page.dynamic Helper: create a page from IO action
- Asset A static asset to be copied
- SiteConfig Site-wide configuration
- PageGenerator Page generator: takes data and produces pages
- Attr A single HTML attribute
- Html HTML document tree
- Html.render Render to string
- Html.renderDoc Render a full HTML5 document with doctype
- htmlEscape Escape for HTML text content
- htmlEscapeAttr Escape for HTML attribute values (superset of text escaping)
- uriEncodeComponent Percent-encode a URI component (RFC 3986 unreserved chars preserved)
- uriEncodePath Encode a full URI path (preserves / and other structure chars)