Skip to content

Commit 95f8119

Browse files
committed
clear most of warnings
1 parent 663bb45 commit 95f8119

File tree

42 files changed

+124
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+124
-109
lines changed

SciLean/AD/FDeriv.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ attribute [fun_trans] fderiv
3434
theorem deriv_fderiv'
3535
{𝕜 : Type*} [NontriviallyNormedField 𝕜]
3636
{X : Type*} [NormedAddCommGroup X] [NormedSpace 𝕜 X]
37-
(f : 𝕜 → X) : deriv f = fun x => fderiv 𝕜 f x 1 := by funext x; rw[← deriv_fderiv]; simp
37+
(f : 𝕜 → X) : deriv f = fun x => fderiv 𝕜 f x 1 := by funext x; rw[← toSpanSingleton_deriv]; simp
3838

3939
-- SciLean prefers `fderiv` over `deriv`
4040
attribute [-simp] fderiv_eq_smul_deriv
@@ -327,7 +327,7 @@ theorem HDiv.hDiv.arg_a0a1.fderiv_rule_at
327327
rw [h (fun x => f x / g x) x, h f x, h g x]
328328
have hdiv := deriv_fun_div (c := (fun h : K => f (x + h • dx))) (d := (fun h : K => g (x + h • dx)))
329329
(x := 0) (hc := by sorry_proof) (hd := by sorry_proof) (hx := by sorry_proof)
330-
convert hdiv using 1 <;> rw [zero_smul, add_zero]
330+
convert hdiv using 1; rw [zero_smul, add_zero]
331331

332332

333333
-- Inv.inv -------------------------------------------------------------------

SciLean/AD/HasRevFDeriv.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ theorem Finset.sum.arg_f.HasRevFDeriv_rule
875875
HasRevFDeriv K
876876
(fun f : I → X => A.sum (fun i => f i))
877877
(fun f =>
878-
(A.sum (fun i => f i), fun dx i => A.toSet.indicator (fun _ => dx) i)) := by
878+
(A.sum (fun i => f i), fun dx i => (A : Set I).indicator (fun _ => dx) i)) := by
879879
apply hasRevFDeriv_from_hasFDerivAt_hasAdjoint
880880
case deriv => intro; data_synth
881881
case adjoint => intro x; simp; data_synth
@@ -889,7 +889,7 @@ theorem Finset.sum.arg_f.HasRevFDeriv_rule'
889889
HasRevFDeriv K
890890
(fun f : I → X => A.sum f)
891891
(fun f =>
892-
(A.sum (fun i => f i), fun dx i => A.toSet.indicator (fun _ => dx) i)) := by
892+
(A.sum (fun i => f i), fun dx i => (A : Set I).indicator (fun _ => dx) i)) := by
893893
apply Finset.sum.arg_f.HasRevFDeriv_rule
894894

895895
@[data_synth]
@@ -898,7 +898,7 @@ theorem Finset.sum.arg_f.HasRevFDerivUpdate_rule
898898
HasRevFDerivUpdate K
899899
(fun f : I → X => A.sum (fun i => f i))
900900
(fun f =>
901-
(A.sum (fun i => f i), fun dx df i => df i + A.toSet.indicator (fun _ => dx) i)) := by
901+
(A.sum (fun i => f i), fun dx df i => df i + (A : Set I).indicator (fun _ => dx) i)) := by
902902
apply hasRevFDerivUpdate_from_hasFDerivAt_hasAdjointUpdate
903903
case deriv => intro; data_synth
904904
case adjoint => intro x; simp; data_synth
@@ -914,7 +914,7 @@ theorem Finset.sum.arg_f.HasRevFDerivUpdate_rule'
914914
(fun f =>
915915
(A.sum (fun i => f i), fun dx df i =>
916916
let dxi := df i
917-
let dx := dxi + A.toSet.indicator (fun _ => dx) i
917+
let dx := dxi + (A : Set I).indicator (fun _ => dx) i
918918
dx)) := by
919919
apply Finset.sum.arg_f.HasRevFDerivUpdate_rule
920920

SciLean/AD/RevFDeriv.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ theorem pi_rule [Fold ι] [Fold ι] -- these instances have different universes
126126
:= by
127127

128128
unfold revFDeriv
129-
simp (disch:=fun_prop) only [fderiv.pi_rule_at,adjoint.pi_rule]
129+
simp (disch:=fun_prop) only [fderiv.pi_rule_at]
130130
fun_trans
131131
sorry_proof
132132

SciLean/AD/Rules/Log.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ theorem log.arg_x.HasFwdFDerivAt_rule
5858

5959

6060
omit [CompleteSpace U] in
61+
set_option linter.unusedVariables false in
6162
@[data_synth]
6263
theorem log.arg_x.HasRevFDeriv_rule
6364
(x : U → R) {x'} (hx : HasRevFDeriv R x x') (hu : ∀ u, x u ≠ 0) :
@@ -70,6 +71,7 @@ theorem log.arg_x.HasRevFDeriv_rule
7071
sorry_proof
7172

7273
omit [CompleteSpace U] in
74+
set_option linter.unusedVariables false in
7375
@[data_synth]
7476
theorem log.arg_x.HasRevFDerivUpdate_rule
7577
(x : U → R) {x'} (hx : HasRevFDerivUpdate R x x') (hu : ∀ u, x u ≠ 0) :

SciLean/Algebra/Dimension.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ instance {R} [Field R] {n m}
6464
{Y} [AddCommGroup Y] [Module R Y] [Module.Finite R Y] [dY : Dimension R Y m] :
6565
Dimension R (X×Y) (n+m) where
6666
is_dim := by
67-
simp [dX.is_dim, dY.is_dim]
67+
simp []
6868

6969
-- instance {R} [Field R] {n}
7070
-- {I} [IndexType I]

SciLean/Algebra/IsAddGroupHom.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ theorem HAdd.hAdd.arg_a0a1.IsAddGroupHom_rule
110110
(f g : X → Y) (hf : IsAddGroupHom f) (hg : IsAddGroupHom g) :
111111
IsAddGroupHom fun x => f x + g x := by
112112
constructor
113-
· simp [hf.map_add,hg.map_add,add_comm]; sorry_proof
113+
· simp [hf.map_add,hg.map_add]; sorry_proof
114114
· simp [hf.map_neg,hg.map_neg,add_comm]
115115

116116

@@ -124,7 +124,7 @@ theorem HSub.hSub.arg_a0a1.IsAddGroupHom_rule
124124
(f g : X → Y) (hf : IsAddGroupHom f) (hg : IsAddGroupHom g) :
125125
IsAddGroupHom fun x => f x - g x := by
126126
constructor
127-
· simp [hf.map_add,hg.map_add,add_comm]; sorry_proof
127+
· simp [hf.map_add,hg.map_add]; sorry_proof
128128
· simp [hf.map_neg,hg.map_neg,add_comm,←neg_add_eq_sub]
129129

130130

SciLean/Algebra/VectorOptimize/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ theorem tmulAdd_smul_y (a b : R) (y : Y) (x : X) (A : YX) :
140140
@[simp, simp_core, vector_optimize]
141141
theorem tmulAdd_smul_x (a b : R) (y : Y) (x : X) (A : YX) :
142142
tmulAdd a y (b•x) A = tmulAdd (a*b) y x A := by
143-
simp [axpby_spec,tmulAdd_spec]
143+
simp [tmulAdd_spec]
144144
sorry_proof
145145

146146

SciLean/Analysis/AdjointSpace/Adjoint.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ theorem HMul.hMul.arg_a0.adjoint_rule
334334
by
335335
rw[← (eq_adjoint_iff _ _ (by fun_prop)).2]
336336
simp (disch:=fun_prop)
337-
[adjoint_inner_left,AdjointSpace.inner_smul_left,AdjointSpace.inner_smul_right]
337+
[adjoint_inner_left,AdjointSpace.inner_smul_left]
338338
intros; ac_rfl
339339

340340
open ComplexConjugate in
@@ -347,7 +347,7 @@ theorem HMul.hMul.arg_a1.adjoint_rule
347347
by
348348
rw[← (eq_adjoint_iff _ _ (by fun_prop)).2]
349349
simp (disch:=fun_prop)
350-
[adjoint_inner_left,AdjointSpace.inner_smul_left,AdjointSpace.inner_smul_right]
350+
[adjoint_inner_left,AdjointSpace.inner_smul_left]
351351
intros; ac_rfl
352352

353353

@@ -394,7 +394,7 @@ theorem HDiv.hDiv.arg_a0.adjoint_rule
394394
by
395395
rw[← (eq_adjoint_iff _ _ (by fun_prop)).2]
396396
simp (disch:=fun_prop)
397-
[adjoint_inner_left,AdjointSpace.inner_smul_left,AdjointSpace.inner_smul_right]
397+
[adjoint_inner_left,AdjointSpace.inner_smul_left]
398398
simp [div_eq_mul_inv]
399399
intros; ac_rfl
400400

@@ -481,7 +481,7 @@ theorem Inner.inner.arg_a1.adjoint_rule
481481
by
482482
rw[← (eq_adjoint_iff _ _ (by sorry_proof)).2]
483483
simp (disch:=fun_prop)
484-
[adjoint_inner_left,AdjointSpace.inner_smul_left,AdjointSpace.conj_symm,mul_comm]
484+
[adjoint_inner_left,AdjointSpace.inner_smul_left,mul_comm]
485485

486486

487487
section OnRealSpace

SciLean/Analysis/AdjointSpace/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ theorem inner_self_nonpos {x : E} : re ⟪x, x⟫ ≤ 0 ↔ x = 0 := by
144144
constructor
145145
· have ⟨c,d,hc,_,h⟩ := inner_top_equiv_norm (𝕜:=𝕜) (E:=E)
146146
have ⟨h,_⟩ := h x
147-
intro h'; simp[h'] at h
147+
intro h'; simp[] at h
148148
have : ‖x‖^20 := by nlinarith
149149
have : ‖x‖ ≤ 0 := by nlinarith
150150
simp_all only [gt_iff_lt, smul_eq_mul, norm_le_zero_iff]

SciLean/Analysis/AdjointSpace/HasAdjoint.lean

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ theorem pi_rule {I : Type*} {n} [IndexType I n] [Fold.{_,u'} I] [Fold.{_,u} I]
253253
case adjoint =>
254254
intro x y
255255
have h := fun i => (hf i).adjoint
256-
simp[Inner.inner, h]
256+
simp[Inner.inner]
257257
sorry_proof
258258
case is_linear => apply IsContinuousLinearMap.pi_rule _ (fun i => (hf i).is_linear)
259259

@@ -376,7 +376,7 @@ theorem HAdd.hAdd.arg_a0a1.HasAdjoint_simple_rule :
376376
(fun x : X×X => x.1 + x.2)
377377
(fun x => (x,x)) := by
378378
constructor
379-
case adjoint => simp[AdjointSpace.inner_prod_split, AdjointSpace.inner_add_left, AdjointSpace.inner_add_right]
379+
case adjoint => simp[AdjointSpace.inner_prod_split, AdjointSpace.inner_add_left]
380380
case is_linear => fun_prop
381381

382382
@[data_synth]
@@ -396,7 +396,7 @@ theorem HSub.hSub.arg_a0a1.HasAdjoint_simple_rule :
396396
(fun x : X×X => x.1 - x.2)
397397
(fun x => (x, -x)) := by
398398
constructor
399-
case adjoint => simp[AdjointSpace.inner_prod_split, AdjointSpace.inner_add_left, AdjointSpace.inner_add_right,sub_eq_add_neg]
399+
case adjoint => simp[AdjointSpace.inner_prod_split, AdjointSpace.inner_add_left,sub_eq_add_neg]
400400
case is_linear => fun_prop
401401

402402
@[data_synth]
@@ -480,7 +480,7 @@ theorem HSMul.hSMul.arg_a1.HasAdjoint_simple_rule_nat (n : ℕ) :
480480
case adjoint =>
481481
intro x y;
482482
simp [← Nat.cast_smul_eq_nsmul (R:=K),AdjointSpace.inner_smul_left,
483-
AdjointSpace.inner_smul_right,AdjointSpace.inner_add_right]
483+
AdjointSpace.inner_smul_right]
484484
case is_linear =>
485485
simp [← Nat.cast_smul_eq_nsmul (R:=K)]; fun_prop
486486

@@ -507,7 +507,7 @@ theorem HSMul.hSMul.arg_a1.HasAdjointUpdate_simple_rule_nat (n : ℕ) :
507507
case adjoint =>
508508
intro x y;
509509
simp [← Int.cast_smul_eq_zsmul (R:=K),AdjointSpace.inner_smul_left,
510-
AdjointSpace.inner_smul_right,AdjointSpace.inner_add_right]
510+
AdjointSpace.inner_smul_right]
511511
case is_linear =>
512512
simp [← Int.cast_smul_eq_zsmul (R:=K)]; fun_prop
513513

@@ -684,7 +684,7 @@ theorem Finset.sum.arg_f.HasAdjoint_simp_rule
684684
(A : Finset I) :
685685
HasAdjoint K
686686
(fun f : I → X => A.sum (fun i => f i))
687-
(fun k i => A.toSet.indicator (fun _ => k) i) := by
687+
(fun k i => (A : Set I).indicator (fun _ => k) i) := by
688688
constructor
689689
case adjoint => intro f y; simp[Inner.inner]; sorry_proof -- missing API
690690
case is_linear => fun_prop
@@ -697,7 +697,7 @@ theorem Finset.sum.arg_f.HasAdjoint_simp_rule'
697697
(A : Finset I) :
698698
HasAdjoint K
699699
(fun f : I → X => A.sum f)
700-
(fun k i => A.toSet.indicator (fun _ => k) i) := by
700+
(fun k i => (A : Set I).indicator (fun _ => k) i) := by
701701
constructor
702702
case adjoint => intro f y; simp[Inner.inner]; sorry_proof -- missing API
703703
case is_linear => fun_prop
@@ -708,7 +708,7 @@ theorem Finset.sum.arg_f.HasAdjointUpdate_simp_rule
708708
(A : Finset I) :
709709
HasAdjointUpdate K
710710
(fun f : I → X => A.sum (fun i => f i))
711-
(fun k f i => f i + A.toSet.indicator (fun _ => k) i) := by
711+
(fun k f i => f i + (A : Set I).indicator (fun _ => k) i) := by
712712
constructor
713713
case adjoint => intro f y; simp[Inner.inner]; sorry_proof -- missing API
714714
case is_linear => fun_prop
@@ -721,7 +721,7 @@ theorem Finset.sum.arg_f.HasAdjointUpdate_simp_rule'
721721
(A : Finset I) :
722722
HasAdjointUpdate K
723723
(fun f : I → X => A.sum f)
724-
(fun k f i => f i + A.toSet.indicator (fun _ => k) i) := by
724+
(fun k f i => f i + (A : Set I).indicator (fun _ => k) i) := by
725725
constructor
726726
case adjoint => intro f y; simp[Inner.inner]; sorry_proof -- missing API
727727
case is_linear => fun_prop
@@ -763,7 +763,7 @@ theorem Inner.inner.arg_a0.HasAdjoint_simple_rule_real
763763
constructor
764764
case adjoint =>
765765
intro x k
766-
simp[AdjointSpace.inner_smul_right,ScalarInner.inner_eq_inner_re_im]
766+
simp[ScalarInner.inner_eq_inner_re_im]
767767
-- lhs has complex inner product and rhs has real inner product
768768
-- it should work out
769769
sorry_proof

0 commit comments

Comments
 (0)