import Mathlib

-- Precondition definitions
@[reducible, simp]
def sieve_of_eratosthenes_precond (n : Nat) : Prop :=
  -- !benchmark @start precond
  n ≤ 100_000
  -- !benchmark @end precond

-- !benchmark @start auxcode
-- !benchmark @end auxcode

-- Main function definitions
def sieve_of_eratosthenes (n : Nat) (h_precond : sieve_of_eratosthenes_precond n) : Array Bool :=
  -- !benchmark @start code
  sorry
  -- !benchmark @end code

-- Postcondition definitions
@[reducible, simp]
def sieve_of_eratosthenes_postcond (n : Nat) (result : Array Bool) (h_precond : sieve_of_eratosthenes_precond n) : Prop :=
  -- !benchmark @start postcond
  result.size = n ∧
  ∀ i : Nat, i < n →
    (result.getD i false = true) ↔
      (i > 1 ∧ ∀ d : Nat, (1 < d ∧ d < i) → i % d ≠ 0)
  -- !benchmark @end postcond

-- !benchmark @start lemma
-- !benchmark @end lemma

-- Proof content
theorem sieve_of_eratosthenes_postcond_satisfied (n : Nat) (h_precond : sieve_of_eratosthenes_precond n) :
    sieve_of_eratosthenes_postcond n (sieve_of_eratosthenes n h_precond) h_precond := by
  -- !benchmark @start proof
  sorry
  -- !benchmark @end proof