theorem
proved
add_comm
show as:
view math explainer →
open explainer
Read the cached plain-language explainer.
open lean source
IndisputableMonolith.Foundation.ArithmeticFromLogic on GitHub at line 161.
browse module
All declarations in this module, on Recognition.
explainer page
Derivations using this theorem
depends on
used by
-
H_dAlembert -
sub_eq_add -
PhiInt -
PhiInt -
canonicalPhiRingObj -
costFamily_neg_param -
PhiRingObj -
galerkinNS_hasDerivAt_duhamelRemainder_mode -
unitSphereSurface_D3 -
Jcost_one_plus_eps_quadratic -
Jcost_small_strain_bound -
dAlembert_to_ODE_general -
dAlembert_to_ODE_general -
dAlembert_product -
dAlembert_to_ODE_general_theorem -
dAlembert_to_ODE_theorem -
dAlembert_to_ODE_theorem -
Jcost_one_plus_eps_quadratic -
Jcost_small_strain_bound -
Jcost_log_second_deriv_normalized -
neutralityScore_shift1_of_periodic8 -
add_right_cancel -
dalembert_deriv_ode -
defect_symmetric -
fromInt_toInt -
conservation_from_balance -
kernel_response_limit -
response_function_is_real_part -
n_of_r_mono_A_of_nonneg_p -
cone_bound -
cone_bound_saturates -
reach_rad_le -
reach_time_eq -
ledger_fraction_kn_forced_under_passive_bound -
ledger_fraction_numerator_offset_forced -
anchor_ratio -
roots_form_group -
fib_recurrence -
measurement_bridge_C_eq_2A -
pathFromRotation
formal source
158 show (a + b) + succ c = a + (b + succ c)
159 rw [add_succ, add_succ, add_succ, ih]
160
161theorem add_comm (a b : LogicNat) : a + b = b + a := by
162 induction b with
163 | identity =>
164 show a + zero = zero + a
165 rw [add_zero, zero_add]
166 | step b ih =>
167 show a + succ b = succ b + a
168 rw [add_succ, succ_add, ih]
169
170/-- Multiplication by recursion on the second argument. -/
171def mul : LogicNat → LogicNat → LogicNat
172 | _, .identity => zero
173 | n, .step m => mul n m + n
174
175instance : Mul LogicNat := ⟨mul⟩
176
177@[simp] theorem mul_def (n m : LogicNat) : n * m = mul n m := rfl
178
179@[simp] theorem mul_zero (n : LogicNat) : n * zero = zero := rfl
180
181@[simp] theorem mul_succ (n m : LogicNat) : n * succ m = n * m + n := rfl
182
183theorem zero_mul (n : LogicNat) : zero * n = zero := by
184 induction n with
185 | identity => rfl
186 | step n ih =>
187 show zero * succ n = zero
188 rw [mul_succ, ih, zero_add]
189
190theorem mul_one (n : LogicNat) : n * succ zero = n := by
191 show n * succ zero = n