Suppose there are 997 points given in a plane. If every two points are joined by a line segment with its midpoint coloured in red, show that there are at least 1991 red points in the plane.

theorem apmo_1991_p2 (points : Fin 997 → ℝ × ℝ) : (red_points points).card ≥ 1991 := by sorry

If points are not distinct, the bound fails (e.g., all points equal), but the NL assumes distinct points.


Let $n \geq 5$ be an integer. Consider $n$ squares with side lengths $1,2, \ldots, n$, respectively. The squares are arranged in the plane with their sides parallel to the $x$ and $y$ axes. Suppose that no two squares touch, except possibly at their vertices.\nShow that it is possible to arrange these squares in a way such that every square touches exactly two other squares.

theorem apmo_2023_p1 (n : ℕ) (h_n: n ≥ 5) :
    ∃ position: Fin n → ℝ × ℝ,
    (∀ n1 n2 : Fin n, n1 ≠ n2 → ¬ touches_interior_or_edge ⟨position n1, n1 + 1⟩ ⟨position n2, n2 + 1⟩)
    ∧ ∀m : Fin n, ∃ l k, m ≠ l ∧ m ≠ k ∧ l ≠ k
      ∧ touches ⟨position m, m + 1⟩ ⟨position l, l + 1⟩
      ∧ touches ⟨position m, m + 1⟩ ⟨position k, k + 1⟩
      ∧ (∀ j : Fin n, j ∉ [m, l, k] → ¬ touches ⟨position m, m + 1⟩ ⟨position j, j + 1⟩) := by sorry

The notion of 'touch / touch only at vertices' and the way 'exactly two touches' is counted appears under-specified/possibly mis-modeled; hard to verify without the definitions of touches*.


There are 100 members in a ladies' club. Each lady has had tea (in private) with exactly 56 of the other members of the club. The Board, consisting of the 50 most distinguished ladies, have all had tea with one another. Prove that the entire club may be split into two groups in such a way that, within each group, any lady has had tea with any other.

theorem balticway_2015_p7 (had_tea: SimpleGraph (Ladies)) [DecidableRel had_tea.Adj]
    (h_had_tea_with_56: ∀ l : Ladies, had_tea.degree l = 56)
    (h_board: ∃ board : Finset Ladies, board.card = 50 ∧ (∀ l1 l2: board, had_tea.Adj l1 l2)) :
    ∃ group1 group2: Finset Ladies,
      group1 ∪ group2 = Finset.univ
      ∧ Disjoint group1 group2
      ∧ (∀ l1 l2: group1, had_tea.Adj l1 l2)
      ∧ (∀ l1 l2: group2, had_tea.Adj l1 l2) := by sorry

∀ l1 l2 : board is ill-typed and does not express a clique; IsClique matches NL.


Let $t$ be a positive integer. Prove that, if there exists a Steiner triple system of index 1 having $v$ varieties, then there exists a Steiner triple system having $v^{t}$ varieties.

theorem brualdi_ch10_34 (t v : ℕ) (ht : t > 1): Nonempty (SteinerTripleSystemOfIndOne 2 3 v) →
    Nonempty (SteinerTripleSystemOfIndOne 2 3 (v ^ t)) := by sorry

NL says 'STS of index 1 ⇒ STS (some index) on v^t'; original conclusion stays in 'index 1' and assumption t>1 vs 'positive integer' is unclear without STS definitions.


Prove that a symmetric, idempotent Latin square has odd order.

theorem brualdi_ch10_60 {n : ℕ} (L : LatinSquare n) :
    IsIdempotentElem L.1 ∧ L.1.IsSymm → Odd n := by sorry

NL assumes positive order and idempotence on the diagonal; original predicate name is unclear and no positivity guard was present.


Use the pigeonhole principle to prove that a graph of order n ≥ 2 always has two vertices of the same degree.

theorem brualdi_ch11_5 {V : Type*} (n : ℕ) (h_n: n ≥ 2) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] :
    ∃ v1 v2, v1 ≠ v2 ∧ G.degree v1 = G.degree v2 := by sorry

Removal of an unused type parameter is refactor-only; original statement was still correct.


How many different necklaces are there that contain four red and three blue beads?

structure PreNecklaces where
  c : Fin 7 → Fin 2
  deriving Fintype

NL requires exactly four red and three blue beads, but the original structure had no count constraint. Note: the proposed fix with ∃ S, S.card = 4 only enforces at-least-4-red, not exactly-4-red.


Find the number of different perfect covers of a 3-by-4 chessboard by dominoes.

theorem brualdi_ch1_5 : Fintype.card PerfectCover = brualdi_ch1_5_solution := by sorry

Refactor to explicit domino modeling and specialization; original already fixed board size, so correctness is unclear.


Determine the total number of combinations (of any size) of a multiset of objects of $k$ different types with finite repetition numbers $n_1, n_2, \ldots, n_k$, respectively.

theorem brualdi_ch2_36 {k : ℕ} (n : Fin k → ℕ) (sols : Finset (Fin k → ℕ)) (h_sols : ∀ f, f ∈ sols ↔ (∀ i, f i ≤ n i)) : sols.card = ((fun n => (∑ i : Fin k, (n i + 1))) : (Fin k → ℕ) → ℕ) n := by sorry

The number of combinations of a multiset with repetition bounds n_i is the product ∏(n_i+1), not the sum ∑(n_i+1). Sum gives wrong answer for any k>1.


How many integers greater than 5400 have both of the following properties? (a) The digits are distinct. (b) The digits 2 and 7 do not occur.

theorem brualdi_ch2_6 (s : Finset ℕ)
    (hs0 : ∀ n ∈ s, n > 5400)
    (hs1 : ∀ n ∈ s, (Nat.digits 10 n).Nodup)
    (hs2 : ∀ n ∈ s, 2 ∉ (Nat.digits 10 n) ∧ 7 ∉ (Nat.digits 10 n)) :
    s.card = brualdi_ch2_6_solution := by sorry

Before only required s subset of valid integers, so s.card is not determined; need iff.


Prove that of any five points chosen within a square of side length 2 , there are two whose distance apart is at most $\sqrt{2}$.

theorem brualdi_ch3_18
    (points : Fin 5 → Set.Icc (0 : ℝ) 2 × Set.Icc (0 : ℝ) 2) :
    ∃ i j, i ≠ j ∧ Dist.dist (points i) (points j) ≤ √2 := by sorry

Original used Set.Icc × Set.Icc which is ill-typed. Also ℝ×ℝ would have wrong metric (sup not Euclidean). EuclideanSpace is correct. Expert confirmed (Joseph Myers).


The complement $\bar{A}$ of an $r$-subset $A$ of $\{1,2, \ldots, n\}$ is the $(n-r)$-subset of $\{1,2, \ldots, n\}$, consisting of all those elements that do not belong to $A$. Let $M=\binom{n}{r}$, the number of $r$-subsets and, at the same time, the number of $(n-r)$ subsets of $\{1,2, \ldots, n\}$. Prove that, if $A_{1}, A_{2}, A_{3}, \ldots, A_{M}$ are the $r$-subsets in lexicographic order, then $\overline{A_{M}}, \ldots, \overline{A_{3}}, \overline{A_{2}}, \overline{A_{1}}$ are the $(n-r)$-subsets in lexicographic order.

theorem brualdi_ch4_35 (r n M : ℕ) (hM : M = ((@Finset.univ (Fin n)).powersetCount r).card)
    (A : Fin M → (Finset.powersetCount r (@Finset.univ (Fin M) _))) :
    ∀ i j, (List.Lex (fun x1 x2 : Fin M => x1 ≤ x2)
    (Finset.sort (· ≤ ·) (A i)) (Finset.sort (· ≤ ·) (A j))) →
    (List.Lex (fun x1 x2 : Fin M => x1 ≤ x2)
    (Finset.sort (· ≤ ·) (A j)ᶜ) (Finset.sort (· ≤ ·) (A i)ᶜ)) := by sorry

Statement is about r-subsets of {1..n}, but before used Fin M elements and lex order on M, so the domain is wrong.


Let $n \geq 2$ be an integer. Prove that the total number of inversions of all $n$ ! permutations of $1,2, \ldots, n$ equals $\frac{1}{2} n!\binom{n}{2}=n!\frac{n(n-1)}{4}$ (Hint: Pair up the permutations so that the number of inversions in each pair is $\frac{n(n-1)}{2}$.)

def invNum {n : ℕ} (σ : Equiv.Perm (Fin n)) : ℕ :=
  ∑ x ∈ Equiv.Perm.finPairsLT n, if σ x.fst ≤ σ x.snd then 0 else 1

Before counted inversions (pairs where σ(i) > σ(j) for i < j). After counts non-inversions. Both give same sum over all permutations due to symmetry, so theorem remains correct either way.


Show that the largest number of inversions of a permutation of ${1, 2, ... , n}$ equals $\frac{n(n -1)}{2}$.

Before counted inversions, after counts non-inversions. Both give same maximum n(n-1)/2 (reverse perm has max inversions = identity has max non-inversions), so theorem correct either way.


Determine the number of integral solutions of the equation $x_{1}+x_{2}+x_{3}+x_{4}=20$ that satisfy $1 \leq x_{1} \leq 6,0 \leq x_{2} \leq 7,4 \leq x_{3} \leq 8,2 \leq x_{4} \leq 6$.

theorem brualdi_ch6_9 : {x : Fin 4 → ℕ | x 0 ∈ Icc 1 6 ∧ x 1 ∈ Icc 0 7 ∧
    x 2 ∈ Icc 4 8 ∧ x 3 ∈ Icc 2 6}.ncard = brualdi_ch6_9_solution := by sorry

Missing constraint x1+x2+x3+x4=20; before counts all tuples in bounds.


Let $A$ be a matrix with $n$ columns, with integer entries taken from the set $S=\{1,2, \ldots, k\}$. Assume that each integer $i$ in $S$ occurs exactly $n r_{i}$ times in $A$, where $r_{i}$ is an integer. Prove that it is possible to permute the entries in each row of $A$ to obtain a matrix $B$ in which each integer $i$ in $S$ appears $r_{i}$ times in each column.

theorem brualdi_ch9_13 (n m : ℕ) (k : ℕ+) (A : Matrix (Fin m) (Fin n) ℕ)
    (hA : ∀ i j, A i j ∈ Finset.Icc 1 k.1) :
    ∃ (rσ : Fin m → Equiv.Perm (Fin n)), ∀ j : Fin n, ∀ i ∈ Set.Icc 1 k.1,
    (∑ x : Fin m, if A x ((rσ x).symm j) = x then 1 else 0) * n =
    (∑ x : Fin m, ∑ y : Fin n, if A x y = i then 1 else 0) := by sorry

Before omits the nr_i counting hypothesis and compares A x ... to x instead of i; it does not encode the NL statement.


For all positive integers n, k, let f(n, 2k) be the number of ways an n × 2k board can be fully covered by nk dominoes of size 2 × 1. Find all positive integers n such that for every positive integer k, the number f(n, 2k) is odd.

structure PerfectCover (n k : ℕ) where
  d_set : Finset (Domino n k)
  d_card : d_set.card = n * k
  covers : ∀ i : Fin n × Fin (2 * k), ∃ d ∈ d_set, i ∈ d.carrier

PerfectCover uses Finset of labeled Dominos and distinguishes two squares of each domino. Count is multiplied by (nk)!·2^(nk). Problem asks when count is odd, so this bug matters. Expert confirmed (Joseph Myers).


How many four-digit numbers can be formed from the numbers 3 5 8 9 if they are not allowed to be repeated?

theorem hackmath_3 (sol : Finset ℕ)
    (h_sol : ∀ s ∈ sol, 1000 ≤ s ∧ s ≤ 9999 ∧ (Nat.digits 10 s).toFinset = {3, 5, 8, 9}) :
    sol.card = hackmath_3_solution := by sorry

Before only required sol subset of valid numbers, so sol.card is not fixed; need iff.


How many people must be in a group for at least two of them to be born in the same month?

theorem hackmath_4 : IsLeast {n | ∀ f : Fin n → Fin 12, ∃ a b, f a = f b} hackmath_4_solution := by sorry

Without a ≠ b, the pigeonhole condition is trivially satisfied by taking a=b, so the least n is wrong.


A ferry with a capacity of 10 people takes a group of 13 men and 7 women across a river. Find the number of ways in which the group may be taken across the if all women go on the first group.

theorem hackmath_8 (sols : Finset ((Fin 13 → Fin 2) × (Fin 7 → Fin 2)))
    (h_women : ∀ f ∈ sols, ∀ i, f.2 i = 0)
    (h_sols : ∀ f, f ∈ sols ↔ ∀ k, ((List.ofFn f.1).count k  + (List.ofFn f.2).count k = 10)) :
    sols.card = hackmath_8_solution := by sorry

Women constraint was outside the membership iff, so sols could be any subset; NL needs the exact set.


A magician has one hundred cards numbered $1$ to $100$. He puts them into three boxes, a red one, a white one and a blue one, so that each box contains at least one card. A member of the audience selects two of the three boxes, chooses one card from each and announces the sum of the numbers on the chosen cards. Given this sum, the magician identifies the box from which no card has been chosen. How many ways are there to put all the cards into the boxes so that this trick always works? (Two ways are considered different if at least one card is put into a different box.)

theorem imo_2000_p4 (good_allocations : Finset Allocation)
    (h : ∀ f ∈ good_allocations, ∃ (t : Trick), trick_works f t) :
    good_allocations.card = imo_2000_p4_solution := by sorry

Cards should be 1..100 and good_allocations should be exactly surjective allocations with a working trick; before is underconstrained and off by domain.


In a mathematical competition, in which 6 problems were posed to the participants, every two of these problems were solved by more than 2/5 of the contestants. Moreover, no contestant solved all the 6 problems. Show that there are at least 2 contestants who solved exactly 5 problems each.

theorem imo_2005_p6 {participants : Type} [Fintype participants] [DecidableEq participants]
    (solved : Fin 6 → Finset participants)
    (h : ∀ i j, i ≠ j → (solved i ∩ solved j).card > (2 * Fintype.card participants : ℝ) / 5)
    (h' : ∀ i, (solved i).card < Fintype.card participants) :
    ∃ s : Finset participants, s.card ≥ 2 ∧
    (∀ i ∈ s, ∃ p : Finset (Fin 6), p.card = 5 ∧ ∀ j, j ∈ p ↔ i ∈ solved j) := by sorry

NL says each participant missed at least one problem; original only said each problem had someone who missed it.


Each of the six boxes $B_1$, $B_2$, $B_3$, $B_4$, $B_5$, $B_6$ initially contains one coin. The following operations are allowed: Type 1) Choose a non-empty box $B_j$, $1\leq j \leq 5$, remove one coin from $B_j$ and add two coins to $B_{j+1}$; Type 2) Choose a non-empty box $B_k$, $1\leq k \leq 4$, remove one coin from $B_k$ and swap the contents (maybe empty) of the boxes $B_{k+1}$ and $B_{k+2}$. Determine if there exists a finite sequence of operations of the allowed types, such that the five boxes $B_1$, $B_2$, $B_3$, $B_4$, $B_5$ become empty, while box $B_6$ contains exactly $2010^{2010^{2010}}$ coins.

def op22 : Boxes → Boxes
  | ⟨b1, b2, b3, b4, b5, b6⟩ => ⟨b1, b2 - 4, b4, b3, b5, b6⟩

Type-1 operation removes one coin, but op22 subtracted 4; constant was wrong.


Let $n\ge2$ be an integer. Consider an $n\times n$ chessboard consisting of $n^2$ unit squares. A configuration of $n$ rooks on this board is $\textit{peaceful}$ if every row and every column contains exactly one rook. Find the greatest positive integer $k$ such that, for each peaceful configuration of $n$ rooks, there is a $k\times k$ square which does not contain a rook on any of its $k^2$ squares.

theorem imo_2014_p2 (n : ℕ) (hn : n ≥ 2) :
    IsGreatest {(k : ℕ) | (k > 0) ∧ ∀ r : peaceful_rooks n, ∃ i j : Fin n,
    i.val + k - 1 < n ∧ i.val + k - 1 < n ∧
    ∀ m n, m.val < k ∧ n.val < k ∧ r.carrier (i + m) (j + n) = false}
    (imo_2014_p2_solution n) := by sorry

Original required m<k ∧ n<k for all m,n, which is impossible; implication matches NL. Also had duplicated i.val + k - 1 < n where second should be j.val.


A set of lines in the plane is in general position if no two are parallel and no three pass through the same point. A set of lines in general position cuts the plane into regions, some of which have finite area; we call these its finite regions. Prove that for all sufficiently large n, in any set of n lines in general position it is possible to colour at least √n of the lines blue in such a way that none of its finite regions has a completely blue boundary.

def finite_regions (S : Set (ℝ × ℝ)) (L : Finset (ℝ × ℝ × ℝ)) : Prop :=
  S.Nonempty ∧ Bornology.IsBounded S ∧
  ∀ l ∈ L, (∀ p ∈ S, on_line p l) ∨ (∀ p ∈ S, same_side_of_line p l)

finite_regions is true for any singleton point, making the theorem trivially false. Should define actual finite regions created by the line arrangement. Expert confirmed (Joseph Myers).


We say that a finite set $\mathcal{S}$ in the plane is balanced if, for any two different points $A$, $B$ in $\mathcal{S}$, there is a point $C$ in $\mathcal{S}$ such that $AC=BC$. We say that $\mathcal{S}$ is centre-free if for any three points $A$, $B$, $C$ in $\mathcal{S}$, there is no point $P$ in $\mathcal{S}$ such that $PA=PB=PC$. (1) Show that for all integers $n\geq 3$, there exists a balanced set consisting of $n$ points. (1) Determine all integers $n\geq 3$ for which there exists a balanced centre-free set consisting of $n$ points.

theorem imo_2015_p1 : (∀ n ≥ 3, ∃ (S : Finset (ℝ × ℝ)), balanced S ∧ S.card = n) ∧
    {n | n ≥ 3 ∧ (∃ (S : Finset (ℝ × ℝ)), balanced S ∧ centre_free S ∧ S.card = n)} =
    imo_2015_p1_solution := by sorry

ℝ × ℝ uses sup/L∞ metric in Mathlib, not Euclidean. For balanced/centre-free sets with distance conditions, this fundamentally changes the problem. Expert confirmed (Joseph Myers).


A hunter and an invisible rabbit play a game in the Euclidean plane. The rabbit's starting point, $A_0$, and the hunter's starting point, $B_0$, are the same. After $n-1$ rounds of the game, the rabbit is at point $A_{n-1}$ and the hunter is at point $B_{n-1}$. In the nth round of the game, three things occur in order. (i) The rabbit moves invisibly to a point $A_n$ such that the distance between $A_{n-1}$ and $A_n$ is exactly 1. (ii) A tracking device reports a point $P_n$ to the hunter. The only guarantee provided by the tracking device is that the distance between $P_n$ and $A_n$ is at most 1. (iii) The hunter moves visibly to a point $B_n$ such that the distance between $B_{n-1}$ and $B_n$ is exactly 1. Is it always possible, no matter how the rabbit moves, and no matter what points are reported by the tracking device, for the hunter to choose her moves so that after $10^9$ rounds she can ensure that the distance between her and the rabbit is at most 100?

theorem imo_2017_p3 (start : ℝ × ℝ) : imo_2017_p3_solution =
    ∀ (A : ℕ → (Fin 2 → ℝ)), A 0 = ![start.1, start.2] → ∀ n, dist (A n) (A (n + 1)) = 1 →
    (∃ (P : ℕ → (Fin 2 → ℝ)), ∀ n > 0, dist (P n) (A n) ≤ 1) →
    (∃ (B : ℕ → (Fin 2 → ℝ)), B 0 = ![start.1, start.2] ∧ ∀ n, dist (B n) (B (n + 1)) = 1 ∧
    dist (A (10 ^ 9)) (B (10 ^9)) ≤ 100) := by sorry

ℝ × ℝ uses sup/L∞ metric in Mathlib, not Euclidean. Hunter/rabbit game with 'distance exactly 1' has different meaning with wrong metric. Expert confirmed (Joseph Myers).


An integer $N \ge 2$ is given. A collection of $N(N + 1)$ soccer players, no two of whom are of the same height, stand in a row. Sir Alex wants to remove $N(N - 1)$ players from this row leaving a new row of $2N$ players in which the following $N$ conditions hold: ($1$) no one stands between the two tallest players, ($2$) no one stands between the third and fourth tallest players, $\cdots$ ($N$) no one stands between the two shortest players. Show that this is always possible.

theorem imo_2017_p5 (N : ℕ) (h_N : N ≥ 2) (height : Perm (Fin (N * (N + 1)))) :
    ∃ kept : Fin (2 * N) ↪o Fin (N * (N + 1)),
    ∀ i j, Even #{l | height (kept l) < height (kept i)} →
      (∀ k, height (kept i) < height (kept k) ↔ height (kept j) ≤ height (kept k)) →
      (∀ k, kept i < kept k ↔ kept j ≤ kept k) ∨ (∀ k, kept j < kept k ↔ kept i ≤ kept k) := by sorry

Original ordering condition replaced with count-of-shorter/no-between constraint; unclear which matches NL.


An anti-Pascal triangle is an equilateral triangular array of numbers such that, except for the numbers in the bottom row, each number is the absolute value of the difference of the two numbers immediately below it. For example, the following is an anti-Pascal triangle with four rows which contains every integer from $1$ to $10$ \[4\]\[2\quad 6\]\[5\quad 7 \quad 1\] \[8\quad 3 \quad 10 \quad 9\] Does there exist an anti-Pascal triangle with $2018$ rows which contains every integer from $1$ to $1 + 2 + 3 + \dots + 2018$?

theorem imo_2018_p3 : imo_2018_p3_solution = ∃ l, IsAntiPascal l ∧
    List.range' 1 (∑ i ∈ Finset.Icc 1 2018, i) = List.insertionSort (· ≤ ·) (List.flatten l) := by

Triangle representation changed from lists to indexed function; likely modeling fix but not clearly wrong.


A site is any point (x, y) in the plane such that x and y are both positive integers less than or equal to 20. Amy and Ben take turns placing stones. On her turn, Amy places a red stone such that the distance between any two red stones is not equal to √5. Find the greatest K such that Amy can ensure she places at least K red stones.

-- Site defined as subset of ℝ × ℝ
-- Problem: ℝ × ℝ uses sup/L∞ metric in Mathlib, not Euclidean
-- dist((1,0), (2,1)) = max(1,1) = 1 with sup metric
-- dist((1,0), (2,1)) = √(1²+1²) = √2 with Euclidean
-- The "distance √5" condition has wrong meaning!

ℝ×ℝ (Prod) uses sup/L∞ metric in Mathlib. The problem requires Euclidean distance for 'distance not equal to √5' (knight's move). With sup metric, √5 distance means something completely different. Expert confirmed (Joseph Myers).


A Japanese triangle consists of 1 + 2 + ... + n circles arranged in an equilateral triangular shape such that for each i = 1, 2, ..., n, the ith row contains exactly i circles. Each circle is colored red or blue. A ninja path starts from a top-row circle and in each step goes to one of the two circles immediately below. Find the greatest k such that in each Japanese triangle there is a ninja path containing at least k red circles.

def triangleGraph (n : ℕ+) : Digraph (Index n) where
  Adj p q :=
    p.atBottomLeft q ∨ p.atBottomRight q ∨
    q.atBottomLeft p ∨ q.atBottomRight p

Digraph edges go both up and down, but ninja paths must go down only. Also Real.log is natural log, not log₂ as needed. Expert confirmed (Joseph Myers).


Let $n$ be a positive integer and let $W=\ldots x_{-1} x_{0} x_{1} x_{2} \ldots$ be an infinite periodic word consisting of the letters $a$ and $b$. Suppose that the minimal period $N$ of $W$ is greater than $2^{n}$. A finite nonempty word $U$ is said to appear in $W$ if there exist indices $k \leq \ell$ such that $U=x_{k} x_{k+1} \ldots x_{\ell}$. A finite word $U$ is called ubiquitous if the four words $U a, U b, a U$, and $b U$ all appear in $W$. Prove that there are at least $n$ ubiquitous finite nonempty words.

theorem imosl_2011_c6 (W : ℤ → Fin 2) (n : ℕ+) (N : ℕ) (hN : 2 ^ n.1 < N)
    (hW : Function.Periodic W N) (hW' : ∀ N' < N, ¬ Function.Periodic W N') :
    ∃ (x : Fin n ↪ (Σ k, Fin k → Fin 2)), (∀ i, (x i).1 ≠ 0) ∧ (∀ i, ubiquitous W (x i)) := by sorry

Period 0 always makes a function periodic, so forbidding all N'<N including 0 makes the premise impossible.


Let $S$ be a nonempty set of positive integers. We say that a positive integer $n$ is clean if it has a unique representation as a sum of an odd number of distinct elements from $S$. Prove that there exist infinitely many positive integers that are not clean.

theorem imosl_2015_c6 (S : Set ℕ+) : ∀ (N : ℕ), ∃ (m : ℕ), N < m ∧ ¬ clean S m := by sorry

NL assumes S nonempty; original allowed empty S (statement may still hold), so mismatch is unclear.


Find the smallest positive integer $n$ such that if $n$ squares of a $1000 \times 1000$ chessboard are colored, then there will exist three colored squares whose centers form a right triangle with sides parallel to the edges of the board.

theorem usamo_2000_p4 : IsLeast colored_card usamo_2000_p4_solution.1 := by sorry

NL requires all size-n colorings force a right triangle; original only required existence of one such coloring.


Time is converted to metric system: 10 metric hours per day, 100 metric minutes per hour. A person wants to wake at the equivalent of 6:36 AM. Find 100A+10B+C where A:BC is the metric time.

Uses Nat division so 6360/1440 truncates to 4; also uses 6*100+36 instead of 6*60+36 for 6:36 AM. Hypothesis can force 100A+10B+C=4, not 275.


Let z be the UNIQUE complex number with properties that (z₃-z₁)/(z₂-z₁)·(z-z₂)/(z-z₃) is real and Im(z) is greatest possible. Find Re(z).

import Mathlib

theorem aime_all_2017_I_10 (z1 z2 z3 z : ℂ) ... (hzz : ∃ r : ℝ, ...) (hzim : ∀ z', ... → z.im ≥ z'.im) : z.re = 56 := by

NL specifies a unique maximizer z; the Lean statement (as sketched) does not encode unique existence (∃!) / a uniqueness hypothesis, only properties of a given z.


Find all positive integers k and n such that k⁴ + n² is divisible by 7^k - 3^n. Prove that the answer is: (k, n) = (2, 4)

import Mathlib

theorem olymid_ref_base_3054 (k n : ℕ) :
    k > 0 ∧ n > 0 ∧ 7^k - 3^n ∣ k^4 + n^2 ↔ (k = 2 ∧ n = 4) := by

In ℕ, 7^k - 3^n truncates to 0 when 3^n > 7^k; at (2,4) denominator becomes 0, so '0 ∣ 32' is false and the claimed ↔ fails.


import Mathlib

open Real

theorem olymid_ref_base_4847 (t : ℝ) (p : ℝ) (ht : t = 2016) (hp : p = log 2) :
    ∑' k : ℕ, ((1 - ∑ n in Finset.range k, exp (-t) * t ^ n / Nat.factorial n) * (1 - p) ^ (k - 1) * p) =
    1 - (1 / 2) ^ 2016 := by

NL sums k=1..∞ but Lean uses ∑' k : ℕ starting at k=0, adding an extra k=0 term (and k-1 is Nat subtraction, so at k=0 it becomes 0, not −1).


Find the smallest positive integer n for which 1!2!⋯(n-1)! > n!²

import Mathlib

open Nat BigOperators

theorem olymid_ref_base_5274 :
    IsLeast {n : ℕ | 0 < n ∧ ∏ i in Finset.Icc 1 (n - 1), i ! > (n !) ^ 2} 8 := by

This appears correctly encoded: product over Icc 1 (n-1) is 1!⋯(n−1)!, n>0 is enforced, and 8 is indeed the smallest n satisfying the inequality.


import Mathlib

open Real

theorem olymid_ref_base_6282 {n : ℕ} (hn : 3 ≤ n) (a : Fin (n + 1) → ℝ)
    (ha : StrictMono a) (hpos : ∀ i, 0 < a i) (han : a n = a 0) :
    ∑ k, a k / a (k + 1) > ∑ k, a (k + 1) / a k := by

StrictMono a on Fin(n+1) implies a 0 < … < a n, but also assumes a n = a 0; premises become inconsistent and mis-encode the cyclic condition a_{n+1}=a_1.


The Fibonacci numbers F_0, F_1, F_2, ... are defined by F_0=0, F_1=1, F_{n+1}=F_n+F_{n-1}. Given n ≥ 2, find the smallest size of a set S of INTEGERS such that for every k=2,...,n there exist x,y ∈ S with x-y=F_k.

import Mathlib

def fib (n : ℕ) : ℕ := match n with
| 0 => 0
| 1 => 1
| n + 2 => fib (n + 1) + fib n

theorem olymid_ref_base_8963 (n : ℕ) (hn : 2 ≤ n) :
    IsLeast {k | ∃ S : Finset ℕ, S.card = k ∧ ∀ k ∈ Finset.Icc 2 n, ∃ x ∈ S, ∃ y ∈ S, x - y = fib k} (Nat.ceil (n / 2) + 1) := by

NL needs a set of integers and differences x−y with sign; Lean uses Finset ℕ and Nat subtraction x-y, which can't represent negative differences and truncates when y>x.


Let a₁,...,a₂₀₁₉ be positive integers. Prove: ∃ real x such that aᵢ = ⌊ix⌋ for all i ∈ {1,...,2019} iff for all i,j with i+j ≤ 2019, aᵢ + aⱼ ≤ aᵢ₊ⱼ ≤ aᵢ + aⱼ + 1.

import Mathlib

theorem olymid_ref_base_2137 (a : Fin 2019 → ℤ) (ha : ∀ i, 0 < a i) :
    (∃ x : ℝ, ∀ i, a i = ⌊i * x⌋) ↔
    (∀ i j, i + j ≤ 2019 → a i + a j ≤ a (i + j) ∧ a (i + j) ≤ a i + a j + 1) := by

Uses Fin 2019 indices (includes 0, wraps on addition) but NL uses 1..2019 with ordinary addition; i=0 forces ⌊0*x⌋=0 contradicting positivity, and (i+j) in Fin wraps mod 2019 rather than staying ≤2019.


What is the smallest integer n, greater than one, for which the root-mean-square of the first n positive integers is an integer? The RMS is defined as sqrt((a_1² + ... + a_n²)/n).

import Mathlib

open Real

noncomputable def sumOfSquares (n : ℕ) : ℕ := ∑ k in Finset.Icc 1 n, k ^ 2

theorem omni_theorem_131 :
    IsLeast {n | 1 < n ∧ ∃ k : ℤ, sqrt (sumOfSquares n / n) = k} 337 := by

RMS needs real division sqrt((∑k^2)/n), but Lean computes Nat division sumOfSquares n / n first (truncates) then coerces to ℝ for sqrt.


Let {a_n}_{n≥1} be arithmetic and {g_n}_{n≥1} be geometric such that first four terms of {a_n+g_n} are 0,0,1,0. Find the 10th term.

Sequences are intended for n≥1, but ha/hg quantify ∀ n:ℕ with (n-1) using Nat subtraction; at n=0 this forces a0=a1 and g0=g1, adding unintended constraints.


Find quadratic polynomials f(x) = ax² + bx + c where a,b,c are positive integers, p<q are primes, f(p)=f(q)=17, f(p+q)=47. Find sum of f(pq) mod 100.

import Mathlib

theorem omni_theorem_2830 :
    (∑ᶠ x ∈ {x | ∃ a b c p q : ℕ, a > 0 ∧ p.Prime ∧ q.Prime ∧ p < q ∧ x = a * (p * q) ^ 2 + b * (p * q) + c ∧
      a * p ^ 2 + b * p + c = 17 ∧ a * q ^ 2 + b * q + c = 17 ∧ a * (p + q) ^ 2 + b * (p + q) + c = 47}, x) % 100 = 71 := by

As written ('a,b,c are positive integers'), the constraints force b = −a(p+q) < 0, so no solutions exist; likely the NL intended b to be an integer (not necessarily positive).


What is the smallest integer that can be placed in the box so that 1/2 < □/9? Prove that the answer is: 5

import Mathlib

theorem omni_theorem_2926 : IsLeast {n | 1 / 2 < n / 9} 5 := by

Inferred type is ℕ, so 1/2=0 and n/9 is Nat division; predicate becomes 0 < n/9, whose least solution is 9, not 5.


Let S(n) be the sum of the digits of the positive integer n. Find all n such that S(n)(S(n)-1) = n-1. Prove that the answer is: n ∈ {1, 13, 43, 91, 157}

import Mathlib

def S : ℕ → ℕ
| n => (Nat.digits 10 n).sum

theorem omni_theorem_4006 {n : ℕ} :
    (S n) * (S n - 1) = n - 1 ↔ n = 1 ∨ n = 13 ∨ n = 43 ∨ n = 91 ∨ n = 157 := by

NL says positive n, but Lean allows n=0; then (S 0)*(S 0 - 1)=0=(0-1) in ℕ, so LHS true while RHS 'n∈{1,13,43,91,157}' is false.


Given M = {x | x = a² + 1, a ∈ ℕ*}, N = {x | x = b² - 4b + 5, b ∈ ℕ*}, prove M ⊊ N. The proof shows 1 ∈ N (at b=2: 4-8+5=1) but 1 ∉ M.

import Mathlib

theorem quantitative_reasoning_zh_blue_41 :
  {x : ℕ | ∃ a : ℕ, 0 < a ∧ x = a^2 + 1} ⊂ {x : ℕ | ∃ b : ℕ, 0 < b ∧ x = b^2 - 4 * b + 5} := by

b^2 - 4*b + 5 is computed in ℕ with truncating subtraction; the NL witness b=2 gives 1, but Lean gives 5, so N is not the intended set.


Given 0 ≤ x_0 < 1, the sequence {x_n} satisfies x_{n+1} = 2x_n - 1 if 1/2 ≤ x_n < 1, else x_{n+1} = 2x_n if 0 ≤ x_n < 1/2. If x_5 = x_0, how many such sequences exist? Answer: 31

import Mathlib

open Real
open scoped BigOperators

theorem quantitative_reasoning_zh_blue_891 :
  Set.ncard {x : ℕ → ℝ | ∃ x0 : ℝ, 0 ≤ x0 ∧ x0 < 1 ∧
    (∀ n : ℕ, x (n + 1) = if 1 / 2 ≤ x n ∧ x n < 1 then 2 * x n - 1 else 2 * x n) ∧
    x 5 = x0} = 31 := by

Does not enforce x 0 = x0 and does not maintain the invariant x n ∈ [0,1); the piecewise recurrence is only correct under those missing constraints.


Find the maximum cardinality of a set S of positive integers ≤100 such that for any two distinct elements a,b ∈ S: (1) there exists c ∈ S with gcd(a,c)=1 and gcd(b,c)=1, and (2) there exists d ∈ S with d≠a, d≠b, gcd(a,d)>1, gcd(b,d)>1. Solution proves |S|_max = 72.

import Mathlib

theorem algebra_587982 :
    IsGreatest {n | ∃ S : Finset ℕ, S.card = n ∧
      (∀ x ∈ S, x ≤ 100) ∧
      (∀ a ∈ S, ∀ b ∈ S, a ≠ b → ∃ c ∈ S, Nat.gcd a c = 1 ∧ Nat.gcd b c = 1) ∧
      (∀ a ∈ S, ∀ b ∈ S, a ≠ b → ∃ d ∈ S, d ≠ a ∧ d ≠ b ∧ Nat.gcd a d > 1 ∧ Nat.gcd b d > 1)} 54 := by

Lean claims the maximum is 54, but the provided solution text claims |S|_max = 72; the constant in IsGreatest is wrong.


If the sequence {a_n} satisfies that for any n ∈ ℕ*, ∑_{d|n} a_d = 2^n, prove that n | a_n.

import Mathlib

theorem algebra_56552 {a : ℕ → ℕ} (ha : ∀ n, ∑ d in n.divisors, a d = 2 ^ n) :
    ∀ n, n ∣ a n := by

NL quantifies n∈ℕ* but Lean has ∀ n including 0; Nat.divisors 0 is empty in Mathlib, so ha 0 would require 0=2^0=1 (inconsistent), making the theorem vacuous.


Let F be a finite set of integers satisfying: (1) for any x ∈ F, there exist y,z ∈ F with x = y + z; (2) there exists n ∈ ℕ* such that for any 1 ≤ k ≤ n and any x_1,...,x_k ∈ F, we have ∑x_i ≠ 0. Prove |F| ≥ 2n + 2.

import Mathlib

theorem theorem_proving_zh_blue_671 {F : Finset ℤ} (hF : ∀ x ∈ F, ∃ y z, x = y + z)
    (hn : ∃ n : ℕ, 0 < n ∧ ∀ k ∈ Finset.Icc 1 n, ∀ x : Fin k → ℤ,
      (∀ i, x i ∈ F) → ∑ i, x i ≠ 0) :
    F.card ≥ 2 * n + 2 := by

Conclusion uses free n not bound by the ∃n in hn; also hF forgets to require y,z ∈ F (it only states ∃ y z with x=y+z).


Let f(m,n) satisfy f(1,n) = f(m,1) = 1 (m,n ∈ ℕ*), and when m,n ≥ 2, f(m,n) ≤ f(m,n-1) + f(m-1,n). Prove f(m,n) ≤ C(m+n-2, m-1).

import Mathlib

theorem algebra_539172 {f : ℕ → ℕ → ℕ}
    (h₁ : ∀ n, f 1 n = 1) (h₂ : ∀ m, f m 1 = 1)
    (h₃ : ∀ m n, 2 ≤ m → 2 ≤ n → f m n ≤ f m (n - 1) + f (m - 1) n) :
    ∀ m n, f m n ≤ (m + n - 2).choose (m - 1) := by

NL is for m,n∈ℕ* but Lean concludes ∀ m n without positivity constraints; this introduces m=0 or n=0 cases where (m+n-2).choose(m-1) and n-1 style terms are not the intended spec.


An epidemiological study of the spread of a certain influenza strain that hit a small school population found that the total number of students, P, who contracted the flu t days after it broke out is given by the model P = t² - 12t + 180, where 1 ≤ t ≤ 6. Find the day that 160 students had the flu.

import Mathlib

theorem u_math_684 (t : ℕ) (ht : 1 ≤ t ∧ t ≤ 6) :
    let P := t ^ 2 - 12 * t + 180
    P = 160 ↔ t = 2 := by

Uses ℕ subtraction in t^2 - 12*t; at t=2, (4-24) truncates to 0 so P=180, not 160, so the ↔ fails.


Compute the integral: ∫ -1/(3·sin(x/3)⁶) dx. Answer involves +C.

Lean's '∫ x, …' is a definite integral (not an antiderivative), and the RHS contains free x and free C (autoImplicit/scope bug), so it does not represent '+C' indefinite integration.


import Mathlib

open Real Set
open scoped BigOperators

theorem u_math_945 : ∫ x, 10 / sin (4 * x) ^ 6 =
    - (cot (4 * x)) ^ 5 / 2 - 5 / 2 * cot (4 * x) - 5 / 3 * (cot (4 * x)) ^ 3 + C := by

Same calculus issue: '∫ x, …' is a definite integral, and the RHS contains free x and free C, so it does not formalize an indefinite integral '+C'.


Prove that $x^2+1$ is irreducible in $\mathbb{F}_7$

theorem exercise_11_4_6b {F : Type*} [Field F] [Fintype F] (hF : card F = 31) :
  Irreducible (X ^ 3 - 9 : Polynomial F) := sorry

Original assumes card F = 31 and proves Irreducible (X^3-9), but NL is about F_7 and x^2+1.


Suppose that $V$ is finite dimensional and that $T \in \mathcal{L}(V, W)$. Prove that there exists a subspace $U$ of $V$ such that $U \cap \operatorname{null} T=\{0\}$ and range $T=\{T u: u \in U\}$.

theorem exercise_3_8 {F V W : Type*} [AddCommGroup V]
  [AddCommGroup W] [Field F] [Module F V] [Module F W]
  (L : V →ₗ[F] W) :
  ∃ U : Submodule F V, U ⊓ (ker L) = ⊥ ∧
  (range L = range (domRestrict L U)) := sorry

NL assumes V is finite-dimensional, but original Lean omits [FiniteDimensional F V].


Suppose $U$ is a subspace of $V$. Prove that $U^{\perp}=\{0\}$ if and only if $U=V$

theorem exercise_6_16 {K V : Type*} [RCLike K] [NormedAddCommGroup V] [InnerProductSpace K V]
  {U : Submodule K V} :
  U.orthogonal = ⊥  ↔ U = ⊤ := sorry

No semantic issue: U.orthogonal = bot iff U = top matches 'U^perp = {0} iff U=V'.


Prove that $\left(\sum_{j=1}^{n} a_{j} b_{j}\right)^{2} \leq\left(\sum_{j=1}^{n} j a_{j}{ }^{2}\right)\left(\sum_{j=1}^{n} \frac{b_{j}{ }^{2}}{j}\right)$ for all real numbers $a_{1}, \ldots, a_{n}$ and $b_{1}, \ldots, b_{n}$.

theorem exercise_6_3 {n : ℕ} (a b : Fin n → ℝ) :
  (∑ i, a i * b i) ^ 2 ≤ (∑ i : Fin n, i * a i ^ 2) * (∑ i, b i ^ 2 / i) := sorry

NL sums j=1..n; original uses i:Fin n (0..n-1), so weights use i not (i+1) and introduces division by i=0.


Prove that a group of order 56 has a normal Sylow $p$-subgroup for some prime $p$ dividing its order.

theorem exercise_4_5_13 {G : Type*} [Group G] [Fintype G]
  (hG : card G = 56) :
  ∃ (p : ℕ) (P : Sylow p G), P.Normal := sorry

Same as 4_5_14: missing p.Prime and p | card G; otherwise trivial p=1-style witnesses are allowed.


Prove that a group of order 312 has a normal Sylow $p$-subgroup for some prime $p$ dividing its order.

theorem exercise_4_5_14 {G : Type*} [Group G] [Fintype G]
  (hG : card G = 312) :
  ∃ (p : ℕ) (P : Sylow p G), P.Normal := sorry

Original misses the constraints 'p is prime' and 'p | |G|'; otherwise p=1 gives a trivial normal Sylow 1-subgroup-style witness.


Let $G$ be a group in which $(a b)^{3}=a^{3} b^{3}$ and $(a b)^{5}=a^{5} b^{5}$ for all $a, b \in G$. Show that $G$ is abelian.

def exercise_2_2_5 {G : Type*} [Group G]
  (h : ∀ (a b : G), (a * b) ^ 3 = a ^ 3 * b ^ 3 ∧ (a * b) ^ 5 = a ^ 5 * b ^ 5) :
  CommGroup G := sorry

Conclusion 'CommGroup G' can mean existence of some commutative group structure on the type G, not commutativity of the given [Group G] multiplication; NL needs forall a b, a*b=b*a.


Prove that if $p > q$ are two primes such that $q \mid p - 1$, then any two nonabelian groups of order $pq$ are isomorphic.

def exercise_2_8_15 {G H: Type*} [Fintype G] [Group G] [Fintype H]
  [Group H] {p q : ℕ} (hp : Nat.Prime p) (hq : Nat.Prime q)
  (h : p > q) (h1 : q ∣ p - 1) (hG : card G = p*q) (hH : card G = p*q) :
  G ≃* H := sorry

Original typo uses hH : card G = p*q instead of card H; also missing 'G nonabelian' and 'H nonabelian' hypotheses required by NL.


If $n$ is a positive integer such that $n \equiv 7 \pmod{8}$, show that $n$ is not a sum of three squares.

theorem exercise_2_4 {n : ℕ} (hn : n % 8 = 7) :
  ¬∃ (a b c : ℤ), n = a^2 + b^2 + c^2 := sorry

Original equates n:N with a^2+b^2+c^2:Z; needs explicit cast (n:Z). Likely does not typecheck as written.


Prove that $1^{k}+2^{k}+\cdots+(p-1)^{k} \equiv 0(p)$ if $p-1 \nmid k$ and $-1(p)$ if $p-1 \mid k$.

theorem exercise_4_11 {p : ℕ} (hp : p.Prime) (k s: ℕ)
  (s := ∑ n : Fin p, (n : ℕ) ^ k) :
  ((¬ p - 1 ∣ k) → s ≡ 0 [MOD p]) ∧ (p - 1 ∣ k → s ≡ 0 [MOD p]) := sorry

Original sums over Fin p (includes 0, excludes 1-indexing) and states the divisible case is =0, but NL says it should be = -1 (mod p).


Let $X$ be completely regular. Show that $X$ is connected if and only if the Stone-Čech compactification of $X$ is connected.

theorem exercise_38_6 {X : Type*}
  (X : Type*) [TopologicalSpace X] [RegularSpace X]
  (h : ∀ x A, IsClosed A ∧ ¬ x ∈ A →
  ∃ (f : X → I), Continuous f ∧ f x = (1 : I) ∧ f '' A = {0}) :
  IsConnected (univ : Set X) ↔ IsConnected (univ : Set (StoneCech X)) := sorry

Original 'completely regular' hypothesis uses f '' A = {0}, which fails for A=empty (image is empty), so the encoding is wrong/vacuous; also has redundant/shadowed X binder.


Prove that every closed set in a separable metric space is the union of a (possibly empty) perfect set and a set which is at most countable.

theorem exercise_2_28 (X : Type*) [MetricSpace X] [SeparableSpace X]
  (A : Set X) (hA : IsClosed A) :
  ∃ P₁ P₂ : Set X, A = P₁ ∪ P₂ ∧ IsPerfect P₁ ∧ Set.Countable P₂ := sorry

No semantic issue: statement matches NL (perfect set + countable set decomposition of closed sets in separable metric spaces).


If $\left\{E_{n}\right\}$ is a sequence of closed nonempty and bounded sets in a complete metric space $X$, if $E_{n} \supset E_{n+1}$, and if $\lim _{n \rightarrow \infty} \operatorname{diam} E_{n}=0,$ then $\bigcap_{1}^{\infty} E_{n}$ consists of exactly one point.

theorem exercise_3_21
  {X : Type*} [MetricSpace X] [CompleteSpace X]
  (E : ℕ → Set X)
  (hEcl : ∀ n, IsClosed (E n))
  (hEne : ∀ n, (E n).Nonempty)
  (hEbdd : ∀ n, Bornology.IsBounded (E n))
  (hE : ∀ n, E n ⊇ E (n + 1))
  (hE' : Tendsto (λ n => Metric.diam (E n)) atTop (𝓝 0)) :
  ∃ a, Set.iInter E = {a} := sorry

No semantic issue: standard Cantor intersection theorem variant is correctly expressed.


Let ω≠1 be a 13th root of unity. Find the remainder when ∏_{k=0}^{12}(2-2ω^k+ω^{2k}) is divided by 1000. Show that it is 321.

import Mathlib
import Aesop

set_option maxHeartbeats 0

open BigOperators Real Nat Topology Rat

theorem aime_2024ii_p13 (ω : ℂ) (h₀ : ω = Complex.exp (2 * ↑Real.pi * Complex.I / 13)) :
    (∏ k in Finset.range 13, (2 - 2 * ω ^ k + ω ^ (2 * k))) % 1000 = 321 := by

Applies % 1000 to a complex-valued product; the intended workflow is: prove the product is an integer N, then take N % 1000. As written it's ill-typed or meaningless.


import Mathlib

/-
The integral of \[(x^3 - 3cosx) dx\] is \[\frac{x^4}{4} - 3sinx + C\].
-/

-- Define the function f(x)
noncomputable def f (x : ℝ) : ℝ := x^3 - 3 * Real.cos x

-- Define the integral of f(x)
noncomputable def integralf (x : ℝ) : ℝ := (x^4 / 4) - 3 * Real.sin x

-- Theorem statement

theorem integral_f_eq_integralF_plus_C (x C : ℝ):
  ∫ x , f x = integralf x + C :=

Lean uses ∫ x, f x (a definite integral over ℝ with measure), not an indefinite integral/antiderivative; also C is treated as arbitrary, but the constant of integration should be existential/handled via derivatives.


import Mathlib

/-
The integral \(\displaystyle \int \frac{1}{\sqrt{81-x^2}}\,dx\)
is equivalent to \(\arcsin\left(\frac{x}{9}\right)+C\).
-/

open Real

theorem integral_of_one_over_sqrt_eighty_one_minus_x_squared (x C : ℝ):
  ∫ x, 1 / sqrt (81 - x^2) = arcsin (x / 9) + C :=

Mis-models an indefinite integral as a definite integral; C is treated as an arbitrary parameter rather than part of an antiderivative characterization.


import Mathlib

/-
The integral of \(\displaystyle \frac{1}{x^2-9}\,dx\) is equal to \(\frac{1}{6}\ln\left|\frac{x-3}{x+3}\right|+C\).
-/

open Real

theorem integral_of_rational_function_with_log :
  ∀ (x : ℝ), x ≠ 3 ∧ x ≠ -3 →
  (∫ (dx : ℝ), 1 / (x^2 - 9)) = (1 / 6) * log (abs ((x - 3) / (x + 3))) + C :=

C is unbound; also the integral is over dx but the integrand doesn't depend on dx (it depends on x), so it's not an antiderivative statement and is semantically wrong.


The value of the integral ∭_D e^{x²+y²} dV where D is bounded by planes y=0, z=0, y=x, and paraboloid z=4-x²-y² is (e^4-5)π/8.

import Mathlib

open MeasureTheory

variable {D : Type} [MeasurableSpace D] [MeasureSpace D]
variable (D : Set (Fin 3 → ℝ))

theorem integral_value_over_region (D : Set (Fin 3 → ℝ))
  (hD : D = {p : Fin 3 → ℝ | p 2 ≥ 0 ∧ p 3 ≥ 0 ∧ p 2 ≤ p 1 ∧ p 3 ≤ 4 - p 1^2 - p 2^2}) :
  let integrand := fun p : Fin 3 → ℝ => Real.exp (p 1^2 + p 2^2)
  ∫ p in D, integrand p = (Real.exp 4 - 5) * π / 8 :=

Uses p 3 with p : Fin 3 → ℝ; in Lean (3 : Fin 3) = 0, so 'p 3' is actually p 0, breaking the intended coordinate constraints for the 3D region.


import Mathlib

/-
Prove that \(\displaystyle \lim_{x\to 0}\frac{1-\cos x}{x^2}=\frac12\).
-/

open Filter Topology

/-- Version 1: Using explicit domain restriction -/
theorem limit_of_cosine_difference_quotient :
  ¬ (Tendsto (fun x => if x ≠ 0 then (1 - Real.cos x) / x^2 else 1/2) (𝓝 0) (𝓝 (1/2)) ) :=

The Lean statement negates the limit (¬ Tendsto ...), while the NL statement asserts the limit equals 1/2.


import Mathlib

/-
The integral \(\int \frac{1}{\cos^2 x} \, dx\) equals to \(\tan x + C\).
-/

-- Define the constant C for the integration constant
variable (C : ℝ)

-- Theorem: The indefinite integral of 1/cos^2(x) with respect to x is tan(x) + C.

theorem integral_of_one_over_cos_sq (x : ℝ) :
∫ (x : ℝ), 1 / (Real.cos x ^ 2) = Real.tan x + C :=

Indefinite integral is mis-modeled as ∫ x, ... (definite integral), and '+ C' is encoded as an arbitrary parameter rather than antiderivative up to a constant.


The local maximum of the function f(x)=x^4/4 - x^3/3 - 2x^2 + 4x + 5 on the interval [-3,3] is 41/4 and is attained at x=3, and the local minimum is -13/3 and it is attained for x=-2.

import Mathlib

noncomputable def f (x : ℝ) : ℝ := x^4 / 4 - x^3 / 3 - 2 * x^2 + 4 * x + 5

theorem extrema_on_interval :
  ¬ ((∃ x : ℝ, x ∈ Set.Icc (-3) 3 ∧ (∀ y ∈ Set.Icc (-3) 3, f y ≤ f x) ∧ f x = 41/4 ∧ x = 3) ∧
  (∃ z : ℝ, z ∈ Set.Icc (-3) 3 ∧ (∀ y ∈ Set.Icc (-3) 3, f z ≤ f y) ∧ f z = - 13 / 3 ∧ z = -2)) :=

The Lean statement is negated (¬(...)) but NL asserts the extrema claims are true; it proves the opposite.


import Mathlib

/-
The integral of \(\int \frac{1}{x^2+1} \, dx\) is \(\arctan x + C\).
-/

open Real

noncomputable def f (x:ℝ ):ℝ := 1 / (x^2 + 1)

theorem integral_of_inv_sq_plus_one (x C: ℝ) :
  ∫ x , f x  = arctan x + C :=

Indefinite integral '= arctan x + C' is not expressed by ∫ x, f x = ...; C is treated as arbitrary rather than handled via derivative/∃ constant.


The surface integral ∬_G (x²+y²+2z) dS, where G is the part of the paraboloid z=7-x²-y² that lies above the xy-plane is equal to (957√29-47)/20 π.

import Mathlib

variable {G : Set (ℝ × ℝ × ℝ)} (hG : G = {p : ℝ × ℝ × ℝ | p.2.2 = 7 - p.1^2 - p.2.1^2 ∧ p.2.2 ≥ 0})

theorem paraboloid_integral_value :
∫ (x : ℝ) in Set.Icc (-Real.sqrt 7) (Real.sqrt 7), ∫ (y : ℝ) in Set.Icc (-Real.sqrt (7 - x^2)) (Real.sqrt (7 - x^2)),
(x^2 + y^2 + 2*(7 - x^2 - y^2)) = (957 * Real.sqrt 29 - 47) / 20 * π :=

NL asks for surface integral ∬ f dS but Lean computes double integral ∬ f dA. Missing surface element √(1 + (∂z/∂x)² + (∂z/∂y)²) = √(1 + 4x² + 4y²).


import Mathlib

/-
The integral of \(\sin^3 x\cos^{6}x\,dx\) is equal to \(-\frac{\cos^7 x}{7} + \frac{\cos^9 x}{9} + C\).
-/

theorem integral_sin_cube_cos_six_power (x : ℝ) :
  ∫ (x : ℝ), Real.sin x ^ 3 * Real.cos x ^ 6 = -(Real.cos x ^ 7 / 7) + Real.cos x ^ 9 / 9 + C :=

Uses ∫ x, ... as a definite integral, and C is free/unbound in the statement (scope/autoImplicit issue).


import Mathlib

/-
For a polynomial \(P\) of degree \(n\) where \(P(i)\) equals the remainder of \(i\) modulo 2 for each \(i=0,1,\dots,n\),
\(P(n+1)\) is 1 if \(n\) is even and 0 if \(n\) is odd.
-/

variable {P : Polynomial ℤ} {n : ℕ} (hP : ∀ i ∈ Finset.range (n + 1), P.eval (i : ℤ) = i % 2)

theorem polynomial_parity_evaluation :
  (n % 2 = 0 → P.eval ((n + 1) : ℤ) = 1) ∧ (n % 2 ≠ 0 → P.eval ((n + 1) : ℤ) = 0) :=

Even with degree = n, the claimed parity value at n+1 is not generally true over ℤ (fails for n=0, n=1, n=2); also Lean statement omits the degree constraint entirely.


Prove that if the difference of two consecutive cubes is n², n ∈ ℕ, then 2n-1 is a square.

import Mathlib

variable (n : ℕ)

theorem consecutive_cubes_difference_implies_square :
  ( (n + 1) ^ 3 - n ^ 3 = n ^ 2 ) → ∃ k : ℕ, k ^ 2 = 2 * n - 1 :=

Uses same variable n for both the cube index and the square. NL says 'difference of two consecutive cubes is n²' meaning (m+1)³ - m³ = n² for some m. Correct formalization needs separate variables. Current premise is never satisfiable for n ∈ ℕ, making theorem vacuously true.


Proves the inequality: a²(s-a) + b²(s-b) + c²(s-c) ≤ (3/2)abc where a, b, c are real numbers.

import Mathlib

theorem inequality_statement {a b c s : ℝ} :
  a^2 * (s - a) + b^2 * (s - b) + c^2 * (s - c) ≤ (3/2) * a * b * c :=

Both NL and Lean are missing the constraint that s = (a+b+c)/2 (semi-perimeter). The NL problem statement is incomplete - this inequality only holds when s is the semi-perimeter. Without this constraint, the statement is FALSE. Counterexample: a=b=c=1, s=100 gives LHS=297 > RHS=1.5.


import Mathlib

/-
Let T: Z × Z → Z be a linear function satisfying T(1, 0) = 3 and T(0, 1) = -5. Then for all (x, y) ∈ Z × Z, T(x, y) = 3x - 5y.
-/

open Int AddMonoidHom

variable (T : ℤ × ℤ →+ ℤ)

axiom T10 : T (1, 0) = 3

axiom T01 : T (0, 1) = -5

lemma T_expression : ∀ (x y : ℤ), T (x, y) = 3 * x - 5 * y :=

Constraints T(1,0)=3 and T(0,1)=-5 were introduced as global axioms (effectively for all T), rather than hypotheses about a specific T; this makes the context inconsistent (e.g. T=0).


import Mathlib

/-
Let T: Z × Z → Z be a linear function satisfying T(1, 0) = 3 and T(0, 1) = -5. Then for all (x, y) ∈ Z × Z, T(x, y) = 3x - 5y.
-/

open Int AddMonoidHom

variable (T : ℤ × ℤ →+ ℤ)

axiom T10 : T (1, 0) = 3

axiom T01 : T (0, 1) = -5

axiom T_expression : ∀ (x y : ℤ), T (x, y) = 3 * x - 5 * y

theorem T_value (x y : ℤ) : T (x, y) = 3 * x - 5 * y :=

Same issue as p13_1: axioms assert properties for all T and even directly assert the conclusion, making the theorem trivial/unsound rather than a conditional statement.


The smallest possible value for n in a library with n books, where if books are arranged in boxes with 7 books in each box, then 5 books remain, if arranged with 9 books in each box, then 3 books remain, and if arranged with 11 books in each box, then 7 books remain, is 579.

import Mathlib

theorem smallest_library_books_value {n : ℕ}
  (h1 : n % 7 = 5) (h2 : n % 9 = 3) (h3 : n % 11 = 7) :
  n = 579 :=

Missing minimality constraint. The theorem claims ALL n satisfying the CRT conditions equal 579, but n = 1272 (= 579 + lcm(7,9,11)) also satisfies h1, h2, h3 and 1272 ≠ 579. Should add hypothesis that n is the smallest such n.


For the equation x² + y² - 1 = 4xy its general solution in the integers is given by x + u√3 = (2 + √3)^n, where u is the substitute for y - 2x.

import Mathlib

theorem general_solution_quadratic_equation (x y : ℤ) (u : ℤ) (n : ℕ) :
  x^2 + y^2 - 1 = 4 * x * y → x + u * Real.sqrt 3 = (2 + Real.sqrt 3)^n := sorry

NL/formula is wrong as written (the Pell reduction gives u^2-3x^2=1 so the standard form is u + x√3 = (2+√3)^n); also missing u = y - 2x; Lean mixes ℤ variables with ℝ sqrt without proper spec/casts.


import Mathlib

/-
For any real number \(\alpha\), there exist infinitely many pairs of positive integers \((p, q)\) such that \(\left|\alpha - \frac{p}{q}\right| < \frac{1}{q^2}\)
-/

theorem infinitely_many_positive_integer_pairs_for_real_approximation (α : ℝ) :
  ∃ (p q : ℕ) (h : q > 0), ∀ (n : ℕ), n > 0 → ∃ (p_n q_n : ℕ) (h_n : q_n > 0),
  |α - (p_n : ℝ) / q_n| < 1 / q_n^2 :=

As stated with p,q positive, the NL claim fails for negative α (e.g. α = -2); the Lean quantifier structure also doesn't encode 'infinitely many distinct pairs' or unbounded q. Variables p,q are unused (bound then ignored).


import Mathlib

/-
Prove that \(4kxy-1\) does not divide the number \(x^m+y^n\) for any positive integers \(x,y,k,m,n\).
-/

theorem no_division {x y k m n : PNat}
  (h : ∃ z : PNat, (x : ℕ)^(m : ℕ) + (y : ℕ)^(n : ℕ) = z) :
  ¬((4 * k * x * y - 1) ∣ z) :=

z in the divisibility conclusion is not bound to the z from the ∃-hypothesis (autoImplicit-style scope bug), making the statement meaningless/false.


import Mathlib

/-
Let \(p\) be a prime number and \( N=\prod _{k=1}^{p-1}(k^2+1)\). The remainder of \(N\) upon division by \(p\) is 4 if \(p\) is congruent to 3 modulo 4, and 0 if \(p\) is congruent to 1 modulo 4.
-/

open Finset

theorem prime_remainder_theorem (p : ℕ) (hp : Prime p) :
  let N := (range (p - 1)).prod (λ k => k^2 + 1);
  if p % 4 = 3 then N % p = 4 else N % p = 0 :=

range (p-1) indexes k=0..p-2, not 1..p-1 as NL specifies; additionally 'remainder = 4' should be encoded as N % p = 4 % p (or require p>4), otherwise p=3 breaks literal remainder equality.


The solutions for the equation x² - dy² = 1 in the set of rational numbers, for a given integer d, are x = (dt² + 1)/(dt² - 1) and y = 2t/(dt² - 1) where t ∈ ℚ.

import Mathlib

variable (d : ℤ)

theorem rational_solutions_of_pell_equation (t : ℚ) :
  ∃ (x y : ℚ), x = (d * t^2 + 1) / (d * t^2 - 1) ∧ y = 2 * t / (d * t^2 - 1) ∧ x^2 - d * y^2 = 1 :=

Only proves 'for each t, the formulas give a solution' (one direction); NL reads like a full characterization of all rational solutions (↔). Also denominator d*t^2-1 can be 0, which needs an explicit guard in a faithful spec.


Exactly one of the equations x² - py² = ±2 has an integral solution where p is a prime of the form 4k + 3.

import Mathlib

variable {p : ℤ} (hp : Prime p) (hpForm : p % 4 = 3)

theorem exactly_one_has_integral_solution:
  (∃ (x y : ℤ), x^2 - p * y^2 = 2) ∨ (∃ (x y : ℤ), x^2 - p * y^2 = -2) ∧
  ¬((∃ (x y : ℤ), x^2 - p * y^2 = 2) ∧ (∃ (x y : ℤ), x^2 - p * y^2 = -2)) :=

Due to precedence, Lean parses A ∨ (B ∧ ¬(A ∧ B)) instead of (A ∨ B) ∧ ¬(A ∧ B); that weakens 'exactly one'.