Theorems about Time.findValidMonthDay
properties #
Main theorems:
theorem
Verify.MonthDay.yd_eq_monthLastDayAsDayOfYear'_val
{dt : Time.Date}
(isLeap : Bool)
(yd : Time.Icc 1 366)
{a : { x : Nat × Nat × Nat // x ∈ Time.monthLastDayAsDayOfYear' isLeap ∧ x.fst = dt.Month.val }}
{ml : { m : Nat × Nat // MonthLength.monthLengthsOfDate m dt }}
(hml : ml = MonthLength.monthLengths_of_date dt)
(h : dt.Day.val = ml.val.snd)
(hmem : ml.val ∈ Time.monthLengths (Time.isLeapYear dt.Year) ∧ ml.val.fst = dt.Month.val ∧ dt.Day.val ≤ ml.val.snd)
(heq : a.val.snd.fst + dt.Day.val - 1 = yd.val)
(hl : Time.isLeapYear dt.Year = isLeap)
:
Day of year yd
equals (Time.monthLastDayAsDayOfYear' isLeap).val.snd.snd
if dt.Day.val = ml.val.snd
(if dt.Day is last day of month).
theorem
Verify.MonthDay.OrdinalDate_of_common_no_leapYear
(dt : Time.OrdinalDate)
(v : Time.Icc 1 365)
(h : dt.dayOfYear = Time.DayOfYear.common v)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
Verify.MonthDay.findValidMonthDay_1_month_eq
{year : Int}
{dt : Time.Date}
(isLeap : Bool)
(yd : Time.Icc 1 366)
{ml : { m : Nat × Nat // MonthLength.monthLengthsOfDate m dt }}
(h : dt.Day.val < ml.val.snd)
(heq : Time.dy' isLeap dt.Month dt.Day = yd.val)
(hle : yd.val + 1 ≤ if isLeap = true then 366 else 365)
(hyd : yd.val + 1 ≤ ((Time.monthLastDayAsDayOfYear isLeap).get ⟨0, ⋯⟩).snd)
:
theorem
Verify.MonthDay.findValidMonthDay_n_month_eq
{dt : Time.Date}
(isLeap : Bool)
(i : Nat)
(yd : Time.Icc 1 366)
(hle' : 1 ≤ i)
(hlt : i < (Time.monthLengths isLeap).length)
(hlt' : i < (Time.monthLastDayAsDayOfYear isLeap).length)
(hl : Time.isLeapYear dt.Year = isLeap)
{ml : { m : Nat × Nat // MonthLength.monthLengthsOfDate m dt }}
(hml : ml = MonthLength.monthLengths_of_date dt)
(h : dt.Day.val < ml.val.snd)
(heq : Time.dy' isLeap dt.Month dt.Day = yd.val)
(hle : yd.val + 1 ≤ if isLeap = true then 366 else 365)
(hydn : ¬yd.val + 1 ≤ ((Time.monthLastDayAsDayOfYear isLeap).get ⟨i - 1, ⋯⟩).snd)
(hyd : yd.val + 1 ≤ ((Time.monthLastDayAsDayOfYear isLeap).get ⟨i, hlt'⟩).snd)
:
theorem
Verify.MonthDay.findValidMonthDay_month_eq
{dt : Time.Date}
(isLeap : Bool)
(yd : Time.Icc 1 366)
{ml : { m : Nat × Nat // MonthLength.monthLengthsOfDate m dt }}
(hml : ml = MonthLength.monthLengths_of_date dt)
(h : dt.Day.val < ml.val.snd)
(heq : Time.dy' isLeap dt.Month dt.Day = yd.val)
(hl : Time.isLeapYear dt.Year = isLeap)
(hle : yd.val + 1 ≤ if isLeap = true then 366 else 365)
:
For a day of year yd
, if dt.Day
is not last day of month, then
- (Time.findValidMonthDay dt.Year (yd + 1)).Month = dt.Month
- (Time.findValidMonthDay dt.Year (yd + 1)).Day = dt.Day + 1
theorem
Verify.MonthDay.findValidMonthDay_n_month_eq_incr
{dt : Time.Date}
(isLeap : Bool)
(i : Nat)
(yd : Time.Icc 1 366)
(hle' : 1 ≤ i)
(hlt : i < (Time.monthLengths isLeap).length)
(hlt' : i < (Time.monthLastDayAsDayOfYear isLeap).length)
(hl : Time.isLeapYear dt.Year = isLeap)
{ml : { m : Nat × Nat // MonthLength.monthLengthsOfDate m dt }}
(hml : ml = MonthLength.monthLengths_of_date dt)
(h : dt.Day.val = ml.val.snd)
(hm : dt.Month.val < 12)
(heq : Time.dy' isLeap dt.Month dt.Day = yd.val)
(hle : yd.val + 1 ≤ if isLeap = true then 366 else 365)
(hydn : ¬yd.val + 1 ≤ ((Time.monthLastDayAsDayOfYear isLeap).get ⟨i - 1, ⋯⟩).snd)
(hyd : yd.val + 1 ≤ ((Time.monthLastDayAsDayOfYear isLeap).get ⟨i, hlt'⟩).snd)
:
theorem
Verify.MonthDay.findValidMonthDay_month_eq_incr
{dt : Time.Date}
(isLeap : Bool)
(yd : Time.Icc 1 366)
{ml : { m : Nat × Nat // MonthLength.monthLengthsOfDate m dt }}
(hml : ml = MonthLength.monthLengths_of_date dt)
(h : dt.Day.val = ml.val.snd)
(hm : dt.Month.val < 12)
(heq : Time.dy' isLeap dt.Month dt.Day = yd.val)
(hl : Time.isLeapYear dt.Year = isLeap)
(hle : yd.val + 1 ≤ if isLeap = true then 366 else 365)
:
For a day of year yd
, if dt.Day
is equal to last day of month, then
- (Time.findValidMonthDay dt.Year (yd + 1)).Month = dt.Month + 1
- (Time.findValidMonthDay dt.Year (yd + 1)).Day = 1