Current library: Alpha v34, 4,223 checked-use theorems; Stable remains 432. Historical first admissions, original proof editions, and non-admitted aliases are preserved. Exact original first-admission records.
Exact expanded first-order arithmetic statement
forall code p n R N. ((((code) = 2 * (p) /\ (n) = 0) \/ exists ge_signed_half_search_signed_decode. (((code) = 2 * ge_signed_half_search_signed_decode + 1 /\ (p) = 0) /\ (n) = S ge_signed_half_search_signed_decode))) -> (((((p) * (p))) + (((n) * (n)))) = ((R) + (((((p) * (n))) + (((n) * (p))))))) -> (exists ge_gap_search_square_bound. ge_gap_search_square_bound + (R) = (N)) -> (exists ge_gap_search_code_bound. ge_gap_search_code_bound + (code) = (2*N))Constructive proof overview
Generated structural guide
A canonical signed code for an integer whose square is bounded by N is at most 2N, for both signs and zero.
The unchanged tactic script uses 6 declared prerequisites and contains 59 exact native proof lines.
Alpha v34 checked-use · first admitted v30 · independently kernel and Lean verified; not Stable
Proof neighborhood
Direct dependencies
GF006D gaussian_search_natural_le_square le_trans Stable theorem; checked-use authorized mul_le_mul_left Stable theorem; checked-use authorized add_succ_left Stable theorem; checked-use authorized zero_add Stable theorem; checked-use authorized mul_zero_left Stable theorem; checked-use authorizedDirect dependents
Formal native tactic body
Dependencies are introduced as named hypotheses before line 1. Local theorem links identify exact declared prerequisites. This exact body belongs to a complete independently kernel-checked constructive proof bundle and has Alpha checked-use authority; it does not imply Stable membership.
Read the argument
Proof checkpoints
This is a reading aid, not a new proof or a proof-tree certificate. Checkpoint groups are consecutive commands, not inferred branch boundaries. Every step links to the preserved script.
Named ingredients (1)
01Fix variables and assumptionsL1–8
02Separate the logical casesL9–10
03Establish heqL11–20
Establish this local claim before using it. It is not an additional assumption.
04Use earlier factsL21–27
05Calculate and transport equalitiesL28–28
Carry out the recorded arithmetic or equality steps; inspect the exact commands for their direction and premises.
- L28
rewrite heq
06Use earlier factsL29–29
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L29
exact hbound
07Separate the logical casesL30–32
08Establish heqL33–38
09Establish hsmallL39–48
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply le trans.
- L39
have hsmall : (exists ge_gap_negative_magnitude_bound. ge_gap_negative_magnitude_bound + (S x) = (N)) - L40
specialize le_trans (S x) - L41
specialize le_trans (S x*S x) - L42
specialize le_trans (N) - L43
apply le_trans - L44
specialize gaussian_search_natural_le_square (S x) - L45
apply gaussian_search_natural_le_square - L46
rewrite heq - L47
exact hbound - L48
rewrite hsigned_right_witness_left_left
10Use earlier factsL49–52
11Construct an explicit witnessL53–53
Supply the displayed value, then prove that it has the required property.
- L53
exists 1
12Calculate and transport equalitiesL54–54
Carry out the recorded arithmetic or equality steps; inspect the exact commands for their direction and premises.
- L54
simp [add_succ_left, zero_add]
Original exact command ledger · 59 lines
- 0001
intro code - 0002
intro p - 0003
intro n - 0004
intro R - 0005
intro N - 0006
intro hsigned - 0007
intro hsquare - 0008
intro hbound - 0009
cases hsigned - 0010
cases hsigned_left - 0011
have heq : p*p=R - 0012
trans p*p+n*n - 0013
simp [hsigned_left_right] - 0014
trans R+(p*n+n*p) - 0015
exact hsquare - 0016
simp [hsigned_left_right, zero_add, mul_zero_left] - 0017
rewrite hsigned_left_left - 0018
specialize mul_le_mul_left (p) - 0019
specialize mul_le_mul_left (N) - 0020
specialize mul_le_mul_left (2) - 0021
apply mul_le_mul_left - 0022
specialize le_trans (p) - 0023
specialize le_trans (p*p) - 0024
specialize le_trans (N) - 0025
apply le_trans - 0026
specialize gaussian_search_natural_le_square (p) - 0027
apply gaussian_search_natural_le_square - 0028
rewrite heq - 0029
exact hbound - 0030
cases hsigned_right - 0031
cases hsigned_right_witness - 0032
cases hsigned_right_witness_left - 0033
have heq : S x*S x=R - 0034
trans p*p+n*n - 0035
simp [hsigned_right_witness_left_right, hsigned_right_witness_right, zero_add] - 0036
trans R+(p*n+n*p) - 0037
exact hsquare - 0038
simp [hsigned_right_witness_left_right, mul_zero_left] - 0039
have hsmall : (exists ge_gap_negative_magnitude_bound. ge_gap_negative_magnitude_bound + (S x) = (N)) - 0040
specialize le_trans (S x) - 0041
specialize le_trans (S x*S x) - 0042
specialize le_trans (N) - 0043
apply le_trans - 0044
specialize gaussian_search_natural_le_square (S x) - 0045
apply gaussian_search_natural_le_square - 0046
rewrite heq - 0047
exact hbound - 0048
rewrite hsigned_right_witness_left_left - 0049
specialize le_trans (2*x+1) - 0050
specialize le_trans (2*S x) - 0051
specialize le_trans (2*N) - 0052
apply le_trans - 0053
exists 1 - 0054
simp [add_succ_left, zero_add] - 0055
specialize mul_le_mul_left (S x) - 0056
specialize mul_le_mul_left (N) - 0057
specialize mul_le_mul_left (2) - 0058
apply mul_le_mul_left - 0059
exact hsmall