def lattice_from_joins(joins):
    """Converts a join matrix of a lattice to an implies matrix."""
    N = len(joins)

    lattice = [[0 for i in range(N)] for j in range(N)]

    for i in range(N):
        for j in range(i + 1):
            c = joins[i][j]
            lattice[c][i] = lattice[c][j] = 1

    return lattice