Skip to content

Commit 7fe0bdc

Browse files
committed
update to v4.26.0
1 parent 229e276 commit 7fe0bdc

26 files changed

+147
-174
lines changed

Auto/Embedding/LCtx.lean

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -493,11 +493,8 @@ section push
493493

494494
theorem pushLCtxs_cons (xs : List α) (lctx : Nat → α) :
495495
pushLCtxs (x :: xs) lctx = pushLCtx x (pushLCtxs xs lctx) := by
496-
apply funext; intros n; cases n
497-
case h.zero =>
498-
dsimp [pushLCtxs, pushLCtx, Nat.blt, Nat.ble]; rw [Nat.zero_ble]
499-
case h.succ n =>
500-
dsimp [pushLCtxs, pushLCtx, Nat.blt, Nat.ble]; rw [Nat.succ_sub_succ]
496+
apply funext; intros n; cases n <;>
497+
simp [pushLCtxs, pushLCtx, Nat.blt, Nat.ble]
501498

502499
theorem pushLCtxs_append (xs ys : List α) (lctx : Nat → α) :
503500
pushLCtxs (xs ++ ys) lctx = pushLCtxs xs (pushLCtxs ys lctx) := by
@@ -515,7 +512,7 @@ section push
515512

516513
theorem pushLCtxs_cons_zero (xs : List α) (lctx : Nat → α) :
517514
pushLCtxs (x :: xs) lctx 0 = x := by
518-
dsimp [pushLCtxs, Nat.blt, Nat.ble]; rw [Nat.zero_ble]
515+
dsimp [pushLCtxs, Nat.blt, Nat.ble, Nat.zero_ble]
519516

520517
theorem pushLCtxs_cons_succ (xs : List α) (lctx : Nat → α) (n : Nat) :
521518
pushLCtxs (x :: xs) lctx (.succ n) = pushLCtxs xs lctx n := by
@@ -611,9 +608,7 @@ section push
611608
HEq (pushLCtxsDep (.cons x xs) lctx) (pushLCtxDep x (pushLCtxsDep xs lctx)) := by
612609
apply HEq.funext; intros n; cases n
613610
case zero =>
614-
dsimp [pushLCtxs, pushLCtx, Nat.blt, Nat.ble]
615-
rw [Nat.ble_eq_true_of_le]; rfl
616-
apply Nat.zero_le
611+
simp [pushLCtxs, pushLCtx, Nat.blt, Nat.ble, HList.getD]
617612
case succ n =>
618613
dsimp [pushLCtxs, pushLCtx, Nat.blt, Nat.ble]
619614
rw [Nat.succ_sub_succ]; rfl
@@ -622,9 +617,7 @@ section push
622617
{lctxty : α → Sort u} {ty : α} (x : lctxty ty) {tys : List α}
623618
(xs : HList lctxty tys) {rty : Nat → α} (lctx : ∀ n, lctxty (rty n)) :
624619
HEq (pushLCtxsDep (.cons x xs) lctx 0) x := by
625-
dsimp [pushLCtxs, Nat.blt, Nat.ble];
626-
rw [Nat.ble_eq_true_of_le]; rfl
627-
apply Nat.zero_le
620+
simp [pushLCtxs, Nat.blt, Nat.ble, HList.getD]
628621

629622
theorem pushLCtxsDep_cons_succ
630623
{lctxty : α → Sort u} {ty : α} (x : lctxty ty) {tys : List α}
@@ -771,9 +764,9 @@ section push
771764
dsimp at heq; rw [← heq]
772765
rw [HList.ofFun_succ];
773766
congr
774-
case e_3.h => dsimp; rw [pushLCtxs_cons_zero]
775-
case e_4.h => dsimp; rw [pushLCtxs_cons_succ_Fn]; apply List.ofFun_ofPushLCtx; rfl
776-
case e_5 => apply pushLCtxsDep_cons_zero
767+
case e_4.h =>
768+
dsimp; rw [pushLCtxs_cons_succ_Fn]
769+
apply List.ofFun_ofPushLCtx; rfl
777770
case e_6 =>
778771
apply HEq.trans _ (ofFun_ofPushLCtxDep rfl xs lctx)
779772
congr

Auto/Embedding/LamBVarOp.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ theorem LamWF.mapBVarAt.correct (lval : LamValuation.{u}) {restoreDep : _}
7979
| .etom _, .ofEtom _ => rfl
8080
| .base _, .ofBase _ => rfl
8181
| .bvar n, .ofBVar _ => by
82-
dsimp [mapBVarAt, LamWF.interp]
82+
simp only [mapBVarAt, LamWF.interp]
8383
apply eq_of_heq; apply HEq.symm (HEq.trans (interp_bvar _) _)
8484
apply (coPairDepAt.ofCoPairDep covPD).right
8585
| .lam argTy body, .ofLam bodyTy wfBody => by
@@ -88,7 +88,7 @@ theorem LamWF.mapBVarAt.correct (lval : LamValuation.{u}) {restoreDep : _}
8888
apply LamWF.interp_substLCtxTerm_rec
8989
apply restoreAtDep_succ_pushLCtxDep_Fn
9090
| .app s fn arg, .ofApp _ wfFn wfArg => by
91-
dsimp [LamWF.interp]
91+
simp only [LamWF.interp]
9292
let IHFn := LamWF.mapBVarAt.correct lval covPD idx lctxTerm fn wfFn
9393
let IHArg := LamWF.mapBVarAt.correct lval covPD idx lctxTerm arg wfArg
9494
rw [IHFn]; rw [IHArg]; rfl

Auto/Embedding/LamBase.lean

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,7 +2567,7 @@ theorem LamTerm.maxLooseBVarSucc.spec (m : Nat) :
25672567
let IH' := Nat.pred_le_pred (IH.mp h)
25682568
rw [Nat.pred_succ] at IH'; exact IH'
25692569
case mpr =>
2570-
apply IH.mpr; apply Nat.lt_pred_iff_succ_lt.mp; exact h
2570+
apply IH.mpr; apply Nat.lt_pred_iff.mp; exact h
25712571
| .app _ t₁ t₂ => by
25722572
dsimp [hasLooseBVarGe, maxLooseBVarSucc];
25732573
rw [Bool.or_eq_true]; rw [spec m t₁]; rw [spec m t₂];
@@ -4094,7 +4094,7 @@ theorem LamWF.interp_bvarAppsRev
40944094
(pushLCtxs_append_singleton _ _ _) (pushLCtxsDep_append_singleton _ _ _)]
40954095
rw [LamWF.interp_substWF (wf':=wfAp)]
40964096
apply IH (LamWF.ofApp _ wft LamWF.bvarAppsRev_Aux)
4097-
dsimp [interp]; apply HEq.trans (b:=LamSort.curry valPre lterm) <;> try rfl
4097+
simp only[interp]; apply HEq.trans (b:=LamSort.curry valPre lterm) <;> try rfl
40984098
case h₁ =>
40994099
apply heq_of_eq; apply congr
41004100
case h₁ =>
@@ -4200,7 +4200,8 @@ theorem LamWF.interp_insertEVarAt_eIdx
42004200
let lval' := {lval with lamEVarTy := replaceAt ty pos lamEVarTy',
42014201
eVarVal := replaceAtDep val pos eVarVal'}
42024202
HEq (lwf.interp lval' lctxTy lctxTerm) val := by
4203-
cases lwf; dsimp [interp, replaceAt, replaceAtDep]; rw [Nat.beq_refl]
4203+
cases lwf; simp only [interp, replaceAt, replaceAtDep]
4204+
rw [Nat.beq_refl]; rfl
42044205

42054206
theorem LamWF.interp_eVarIrrelevance
42064207
(lval₁ : LamValuation.{u}) (lval₂ : LamValuation.{u})
@@ -4238,17 +4239,17 @@ theorem LamWF.interp_eVarIrrelevance
42384239
apply HEq.trans _ (LamWF.interp_heq (lval:=lval₂) (lwf₁ := lwf₂') rfl HEq.rfl _ rfl)
42394240
cases lwf₂'; dsimp [interp]; apply (hirr _ _).right; exact .refl
42404241
case base b =>
4241-
cases lwf₁; cases lwf₂; dsimp [interp]
4242+
cases lwf₁; cases lwf₂; simp only [interp]
42424243
apply LamBaseTerm.LamWF.interp_lvalIrrelevance <;> rfl
42434244
case lam s t IH =>
42444245
cases lwf₁; case ofLam bodyTy₁ H₁ =>
42454246
cases lwf₂; case ofLam H₂ =>
4246-
dsimp [interp]; apply HEq.funext; intro x; apply IH
4247+
simp only [interp]; apply HEq.funext; intro x; apply IH
42474248
exact hirr
42484249
case app s fn arg IHFn IHArg =>
42494250
cases lwf₁; case ofApp HArg₁ HFn₁ =>
42504251
cases lwf₂; case ofApp HArg₂ HFn₂ =>
4251-
dsimp [interp]; apply congr_h_heq <;> try rfl
4252+
simp only [interp]; apply congr_h_heq <;> try rfl
42524253
case h₁ =>
42534254
apply IHFn; intros n hlt;
42544255
apply (hirr n (Nat.le_trans hlt (Nat.le_max_left _ _)))
@@ -4268,20 +4269,20 @@ theorem LamWF.interp_lctxIrrelevance
42684269
HEq (LamWF.interp lval lctxTy₁ lctxTerm₁ lwf₁) (LamWF.interp lval lctxTy₂ lctxTerm₂ lwf₂) := by
42694270
induction t generalizing lctxTy₁ lctxTy₂ rty <;> try (cases lwf₁; cases lwf₂; rfl)
42704271
case base b =>
4271-
cases lwf₁; cases lwf₂; dsimp [interp]; apply LamBaseTerm.LamWF.interp_heq <;> rfl
4272+
cases lwf₁; cases lwf₂; simp only [interp]; apply LamBaseTerm.LamWF.interp_heq <;> rfl
42724273
case bvar n =>
4273-
cases lwf₁; dsimp [interp]
4274+
cases lwf₁; simp only [interp]
42744275
have htyeq : lctxTy₁ n = lctxTy₂ n := by
42754276
apply (hirr _ _).left; exact .refl
42764277
rw [htyeq] at lwf₂; apply HEq.trans (b:=interp _ _ lctxTerm₂ lwf₂)
42774278
case h₁ =>
4278-
cases lwf₂; dsimp [interp]; apply (hirr _ _).right; exact .refl
4279+
cases lwf₂; simp only [interp]; apply (hirr _ _).right; exact .refl
42794280
case h₂ =>
42804281
apply interp_heq <;> rfl
42814282
case lam s t IH =>
42824283
cases lwf₁; case ofLam bodyTy₁ H₁ =>
42834284
cases lwf₂; case ofLam H₂ =>
4284-
dsimp [interp]; apply HEq.funext; intros x; apply IH
4285+
simp only [interp]; apply HEq.funext; intros x; apply IH
42854286
intros n hlt; dsimp [pushLCtx, pushLCtxDep]
42864287
cases n
42874288
case zero => exact And.intro rfl HEq.rfl
@@ -4292,7 +4293,7 @@ theorem LamWF.interp_lctxIrrelevance
42924293
case app s fn arg IHFn IHArg =>
42934294
cases lwf₁; case ofApp HArg₁ HFn₁ =>
42944295
cases lwf₂; case ofApp HArg₂ HFn₂ =>
4295-
dsimp [interp]; apply congr_h_heq <;> try rfl
4296+
simp only [interp]; apply congr_h_heq <;> try rfl
42964297
case h₁ =>
42974298
apply IHFn; intros n hlt;
42984299
apply (hirr n (Nat.le_trans hlt (Nat.le_max_left _ _)))

Auto/Embedding/LamBitVec.lean

Lines changed: 25 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ namespace BVLems
6666
have hle := of_decide_eq_true hdec
6767
rw [Bool.dite_eq_true (proof:=hle), toNat_zeroExtend']
6868
rw [Nat.mod_eq_of_lt]; rcases a with ⟨⟨a, isLt⟩⟩;
69-
apply Nat.le_trans isLt; apply Nat.pow_le_pow_right (Nat.le_step .refl) hle
69+
apply Nat.le_trans isLt; apply Nat.pow_le_pow_right (Nat.lt_succ_of_lt .refl) hle
7070

7171
theorem toNat_sub (a b : BitVec n) : (a - b).toNat = (2 ^ n - b.toNat + a.toNat) % (2 ^ n) := rfl
7272

@@ -93,55 +93,32 @@ namespace BVLems
9393
theorem ushiftRight_ge_length_eq_zero (a : BitVec n) (i : Nat) : i ≥ n → a >>> i = 0#n := by
9494
intro h; apply eq_of_val_eq; rw [toNat_ushiftRight, toNat_ofNat]
9595
apply (Nat.le_iff_div_eq_zero (Nat.two_pow_pos _)).mpr
96-
apply Nat.le_trans (toNat_le _) (Nat.pow_le_pow_right (.step .refl) h)
97-
98-
theorem ushiftRight_ge_length_eq_zero' (a : BitVec n) (i : Nat) : i ≥ n → BitVec.ofNat n (a.toNat >>> i) = 0#n := by
99-
intro h; apply congrArg (@BitVec.ofNat n)
100-
rw [Nat.shiftRight_eq_div_pow, Nat.le_iff_div_eq_zero (Nat.two_pow_pos _)]
101-
apply Nat.le_trans (toNat_le _) (Nat.pow_le_pow_right (.step .refl) h)
102-
103-
theorem msb_equiv_lt (a : BitVec n) : !a.msb ↔ a.toNat < 2 ^ (n - 1) := by
104-
dsimp [BitVec.msb, BitVec.getMsbD, BitVec.getLsbD]
105-
cases n
106-
case zero => cases a <;> simp
107-
case succ n =>
108-
have dtrue : decide (0 < n + 1) = true := by simp
109-
rw [dtrue, Bool.not_eq_true', Bool.true_and, Nat.succ_sub_one, Nat.testBit_false_iff]
110-
rw [Nat.mod_eq_of_lt (toNat_le _)]
111-
112-
theorem msb_equiv_lt' (a : BitVec n) : !a.msb ↔ 2 * a.toNat < 2 ^ n := by
113-
rw [msb_equiv_lt]
114-
cases n
115-
case zero => cases a <;> simp
116-
case succ n =>
117-
rw [Nat.succ_sub_one, Nat.pow_succ, Nat.mul_comm (m:=2)]
118-
apply Iff.symm; apply Nat.mul_lt_mul_left
119-
exact .step .refl
96+
apply Nat.le_trans (toNat_le _) (Nat.pow_le_pow_right (Nat.lt_succ_of_lt .refl) h)
12097

12198
theorem sshiftRight_ge_length_eq_msb (a : BitVec n) (i : Nat) : i ≥ n → a.sshiftRight i =
12299
if a.msb then (1#n).neg else 0#n := by
123-
intro h; simp only [sshiftRight, BitVec.toInt, ← msb_equiv_lt']
124-
cases hmsb : a.msb <;> simp only [Int.shiftRight_def] <;> dsimp
100+
intro h
101+
cases hmsb : a.msb <;> dsimp <;> rw [eq_iff_val_eq]
125102
case false =>
126-
rw [BitVec.ofNat]
127-
apply ushiftRight_ge_length_eq_zero'; exact h
103+
rw [BitVec.sshiftRight_eq_of_msb_false hmsb]
104+
have ha : a.toNat < 2 ^ i := Nat.le_trans (toNat_le _) (
105+
Nat.pow_le_pow_right Nat.zero_lt_two h)
106+
simp [Nat.shiftRight_eq_div_pow, ha]
128107
case true =>
129-
rw [← Int.subNatNat_eq_coe, Int.subNatNat_of_lt (toNat_le _)]
130-
simp only [BitVec.ofInt]; dsimp
131-
have hzero : (2 ^ n - BitVec.toNat a - 1) >>> i = 0 := by
132-
rw [Nat.shiftRight_eq_div_pow]; apply (Nat.le_iff_div_eq_zero (Nat.two_pow_pos _)).mpr
133-
rw [Nat.sub_one, Nat.pred_lt_iff_le (Nat.two_pow_pos _)]
134-
apply Nat.le_trans (Nat.sub_le _ _) (Nat.pow_le_pow_right (.step .refl) h)
135-
apply eq_of_val_eq; rw [toNat_ofNatLt, hzero]
136-
rw [toNat_neg, Int.mod_def', Int.emod]
137-
rw [Nat.zero_mod, Int.natAbs_natCast, Nat.succ_eq_add_one, Nat.zero_add]
138-
rw [Int.subNatNat_of_sub_eq_zero ((Nat.sub_eq_zero_iff_le).mpr (Nat.two_pow_pos _))]
139-
rw [Int.toNat_natCast, BitVec.toNat_ofNat]
140-
cases n <;> try rfl
141-
case succ n =>
142-
have hlt : 22 ^ Nat.succ n := @Nat.pow_le_pow_right 2 (.step .refl) 1 (.succ n) (Nat.succ_le_succ (Nat.zero_le _))
143-
rw [Nat.mod_eq_of_lt (a:=1) hlt]
144-
rw [Nat.mod_eq_of_lt]; apply Nat.sub_lt (Nat.le_trans (.step .refl) hlt) .refl
108+
have hn : n > 0 := by
109+
apply Nat.ne_zero_iff_zero_lt.mp; intro hn; cases hn
110+
rw [BitVec.msb_eq_toNat] at hmsb
111+
have := toNat_le a; simp_all
112+
have hpn : 2 ^ n > 1 := Nat.pow_le_pow_right Nat.zero_lt_two hn
113+
have hin : 2 ^ n ≤ 2 ^ i := Nat.pow_le_pow_right Nat.zero_lt_two h
114+
rw [BitVec.sshiftRight_eq_of_msb_true hmsb]
115+
rw [BitVec.toNat_not, BitVec.toNat_neg, BitVec.toNat_ofNat]
116+
rw [Nat.one_mod_eq_one.mpr (Nat.ne_of_gt hpn)]
117+
have hsa : 2 ^ n - 1 - a.toNat < 2 ^ i := by
118+
apply Nat.sub_lt_of_lt; apply Nat.lt_iff_add_one_le.mpr
119+
rw [Nat.sub_add_cancel (Nat.le_of_lt hpn)]; exact hin
120+
have han : (~~~a >>> i).toNat = 0 := by simp [Nat.shiftRight_eq_div_pow, hsa]
121+
simp [han]
145122

146123
theorem shiftRight_eq_zero_iff (a : BitVec n) (b : Nat) : a >>> b = 0#n ↔ a.toNat < 2 ^ b := by
147124
rw [ushiftRight_def]; rcases a with ⟨⟨a, isLt⟩⟩;
@@ -201,7 +178,7 @@ namespace BVLems
201178

202179
theorem shl_toNat_equiv_short (a : BitVec n) (b : BitVec m) (h : m ≤ n) : a <<< b.toNat = a <<< (zeroExtend n b) := by
203180
apply eq_of_val_eq; rw [toNat_shiftLeft, smtshiftLeft_def, toNat_shiftLeft, toNat_zeroExtend, Nat.mod_eq_of_lt (a:=BitVec.toNat b)]
204-
apply Nat.le_trans (toNat_le _) (Nat.pow_le_pow_right (.step .refl) h)
181+
apply Nat.le_trans (toNat_le _) (Nat.pow_le_pow_right (Nat.lt_succ_of_lt .refl) h)
205182

206183
theorem shl_toNat_equiv_long (a : BitVec n) (b : BitVec m) (h : m > n) : a <<< b.toNat =
207184
if (b >>> (BitVec.ofNat m n)) = 0#m then a <<< (zeroExtend n b) else 0 := by
@@ -244,7 +221,7 @@ namespace BVLems
244221

245222
theorem lshr_toNat_equiv_short (a : BitVec n) (b : BitVec m) (h : m ≤ n) : a >>> b.toNat = a >>> (zeroExtend n b) := by
246223
apply eq_of_val_eq; rw [toNat_ushiftRight, smtushiftRight_def, toNat_ushiftRight, toNat_zeroExtend, Nat.mod_eq_of_lt]
247-
apply Nat.le_trans (toNat_le _) (Nat.pow_le_pow_right (.step .refl) h)
224+
apply Nat.le_trans (toNat_le _) (Nat.pow_le_pow_right (Nat.lt_succ_of_lt .refl) h)
248225

249226
theorem lshr_toNat_equiv_long (a : BitVec n) (b : BitVec m) (h : m > n) : a >>> b.toNat =
250227
if (b >>> (BitVec.ofNat m n)) = 0#m then a >>> (zeroExtend n b) else 0 := by
@@ -289,7 +266,7 @@ namespace BVLems
289266

290267
theorem ashr_toNat_equiv_short (a : BitVec n) (b : BitVec m) (h : m ≤ n) : a.sshiftRight b.toNat = a.sshiftRight (zeroExtend n b).toNat := by
291268
apply eq_of_val_eq; rw [toNat_zeroExtend, Nat.mod_eq_of_lt]
292-
apply Nat.le_trans (toNat_le _) (Nat.pow_le_pow_right (.step .refl) h)
269+
apply Nat.le_trans (toNat_le _) (Nat.pow_le_pow_right (Nat.lt_succ_of_lt .refl) h)
293270

294271
theorem ashr_toNat_equiv_long (a : BitVec n) (b : BitVec m) (h : m > n) : a.sshiftRight b.toNat =
295272
if (b >>> (BitVec.ofNat m n)) = 0#m then a.sshiftRight (zeroExtend n b).toNat else (if a.msb then (1#n).neg else 0#n) := by

Auto/Embedding/LamChecker.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ theorem EtomStep.eval_correct
16641664
rw [Nat.beq_eq_false_of_ne (Nat.ne_of_lt hlt)]
16651665
case right =>
16661666
rw [LamTerm.maxEVarSucc_mkEq]; dsimp [LamTerm.maxEVarSucc]
1667-
rw [Nat.max_le]; apply And.intro (Nat.le_refl _) (Nat.le_step h₂')
1667+
rw [Nat.max_le]; apply And.intro (Nat.le_refl _) (Nat.le_succ_of_le h₂')
16681668
| false => exact True.intro
16691669
| .none => exact True.intro
16701670

Auto/Embedding/LamConv.lean

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ theorem LamWF.interp_app_bvarLift_bvar0
1313
(wft : LamWF lval.toLamTyVal ⟨lctx, t, .func argTy resTy⟩) :
1414
LamWF.interp lval (pushLCtx argTy lctx) (pushLCtxDep x lctxTerm) wft.app_bvarLift_bvar0 =
1515
LamWF.interp (rty:=.func _ _) lval lctx lctxTerm wft x := by
16-
dsimp [LamWF.interp, LamTerm.app_bvarLift_bvar0, app_bvarLift_bvar0, pushLCtx_ofBVar]; rw [← LamWF.interp_bvarLift]
16+
simp only [LamWF.interp, LamTerm.app_bvarLift_bvar0, app_bvarLift_bvar0, pushLCtx_ofBVar]
17+
rw [← LamWF.interp_bvarLift]; rfl
1718

1819
def LamTerm.etaExpand1 (s : LamSort) (t : LamTerm) : LamTerm :=
1920
.lam s (.app s t.bvarLift (.bvar 0))
@@ -881,8 +882,8 @@ theorem LamWF.interp_instantiateAt.{u}
881882
| lctxTy, lctxTerm, wfArg, .ofEtom n => rfl
882883
| lctxTy, lctxTerm, wfArg, .ofBase b => rfl
883884
| lctxTy, lctxTerm, wfArg, .ofBVar n => by
884-
dsimp [LamWF.interp, LamWF.instantiateAt, LamTerm.instantiateAt]
885-
dsimp [pushLCtxAt, pushLCtxAtDep, restoreAt, restoreAtDep, pushLCtx]
885+
simp only [LamWF.interp, LamWF.instantiateAt, LamTerm.instantiateAt]
886+
simp only [pushLCtxAt, pushLCtxAtDep, restoreAt, restoreAtDep, pushLCtx]
886887
match Nat.ble idx n with
887888
| true =>
888889
dsimp;
@@ -912,7 +913,8 @@ theorem LamWF.interp_instantiateAt.{u}
912913
| lctxTy, lctxTerm, wfArg, .ofApp argTy' HFn HArg =>
913914
let IHFn := LamWF.interp_instantiateAt lval idx lctxTy lctxTerm wfArg HFn
914915
let IHArg := LamWF.interp_instantiateAt lval idx lctxTy lctxTerm wfArg HArg
915-
by dsimp [LamWF.interp, LamTerm.instantiateAt, instantiateAt]; dsimp at IHFn; dsimp at IHArg; simp [IHFn, IHArg]
916+
by simp only [LamWF.interp, LamTerm.instantiateAt, instantiateAt]
917+
dsimp at IHFn; dsimp at IHArg; simp [IHFn, IHArg]
916918

917919
def LamTerm.instantiate1 := LamTerm.instantiateAt 0
918920

@@ -962,7 +964,6 @@ theorem LamWF.interp_instantiate1.{u}
962964
case eqBody => rw [pushLCtxAt_zero]
963965
case eqLarge =>
964966
apply eq_of_heq; apply LamWF.interp_heq <;> try rfl
965-
case h.HLCtxTyEq => rw [pushLCtxAt_zero]
966967
case h.HLCtxTermEq =>
967968
apply HEq.trans (HEq.symm (pushLCtxAtDep_zero _ _)) _
968969
apply pushLCtxAtDep_heq <;> try rfl
@@ -1072,10 +1073,10 @@ theorem LamWF.interp_resolveImport
10721073
| .ofBase b => LamBaseTerm.LamWF.interp_resolveImport lval b
10731074
| .ofBVar n => rfl
10741075
| .ofLam s hwf => by
1075-
apply funext; intros x; dsimp [interp, LamTerm.resolveImport, resolveImport]
1076+
apply funext; intros x; simp only [interp, LamTerm.resolveImport, resolveImport]
10761077
rw [LamWF.interp_resolveImport _ _ hwf]
10771078
| .ofApp s wfFn wfArg => by
1078-
dsimp [interp, LamTerm.resolveImport, resolveImport];
1079+
simp only [interp, LamTerm.resolveImport, resolveImport];
10791080
rw [LamWF.interp_resolveImport _ _ wfFn]
10801081
rw [LamWF.interp_resolveImport _ _ wfArg]
10811082

Auto/Embedding/LamPrep.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ theorem propne_equiv {a b : Prop} : (a ≠ b) ↔ (a ∨ b) ∧ (¬ a ∨ ¬ b)
6767
theorem LamEquiv.not_true_equiv_false :
6868
LamEquiv lval lctx (.base .prop) (.mkNot (.base .trueE)) (.base .falseE) := by
6969
exists LamWF.mkNot (.ofBase .ofTrueE); exists LamWF.ofBase .ofFalseE; intro lctxTerm
70-
dsimp [LamWF.interp, LamBaseTerm.LamWF.interp, notLift]
70+
simp only [LamWF.interp, LamBaseTerm.LamWF.interp]
7171
apply GLift.down.inj; dsimp; apply eq_false; exact fun h => h .intro
7272

7373
theorem LamEquiv.not_false_equiv_true :
7474
LamEquiv lval lctx (.base .prop) (.mkNot (.base .falseE)) (.base .trueE) := by
7575
exists LamWF.mkNot (.ofBase .ofFalseE); exists LamWF.ofBase .ofTrueE; intro lctxTerm
76-
dsimp [LamWF.interp, LamBaseTerm.LamWF.interp, notLift]
76+
simp only [LamWF.interp, LamBaseTerm.LamWF.interp]
7777
apply GLift.down.inj; dsimp; apply eq_true; exact id
7878

7979
theorem LamEquiv.prop_ne_equiv_eq_not
@@ -267,7 +267,7 @@ theorem LamEquiv.eq_true_equiv?
267267
match wft with
268268
| .ofApp _ (.ofApp _ (.ofBase (.ofEq _)) Hlhs) (.ofBase .ofTrueE) =>
269269
exists Hlhs; intro lctxTerm
270-
dsimp [LamWF.interp, LamBaseTerm.LamWF.interp, eqLiftFn]
270+
simp only [LamWF.interp, LamBaseTerm.LamWF.interp, eqLiftFn]
271271
apply GLift.down.inj; dsimp; apply propext (Iff.intro ?mp ?mpr)
272272
case mp =>
273273
intro h; apply of_eq_true (_root_.congrArg _ h)
@@ -308,7 +308,7 @@ theorem LamEquiv.eq_false_equiv?
308308
match wft with
309309
| .ofApp _ (.ofApp _ (.ofBase (.ofEq _)) Hlhs) (.ofBase .ofFalseE) =>
310310
exists LamWF.mkNot Hlhs; intro lctxTerm
311-
dsimp [LamWF.interp, LamBaseTerm.LamWF.interp, eqLiftFn]
311+
simp only [LamWF.interp, LamBaseTerm.LamWF.interp, eqLiftFn]
312312
apply GLift.down.inj; dsimp; apply propext (Iff.intro ?mp ?mpr)
313313
case mp =>
314314
intro h h'; rw [h] at h'; exact h'

0 commit comments

Comments
 (0)