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 PA statement
forall B p a. ~(p = 0) -> ((exists qr_x_search_yes. (exists qr_bound_search_yes. qr_bound_search_yes + qr_x_search_yes = B) /\ (exists qr_u_search_yes qr_v_search_yes. qr_x_search_yes * qr_x_search_yes + p * qr_u_search_yes = a + p * qr_v_search_yes)) \/ (forall qr_x_search_no. (exists qr_bound_search_no. qr_bound_search_no + qr_x_search_no = B) -> ~(exists qr_u_search_no qr_v_search_no. qr_x_search_no * qr_x_search_no + p * qr_u_search_no = a + p * qr_v_search_no)))Structural proof guide
Generated structural guide
Inclusive bounded search constructively decides square congruence.
Use the direct prerequisites mod_eq_decidable_nonzero, add_eq_zero_right, le_eq_or_lt, add_succ_left, zero_add as previously established PA formulas.
The proof proceeds by structural induction (1), case analysis (9), intermediate claims (5), equality transport (4), certified simplification (2).
Referenced ingredients
Proof neighborhood
Direct dependencies
PA005K mod_eq_decidable_nonzero PA0004 add_eq_zero_right PA000W le_eq_or_lt PA000E add_succ_left PA0001 zero_addDirect dependents
Formal native tactic body
Dependencies are introduced as named hypotheses before line 1. Linked names are exact direct references. This Stable checked-use theorem is independently kernel-checked when replayed.
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 (5)
01Induction on BL1–4
02Establish hdecL5–10
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply mod eq decidable nonzero.
03Separate the logical casesL11–12
04Construct an explicit witnessL13–13
Supply the displayed value, then prove that it has the required property.
- L13
exists 0
05Separate the logical casesL14–14
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L14
split
06Construct an explicit witnessL15–15
Supply the displayed value, then prove that it has the required property.
- L15
exists 0
07Calculate and transport equalitiesL16–16
Carry out the recorded arithmetic or equality steps; inspect the exact commands for their direction and premises.
- L16
simp
08Use earlier factsL17–17
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L17
exact hdec_left
09Separate the logical casesL18–18
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L18
right
10Fix variables and assumptionsL19–21
11Separate the logical casesL22–22
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L22
cases hx
12Establish hx0L23–32
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply add eq zero right.
13Fix variables and assumptionsL33–34
14Establish hprevL35–39
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply IH.
15Separate the logical casesL40–43
16Construct an explicit witnessL44–44
Supply the displayed value, then prove that it has the required property.
- L44
exists x
17Separate the logical casesL45–46
18Construct an explicit witnessL47–47
Supply the displayed value, then prove that it has the required property.
- L47
exists S x1
19Calculate and transport equalitiesL48–48
Carry out the recorded arithmetic or equality steps; inspect the exact commands for their direction and premises.
- L48
trans S (x1 + x)
20Use earlier factsL49–49
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L49
apply add_succ_left
21Calculate and transport equalitiesL50–50
Carry out the recorded arithmetic or equality steps; inspect the exact commands for their direction and premises.
- L50
congr
22Use earlier factsL51–52
23Establish hdecL53–58
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply mod eq decidable nonzero.
24Separate the logical casesL59–60
25Construct an explicit witnessL61–61
Supply the displayed value, then prove that it has the required property.
- L61
exists S B
26Separate the logical casesL62–62
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L62
split
27Construct an explicit witnessL63–63
Supply the displayed value, then prove that it has the required property.
- L63
exists 0
28Calculate and transport equalitiesL64–65
29Use earlier factsL66–68
30Separate the logical casesL69–69
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L69
right
31Fix variables and assumptionsL70–72
32Use earlier factsL73–74
33Establish hcasesL75–77
34Separate the logical casesL78–78
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L78
cases hcases
35Use earlier factsL79–79
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L79
apply hdec_right
36Calculate and transport equalitiesL80–81
37Use earlier factsL82–83
38Separate the logical casesL84–84
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L84
cases hcases_right
39Construct an explicit witnessL85–85
Supply the displayed value, then prove that it has the required property.
- L85
exists x1
40Use earlier factsL86–86
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L86
apply PA2
41Calculate and transport equalitiesL87–88
Original exact command ledger · 91 lines
- 0001
induction B - 0002
intro p - 0003
intro a - 0004
intro hp - 0005
have hdec : (exists u v. 0 * 0 + p * u = a + p * v) \/ ~(exists u v. 0 * 0 + p * u = a + p * v) - 0006
specialize mod_eq_decidable_nonzero p - 0007
specialize mod_eq_decidable_nonzero (0 * 0) - 0008
specialize mod_eq_decidable_nonzero a - 0009
apply mod_eq_decidable_nonzero - 0010
exact hp - 0011
cases hdec - 0012
left - 0013
exists 0 - 0014
split - 0015
exists 0 - 0016
simp - 0017
exact hdec_left - 0018
right - 0019
intro x - 0020
intro hx - 0021
intro hs - 0022
cases hx - 0023
have hx0 : x = 0 - 0024
specialize add_eq_zero_right x1 - 0025
specialize add_eq_zero_right x - 0026
apply add_eq_zero_right - 0027
exact hx_witness - 0028
apply hdec_right - 0029
rewrite hx0 at hs - 0030
rewrite hx0 at hs - 0031
exact hs - 0032
intro p - 0033
intro a - 0034
intro hp - 0035
have hprev : (exists x. (exists h. h + x = B) /\ exists u v. x * x + p * u = a + p * v) \/ (forall x. (exists h. h + x = B) -> ~(exists u v. x * x + p * u = a + p * v)) - 0036
specialize IH p - 0037
specialize IH a - 0038
apply IH - 0039
exact hp - 0040
cases hprev - 0041
left - 0042
cases hprev_left - 0043
cases hprev_left_witness - 0044
exists x - 0045
split - 0046
cases hprev_left_witness_left - 0047
exists S x1 - 0048
trans S (x1 + x) - 0049
apply add_succ_left - 0050
congr - 0051
exact hprev_left_witness_left_witness - 0052
exact hprev_left_witness_right - 0053
have hdec : (exists u v. (S B) * (S B) + p * u = a + p * v) \/ ~(exists u v. (S B) * (S B) + p * u = a + p * v) - 0054
specialize mod_eq_decidable_nonzero p - 0055
specialize mod_eq_decidable_nonzero ((S B) * (S B)) - 0056
specialize mod_eq_decidable_nonzero a - 0057
apply mod_eq_decidable_nonzero - 0058
exact hp - 0059
cases hdec - 0060
left - 0061
exists S B - 0062
split - 0063
exists 0 - 0064
simp - 0065
congr - 0066
specialize zero_add B - 0067
exact zero_add - 0068
exact hdec_left - 0069
right - 0070
intro x - 0071
intro hx - 0072
intro hs - 0073
specialize le_eq_or_lt x - 0074
specialize le_eq_or_lt (S B) - 0075
have hcases : x = S B \/ exists k. k + S x = S B - 0076
apply le_eq_or_lt - 0077
exact hx - 0078
cases hcases - 0079
apply hdec_right - 0080
rewrite hcases_left at hs - 0081
rewrite hcases_left at hs - 0082
exact hs - 0083
apply hprev_right - 0084
cases hcases_right - 0085
exists x1 - 0086
apply PA2 - 0087
trans x1 + S x - 0088
symm - 0089
apply PA4 - 0090
exact hcases_right_witness - 0091
exact hs