Theorems about Time.monthLengths
properties #
Relation of Date to Time.monthLengths
list.
Equations
- Verify.MonthLength.monthLengthsOfDate m dt = (m ∈ Time.monthLengths (Time.isLeapYear dt.Year) ∧ m.fst = dt.Month.val ∧ dt.Day.val ≤ m.snd)
Instances For
def
Verify.MonthLength.monthLengths_of_date
(dt : Time.Date)
:
{ m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }
Build relation of Date to Time.monthLengths
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
Verify.MonthLength.monthLastDayAsDayOfYear'_index_eq_if_fst_eq
{isleap : Bool}
(i : Fin (Time.monthLastDayAsDayOfYear' isleap).length)
(i' : Fin (Time.monthLengths isleap).length)
(h : (Time.monthLastDayAsDayOfYear' isleap)[↑i].fst = (Time.monthLengths isleap)[↑i'].fst)
:
↑i = ↑i'
theorem
Verify.MonthLength.monthLastDayAsDayOfYear'_sub_eq_incr
{isleap : Bool}
(i : Fin (Time.monthLastDayAsDayOfYear' isleap).length)
(dt : Time.Date)
(hl : Time.isLeapYear dt.Year = isleap)
{ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }}
(hml : ml = Verify.MonthLength.monthLengths_of_date dt)
(h : dt.Day.val = ml.val.snd)
(hmonth : ((Time.monthLastDayAsDayOfYear' isleap).get i).fst = dt.Month.val)
:
dt.Day.val = (Time.monthLastDayAsDayOfYear' isleap)[↑i].snd.snd - (Time.monthLastDayAsDayOfYear' isleap)[↑i].snd.fst + 1
theorem
Verify.MonthLength.monthLastDayAsDayOfYear'_sub_le
{isleap : Bool}
(i : Fin (Time.monthLastDayAsDayOfYear' isleap).length)
(dt : Time.Date)
(hl : Time.isLeapYear dt.Year = isleap)
{ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }}
(hml : ml = Verify.MonthLength.monthLengths_of_date dt)
(h : dt.Day.val < ml.val.snd)
(hmonth : ((Time.monthLastDayAsDayOfYear' isleap).get i).fst = dt.Month.val)
:
dt.Day.val ≤ (Time.monthLastDayAsDayOfYear' isleap)[i].snd.snd - (Time.monthLastDayAsDayOfYear' isleap)[i].snd.fst
theorem
Verify.MonthLength.monthLastDayAsDayOfYear'_index_eq
{isleap : Bool}
(i i' : Fin (Time.monthLastDayAsDayOfYear' isleap).length)
(dt : Time.Date)
(hl : Time.isLeapYear dt.Year = isleap)
{ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }}
(hml : ml = Verify.MonthLength.monthLengths_of_date dt)
(h : dt.Day.val < ml.val.snd)
(hmonth : ((Time.monthLastDayAsDayOfYear' isleap).get i').fst = dt.Month.val)
(h1 :
(Time.monthLastDayAsDayOfYear' isleap)[i].snd.fst ≤ (Time.monthLastDayAsDayOfYear' isleap)[i'].snd.fst + dt.Day.val)
(h2 :
(Time.monthLastDayAsDayOfYear' isleap)[i'].snd.fst + dt.Day.val ≤ (Time.monthLastDayAsDayOfYear' isleap)[i].snd.snd)
:
i = i'
theorem
Verify.MonthLength.monthLastDayAsDayOfYear'_index_eq_of_last_day_in_month
{isleap : Bool}
(i i' : Fin (Time.monthLastDayAsDayOfYear' isleap).length)
(dt : Time.Date)
(hl : Time.isLeapYear dt.Year = isleap)
{ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }}
(hml : ml = Verify.MonthLength.monthLengths_of_date dt)
(h : dt.Day.val = ml.val.snd)
(hmonth : ((Time.monthLastDayAsDayOfYear' isleap).get i').fst = dt.Month.val)
(h1 :
(Time.monthLastDayAsDayOfYear' isleap)[↑i].snd.fst ≤ (Time.monthLastDayAsDayOfYear' isleap)[↑i'].snd.fst + dt.Day.val)
(h2 :
(Time.monthLastDayAsDayOfYear' isleap)[↑i'].snd.fst + dt.Day.val ≤ (Time.monthLastDayAsDayOfYear' isleap)[↑i].snd.snd)
: