statement stringlengths 1 615 | proof stringlengths 0 8.26k | type stringclasses 11
values | symbolic_name stringlengths 1 64 | library stringclasses 29
values | filename stringclasses 121
values | imports listlengths 0 15 | deps listlengths 0 20 | docstring stringlengths 0 1.5k | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
leastSquaresVec {n : ℕ} (a : Fin n → ℝ) | optimization (x : ℝ)
minimize (Vec.sum ((a - Vec.const n x) ^ 2) : ℝ) | def | leastSquaresVec | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [
"Vec.const",
"Vec.sum"
] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
leastSquaresVec_optimal_eq_mean {n : ℕ} (hn : 0 < n) (a : Fin n → ℝ) (x : ℝ)
(h : (leastSquaresVec a).optimal x) : x = mean a | by
apply leastSquares_optimal_eq_mean hn a
simp [leastSquaresVec, leastSquares, optimal, feasible] at h ⊢
intros y
simp only [Vec.sum, Pi.pow_apply, Pi.sub_apply, Vec.const, rpow_two] at h
exact h y | lemma | leastSquaresVec_optimal_eq_mean | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [
"Vec.const",
"Vec.sum",
"leastSquares",
"leastSquaresVec",
"leastSquares_optimal_eq_mean",
"mean"
] | Same as `leastSquares_optimal_eq_mean` in vector notation. | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 |
fittingSphere | optimization (c : Fin n → ℝ) (r : ℝ)
minimize (∑ i, (‖(x i) - c‖ ^ 2 - r ^ 2) ^ 2 : ℝ)
subject to
h₁ : 0 ≤ r | def | FittingSphere.fittingSphere | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
ChangeOfVariablesBij {D E} (c : E → D) where
c_inv : D → E
cond_D : D → Prop
cond_E : E → Prop
prop_D : ∀ x, cond_D x → c (c_inv x) = x
prop_E : ∀ y, cond_E y → c_inv (c y) = y | structure | FittingSphere.ChangeOfVariablesBij | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | ||
ChangeOfVariablesBij.toEquivalence {D E R} [Preorder R] {f : D → R} {cs : D → Prop} (c : E → D)
(cov : ChangeOfVariablesBij c)
(hD : ∀ x, cs x → cov.cond_D x)
(hE : ∀ x, cs x → cov.cond_E (cov.c_inv x)) :
⟨f, cs⟩ ≡ ⟨fun y => f (c y), fun y => cs (c y) ∧ cov.cond_E y⟩ | Equivalence.ofStrongEquivalence <|
{ phi := fun x => cov.c_inv x
psi := fun y => c y
phi_feasibility := fun x hx => by simp [feasible, cov.prop_D x (hD x hx)]; exact ⟨hx, hE x hx⟩
psi_feasibility := fun y ⟨hy, _⟩ => hy
phi_optimality := fun x hx => by simp [cov.prop_D x (hD x hx)]
psi_optimality :... | def | FittingSphere.ChangeOfVariablesBij.toEquivalence | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
covBij {n} : ChangeOfVariablesBij
(fun ((c, t) : (Fin n → ℝ) × ℝ) => (c, sqrt (t + ‖c‖ ^ 2))) | { c_inv := fun (c, r) => (c, r ^ 2 - ‖c‖ ^ 2),
cond_D := fun (_, r) => 0 ≤ r,
cond_E := fun (c, t) => 0 ≤ t + ‖c‖ ^ 2,
prop_D := fun (c, r) h => by simp [sqrt_sq h],
prop_E := fun (c, t) h => by simp at h; simp [sq_sqrt h] }
equivalence* eqv/fittingSphereT (n m : ℕ) (x : Fin m → Fin n → ℝ) : fittingSph... | def | FittingSphere.covBij | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [
"Vec.const",
"Vec.norm",
"Vec.sum"
] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
fittingSphereConvex (n m : ℕ) (x : Fin m → Fin n → ℝ) | optimization (c : Fin n → ℝ) (t : ℝ)
minimize (Vec.sum ((Vec.norm x ^ 2 - 2 * mulVec x c - Vec.const m t) ^ 2) : ℝ) | def | FittingSphere.fittingSphereConvex | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [
"Vec.const",
"Vec.norm",
"Vec.sum"
] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
optimal_convex_implies_optimal_t (hm : 0 < m) (c : Fin n → ℝ) (t : ℝ)
(h_opt : (fittingSphereConvex n m x).optimal (c, t)) :
(fittingSphereT n m x).optimal (c, t) | by
simp [fittingSphereT, fittingSphereConvex, optimal, feasible] at h_opt ⊢
constructor
-- Feasibility.
· let a := Vec.norm x ^ 2 - 2 * mulVec x c
have h_ls : optimal (leastSquaresVec a) t := by
refine ⟨trivial, ?_⟩
intros y _
simp [objFun, leastSquaresVec]
exact h_opt c y
-- App... | lemma | FittingSphere.optimal_convex_implies_optimal_t | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [
"Vec.norm",
"leastSquaresVec",
"leastSquaresVec_optimal_eq_mean",
"mean"
] | This tells us that solving the relaxed problem is sufficient (i.e., it is a valid reduction). | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 |
red (hm : 0 < m) : (fittingSphereT n m x) ≼ (fittingSphereConvex n m x) | { psi := id,
psi_optimality := fun (c, t) h_opt => optimal_convex_implies_optimal_t n m x hm c t h_opt }
#print fittingSphereConvex | def | FittingSphere.red | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [] | We show that we have a reduction via the identity map. | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 |
nₚ | 2 | def | FittingSphere.nₚ | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
mₚ | 10 | def | FittingSphere.mₚ | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
xₚ : Fin mₚ → Fin nₚ → ℝ | Matrix.transpose <| ![
![1.824183228637652032e+00, 1.349093690455489103e+00, 6.966316403935147727e-01,
7.599387854623529392e-01, 2.388321695850912363e+00, 8.651370608981923116e-01,
1.863922545015865406e+00, 7.099743941474848663e-01, 6.005484882320809570e-01,
4.561429569892232472e-01],
![-9.6441362841878... | def | FittingSphere.xₚ | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
sol | eqv.backward_map nₚ mₚ xₚ.float fittingSphereConvex.solution | def | FittingSphere.sol | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
cₚ_opt | sol.1 | def | FittingSphere.cₚ_opt | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
rₚ_opt | sol.2
#eval cₚ_opt -- ![1.664863, 0.031932]
#eval rₚ_opt | def | FittingSphere.rₚ_opt | Examples | CvxLean/Examples/FittingSphere.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
hypersonicShapeDesign | optimization (Δx : ℝ)
minimize sqrt ((1 / Δx ^ 2) - 1)
subject to
h₁ : 10e-6 ≤ Δx
h₂ : Δx ≤ 1
h₃ : a * (1 / Δx) - (1 - b) * sqrt (1 - Δx ^ 2) ≤ 0
equivalence* eqv₁/hypersonicShapeDesignConvex (a b : ℝ) (ha : 0 ≤ a) (hb₁ : 0 ≤ b) (hb₂ : b < 1) :
hypersonicShapeDesign a b := by
pre_dcp
#... | def | HypersonicShapeDesign.hypersonicShapeDesign | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
aₚ : ℝ | 0.05 | def | HypersonicShapeDesign.aₚ | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
aₚ_nonneg : 0 ≤ aₚ | by
unfold aₚ; norm_num | lemma | HypersonicShapeDesign.aₚ_nonneg | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
bₚ : ℝ | 0.65 | def | HypersonicShapeDesign.bₚ | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
bₚ_nonneg : 0 ≤ bₚ | by
unfold bₚ; norm_num | lemma | HypersonicShapeDesign.bₚ_nonneg | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
bₚ_lt_one : bₚ < 1 | by
unfold bₚ; norm_num | lemma | HypersonicShapeDesign.bₚ_lt_one | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
one_sub_bₚ_nonneg : 0 ≤ 1 - bₚ | by
unfold bₚ; norm_num
time_cmd solve hypersonicShapeDesignConvex aₚ bₚ aₚ_nonneg bₚ_nonneg bₚ_lt_one
#print hypersonicShapeDesignConvex.conicForm | lemma | HypersonicShapeDesign.one_sub_bₚ_nonneg | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
wₚ_opt | eqv₁.backward_map aₚ.float bₚ.float hypersonicShapeDesignConvex.solution
#eval wₚ_opt -- 0.989524
#eval aₚ.float * (1 / wₚ_opt) - (1 - bₚ.float) * Float.sqrt (1 - wₚ_opt ^ 2) ≤ 0
#eval aₚ.float * (1 / wₚ_opt) - (1 - bₚ.float) * Float.sqrt (1 - wₚ_opt ^ 2) ≤ 0.000001 | def | HypersonicShapeDesign.wₚ_opt | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
hₚ_opt | Float.sqrt (1 - wₚ_opt ^ 2)
#eval hₚ_opt | def | HypersonicShapeDesign.hₚ_opt | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
ldRatioₚ | 1 / (Float.sqrt ((1 / wₚ_opt ^ 2) - 1))
#eval ldRatioₚ -- 6.854156
-- While the above is good enough, we simplify the problem further by performing a change of
-- variables and simplifying appropriately.
equivalence* eqv₂/hypersonicShapeDesignSimpler (a b : ℝ) (ha : 0 ≤ a) (hb₁ : 0 ≤ b)
(hb₂ : b < 1) : hypersoni... | def | HypersonicShapeDesign.ldRatioₚ | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
wₚ'_opt | eqv₁.backward_map aₚ.float bₚ.float <|
eqv₂.backward_map aₚ.float bₚ.float hypersonicShapeDesignSimpler.solution
#eval wₚ'_opt -- 0.989524
#eval aₚ.float * (1 / wₚ'_opt) - (1 - bₚ.float) * Float.sqrt (1 - wₚ'_opt ^ 2) ≤ 0 | def | HypersonicShapeDesign.wₚ'_opt | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
hₚ'_opt | Float.sqrt (1 - wₚ'_opt ^ 2)
#eval hₚ'_opt | def | HypersonicShapeDesign.hₚ'_opt | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
ldRatioₚ' | 1 / (Float.sqrt ((1 / wₚ'_opt ^ 2) - 1))
#eval ldRatioₚ' | def | HypersonicShapeDesign.ldRatioₚ' | Examples | CvxLean/Examples/HypersonicShapeDesign.lean | [
"CvxLean",
"CvxLean.Command.Util.TimeCmd"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
trussDesign | optimization (h w r R : ℝ) with A := 2 * π * (R ^ 2 - r ^ 2)
minimize 2 * A * sqrt (w ^ 2 + h ^ 2)
subject to
c_r : 0 < r
c_F₁ : F₁ * sqrt (w ^ 2 + h ^ 2) / (2 * h) ≤ σ * A
c_F₂ : F₂ * sqrt (w ^ 2 + h ^ 2) / (2 * w) ≤ σ * A
c_hmin : hmin ≤ h
c_hmax : h ≤ hmax
c_wmin : ... | def | TrussDesign.trussDesign | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
hminₚ : ℝ | 1 | def | TrussDesign.hminₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
hmaxₚ : ℝ | 100 | def | TrussDesign.hmaxₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
hminₚ_pos : 0 < hminₚ | by
unfold hminₚ; norm_num | lemma | TrussDesign.hminₚ_pos | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
hminₚ_le_hmaxₚ : hminₚ ≤ hmaxₚ | by
unfold hminₚ hmaxₚ; norm_num | lemma | TrussDesign.hminₚ_le_hmaxₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
wminₚ : ℝ | 1 | def | TrussDesign.wminₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
wmaxₚ : ℝ | 100 | def | TrussDesign.wmaxₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
wminₚ_pos : 0 < wminₚ | by
unfold wminₚ; norm_num | lemma | TrussDesign.wminₚ_pos | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
wminₚ_le_wmaxₚ : wminₚ ≤ wmaxₚ | by
unfold wminₚ wmaxₚ; norm_num | lemma | TrussDesign.wminₚ_le_wmaxₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
Rmaxₚ : ℝ | 10 | def | TrussDesign.Rmaxₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
Rmaxₚ_pos : 0 < Rmaxₚ | by
unfold Rmaxₚ; norm_num | lemma | TrussDesign.Rmaxₚ_pos | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
σₚ : ℝ | 0.5 | def | TrussDesign.σₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
σₚ_pos : 0 < σₚ | by
unfold σₚ; norm_num | lemma | TrussDesign.σₚ_pos | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
F₁ₚ : ℝ | 10 | def | TrussDesign.F₁ₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
F₁ₚ_pos : 0 < F₁ₚ | by
unfold F₁ₚ; norm_num | lemma | TrussDesign.F₁ₚ_pos | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
F₂ₚ : ℝ | 20 | def | TrussDesign.F₂ₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
F₂ₚ_pos : 0 < F₂ₚ | by
unfold F₂ₚ; norm_num
solve trussDesignDCP hminₚ hmaxₚ hminₚ_pos hminₚ_le_hmaxₚ wminₚ wmaxₚ wminₚ_pos wminₚ_le_wmaxₚ Rmaxₚ
Rmaxₚ_pos σₚ σₚ_pos F₁ₚ F₁ₚ_pos F₂ₚ F₂ₚ_pos | lemma | TrussDesign.F₂ₚ_pos | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
eqv₁.backward_mapₚ | eqv₁.backward_map hminₚ.float hmaxₚ.float wminₚ.float wmaxₚ.float
Rmaxₚ.float σₚ.float F₁ₚ.float F₂ₚ.float | def | TrussDesign.eqv₁.backward_mapₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
eqv₂.backward_mapₚ | eqv₂.backward_map hminₚ.float hmaxₚ.float wminₚ.float wmaxₚ.float
Rmaxₚ.float σₚ.float F₁ₚ.float F₂ₚ.float | def | TrussDesign.eqv₂.backward_mapₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
sol | eqv₁.backward_mapₚ (eqv₂.backward_mapₚ trussDesignDCP.solution) | def | TrussDesign.sol | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
hₚ_opt | sol.1 | def | TrussDesign.hₚ_opt | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
wₚ_opt | sol.2.1 | def | TrussDesign.wₚ_opt | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
rₚ_opt | sol.2.2.1 | def | TrussDesign.rₚ_opt | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
Rₚ_opt | sol.2.2.2
-- NOTE: These numbers may differ slighlty depending on the rewrites found by `pre_dcp`.
#eval hₚ_opt -- 1.000000
#eval wₚ_opt -- 1.000517
#eval rₚ_opt -- 0.010162
#eval Rₚ_opt | def | TrussDesign.Rₚ_opt | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
valueₚ | let pi := 2 * Float.acos 0;
let Aₚ_opt := 2 * pi * (Rₚ_opt ^ 2 - rₚ_opt ^ 2);
2 * Aₚ_opt * Float.sqrt (wₚ_opt ^ 2 + hₚ_opt ^ 2)
#eval valueₚ | def | TrussDesign.valueₚ | Examples | CvxLean/Examples/TrussDesign.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
vehSpeedSched [Fact (0 < n)] | optimization (s : Fin n → ℝ)
minimize ∑ i, (d i / s i) * F (s i)
subject to
c_smin : ∀ i, smin i ≤ s i
c_smax : ∀ i, s i ≤ smax i
c_τmin : ∀ i, τmin i ≤ ∑ j in [[0, i]], d j / s j
c_τmax : ∀ i, ∑ j in [[0, i]], d j / s j ≤ τmax i | def | VehicleSpeedSched.vehSpeedSched | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
simp_vec_fraction (h_d_pos : StrongLT 0 d) (s : Fin n → ℝ) (i : Fin n) :
d i / (d i / s i) = s i | by
have h_di_pos := h_d_pos i; simp at h_di_pos;
have h_di_nonzero : d i ≠ 0 := by linarith
rw [← div_mul, div_self h_di_nonzero, one_mul] | lemma | VehicleSpeedSched.simp_vec_fraction | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
fold_partial_sum [hn : Fact (0 < n)] (t : Fin n → ℝ) (i : Fin n) :
∑ j in [[0, i]], t j = Vec.cumsum t i | by
simp [Vec.cumsum]; split_ifs
· rfl
· linarith [hn.out]
equivalence* eqv₁/vehSpeedSchedConvex (n : ℕ) (d : Fin n → ℝ)
(τmin τmax smin smax : Fin n → ℝ) (F : ℝ → ℝ) (h_n_pos : 0 < n) (h_d_pos : StrongLT 0 d)
(h_smin_pos : StrongLT 0 smin) : @vehSpeedSched n d τmin τmax smin smax F ⟨h_n_pos⟩ := by
repl... | lemma | VehicleSpeedSched.fold_partial_sum | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [
"Vec.cumsum",
"Vec.div_le_iff",
"Vec.le_div_iff",
"Vec.map",
"Vec.sum"
] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
nₚ : ℕ | 10 | def | VehicleSpeedSched.nₚ | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
nₚ_pos : 0 < nₚ | by unfold nₚ; norm_num | lemma | VehicleSpeedSched.nₚ_pos | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
dₚ : Fin nₚ → ℝ | ![1.9501, 1.2311, 1.6068, 1.4860, 1.8913, 1.7621, 1.4565, 1.0185, 1.8214, 1.4447] | def | VehicleSpeedSched.dₚ | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
dₚ_pos : StrongLT 0 dₚ | by
intro i; fin_cases i <;> (dsimp [dₚ]; norm_num) | lemma | VehicleSpeedSched.dₚ_pos | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
τminₚ : Fin nₚ → ℝ | ![1.0809, 2.7265, 3.5118, 5.3038, 5.4516, 7.1648, 9.2674, 12.1543, 14.4058, 16.6258] | def | VehicleSpeedSched.τminₚ | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
τmaxₚ : Fin nₚ → ℝ | ![4.6528, 6.5147, 7.5178, 9.7478, 9.0641, 10.3891, 13.1540, 16.0878, 17.4352, 20.9539] | def | VehicleSpeedSched.τmaxₚ | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
sminₚ : Fin nₚ → ℝ | ![0.7828, 0.6235, 0.7155, 0.5340, 0.6329, 0.4259, 0.7798, 0.9604, 0.7298, 0.8405] | def | VehicleSpeedSched.sminₚ | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
smaxₚ : Fin nₚ → ℝ | ![1.9624, 1.6036, 1.6439, 1.5641, 1.7194, 1.9090, 1.3193, 1.3366, 1.9470, 2.8803] | def | VehicleSpeedSched.smaxₚ | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
sminₚ_pos : StrongLT 0 sminₚ | by
intro i; fin_cases i <;> norm_num | lemma | VehicleSpeedSched.sminₚ_pos | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
sminₚ_nonneg : 0 ≤ sminₚ | le_of_strongLT sminₚ_pos | lemma | VehicleSpeedSched.sminₚ_nonneg | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
sminₚ_le_smaxₚ : sminₚ ≤ smaxₚ | by
intro i; fin_cases i <;> (dsimp [sminₚ, smaxₚ]; norm_num) | lemma | VehicleSpeedSched.sminₚ_le_smaxₚ | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
smaxₚ_nonneg : 0 ≤ smaxₚ | le_trans sminₚ_nonneg sminₚ_le_smaxₚ | lemma | VehicleSpeedSched.smaxₚ_nonneg | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
aₚ : ℝ | 1 | def | VehicleSpeedSched.aₚ | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
aₚ_nonneg : 0 ≤ aₚ | by unfold aₚ; norm_num | lemma | VehicleSpeedSched.aₚ_nonneg | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
aₚdₚ2_nonneg : 0 ≤ aₚ • (dₚ ^ (2 : ℝ)) | by
intros i; fin_cases i <;> (dsimp [aₚ, dₚ]; norm_num) | lemma | VehicleSpeedSched.aₚdₚ2_nonneg | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
bₚ : ℝ | 6 | def | VehicleSpeedSched.bₚ | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
cₚ : ℝ | 10
solve vehSpeedSchedQuadratic nₚ dₚ τminₚ τmaxₚ sminₚ smaxₚ aₚ bₚ cₚ nₚ_pos dₚ_pos sminₚ_pos
#eval vehSpeedSchedQuadratic.status -- "PRIMAL_AND_DUAL_FEASIBLE"
#eval vehSpeedSchedQuadratic.value -- 275.042133
#eval vehSpeedSchedQuadratic.solution | def | VehicleSpeedSched.cₚ | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
eqv₁.backward_mapₚ | eqv₁.backward_map nₚ dₚ.float τminₚ.float τmaxₚ.float sminₚ.float
smaxₚ.float (fun s => aₚ.float * s ^ 2 + bₚ.float * s + cₚ.float) | def | VehicleSpeedSched.eqv₁.backward_mapₚ | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
eqv₂.backward_mapₚ | eqv₂.backward_map nₚ dₚ.float τminₚ.float τmaxₚ.float sminₚ.float
smaxₚ.float aₚ.float bₚ.float cₚ.float | def | VehicleSpeedSched.eqv₂.backward_mapₚ | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
sₚ_opt | eqv₁.backward_mapₚ (eqv₂.backward_mapₚ vehSpeedSchedQuadratic.solution)
#eval sₚ_opt | def | VehicleSpeedSched.sₚ_opt | Examples | CvxLean/Examples/VehicleSpeedScheduling.lean | [
"CvxLean"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
Equivalence where
phi : D → E
psi : E → D
phi_optimality : ∀ x, p.optimal x → q.optimal (phi x)
psi_optimality : ∀ x, q.optimal x → p.optimal (psi x) | structure | Minimization.Equivalence | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | Regular notion of equivalence between optimization problems. We require maps `(φ, ψ)` between
teh domains of `p` and `q` such that they map optimal points to optimal points. | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
refl : p ≡ p | { phi := id,
psi := id,
phi_optimality := fun _ hx => hx,
psi_optimality := fun _ hx => hx } | def | Minimization.Equivalence.refl | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
symm (E : p ≡ q) : q ≡ p | { phi := E.psi,
psi := E.phi,
phi_optimality := E.psi_optimality,
psi_optimality := E.phi_optimality } | def | Minimization.Equivalence.symm | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
trans (E₁ : p ≡ q) (E₂ : q ≡ r) : p ≡ r | { phi := E₂.phi ∘ E₁.phi,
psi := E₁.psi ∘ E₂.psi,
phi_optimality := fun x hx => E₂.phi_optimality (E₁.phi x) (E₁.phi_optimality x hx),
psi_optimality := fun y hy => E₁.psi_optimality (E₂.psi y) (E₂.psi_optimality y hy) } | def | Minimization.Equivalence.trans | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
toFwd (E : p ≡ q) : Solution p → Solution q | fun sol =>
{ point := E.phi sol.point,
isOptimal := E.phi_optimality sol.point sol.isOptimal } | def | Minimization.Equivalence.toFwd | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | An equivalence induces a map between the solution set of `p` and the solution set of `q`. | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 |
toBwd (E : p ≡ q) : Solution q → Solution p | fun sol =>
{ point := E.psi sol.point,
isOptimal := E.psi_optimality sol.point sol.isOptimal } | def | Minimization.Equivalence.toBwd | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | An equivalence induces a map between the solution set of `q` and the solution set of `p`. | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 |
StrongEquivalence where
phi : D → E
psi : E → D
phi_feasibility : ∀ x, p.feasible x → q.feasible (phi x)
psi_feasibility : ∀ y, q.feasible y → p.feasible (psi y)
phi_optimality : ∀ x, p.feasible x → q.objFun (phi x) ≤ p.objFun x
psi_optimality : ∀ y, q.feasible y → p.objFun (psi y) ≤ q.objFun y | structure | Minimization.StrongEquivalence | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | Notion of equivalence used by the DCP procedure. It makes some proofs simpler. The
optimality-preserving requirements of `(φ, ψ)` are replaced by:
* for every `p`-feasible `x`, `g(φ(x)) ≤ f(x)`, i.e. `φ` gives a lower bound of `f`.
* for every `q`-feasible `y`, `f(ψ(y)) ≤ g(y)`, i.e. `ψ` fives a lower bound of `g`. | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
refl : p ≡' p | { phi := id,
psi := id,
phi_feasibility := fun _ hx => hx,
psi_feasibility := fun _ hy => hy,
phi_optimality := fun _ _ => le_refl _,
psi_optimality := fun _ _ => le_refl _ } | def | Minimization.StrongEquivalence.refl | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
symm (E : p ≡' q) : q ≡' p | { phi := E.psi,
psi := E.phi,
phi_feasibility := E.psi_feasibility,
psi_feasibility := E.phi_feasibility,
phi_optimality := E.psi_optimality,
psi_optimality := E.phi_optimality } | def | Minimization.StrongEquivalence.symm | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
trans (E₁ : p ≡' q) (E₂ : q ≡' r) : p ≡' r | { phi := E₂.phi ∘ E₁.phi,
psi := E₁.psi ∘ E₂.psi,
phi_feasibility := fun x hx => E₂.phi_feasibility (E₁.phi x) (E₁.phi_feasibility x hx),
psi_feasibility := fun y hy => E₁.psi_feasibility (E₂.psi y) (E₂.psi_feasibility y hy),
phi_optimality := fun x hx =>
-- `h(φ₂(φ₁(x))) ≤ g(φ₁(x))`
have h₁... | def | Minimization.StrongEquivalence.trans | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
ofEq (h : p = q) : p ≡ q | { phi := id,
psi := id,
phi_optimality := fun _ hx => h ▸ hx,
psi_optimality := fun _ hy => h ▸ hy } | def | Minimization.Equivalence.ofEq | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | Equal problems are equivalent. Note that the domain needs to be the same. We intentionally do
not define this as `h ▸ Equivalence.refl (p := p)` so that `phi` and `psi` can be easily
extracted. | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 |
ofStrongEquivalence (E : p ≡' q) : p ≡ q | { phi := E.phi,
psi := E.psi,
phi_optimality := fun x ⟨h_feas_x, h_opt_x⟩ =>
⟨E.phi_feasibility x h_feas_x,
fun y h_feas_y =>
-- `g(φ(x)) ≤ f(x)`
have h₁ := E.phi_optimality x h_feas_x
-- `f(x) ≤ f(ψ(y))`
have h₂ := h_opt_x (E.psi y) (E.psi_feasibility y h_feas_y)
... | def | Minimization.Equivalence.ofStrongEquivalence | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | As expected, an `Equivalence` can be built from a `StrongEquivalence`. | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 |
toFwd (E : p ≡' q) : Solution p → Solution q | (ofStrongEquivalence E).toFwd | def | Minimization.StrongEquivalence.toFwd | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
toBwd (E : p ≡' q) : Solution q → Solution p | (ofStrongEquivalence E).toBwd | def | Minimization.StrongEquivalence.toBwd | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
map_objFun {g : R → R} (h : ∀ {r s}, cs r → cs s → (g (f r) ≤ g (f s) ↔ f r ≤ f s)) :
⟨f, cs⟩ ≡ ⟨fun x => g (f x), cs⟩ | { phi := id,
psi := id,
phi_optimality := fun _ ⟨h_feas_x, h_opt_x⟩ =>
⟨h_feas_x, fun y h_feas_y => (h h_feas_x h_feas_y).mpr (h_opt_x y h_feas_y)⟩,
psi_optimality := fun _ ⟨h_feas_x, h_opt_x⟩ =>
⟨h_feas_x, fun y h_feas_y => (h h_feas_x h_feas_y).mp (h_opt_x y h_feas_y)⟩ } | def | Minimization.Equivalence.map_objFun | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | See [BV04,p.131] where `g` is `ψ₀`. | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 |
map_objFun_log {f : D → ℝ} (h : ∀ x, cs x → f x > 0) :
⟨f, cs⟩ ≡ ⟨fun x => (Real.log (f x)), cs⟩ | by
apply map_objFun
intros r s h_feas_r h_feas_s
exact Real.log_le_log_iff (h r h_feas_r) (h s h_feas_s) | def | Minimization.Equivalence.map_objFun_log | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
map_objFun_sq {f : D → ℝ} (h : ∀ x, cs x → f x ≥ 0) :
⟨f, cs⟩ ≡ ⟨fun x => (f x) ^ (2 : ℝ), cs⟩ | by
apply map_objFun (g := fun x => x ^ (2 : ℝ))
intros r s h_feas_r h_feas_s
simp [sq_le_sq, abs_of_nonneg (h r h_feas_r), abs_of_nonneg (h s h_feas_s)] | def | Minimization.Equivalence.map_objFun_sq | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
map_domain {f : D → R} {cs : D → Prop} {fwd : D → E} {bwd : E → D}
(h : ∀ x, cs x → bwd (fwd x) = x) :
⟨f, cs⟩ ≡ ⟨fun x => f (bwd x), fun x => cs (bwd x)⟩ | Equivalence.ofStrongEquivalence <|
{ phi := fwd,
psi := bwd,
phi_feasibility := fun {x} hx => by simp [feasible, h x hx]; exact hx,
psi_feasibility := fun _ hx => hx,
phi_optimality := fun {x} hx => by simp [h x hx],
psi_optimality := fun {x} _ => by simp } | def | Minimization.Equivalence.map_domain | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | This is simply a change of variables, see `ChangeOfVariables.toEquivalence` and [BV04,p.130]. | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 |
rewrite_objFun (hrw : ∀ x, cs x → f x = g x) : ⟨f, cs⟩ ≡ ⟨g, cs⟩ | Equivalence.ofStrongEquivalence <|
{ phi := id,
psi := id,
phi_feasibility := fun _ hx => hx
psi_feasibility := fun _ hx => hx
phi_optimality := fun {x} hx => le_of_eq (hrw x hx).symm
psi_optimality := fun {x} hx => le_of_eq (hrw x hx) } | def | Minimization.Equivalence.rewrite_objFun | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
rewrite_objFun_1 (hrw : ∀ x, c1 x → f x = g x) : ⟨f, c1⟩ ≡ ⟨g, c1⟩ | rewrite_objFun hrw | def | Minimization.Equivalence.rewrite_objFun_1 | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [
"c1"
] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
rewrite_objFun_2 (hrw : ∀ x, c1 x → c2 x → f x = g x) : ⟨f, [[c1, c2]]⟩ ≡ ⟨g, [[c1, c2]]⟩ | rewrite_objFun (fun x _ => by apply hrw x <;> tauto) | def | Minimization.Equivalence.rewrite_objFun_2 | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [
"c1"
] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
rewrite_objFun_3 (hrw : ∀ x, c1 x → c2 x → c3 x → f x = g x) :
⟨f, [[c1, c2, c3]]⟩ ≡ ⟨g, [[c1, c2, c3]]⟩ | rewrite_objFun (fun x _ => by apply hrw x <;> tauto) | def | Minimization.Equivalence.rewrite_objFun_3 | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [
"c1"
] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
rewrite_objFun_4 (hrw : ∀ x, c1 x → c2 x → c3 x → c4 x → f x = g x) :
⟨f, [[c1, c2, c3, c4]]⟩ ≡ ⟨g, [[c1, c2, c3, c4]]⟩ | rewrite_objFun (fun x _ => by apply hrw x <;> tauto) | def | Minimization.Equivalence.rewrite_objFun_4 | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [
"c1"
] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 | |
rewrite_objFun_5 (hrw : ∀ x, c1 x → c2 x → c3 x → c4 x → c5 x → f x = g x) :
⟨f, [[c1, c2, c3, c4, c5]]⟩ ≡ ⟨g, [[c1, c2, c3, c4, c5]]⟩ | rewrite_objFun (fun x _ => by apply hrw x <;> tauto) | def | Minimization.Equivalence.rewrite_objFun_5 | Lib | CvxLean/Lib/Equivalence.lean | [
"CvxLean.Lib.Math.Data.Real",
"CvxLean.Lib.Minimization",
"CvxLean.Meta.Attributes"
] | [
"c1",
"c5"
] | https://github.com/verified-optimization/CvxLean | c62c2f292c6420f31a12e738ebebdfed50f6f840 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.