abbrev
definition
LogicInt
show as:
view math explainer →
open explainer
Read the cached plain-language explainer.
open lean source
IndisputableMonolith.NumberTheory.LogicLedgerInterop on GitHub at line 18.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
-
add -
add_assoc' -
add_comm' -
add_left_neg' -
add_mul' -
add_zero' -
eq_iff_toInt_eq -
equivInt -
fromInt -
fromInt_toInt -
LogicInt -
mk -
mul -
mul_add' -
mul_assoc' -
mul_comm' -
mul_eq_zero -
mul_one' -
mul_right_cancel -
neg -
ofLogicNat -
ofLogicNat_zero -
one -
one_mul' -
setoid -
sound -
toInt -
toInt_add -
toIntCore_respects -
toInt_mul -
toInt_neg -
toInt_one -
toInt_zero -
zero -
zero_add' -
add_mul' -
fromRat -
mk -
ofLogicInt -
one
formal source
15
16open FinitePhaseCompleteness
17
18abbrev LogicInt := Foundation.IntegersFromLogic.LogicInt
19abbrev logicIntToInt : LogicInt → Int := Foundation.IntegersFromLogic.LogicInt.toInt
20
21/-- A recovered integer ledger is non-identity when its `Int` recovery is
22positive and not equal to one. -/
23structure LogicIntNonIdentityReciprocal (z : LogicInt) : Prop where
24 pos : 0 < logicIntToInt z
25 nonidentity : logicIntToInt z ≠ 1
26 reciprocal_budget : ∃ N : ℕ, 0 < N ∧ Int.natAbs (logicIntToInt z) ∣ N ^ 2
27
28/-- Positive recovered integers yield positive natural carriers. -/
29theorem natAbs_pos_of_logicInt_pos
30 {z : LogicInt}
31 (hz : 0 < logicIntToInt z) :
32 0 < Int.natAbs (logicIntToInt z) := by
33 exact Int.natAbs_pos.mpr (ne_of_gt hz)
34
35/-- Convert a non-identity recovered integer ledger into the Nat-level
36reciprocal ledger used by finite phase completeness. -/
37def reciprocalIntegerLedger_of_logicInt
38 {z : LogicInt}
39 (h : LogicIntNonIdentityReciprocal z) :
40 ReciprocalIntegerLedger where
41 carrier := Int.natAbs (logicIntToInt z)
42 carrier_pos := natAbs_pos_of_logicInt_pos h.pos
43 nonidentity := by
44 intro hcarrier
45 have h_toInt_abs : Int.natAbs (logicIntToInt z) = 1 := hcarrier
46 have h_toInt : logicIntToInt z = 1 := by
47 have habs_cast : (Int.natAbs (logicIntToInt z) : Int) = 1 := by
48 exact_mod_cast h_toInt_abs