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 // Verify.MonthLength.monthLengthsOfDate m dt }}
(hml : ml = Verify.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)
:
a.val.snd.snd = yd.val
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).
Instances For
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
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
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
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
Instances For
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
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
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.incr_of_day_is_valid
(dt : Time.Date)
(ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt })
(h : dt.Day.val < ml.val.snd)
:
theorem
Verify.MonthDay.OrdinalDate_of_common_no_leapYear
(dt : Time.OrdinalDate)
(v : Time.Icc 1 365)
(h : dt.dayOfYear = Time.DayOfYear.common v)
:
Time.isLeapYear dt.year = false
theorem
Verify.MonthDay.dateToOrdinalDate_year_eq
(dt : Time.Date)
:
(Time.dateToOrdinalDate dt).year = dt.Year
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.next_date_of_day_lt_top
(dt : Time.Date)
{ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }}
(h : dt.Day.val < ml.val.snd ∨ dt.Month.val < 12)
:
theorem
Verify.MonthDay.next_date_of_day_lt_eq_incr'
{dt : Time.Date}
{dt' : Time.OrdinalDate}
{ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }}
(h : dt.Day.val < ml.val.snd ∨ dt.Month.val < 12)
(heq : dt' = Time.dateToOrdinalDate dt)
:
theorem
Verify.MonthDay.findValidMonthDay_year_eq
(year : Int)
(isLeap : Bool)
(yd : Time.Icc 1 366)
(hl : Time.isLeapYear year = isLeap)
(hle : yd.val ≤ if isLeap = true then 366 else 365)
:
(Time.findValidMonthDay year isLeap yd hl hle).Year = year
theorem
Verify.MonthDay.findValidMonthDay_1_month_eq
{year : Int}
{dt : Time.Date}
(isLeap : Bool)
(yd : Time.Icc 1 366)
{ml : { m : Nat × Nat // Verify.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)
:
(Time.findValidMonthDay_1 year isLeap ⟨yd.val + 1, ⋯⟩ hyd).Month = dt.Month ∧ ⟨dt.Day.val + 1, ⋯⟩ = (Time.findValidMonthDay_1 year isLeap ⟨yd.val + 1, ⋯⟩ hyd).Day
theorem
Verify.MonthDay.findValidMonthDay_12_month_eq
{dt : Time.Date}
(isLeap : Bool)
(yd : Time.Icc 1 366)
{ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }}
(hml : ml = Verify.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)
(hl : Time.isLeapYear dt.Year = isLeap)
(hne : ¬yd.val + 1 ≤ (Time.monthLastDayAsDayOfYear isLeap)[10].snd)
:
(Time.findValidMonthDay_12 dt.Year isLeap ⟨yd.val + 1, ⋯⟩ hl hne ⋯).Month = dt.Month ∧ ⟨dt.Day.val + 1, ⋯⟩ = (Time.findValidMonthDay_12 dt.Year isLeap ⟨yd.val + 1, ⋯⟩ hl hne ⋯).Day
theorem
Verify.MonthDay.findValidMonthDay_month_eq
{dt : Time.Date}
(isLeap : Bool)
(yd : Time.Icc 1 366)
{ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }}
(hml : ml = Verify.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)
:
(Time.findValidMonthDay dt.Year isLeap ⟨yd.val + 1, ⋯⟩ hl hle).Month = dt.Month ∧ ⟨dt.Day.val + 1, ⋯⟩ = (Time.findValidMonthDay dt.Year isLeap ⟨yd.val + 1, ⋯⟩ hl hle).Day
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.monthLengths_month_1_eq_31
(isleap : Bool)
(a : { x : Nat × Nat // x ∈ Time.monthLengths isleap })
(h : a.val.fst = 1)
:
a.val.snd = 31
theorem
Verify.MonthDay.findValidMonthDay_1_month_eq_incr
{dt : Time.Date}
(isLeap : Bool)
(yd : Time.Icc 1 366)
{ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }}
(hml : ml = Verify.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)
(hyd : yd.val + 1 ≤ ((Time.monthLastDayAsDayOfYear isLeap).get ⟨0, ⋯⟩).snd)
:
(Time.findValidMonthDay_1 dt.Year isLeap ⟨yd.val + 1, ⋯⟩ hyd).Month = ⟨dt.Month.val + 1, ⋯⟩ ∧ (Time.findValidMonthDay_1 dt.Year isLeap ⟨yd.val + 1, ⋯⟩ hyd).Day = ⟨1, ⋯⟩
theorem
Verify.MonthDay.findValidMonthDay_12_month_eq_incr'
{dt : Time.Date}
(isLeap : Bool)
(yd : Time.Icc 1 366)
{ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }}
(hml : ml = Verify.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)
(h1 : (if isLeap = true then 335 else 334) ≤ yd.val)
(h2 : yd.val ≤ if isLeap = true then 365 else 364)
:
theorem
Verify.MonthDay.findValidMonthDay_12_month_eq_incr
{dt : Time.Date}
(isLeap : Bool)
(yd : Time.Icc 1 366)
{ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }}
(hml : ml = Verify.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)
(hn : ¬yd.val + 1 ≤ ((Time.monthLastDayAsDayOfYear isLeap).get ⟨10, ⋯⟩).snd)
(hle : yd.val + 1 ≤ if isLeap = true then 366 else 365)
:
(Time.findValidMonthDay_12 dt.Year isLeap ⟨yd.val + 1, ⋯⟩ hl hn ⋯).Month = ⟨dt.Month.val + 1, ⋯⟩ ∧ (Time.findValidMonthDay_12 dt.Year isLeap ⟨yd.val + 1, ⋯⟩ hl hn ⋯).Day = ⟨1, ⋯⟩
theorem
Verify.MonthDay.findValidMonthDay_month_eq_incr
{dt : Time.Date}
(isLeap : Bool)
(yd : Time.Icc 1 366)
{ml : { m : Nat × Nat // Verify.MonthLength.monthLengthsOfDate m dt }}
(hml : ml = Verify.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)
:
(Time.findValidMonthDay dt.Year isLeap ⟨yd.val + 1, ⋯⟩ hl hle).Month = ⟨dt.Month.val + 1, ⋯⟩ ∧ (Time.findValidMonthDay dt.Year isLeap ⟨yd.val + 1, ⋯⟩ hl hle).Day = ⟨1, ⋯⟩
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