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 p n x. p = S n -> ((~(p = 1) /\ forall wsq_prime_left_prime wsq_prime_right_prime. p = wsq_prime_left_prime * wsq_prime_right_prime -> wsq_prime_left_prime = 1 \/ wsq_prime_right_prime = 1)) -> (exists wsq_positive_gap_positive. wsq_positive_gap_positive + 1 = x) -> (exists wsq_strict_gap_bounded. wsq_strict_gap_bounded + S x = p) -> (exists wsq_mod_left_square_one wsq_mod_right_square_one. x * x + p * wsq_mod_left_square_one = 1 + p * wsq_mod_right_square_one) -> x = 1 \/ x = nStructural proof guide
Generated structural guide
A bounded square root of one modulo a prime is one or the prime predecessor.
Use the direct prerequisites ne_zero_of_one_le, nonzero_is_succ, mul_succ_left, add_assoc, add_comm, add_left_cancel, factor_difference, euclid_prime_dvd_product, le_succ_self, lt_of_le_of_lt, zero_or_succ, divisor_le_nonzero, lt_not_le, succ_ne_zero, le_antisymm, succ_injective as previously established PA formulas.
The proof proceeds by case analysis (7), intermediate claims (18), equality transport (6).
Referenced ingredients
PA003U ne_zero_of_one_le PA001V nonzero_is_succ PA000G mul_succ_left PA0009 add_assoc PA000F add_comm PA002B add_left_cancel PA0013 factor_difference PA0038 euclid_prime_dvd_product PA000Q le_succ_self PA0033 lt_of_le_of_lt PA0008 zero_or_succ PA0039 divisor_le_nonzero PA003A lt_not_le PA0005 succ_ne_zero PA0069 le_antisymm PA003V succ_injectiveProof neighborhood
Direct dependencies
PA003U ne_zero_of_one_le PA001V nonzero_is_succ PA000G mul_succ_left PA0009 add_assoc PA000F add_comm PA002B add_left_cancel PA0013 factor_difference PA0038 euclid_prime_dvd_product PA000Q le_succ_self PA0033 lt_of_le_of_lt PA0008 zero_or_succ PA0039 divisor_le_nonzero PA003A lt_not_le PA0005 succ_ne_zero PA0069 le_antisymm PA003V succ_injectiveDirect dependents
Formal native tactic body
Dependencies are introduced as named hypotheses before line 1. Linked names are exact direct references. This Alpha-v25 checked-use theorem is independently kernel-checked when replayed; it is not a Stable theorem.
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 (16)
01Fix variables and assumptionsL1–8
02Separate the logical casesL9–9
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L9
cases hp
03Establish hprimeL10–10
Establish this local claim before using it. It is not an additional assumption.
- L10
have hprime : (~(p = 1) /\ forall wsq_prime_left_prime wsq_prime_right_prime. p = wsq_prime_left_prime * wsq_prime_right_prime -> wsq_prime_left_prime = 1 \/ wsq_prime_right_prime = 1)
04Separate the logical casesL11–11
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L11
split
05Use earlier factsL12–13
06Establish hx0L14–19
07Establish hxpredL20–23
08Separate the logical casesL24–24
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L24
cases hxpred
09Establish hsquareL25–34
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply PA4.
10Calculate and transport equalitiesL35–36
11Use earlier factsL37–37
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L37
apply PA4
12Calculate and transport equalitiesL38–38
Carry out the recorded arithmetic or equality steps; inspect the exact commands for their direction and premises.
- L38
congr
13Use earlier factsL39–39
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L39
apply PA3
14Calculate and transport equalitiesL40–40
Carry out the recorded arithmetic or equality steps; inspect the exact commands for their direction and premises.
- L40
trans 1 + (x1 * S x1 + x1)
15Use earlier factsL41–41
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L41
apply add_comm
16Calculate and transport equalitiesL42–44
17Use earlier factsL45–45
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L45
apply PA6
18Separate the logical casesL46–47
19Establish hcancelL48–57
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply add left cancel.
20Calculate and transport equalitiesL58–58
Carry out the recorded arithmetic or equality steps; inspect the exact commands for their direction and premises.
- L58
symm
21Use earlier factsL59–59
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L59
exact hsquare
22Calculate and transport equalitiesL60–61
23Use earlier factsL62–62
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L62
exact hsquaremod_witness_witness
24Calculate and transport equalitiesL63–63
Carry out the recorded arithmetic or equality steps; inspect the exact commands for their direction and premises.
- L63
refl
25Establish hfactorL64–68
26Establish hproductL69–75
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply factor difference.
27Establish hsplitL76–82
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply euclid prime dvd product.
28Separate the logical casesL83–83
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L83
cases hsplit
29Establish htxL84–87
30Establish htpL88–94
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply lt of le of lt.
31Establish htcaseL95–97
32Separate the logical casesL98–99
33Calculate and transport equalitiesL100–100
Carry out the recorded arithmetic or equality steps; inspect the exact commands for their direction and premises.
- L100
trans S x1
34Use earlier factsL101–101
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L101
exact hxpred_witness
35Calculate and transport equalitiesL102–103
36Separate the logical casesL104–104
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L104
cases htcase_right
37Establish ht0L105–109
38Establish hptL110–115
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply divisor le nonzero.
39Separate the logical casesL116–116
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L116
exfalso
40Use earlier factsL117–121
41Separate the logical casesL122–122
Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.
- L122
right
42Establish hfactor0L123–125
43Establish hpfactorL126–131
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply divisor le nonzero.
44Establish hfactorpL132–134
45Establish hpeqL135–140
46Establish hpred_eqL141–150
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply succ injective.
47Use earlier factsL151–151
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L151
exact hpred_eq
Original exact command ledger · 151 lines
- 0001
intro p - 0002
intro n - 0003
intro x - 0004
intro hpn - 0005
intro hp - 0006
intro hxpos - 0007
intro hxlt - 0008
intro hsquaremod - 0009
cases hp - 0010
have hprime : (~(p = 1) /\ forall wsq_prime_left_prime wsq_prime_right_prime. p = wsq_prime_left_prime * wsq_prime_right_prime -> wsq_prime_left_prime = 1 \/ wsq_prime_right_prime = 1) - 0011
split - 0012
exact hp_left - 0013
exact hp_right - 0014
have hx0 : ~(x = 0) - 0015
specialize ne_zero_of_one_le x - 0016
intro hxzero - 0017
apply ne_zero_of_one_le - 0018
exact hxpos - 0019
exact hxzero - 0020
have hxpred : exists t. x = S t - 0021
specialize nonzero_is_succ x - 0022
apply nonzero_is_succ - 0023
exact hx0 - 0024
cases hxpred - 0025
have hsquare : x * x = 1 + x1 * S (S x1) - 0026
rewrite hxpred_witness - 0027
rewrite hxpred_witness - 0028
specialize mul_succ_left x1 - 0029
specialize mul_succ_left (S x1) - 0030
trans x1 * S x1 + S x1 - 0031
exact mul_succ_left - 0032
trans S (x1 * S x1 + x1) - 0033
apply PA4 - 0034
trans (x1 * S x1 + x1) + 1 - 0035
symm - 0036
trans S ((x1 * S x1 + x1) + 0) - 0037
apply PA4 - 0038
congr - 0039
apply PA3 - 0040
trans 1 + (x1 * S x1 + x1) - 0041
apply add_comm - 0042
congr - 0043
refl - 0044
symm - 0045
apply PA6 - 0046
cases hsquaremod - 0047
cases hsquaremod_witness - 0048
have hcancel : x1 * S (S x1) + p * x2 = p * x3 - 0049
specialize add_left_cancel 1 - 0050
specialize add_left_cancel (x1 * S (S x1) + p * x2) - 0051
specialize add_left_cancel (p * x3) - 0052
apply add_left_cancel - 0053
trans (1 + x1 * S (S x1)) + p * x2 - 0054
symm - 0055
apply add_assoc - 0056
trans x * x + p * x2 - 0057
congr - 0058
symm - 0059
exact hsquare - 0060
refl - 0061
trans 1 + p * x3 - 0062
exact hsquaremod_witness_witness - 0063
refl - 0064
have hfactor : p * x3 = p * x2 + x1 * S (S x1) - 0065
trans x1 * S (S x1) + p * x2 - 0066
symm - 0067
exact hcancel - 0068
apply add_comm - 0069
have hproduct : exists w. x1 * S (S x1) = p * w - 0070
specialize factor_difference p - 0071
specialize factor_difference x3 - 0072
specialize factor_difference x2 - 0073
specialize factor_difference (x1 * S (S x1)) - 0074
apply factor_difference - 0075
exact hfactor - 0076
have hsplit : (exists u. x1 = p * u) \/ exists v. S (S x1) = p * v - 0077
specialize euclid_prime_dvd_product p - 0078
specialize euclid_prime_dvd_product x1 - 0079
specialize euclid_prime_dvd_product (S (S x1)) - 0080
apply euclid_prime_dvd_product - 0081
exact hprime - 0082
exact hproduct - 0083
cases hsplit - 0084
have htx : exists k. k + x1 = x - 0085
rewrite hxpred_witness - 0086
specialize le_succ_self x1 - 0087
exact le_succ_self - 0088
have htp : exists k. k + S x1 = p - 0089
specialize lt_of_le_of_lt x1 - 0090
specialize lt_of_le_of_lt x - 0091
specialize lt_of_le_of_lt p - 0092
apply lt_of_le_of_lt - 0093
exact htx - 0094
exact hxlt - 0095
have htcase : x1 = 0 \/ exists t. x1 = S t - 0096
specialize zero_or_succ x1 - 0097
exact zero_or_succ - 0098
cases htcase - 0099
left - 0100
trans S x1 - 0101
exact hxpred_witness - 0102
rewrite htcase_left - 0103
refl - 0104
cases htcase_right - 0105
have ht0 : ~(x1 = 0) - 0106
intro htzero - 0107
rewrite htcase_right_witness at htzero - 0108
apply PA1 - 0109
exact htzero - 0110
have hpt : exists k. k + p = x1 - 0111
specialize divisor_le_nonzero p - 0112
specialize divisor_le_nonzero x1 - 0113
apply divisor_le_nonzero - 0114
exact ht0 - 0115
exact hsplit_left - 0116
exfalso - 0117
specialize lt_not_le x1 - 0118
specialize lt_not_le p - 0119
apply lt_not_le - 0120
exact htp - 0121
exact hpt - 0122
right - 0123
have hfactor0 : ~(S (S x1) = 0) - 0124
specialize succ_ne_zero (S x1) - 0125
exact succ_ne_zero - 0126
have hpfactor : exists k. k + p = S (S x1) - 0127
specialize divisor_le_nonzero p - 0128
specialize divisor_le_nonzero (S (S x1)) - 0129
apply divisor_le_nonzero - 0130
exact hfactor0 - 0131
exact hsplit_right - 0132
have hfactorp : exists k. k + S (S x1) = p - 0133
rewrite <- hxpred_witness - 0134
exact hxlt - 0135
have hpeq : p = S (S x1) - 0136
specialize le_antisymm p - 0137
specialize le_antisymm (S (S x1)) - 0138
apply le_antisymm - 0139
exact hpfactor - 0140
exact hfactorp - 0141
have hpred_eq : S x1 = n - 0142
specialize succ_injective (S x1) - 0143
specialize succ_injective n - 0144
apply succ_injective - 0145
trans p - 0146
symm - 0147
exact hpeq - 0148
exact hpn - 0149
trans S x1 - 0150
exact hxpred_witness - 0151
exact hpred_eq