def
definition
one
show as:
view math explainer →
open explainer
Read the cached plain-language explainer.
open lean source
IndisputableMonolith.Foundation.RationalsFromLogic on GitHub at line 117.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
-
costRateEL_implies_const_one -
geodesicEquationHolds -
actionJ_convex_on_interp -
actionJ_local_min_is_global -
actionJ_minimum_unique_value -
no_eighth_plot -
Jcost_anti_mono_on_unit_interval -
symmetryGroupPreferenceCert -
canonicalRecognitionCostSystem_cost_inv -
shiftedCompose_val -
windowSums -
PhiInt -
PhiInt -
phiInt_sq -
phi_ring_certificate -
canonicalPhiRingObj -
initial_morphism_exists -
phiRing_comp -
PhiRingHom -
PhiRingObj -
trivial -
eV_to_J_pos -
rs_pattern -
ml_nucleosynthesis_eq_phi -
NuclearTier -
r_orbit_adjacent_ratio_band -
bimodal_ratio_lt_phi_nine -
ml_is_phi_power -
fr_valence_one -
essentialSymmetry -
noble_gas_ea_zero -
normalizedEA -
predictedI1_eV -
ForcingDominatedConvergenceAt -
galerkin_duhamelKernel_identity -
coeffSign -
encodeIndex -
DecodedSimulationHypothesis -
decodeGalerkin2D -
SimulationHypothesis
formal source
114 exact one_ne_zero this)
115
116/-- One in `LogicRat`. -/
117def one : LogicRat :=
118 mk 1 1 (by
119 intro h
120 have : toInt (1 : LogicInt) = toInt (0 : LogicInt) := congrArg toInt h
121 rw [toInt_one, toInt_zero] at this
122 exact one_ne_zero this)
123
124instance : Zero LogicRat := ⟨zero⟩
125instance : One LogicRat := ⟨one⟩
126
127/-- Negation: `-(a/b) = (-a)/b`. -/
128def neg : LogicRat → LogicRat :=
129 Quotient.lift
130 (fun (p : PreRat) => mk (-p.num) p.den p.den_nonzero)
131 (by
132 rintro ⟨a, b, hb⟩ ⟨c, d, hd⟩ h
133 show mk (-a) b hb = mk (-c) d hd
134 apply sound
135 show -a * d = -c * b
136 have h' : a * d = c * b := h
137 rw [eq_iff_toInt_eq, toInt_mul, toInt_mul, toInt_neg, toInt_neg]
138 have h'' : toInt a * toInt d = toInt c * toInt b := by
139 have := congrArg toInt h'
140 rwa [toInt_mul, toInt_mul] at this
141 linarith)
142
143instance : Neg LogicRat := ⟨neg⟩
144
145/-- Addition: `(a/b) + (c/d) = (a*d + c*b) / (b*d)`. -/
146def add : LogicRat → LogicRat → LogicRat :=
147 Quotient.lift₂