Documentation
Marginis
.
RamirezVellis2024
.
AnalysTSP
Search
return to top
source
Imports
Init
Init.Prelude
Init.Data.Int
Lean.Meta.Tactic.LibrarySearch
Mathlib.Algebra.Algebra.Prod
Mathlib.Algebra.CharZero.Defs
Mathlib.Algebra.Group.Basic
Mathlib.Algebra.Group.Even
Mathlib.Algebra.Ring.Parity
Mathlib.Data.Finset.Basic
Mathlib.Data.Rat.Init
Mathlib.Data.Real.Basic
Mathlib.Data.Real.Sqrt
Mathlib.Data.Set.Countable
Mathlib.Data.Set.Function
Mathlib.Logic.Function.Basic
Mathlib.Tactic.Linarith.Frontend
Mathlib.Tactic.Ring.Basic
Mathlib.Topology.MetricSpace.Basic
Mathlib.Topology.MetricSpace.Defs
Mathlib.Data.Rat.Cast.CharZero
Mathlib.Topology.MetricSpace.Pseudo.Basic
Mathlib.Topology.MetricSpace.Pseudo.Lemmas
Mathlib.Topology.MetricSpace.Pseudo.Pi
Mathlib.Algebra.Order.BigOperators.Group.Finset
Imported by
nat_to_int_eq
flip_neg
neg_fit_part
neg_fit
neg_fit_eq_zero_or_one
sign_nonneg_iff_natAbs_eq
neg_fit_iff_pos
spread_fun
spread_fun_inj
spread_fun_inj_explicit
int_countable
infant_Gauss
diag_fun
mul_2_both_sides
n_sq_add_n_monotone
n_sq_add_n_monotone_strict
pred_legit
range_lem
sum_range
sum_range_simp
lemma1
lemma2
lemma2_le
lt_if_lt_add_right
diag_fun_inj
nat_prod_countable
diag_fun_inj_explicit
proj_fst
proj_snd
diag3_fun
diag3_fun_inj
nat_trip_prod_countable
rat_fun
rat_fun_inj
rat_fun_inj_explicit
rat_countable
rat_prod_fun
rat_prod_fun_inj
rat_prod_countable
euclideanNorm
euclideanDist
myPoint1
myPoint2
myPoint3
source
theorem
nat_to_int_eq
(
a
b
:
ℕ
)
:
a
=
b
→
↑
a
=
↑
b
source
theorem
flip_neg
(
a
b
:
ℤ
)
:
a
=
-
b
↔
-
a
=
b
source
def
neg_fit_part
(
z
:
ℤ
)
:
ℕ
Equations
neg_fit_part
0
=
0
neg_fit_part
1
=
0
neg_fit_part
(-
1
)
=
1
neg_fit_part
z
=
2
Instances For
source
def
neg_fit
(
z
:
ℤ
)
:
ℕ
Equations
neg_fit
z
=
neg_fit_part
z
.
sign
Instances For
source
theorem
neg_fit_eq_zero_or_one
(
z
:
ℤ
)
:
neg_fit
z
=
0
∨
neg_fit
z
=
1
source
theorem
sign_nonneg_iff_natAbs_eq
(
z
:
ℤ
)
:
↑
z
.
natAbs
=
z
↔
z
.
sign
=
0
∨
z
.
sign
=
1
source
theorem
neg_fit_iff_pos
(
z
:
ℤ
)
:
↑
z
.
natAbs
=
z
↔
neg_fit
z
=
0
source
def
spread_fun
(
z
:
ℤ
)
:
ℕ
Equations
spread_fun
z
=
2
*
z
.
natAbs
+
neg_fit
z
Instances For
source
theorem
spread_fun_inj
:
Function.Injective
spread_fun
source
theorem
spread_fun_inj_explicit
(
a
b
:
ℤ
)
:
spread_fun
a
=
spread_fun
b
→
a
=
b
source
theorem
int_countable
(
B
:
Set
ℤ
)
:
B
.
Countable
source
theorem
infant_Gauss
(
n
:
ℕ
)
:
2
*
∑
x
∈
Finset.range
(
n
+
1
)
,
x
=
n
*
(
n
+
1
)
source
def
diag_fun
(
a
:
ℕ
×
ℕ
)
:
ℕ
Equations
diag_fun
a
=
∑
x
∈
Finset.range
(
a
.1
+
a
.2
+
1
)
,
x
+
a
.2
Instances For
source
theorem
mul_2_both_sides
(
a
b
:
ℕ
)
:
a
=
b
→
2
*
a
=
2
*
b
source
theorem
n_sq_add_n_monotone
(
m
n
:
ℕ
)
:
m
≤
n
↔
m
*
(
m
+
1
)
≤
n
*
(
n
+
1
)
source
theorem
n_sq_add_n_monotone_strict
(
m
n
:
ℕ
)
:
m
<
n
↔
m
*
(
m
+
1
)
<
n
*
(
n
+
1
)
source
theorem
pred_legit
(
c
:
ℕ
)
:
c
>
0
→
∃ (
a
:
ℕ
),
c
=
a
+
1
source
theorem
range_lem
(
b
c
:
ℕ
)
:
c
*
(
c
+
1
)
<
b
*
(
b
+
1
)
+
2
*
c
→
c
≤
b
source
theorem
sum_range
(
a
c
:
ℕ
)
:
a
*
(
a
+
1
)
≤
2
*
∑
x
∈
Finset.range
(
c
+
1
)
,
x
∧
2
*
∑
x
∈
Finset.range
(
c
+
1
)
,
x
<
a
*
(
a
+
1
)
+
2
*
c
→
a
=
c
source
theorem
sum_range_simp
(
a
c
:
ℕ
)
:
a
≤
c
∧
c
*
(
c
+
1
)
<
a
*
(
a
+
1
)
+
2
*
c
→
a
=
c
source
theorem
lemma1
(
a
b
c
d
:
ℕ
)
:
a
+
b
=
c
+
d
∧
a
≤
c
→
b
≥
d
source
theorem
lemma2
(
a
b
c
d
:
ℕ
)
:
a
+
b
=
c
+
d
∧
a
≥
c
→
b
≤
d
source
theorem
lemma2_le
(
a
b
c
d
:
ℕ
)
:
a
+
b
≤
c
+
d
∧
a
≥
c
→
b
≤
d
source
theorem
lt_if_lt_add_right
(
a
b
c
:
ℕ
)
:
a
+
c
<
b
+
c
→
a
<
b
source
theorem
diag_fun_inj
:
Function.Injective
diag_fun
source
theorem
nat_prod_countable
(
C
:
Set
(
ℕ
×
ℕ
)
)
:
C
.
Countable
source
theorem
diag_fun_inj_explicit
(
a
b
:
ℕ
×
ℕ
)
:
diag_fun
a
=
diag_fun
b
→
a
=
b
source
theorem
proj_fst
(
a
b
:
ℕ
×
ℕ
)
:
a
=
b
→
a
.1
=
b
.1
source
theorem
proj_snd
(
a
b
:
ℕ
×
ℕ
)
:
a
=
b
→
a
.2
=
b
.2
source
def
diag3_fun
(
a
:
ℕ
×
ℕ
×
ℕ
)
:
ℕ
Equations
diag3_fun
a
=
diag_fun
(
diag_fun
(
a
.2
.1
,
a
.2
.2
)
,
a
.1
)
Instances For
source
theorem
diag3_fun_inj
:
Function.Injective
diag3_fun
source
theorem
nat_trip_prod_countable
(
D
:
Set
(
ℕ
×
ℕ
×
ℕ
)
)
:
D
.
Countable
source
def
rat_fun
(
q
:
ℚ
)
:
ℕ
Equations
rat_fun
q
=
diag_fun
(
spread_fun
q
.
num
,
q
.
den
)
Instances For
source
theorem
rat_fun_inj
:
Function.Injective
rat_fun
source
theorem
rat_fun_inj_explicit
(
a
b
:
ℚ
)
:
rat_fun
a
=
rat_fun
b
→
a
=
b
source
theorem
rat_countable
(
A
:
Set
ℚ
)
:
A
.
Countable
source
def
rat_prod_fun
(
s
:
ℚ
×
ℚ
)
:
ℕ
Equations
rat_prod_fun
s
=
diag_fun
(
rat_fun
s
.1
,
rat_fun
s
.2
)
Instances For
source
theorem
rat_prod_fun_inj
:
Function.Injective
rat_prod_fun
source
theorem
rat_prod_countable
(
E
:
Set
(
ℚ
×
ℚ
)
)
:
E
.
Countable
source
noncomputable def
euclideanNorm
(
x
:
ℝ
×
ℝ
)
:
ℝ
Equations
euclideanNorm
x
=
√
(
x
.1
^
2
+
x
.2
^
2
)
Instances For
source
noncomputable def
euclideanDist
(
x
y
:
ℝ
×
ℝ
)
:
ℝ
Equations
euclideanDist
x
y
=
euclideanNorm
(
x
-
y
)
Instances For
source
def
myPoint1
:
ℝ
×
ℝ
Equations
myPoint1
=
(
3
,
5
)
Instances For
source
noncomputable def
myPoint2
:
ℝ
×
ℝ
Equations
myPoint2
=
(
√
3
,
4
)
Instances For
source
def
myPoint3
:
ℝ
×
ℝ
Equations
myPoint3
=
(
-
1.4
,
4
)
Instances For